Skip to content

Commit

Permalink
Updating based on c2d93e248
Browse files Browse the repository at this point in the history
  • Loading branch information
hc-github-team-tf-azure committed Nov 27, 2023
1 parent 25888b9 commit 522c81e
Show file tree
Hide file tree
Showing 6,689 changed files with 128,875 additions and 159,673 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
38 changes: 18 additions & 20 deletions resource-manager/aad/2021-05-01/domainservices/id_domainservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,9 @@ func ParseDomainServiceID(input string) (*DomainServiceId, error) {
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

var ok bool
id := DomainServiceId{}

if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed)
}

if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed)
}

if id.DomainServiceName, ok = parsed.Parsed["domainServiceName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "domainServiceName", *parsed)
if err := id.FromParseResult(*parsed); err != nil {
return nil, err
}

return &id, nil
Expand All @@ -63,22 +53,30 @@ func ParseDomainServiceIDInsensitively(input string) (*DomainServiceId, error) {
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

var ok bool
id := DomainServiceId{}
if err := id.FromParseResult(*parsed); err != nil {
return nil, err
}

return &id, nil
}

if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed)
func (id *DomainServiceId) FromParseResult(input resourceids.ParseResult) error {
var ok bool

if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input)
}

if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed)
if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input)
}

if id.DomainServiceName, ok = parsed.Parsed["domainServiceName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "domainServiceName", *parsed)
if id.DomainServiceName, ok = input.Parsed["domainServiceName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "domainServiceName", input)
}

return &id, nil
return nil
}

// ValidateDomainServiceID checks that 'input' can be parsed as a Domain Service ID
Expand Down
38 changes: 18 additions & 20 deletions resource-manager/aad/2021-05-01/oucontainer/id_domainservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,9 @@ func ParseDomainServiceID(input string) (*DomainServiceId, error) {
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

var ok bool
id := DomainServiceId{}

if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed)
}

if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed)
}

if id.DomainServiceName, ok = parsed.Parsed["domainServiceName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "domainServiceName", *parsed)
if err := id.FromParseResult(*parsed); err != nil {
return nil, err
}

return &id, nil
Expand All @@ -63,22 +53,30 @@ func ParseDomainServiceIDInsensitively(input string) (*DomainServiceId, error) {
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

var ok bool
id := DomainServiceId{}
if err := id.FromParseResult(*parsed); err != nil {
return nil, err
}

return &id, nil
}

if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed)
func (id *DomainServiceId) FromParseResult(input resourceids.ParseResult) error {
var ok bool

if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input)
}

if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed)
if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input)
}

if id.DomainServiceName, ok = parsed.Parsed["domainServiceName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "domainServiceName", *parsed)
if id.DomainServiceName, ok = input.Parsed["domainServiceName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "domainServiceName", input)
}

return &id, nil
return nil
}

// ValidateDomainServiceID checks that 'input' can be parsed as a Domain Service ID
Expand Down
46 changes: 20 additions & 26 deletions resource-manager/aad/2021-05-01/oucontainer/id_oucontainer.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,9 @@ func ParseOuContainerID(input string) (*OuContainerId, error) {
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

var ok bool
id := OuContainerId{}

if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed)
}

if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed)
}

if id.DomainServiceName, ok = parsed.Parsed["domainServiceName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "domainServiceName", *parsed)
}

if id.OuContainerName, ok = parsed.Parsed["ouContainerName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "ouContainerName", *parsed)
if err := id.FromParseResult(*parsed); err != nil {
return nil, err
}

return &id, nil
Expand All @@ -69,26 +55,34 @@ func ParseOuContainerIDInsensitively(input string) (*OuContainerId, error) {
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

var ok bool
id := OuContainerId{}
if err := id.FromParseResult(*parsed); err != nil {
return nil, err
}

return &id, nil
}

func (id *OuContainerId) FromParseResult(input resourceids.ParseResult) error {
var ok bool

if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed)
if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input)
}

if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed)
if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input)
}

if id.DomainServiceName, ok = parsed.Parsed["domainServiceName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "domainServiceName", *parsed)
if id.DomainServiceName, ok = input.Parsed["domainServiceName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "domainServiceName", input)
}

if id.OuContainerName, ok = parsed.Parsed["ouContainerName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "ouContainerName", *parsed)
if id.OuContainerName, ok = input.Parsed["ouContainerName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "ouContainerName", input)
}

return &id, nil
return nil
}

// ValidateOuContainerID checks that 'input' can be parsed as a Ou Container ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,9 @@ func ParseB2CDirectoryID(input string) (*B2CDirectoryId, error) {
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

var ok bool
id := B2CDirectoryId{}

if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed)
}

if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroup", *parsed)
}

if id.DirectoryName, ok = parsed.Parsed["directoryName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "directoryName", *parsed)
if err := id.FromParseResult(*parsed); err != nil {
return nil, err
}

return &id, nil
Expand All @@ -63,22 +53,30 @@ func ParseB2CDirectoryIDInsensitively(input string) (*B2CDirectoryId, error) {
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

var ok bool
id := B2CDirectoryId{}
if err := id.FromParseResult(*parsed); err != nil {
return nil, err
}

return &id, nil
}

if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed)
func (id *B2CDirectoryId) FromParseResult(input resourceids.ParseResult) error {
var ok bool

if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input)
}

if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroup", *parsed)
if id.ResourceGroup, ok = input.Parsed["resourceGroup"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroup", input)
}

if id.DirectoryName, ok = parsed.Parsed["directoryName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "directoryName", *parsed)
if id.DirectoryName, ok = input.Parsed["directoryName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "directoryName", input)
}

return &id, nil
return nil
}

// ValidateB2CDirectoryID checks that 'input' can be parsed as a B 2 C Directory ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,9 @@ func ParseGenerateRecommendationID(input string) (*GenerateRecommendationId, err
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

var ok bool
id := GenerateRecommendationId{}

if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed)
}

if id.OperationId, ok = parsed.Parsed["operationId"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "operationId", *parsed)
if err := id.FromParseResult(*parsed); err != nil {
return nil, err
}

return &id, nil
Expand All @@ -57,18 +51,26 @@ func ParseGenerateRecommendationIDInsensitively(input string) (*GenerateRecommen
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

var ok bool
id := GenerateRecommendationId{}
if err := id.FromParseResult(*parsed); err != nil {
return nil, err
}

if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed)
return &id, nil
}

func (id *GenerateRecommendationId) FromParseResult(input resourceids.ParseResult) error {
var ok bool

if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input)
}

if id.OperationId, ok = parsed.Parsed["operationId"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "operationId", *parsed)
if id.OperationId, ok = input.Parsed["operationId"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "operationId", input)
}

return &id, nil
return nil
}

// ValidateGenerateRecommendationID checks that 'input' can be parsed as a Generate Recommendation ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,9 @@ func ParseScopedRecommendationID(input string) (*ScopedRecommendationId, error)
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

var ok bool
id := ScopedRecommendationId{}

if id.ResourceUri, ok = parsed.Parsed["resourceUri"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceUri", *parsed)
}

if id.RecommendationId, ok = parsed.Parsed["recommendationId"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "recommendationId", *parsed)
if err := id.FromParseResult(*parsed); err != nil {
return nil, err
}

return &id, nil
Expand All @@ -57,18 +51,26 @@ func ParseScopedRecommendationIDInsensitively(input string) (*ScopedRecommendati
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

var ok bool
id := ScopedRecommendationId{}
if err := id.FromParseResult(*parsed); err != nil {
return nil, err
}

if id.ResourceUri, ok = parsed.Parsed["resourceUri"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceUri", *parsed)
return &id, nil
}

func (id *ScopedRecommendationId) FromParseResult(input resourceids.ParseResult) error {
var ok bool

if id.ResourceUri, ok = input.Parsed["resourceUri"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "resourceUri", input)
}

if id.RecommendationId, ok = parsed.Parsed["recommendationId"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "recommendationId", *parsed)
if id.RecommendationId, ok = input.Parsed["recommendationId"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "recommendationId", input)
}

return &id, nil
return nil
}

// ValidateScopedRecommendationID checks that 'input' can be parsed as a Scoped Recommendation ID
Expand Down
22 changes: 14 additions & 8 deletions resource-manager/advisor/2020-01-01/metadata/id_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ func ParseMetadataID(input string) (*MetadataId, error) {
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

var ok bool
id := MetadataId{}

if id.MetadataName, ok = parsed.Parsed["metadataName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "metadataName", *parsed)
if err := id.FromParseResult(*parsed); err != nil {
return nil, err
}

return &id, nil
Expand All @@ -51,16 +49,24 @@ func ParseMetadataIDInsensitively(input string) (*MetadataId, error) {
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

var ok bool
id := MetadataId{}

if id.MetadataName, ok = parsed.Parsed["metadataName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "metadataName", *parsed)
if err := id.FromParseResult(*parsed); err != nil {
return nil, err
}

return &id, nil
}

func (id *MetadataId) FromParseResult(input resourceids.ParseResult) error {
var ok bool

if id.MetadataName, ok = input.Parsed["metadataName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "metadataName", input)
}

return nil
}

// ValidateMetadataID checks that 'input' can be parsed as a Metadata ID
func ValidateMetadataID(input interface{}, key string) (warnings []string, errors []error) {
v, ok := input.(string)
Expand Down
Loading

0 comments on commit 522c81e

Please sign in to comment.