// 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{ResourceTypeSchemaVersion: common.String("EXAMPLE-resourceTypeSchemaVersion-Value"),
Schema: identitydomains.Schema{IdcsResourceTypes: []string{"EXAMPLE--Value"},
Schemas: []string{"EXAMPLE--Value"},
Attributes: []identitydomains.SchemaAttributes{identitydomains.SchemaAttributes{IdcsAllowUpdatesInReadOnlyMode: common.Bool(true),
IdcsCanonicalValueType: identitydomains.SchemaAttributesIdcsCanonicalValueTypeDynamic,
IdcsPaginateResponse: common.Bool(true),
IdcsAutoIncrementSeqName: common.String("EXAMPLE-idcsAutoIncrementSeqName-Value"),
IdcsCompositeKey: []string{"EXAMPLE--Value"},
IdcsPii: common.Bool(false),
IdcsRefResourceAttributes: []string{"EXAMPLE--Value"},
Description: common.String("EXAMPLE-description-Value"),
IdcsExcludeFromUpgradePatch: common.Bool(true),
IdcsICFRequired: common.Bool(true),
IdcsValuePersistedInOtherAttribute: common.Bool(true),
SubAttributes: []identitydomains.SchemaSubAttributes{identitydomains.SchemaSubAttributes{IdcsAuditable: common.Bool(false),
IdcsDeprecatedSinceReleaseNumber: common.String("EXAMPLE-idcsDeprecatedSinceReleaseNumber-Value"),
IdcsuiOrder: common.Int(61),
Description: common.String("EXAMPLE-description-Value"),
IdcsMinValue: common.Int(565),
ReferenceTypes: []string{"EXAMPLE--Value"},
IdcsMaxValuesReturned: common.Int(706),
IdcsScimCompliant: common.Bool(false),
IdcsTargetAttributeNameToMigrateFrom: common.String("EXAMPLE-idcsTargetAttributeNameToMigrateFrom-Value"),
IdcsDeprecatedSinceVersion: common.Int(748),
MultiValued: common.Bool(true),
IdcsMaxLength: common.Int(899),
IdcsSensitive: identitydomains.SchemaSubAttributesIdcsSensitiveEncrypt,
IdcsTargetAttributeName: common.String("EXAMPLE-idcsTargetAttributeName-Value"),
IdcsTargetUniqueConstraintName: common.String("EXAMPLE-idcsTargetUniqueConstraintName-Value"),
IdcsuiRegexp: common.String("EXAMPLE-idcsuiRegexp-Value"),
Type: identitydomains.SchemaSubAttributesTypeBinary,
IdcsDisplayNameMessageId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-idcsDisplayNameMessageId-Value"),
IdcsFromTargetMapper: common.String("EXAMPLE-idcsFromTargetMapper-Value"),
IdcsOneValueMustBeTrue: common.Bool(false),
IdcsRefResourceAttributes: []string{"EXAMPLE--Value"},
IdcsRequiresWriteForAccessFlows: common.Bool(false),
IdcsValidateReference: common.Bool(false),
Uniqueness: identitydomains.SchemaSubAttributesUniquenessGlobal,
IdcsAttributeCacheable: common.Bool(true),
IdcsInternal: common.Bool(true),
IdcsReturnEmptyWhenNull: common.Bool(true),
Mutability: identitydomains.SchemaSubAttributesMutabilityReadonly,
Returned: identitydomains.SchemaSubAttributesReturnedRequest,
IdcsCanonicalValueSourceFilter: common.String("EXAMPLE-idcsCanonicalValueSourceFilter-Value"),
IdcsTargetNormAttributeName: common.String("EXAMPLE-idcsTargetNormAttributeName-Value"),
IdcsToTargetMapper: common.String("EXAMPLE-idcsToTargetMapper-Value"),
IdcsMaxValue: common.Int(365),
IdcsSearchable: common.Bool(false),
IdcsuiWidget: identitydomains.SchemaSubAttributesIdcsuiWidgetCombobox,
Name: common.String("EXAMPLE-name-Value"),
Required: common.Bool(true),
IdcsAddedSinceReleaseNumber: common.String("EXAMPLE-idcsAddedSinceReleaseNumber-Value"),
IdcsCanonicalValueSourceResourceTypeID: common.String("EXAMPLE-idcsCanonicalValueSourceResourceTypeID-Value"),
IdcsAddedSinceVersion: common.Int(243),
IdcsCanonicalValueSourceDisplayAttrName: common.String("EXAMPLE-idcsCanonicalValueSourceDisplayAttrName-Value"),
IdcsMinLength: common.Int(720),
IdcsPii: common.Bool(false),
IdcsRequiresImmediateReadAfterWriteForAccessFlows: common.Bool(true),
IdcsValuePersistedInOtherAttribute: common.Bool(true),
CanonicalValues: []string{"EXAMPLE--Value"},
CaseExact: common.Bool(true),
IdcsDisplayName: common.String("EXAMPLE-idcsDisplayName-Value"),
IdcsRtsaHideAttribute: common.Bool(true),
IdcsTrimStringValue: common.Bool(true),
IdcsValuePersisted: common.Bool(true),
IdcsAttributeMappable: common.Bool(true),
IdcsCsvAttributeName: common.String("EXAMPLE-idcsCsvAttributeName-Value"),
IdcsDefaultValue: common.String("EXAMPLE-idcsDefaultValue-Value"),
IdcsExcludeFromUpgradePatch: common.Bool(false),
IdcsGenerated: common.Bool(false),
IdcsSanitize: common.Bool(true),
IdcsCanonicalValueSourceKeyAttrName: common.String("EXAMPLE-idcsCanonicalValueSourceKeyAttrName-Value"),
IdcsOnlyOneValueCanBeTrue: common.Bool(true),
IdcsCanonicalValueSourceResourceType: common.String("EXAMPLE-idcsCanonicalValueSourceResourceType-Value"),
IdcsIndirectRefResourceAttributes: []string{"EXAMPLE--Value"},
IdcsuiVisible: common.Bool(true)}},
IdcsComplexAttributeNameMappings: []identitydomains.SchemaIdcsComplexAttributeNameMappings{identitydomains.SchemaIdcsComplexAttributeNameMappings{IdcsRtsaHideAttribute: common.Bool(false),
MapsTo: common.String("EXAMPLE-mapsTo-Value"),
Name: common.String("EXAMPLE-name-Value")}},
IdcsICFAttributeType: identitydomains.SchemaAttributesIdcsICFAttributeTypeBigdecimal,
IdcsReturnEmptyWhenNull: common.Bool(false),
IdcsTargetAttributeNameToMigrateFrom: common.String("EXAMPLE-idcsTargetAttributeNameToMigrateFrom-Value"),
MultiValued: common.Bool(true),
IdcsDisplayNameMessageId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-idcsDisplayNameMessageId-Value"),
IdcsFeatures: []identitydomains.SchemaAttributesIdcsFeaturesEnum{identitydomains.SchemaAttributesIdcsFeaturesMfa},
IdcsMapsToSameTargetAttributeNameAs: common.String("EXAMPLE-idcsMapsToSameTargetAttributeNameAs-Value"),
IdcsAttributeMappable: common.Bool(true),
IdcsAuditable: common.Bool(true),
IdcsCsvAttributeName: common.String("EXAMPLE-idcsCsvAttributeName-Value"),
IdcsDeprecatedSinceReleaseNumber: common.String("EXAMPLE-idcsDeprecatedSinceReleaseNumber-Value"),
IdcsMultiLanguage: common.Bool(true),
IdcsOptionalPiiCanonicalValues: []string{"EXAMPLE--Value"},
IdcsToTargetMapper: common.String("EXAMPLE-idcsToTargetMapper-Value"),
IdcsuiOrder: common.Int(3),
IdcsFromTargetMapper: common.String("EXAMPLE-idcsFromTargetMapper-Value"),
IdcsGenerated: common.Bool(false),
IdcsMaxLength: common.Int(540),
IdcsMinLength: common.Int(957),
Returned: identitydomains.SchemaAttributesReturnedDefault,
IdcsRequiresWriteForAccessFlows: common.Bool(true),
IdcsuiWidget: identitydomains.SchemaAttributesIdcsuiWidgetCheckbox,
LocalizedCanonicalValues: []identitydomains.SchemaLocalizedCanonicalValues{identitydomains.SchemaLocalizedCanonicalValues{Locale: common.String("EXAMPLE-locale-Value"),
Value: common.String("EXAMPLE-value-Value"),
CanonicalValue: []string{"EXAMPLE--Value"}}},
ReferenceTypes: []string{"EXAMPLE--Value"},
IdcsRtsaHideAttribute: common.Bool(true),
IdcsTargetAttributeName: common.String("EXAMPLE-idcsTargetAttributeName-Value"),
IdcsuiRegexp: common.String("EXAMPLE-idcsuiRegexp-Value"),
IdcsAttributeCacheable: common.Bool(true),
IdcsCsvAttributeNameMappings: []identitydomains.SchemaIdcsCsvAttributeNameMappings{identitydomains.SchemaIdcsCsvAttributeNameMappings{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")}},
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")}},
IdcsDisplayName: common.String("EXAMPLE-idcsDisplayName-Value"),
IdcsIgnoreReadOnlyAndImmutableRefAttrsDuringForceDelete: common.Bool(false),
IdcsScimCompliant: common.Bool(true),
IdcsuiVisible: common.Bool(false),
IdcsValuePersisted: common.Bool(true),
IdcsAddedSinceReleaseNumber: common.String("EXAMPLE-idcsAddedSinceReleaseNumber-Value"),
IdcsCanonicalValueSourceResourceTypeID: common.String("EXAMPLE-idcsCanonicalValueSourceResourceTypeID-Value"),
IdcsMinValue: common.Int(831),
IdcsSearchable: common.Bool(true),
Mutability: identitydomains.SchemaAttributesMutabilityReadonly,
Uniqueness: identitydomains.SchemaAttributesUniquenessNone,
CaseExact: common.Bool(false),
IdcsCanonicalValueSourceKeyAttrName: common.String("EXAMPLE-idcsCanonicalValueSourceKeyAttrName-Value"),
IdcsCanonicalValueSourceResourceType: common.String("EXAMPLE-idcsCanonicalValueSourceResourceType-Value"),
IdcsDeprecatedSinceVersion: common.Int(456),
IdcsIndirectRefResourceAttributes: []string{"EXAMPLE--Value"},
IdcsOverrideCommonAttribute: common.Bool(false),
IdcsRequiresImmediateReadAfterWriteForAccessFlows: common.Bool(true),
IdcsSensitive: identitydomains.SchemaAttributesIdcsSensitiveChecksum,
IdcsSanitize: common.Bool(true),
IdcsInternal: common.Bool(false),
IdcsMaxValue: common.Int(286),
IdcsTargetNormAttributeName: common.String("EXAMPLE-idcsTargetNormAttributeName-Value"),
IdcsTargetUniqueConstraintName: common.String("EXAMPLE-idcsTargetUniqueConstraintName-Value"),
IdcsValidateReference: common.Bool(true),
LocalizedDisplayName: &identitydomains.SchemaLocalizedDisplayName{Locale: common.String("EXAMPLE-locale-Value"),
Value: common.String("EXAMPLE-value-Value")},
Type: identitydomains.SchemaAttributesTypeDatetime,
IdcsAddedSinceVersion: common.Int(725),
IdcsCanonicalValueSourceDisplayAttrName: common.String("EXAMPLE-idcsCanonicalValueSourceDisplayAttrName-Value"),
IdcsCanonicalValueSourceFilter: common.String("EXAMPLE-idcsCanonicalValueSourceFilter-Value"),
IdcsFetchComplexAttributeValues: common.Bool(false),
IdcsICFBundleAttributeName: common.String("EXAMPLE-idcsICFBundleAttributeName-Value"),
IdcsTrimStringValue: common.Bool(true),
Name: common.String("EXAMPLE-name-Value"),
CanonicalValues: []string{"EXAMPLE--Value"},
IdcsDefaultValue: common.String("EXAMPLE-idcsDefaultValue-Value"),
IdcsRefResourceAttribute: common.String("EXAMPLE-idcsRefResourceAttribute-Value"),
Required: common.Bool(true)}},
Description: common.String("EXAMPLE-description-Value"),
ExternalId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-externalId-Value"),
IdcsMapsToSameTargetAttributeNameAs: common.String("EXAMPLE-idcsMapsToSameTargetAttributeNameAs-Value"),
IdcsOverrideCommonAttribute: common.Bool(true),
Name: common.String("EXAMPLE-name-Value"),
IdcsAttributeCacheable: common.Bool(true),
IdcsMappable: common.Bool(false)},
SchemaId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-schemaId-Value"),
Authorization: common.String("EXAMPLE-authorization-Value"),
IfMatch: common.String("EXAMPLE-ifMatch-Value"),
OpcRetryToken: common.String("EXAMPLE-opcRetryToken-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)
}