// This is an automatically generated code sample.
// To make this code sample work in your Oracle Cloud tenancy,
// please replace the values for any parameters whose current values do not fit
// your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
// boolean, number, and enum parameters with values not fitting your use case).
package main
import (
"context"
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"github.com/oracle/oci-go-sdk/v65/example/helpers"
"github.com/oracle/oci-go-sdk/v65/identitydomains"
)
func ExamplePutSchema() {
// Create a default authentication provider that uses the DEFAULT
// profile in the configuration file.
// Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.
client, err := identitydomains.NewIdentityDomainsClientWithConfigurationProvider(common.DefaultConfigProvider(), "specificEndpoint")
helpers.FatalIfError(err)
// Create a request and dependent object(s).
req := identitydomains.PutSchemaRequest{Authorization: common.String("EXAMPLE-authorization-Value"),
IfMatch: common.String("EXAMPLE-ifMatch-Value"),
OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
ResourceTypeSchemaVersion: common.String("EXAMPLE-resourceTypeSchemaVersion-Value"),
Schema: identitydomains.Schema{IdcsAttributeCacheable: common.Bool(false),
IdcsMapsToSameTargetAttributeNameAs: common.String("EXAMPLE-idcsMapsToSameTargetAttributeNameAs-Value"),
IdcsOverrideCommonAttribute: common.Bool(false),
Schemas: []string{"EXAMPLE--Value"},
Attributes: []identitydomains.SchemaAttributes{identitydomains.SchemaAttributes{IdcsToTargetMapper: common.String("EXAMPLE-idcsToTargetMapper-Value"),
MultiValued: common.Bool(true),
Type: identitydomains.SchemaAttributesTypeString,
IdcsAddedSinceVersion: common.Int(165),
IdcsDisplayNameMessageId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-idcsDisplayNameMessageId-Value"),
IdcsGenerated: common.Bool(true),
IdcsIgnoreReadOnlyAndImmutableRefAttrsDuringForceDelete: common.Bool(true),
IdcsReturnEmptyWhenNull: common.Bool(false),
Uniqueness: identitydomains.SchemaAttributesUniquenessNone,
IdcsuiOrder: common.Int(847),
IdcsAutoIncrementSeqName: common.String("EXAMPLE-idcsAutoIncrementSeqName-Value"),
IdcsDisplayName: common.String("EXAMPLE-idcsDisplayName-Value"),
IdcsMinLength: common.Int(349),
IdcsMultiLanguage: common.Bool(false),
IdcsTargetAttributeName: common.String("EXAMPLE-idcsTargetAttributeName-Value"),
IdcsInternal: common.Bool(false),
IdcsuiWidget: identitydomains.SchemaAttributesIdcsuiWidgetTextarea,
IdcsAttributeCacheable: common.Bool(true),
IdcsDeprecatedSinceVersion: common.Int(808),
IdcsICFBundleAttributeName: common.String("EXAMPLE-idcsICFBundleAttributeName-Value"),
IdcsICFRequired: common.Bool(true),
IdcsIndirectRefResourceAttributes: []string{"EXAMPLE--Value"},
ReferenceTypes: []string{"EXAMPLE--Value"},
CaseExact: common.Bool(true),
IdcsAddedSinceReleaseNumber: common.String("EXAMPLE-idcsAddedSinceReleaseNumber-Value"),
IdcsMaxValue: common.Int(828),
IdcsTargetNormAttributeName: common.String("EXAMPLE-idcsTargetNormAttributeName-Value"),
IdcsuiVisible: common.Bool(true),
IdcsScimCompliant: common.Bool(true),
IdcsValuePersisted: common.Bool(false),
IdcsDeprecatedSinceReleaseNumber: common.String("EXAMPLE-idcsDeprecatedSinceReleaseNumber-Value"),
IdcsFetchComplexAttributeValues: common.Bool(false),
IdcsICFAttributeType: identitydomains.SchemaAttributesIdcsICFAttributeTypeGuardedstring,
IdcsPii: common.Bool(true),
IdcsRequiresImmediateReadAfterWriteForAccessFlows: common.Bool(true),
IdcsDefaultValue: common.String("EXAMPLE-idcsDefaultValue-Value"),
IdcsTargetAttributeNameToMigrateFrom: common.String("EXAMPLE-idcsTargetAttributeNameToMigrateFrom-Value"),
Name: common.String("EXAMPLE-name-Value"),
CanonicalValues: []string{"EXAMPLE--Value"},
IdcsCanonicalValueSourceKeyAttrName: common.String("EXAMPLE-idcsCanonicalValueSourceKeyAttrName-Value"),
IdcsExcludeFromUpgradePatch: common.Bool(false),
IdcsPaginateResponse: common.Bool(false),
IdcsuiRegexp: common.String("EXAMPLE-idcsuiRegexp-Value"),
IdcsTrimStringValue: common.Bool(true),
Mutability: identitydomains.SchemaAttributesMutabilityWriteonly,
Description: common.String("EXAMPLE-description-Value"),
IdcsComplexAttributeNameMappings: []identitydomains.SchemaIdcsComplexAttributeNameMappings{identitydomains.SchemaIdcsComplexAttributeNameMappings{IdcsRtsaHideAttribute: common.Bool(true),
MapsTo: common.String("EXAMPLE-mapsTo-Value"),
Name: common.String("EXAMPLE-name-Value")}},
IdcsCsvAttributeNameMappings: []identitydomains.SchemaIdcsCsvAttributeNameMappings{identitydomains.SchemaIdcsCsvAttributeNameMappings{ResolveValueUsingResourceType: []identitydomains.SchemaResolveValueUsingResourceType{identitydomains.SchemaResolveValueUsingResourceType{ResolveBy: common.String("EXAMPLE-resolveBy-Value"),
ValueToBeResolved: common.String("EXAMPLE-valueToBeResolved-Value")}},
ColumnHeaderName: common.String("EXAMPLE-columnHeaderName-Value"),
CsvColumnForResolvingResourceType: common.String("EXAMPLE-csvColumnForResolvingResourceType-Value"),
DefaultValue: common.String("EXAMPLE-defaultValue-Value"),
DeprecatedColumnHeaderName: common.String("EXAMPLE-deprecatedColumnHeaderName-Value"),
MapsTo: common.String("EXAMPLE-mapsTo-Value"),
MultiValueDelimiter: common.String("EXAMPLE-multiValueDelimiter-Value"),
ReferencedResourceTypeUniqueAttributeNameMappings: []identitydomains.SchemaReferencedResourceTypeUniqueAttributeNameMappings{identitydomains.SchemaReferencedResourceTypeUniqueAttributeNameMappings{MapsFromColumnName: common.String("EXAMPLE-mapsFromColumnName-Value"),
ResourceTypeAttributeName: common.String("EXAMPLE-resourceTypeAttributeName-Value")}}}},
IdcsRefResourceAttribute: common.String("EXAMPLE-idcsRefResourceAttribute-Value"),
IdcsTargetUniqueConstraintName: common.String("EXAMPLE-idcsTargetUniqueConstraintName-Value"),
IdcsCanonicalValueSourceDisplayAttrName: common.String("EXAMPLE-idcsCanonicalValueSourceDisplayAttrName-Value"),
IdcsFeatures: []identitydomains.SchemaAttributesIdcsFeaturesEnum{identitydomains.SchemaAttributesIdcsFeaturesSocial},
IdcsRefResourceAttributes: []string{"EXAMPLE--Value"},
IdcsSanitize: common.Bool(true),
Required: common.Bool(true),
IdcsAuditable: common.Bool(true),
IdcsMaxLength: common.Int(714),
LocalizedDisplayName: &identitydomains.SchemaLocalizedDisplayName{Locale: common.String("EXAMPLE-locale-Value"),
Value: common.String("EXAMPLE-value-Value")},
IdcsRequiresWriteForAccessFlows: common.Bool(true),
LocalizedCanonicalValues: []identitydomains.SchemaLocalizedCanonicalValues{identitydomains.SchemaLocalizedCanonicalValues{Value: common.String("EXAMPLE-value-Value"),
CanonicalValue: []string{"EXAMPLE--Value"},
Locale: common.String("EXAMPLE-locale-Value")}},
IdcsAttributeMappable: common.Bool(true),
IdcsCsvAttributeName: common.String("EXAMPLE-idcsCsvAttributeName-Value"),
IdcsMinValue: common.Int(397),
IdcsSearchable: common.Bool(false),
IdcsCanonicalValueSourceFilter: common.String("EXAMPLE-idcsCanonicalValueSourceFilter-Value"),
IdcsCanonicalValueSourceResourceTypeID: common.String("EXAMPLE-idcsCanonicalValueSourceResourceTypeID-Value"),
IdcsMapsToSameTargetAttributeNameAs: common.String("EXAMPLE-idcsMapsToSameTargetAttributeNameAs-Value"),
IdcsSensitive: identitydomains.SchemaAttributesIdcsSensitiveHash,
IdcsFromTargetMapper: common.String("EXAMPLE-idcsFromTargetMapper-Value"),
IdcsValidateReference: common.Bool(true),
SubAttributes: []identitydomains.SchemaSubAttributes{identitydomains.SchemaSubAttributes{IdcsTargetNormAttributeName: common.String("EXAMPLE-idcsTargetNormAttributeName-Value"),
IdcsCanonicalValueSourceDisplayAttrName: common.String("EXAMPLE-idcsCanonicalValueSourceDisplayAttrName-Value"),
IdcsCanonicalValueSourceKeyAttrName: common.String("EXAMPLE-idcsCanonicalValueSourceKeyAttrName-Value"),
IdcsOneValueMustBeTrue: common.Bool(false),
IdcsSensitive: identitydomains.SchemaSubAttributesIdcsSensitiveNone,
IdcsCsvAttributeName: common.String("EXAMPLE-idcsCsvAttributeName-Value"),
IdcsCanonicalValueSourceFilter: common.String("EXAMPLE-idcsCanonicalValueSourceFilter-Value"),
IdcsToTargetMapper: common.String("EXAMPLE-idcsToTargetMapper-Value"),
IdcsValuePersisted: common.Bool(false),
MultiValued: common.Bool(true),
Mutability: identitydomains.SchemaSubAttributesMutabilityImmutable,
Name: common.String("EXAMPLE-name-Value"),
IdcsAuditable: common.Bool(true),
IdcsFromTargetMapper: common.String("EXAMPLE-idcsFromTargetMapper-Value"),
IdcsRequiresWriteForAccessFlows: common.Bool(false),
Type: identitydomains.SchemaSubAttributesTypeComplex,
IdcsMaxValuesReturned: common.Int(24),
IdcsTargetUniqueConstraintName: common.String("EXAMPLE-idcsTargetUniqueConstraintName-Value"),
Required: common.Bool(false),
IdcsCanonicalValueSourceResourceType: common.String("EXAMPLE-idcsCanonicalValueSourceResourceType-Value"),
IdcsGenerated: common.Bool(true),
IdcsMaxLength: common.Int(519),
IdcsRefResourceAttributes: []string{"EXAMPLE--Value"},
IdcsScimCompliant: common.Bool(false),
IdcsTargetAttributeNameToMigrateFrom: common.String("EXAMPLE-idcsTargetAttributeNameToMigrateFrom-Value"),
Uniqueness: identitydomains.SchemaSubAttributesUniquenessNone,
IdcsAttributeCacheable: common.Bool(false),
IdcsDeprecatedSinceReleaseNumber: common.String("EXAMPLE-idcsDeprecatedSinceReleaseNumber-Value"),
IdcsDisplayNameMessageId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-idcsDisplayNameMessageId-Value"),
IdcsMinValue: common.Int(127),
IdcsRequiresImmediateReadAfterWriteForAccessFlows: common.Bool(true),
IdcsTrimStringValue: common.Bool(true),
IdcsValuePersistedInOtherAttribute: common.Bool(false),
IdcsuiRegexp: common.String("EXAMPLE-idcsuiRegexp-Value"),
IdcsAttributeMappable: common.Bool(true),
IdcsDefaultValue: common.String("EXAMPLE-idcsDefaultValue-Value"),
IdcsDisplayName: common.String("EXAMPLE-idcsDisplayName-Value"),
IdcsReturnEmptyWhenNull: common.Bool(false),
IdcsRtsaHideAttribute: common.Bool(false),
CanonicalValues: []string{"EXAMPLE--Value"},
IdcsAddedSinceVersion: common.Int(267),
IdcsIndirectRefResourceAttributes: []string{"EXAMPLE--Value"},
IdcsDeprecatedSinceVersion: common.Int(744),
IdcsPii: common.Bool(false),
IdcsuiWidget: identitydomains.SchemaSubAttributesIdcsuiWidgetTextarea,
IdcsTargetAttributeName: common.String("EXAMPLE-idcsTargetAttributeName-Value"),
ReferenceTypes: []string{"EXAMPLE--Value"},
IdcsAddedSinceReleaseNumber: common.String("EXAMPLE-idcsAddedSinceReleaseNumber-Value"),
IdcsExcludeFromUpgradePatch: common.Bool(true),
IdcsSanitize: common.Bool(false),
IdcsValidateReference: common.Bool(true),
Returned: identitydomains.SchemaSubAttributesReturnedDefault,
CaseExact: common.Bool(false),
Description: common.String("EXAMPLE-description-Value"),
IdcsInternal: common.Bool(true),
IdcsuiVisible: common.Bool(false),
IdcsOnlyOneValueCanBeTrue: common.Bool(false),
IdcsSearchable: common.Bool(false),
IdcsuiOrder: common.Int(518),
IdcsCanonicalValueSourceResourceTypeID: common.String("EXAMPLE-idcsCanonicalValueSourceResourceTypeID-Value"),
IdcsMaxValue: common.Int(917),
IdcsMinLength: common.Int(355)}},
IdcsCanonicalValueType: identitydomains.SchemaAttributesIdcsCanonicalValueTypeStatic,
IdcsOptionalPiiCanonicalValues: []string{"EXAMPLE--Value"},
IdcsRtsaHideAttribute: common.Bool(true),
IdcsValuePersistedInOtherAttribute: common.Bool(false),
Returned: identitydomains.SchemaAttributesReturnedRequest,
IdcsAllowUpdatesInReadOnlyMode: common.Bool(true),
IdcsCanonicalValueSourceResourceType: common.String("EXAMPLE-idcsCanonicalValueSourceResourceType-Value"),
IdcsCompositeKey: []string{"EXAMPLE--Value"},
IdcsOverrideCommonAttribute: common.Bool(false)}},
ExternalId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-externalId-Value"),
IdcsResourceTypes: []string{"EXAMPLE--Value"},
Name: common.String("EXAMPLE-name-Value"),
Description: common.String("EXAMPLE-description-Value"),
IdcsMappable: common.Bool(false)},
SchemaId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-schemaId-Value")}
// Send the request using the service client
resp, err := client.PutSchema(context.Background(), req)
helpers.FatalIfError(err)
// Retrieve value from the response.
fmt.Println(resp)
}