# RestrictionsProperty

- Source: Generated at build time
- Type last changed: v2.134.0 · 26 Mar 2024

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_codeartifact as codeartifact } from 'aws-cdk-lib';
const restrictionsProperty: codeartifact.CfnPackageGroup.RestrictionsProperty = {
  externalUpstream: {
    restrictionMode: 'restrictionMode',

    // the properties below are optional
    repositories: ['repositories'],
  },
  internalUpstream: {
    restrictionMode: 'restrictionMode',

    // the properties below are optional
    repositories: ['repositories'],
  },
  publish: {
    restrictionMode: 'restrictionMode',

    // the properties below are optional
    repositories: ['repositories'],
  },
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_codeartifact as codeartifact

restrictions_property = codeartifact.CfnPackageGroup.RestrictionsProperty(
    external_upstream=codeartifact.CfnPackageGroup.RestrictionTypeProperty(
        restriction_mode="restrictionMode",

        # the properties below are optional
        repositories=["repositories"]
    ),
    internal_upstream=codeartifact.CfnPackageGroup.RestrictionTypeProperty(
        restriction_mode="restrictionMode",

        # the properties below are optional
        repositories=["repositories"]
    ),
    publish=codeartifact.CfnPackageGroup.RestrictionTypeProperty(
        restriction_mode="restrictionMode",

        # the properties below are optional
        repositories=["repositories"]
    )
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.codeartifact.*;

RestrictionsProperty restrictionsProperty = RestrictionsProperty.builder()
        .externalUpstream(RestrictionTypeProperty.builder()
                .restrictionMode("restrictionMode")

                // the properties below are optional
                .repositories(List.of("repositories"))
                .build())
        .internalUpstream(RestrictionTypeProperty.builder()
                .restrictionMode("restrictionMode")

                // the properties below are optional
                .repositories(List.of("repositories"))
                .build())
        .publish(RestrictionTypeProperty.builder()
                .restrictionMode("restrictionMode")

                // the properties below are optional
                .repositories(List.of("repositories"))
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CodeArtifact;

var restrictionsProperty = new RestrictionsProperty {
    ExternalUpstream = new RestrictionTypeProperty {
        RestrictionMode = "restrictionMode",

        // the properties below are optional
        Repositories = new [] { "repositories" }
    },
    InternalUpstream = new RestrictionTypeProperty {
        RestrictionMode = "restrictionMode",

        // the properties below are optional
        Repositories = new [] { "repositories" }
    },
    Publish = new RestrictionTypeProperty {
        RestrictionMode = "restrictionMode",

        // the properties below are optional
        Repositories = new [] { "repositories" }
    }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

restrictionsProperty := &RestrictionsProperty{
	ExternalUpstream: &RestrictionTypeProperty{
		RestrictionMode: jsii.String("restrictionMode"),

		// the properties below are optional
		Repositories: []*string{
			jsii.String("repositories"),
		},
	},
	InternalUpstream: &RestrictionTypeProperty{
		RestrictionMode: jsii.String("restrictionMode"),

		// the properties below are optional
		Repositories: []*string{
			jsii.String("repositories"),
		},
	},
	Publish: &RestrictionTypeProperty{
		RestrictionMode: jsii.String("restrictionMode"),

		// the properties below are optional
		Repositories: []*string{
			jsii.String("repositories"),
		},
	},
}
```

## Properties

- `externalUpstream`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnPackageGroup.RestrictionTypeProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codeartifact.CfnPackageGroup.RestrictionTypeProperty.html)

- `internalUpstream`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnPackageGroup.RestrictionTypeProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codeartifact.CfnPackageGroup.RestrictionTypeProperty.html)

- `publish`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnPackageGroup.RestrictionTypeProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codeartifact.CfnPackageGroup.RestrictionTypeProperty.html)
