Skip to content

Commit

Permalink
Automated DCL import.
Browse files Browse the repository at this point in the history
  - 20f0b6c1c980ce17292dfc0cd4141f12406002ee Automatic import from cloud_mmv2_dcl_20220720_1531_RC00 by DCL Team <[email protected]>

GitOrigin-RevId: 20f0b6c1c980ce17292dfc0cd4141f12406002ee
  • Loading branch information
DCL Team authored and copybara-github committed Jul 20, 2022
1 parent 10d12a0 commit 4aff891
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 69 deletions.
9 changes: 0 additions & 9 deletions python/services/iam/alpha/workforce_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def __init__(

channel.initialize()
self.name = name
self.self_link = self_link
self.parent = parent
self.display_name = display_name
self.description = description
Expand All @@ -52,9 +51,6 @@ def apply(self):
if Primitive.to_proto(self.name):
request.resource.name = Primitive.to_proto(self.name)

if Primitive.to_proto(self.self_link):
request.resource.self_link = Primitive.to_proto(self.self_link)

if Primitive.to_proto(self.parent):
request.resource.parent = Primitive.to_proto(self.parent)

Expand Down Expand Up @@ -97,9 +93,6 @@ def delete(self):
if Primitive.to_proto(self.name):
request.resource.name = Primitive.to_proto(self.name)

if Primitive.to_proto(self.self_link):
request.resource.self_link = Primitive.to_proto(self.self_link)

if Primitive.to_proto(self.parent):
request.resource.parent = Primitive.to_proto(self.parent)

Expand Down Expand Up @@ -139,8 +132,6 @@ def to_proto(self):
resource = workforce_pool_pb2.IamAlphaWorkforcePool()
if Primitive.to_proto(self.name):
resource.name = Primitive.to_proto(self.name)
if Primitive.to_proto(self.self_link):
resource.self_link = Primitive.to_proto(self.self_link)
if Primitive.to_proto(self.parent):
resource.parent = Primitive.to_proto(self.parent)
if Primitive.to_proto(self.display_name):
Expand Down
9 changes: 0 additions & 9 deletions python/services/iam/beta/workforce_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def __init__(

channel.initialize()
self.name = name
self.self_link = self_link
self.parent = parent
self.display_name = display_name
self.description = description
Expand All @@ -52,9 +51,6 @@ def apply(self):
if Primitive.to_proto(self.name):
request.resource.name = Primitive.to_proto(self.name)

if Primitive.to_proto(self.self_link):
request.resource.self_link = Primitive.to_proto(self.self_link)

if Primitive.to_proto(self.parent):
request.resource.parent = Primitive.to_proto(self.parent)

Expand Down Expand Up @@ -97,9 +93,6 @@ def delete(self):
if Primitive.to_proto(self.name):
request.resource.name = Primitive.to_proto(self.name)

if Primitive.to_proto(self.self_link):
request.resource.self_link = Primitive.to_proto(self.self_link)

if Primitive.to_proto(self.parent):
request.resource.parent = Primitive.to_proto(self.parent)

Expand Down Expand Up @@ -139,8 +132,6 @@ def to_proto(self):
resource = workforce_pool_pb2.IamBetaWorkforcePool()
if Primitive.to_proto(self.name):
resource.name = Primitive.to_proto(self.name)
if Primitive.to_proto(self.self_link):
resource.self_link = Primitive.to_proto(self.self_link)
if Primitive.to_proto(self.parent):
resource.parent = Primitive.to_proto(self.parent)
if Primitive.to_proto(self.display_name):
Expand Down
9 changes: 0 additions & 9 deletions python/services/iam/workforce_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def __init__(

channel.initialize()
self.name = name
self.self_link = self_link
self.parent = parent
self.display_name = display_name
self.description = description
Expand All @@ -50,9 +49,6 @@ def apply(self):
if Primitive.to_proto(self.name):
request.resource.name = Primitive.to_proto(self.name)

if Primitive.to_proto(self.self_link):
request.resource.self_link = Primitive.to_proto(self.self_link)

if Primitive.to_proto(self.parent):
request.resource.parent = Primitive.to_proto(self.parent)

Expand Down Expand Up @@ -93,9 +89,6 @@ def delete(self):
if Primitive.to_proto(self.name):
request.resource.name = Primitive.to_proto(self.name)

if Primitive.to_proto(self.self_link):
request.resource.self_link = Primitive.to_proto(self.self_link)

if Primitive.to_proto(self.parent):
request.resource.parent = Primitive.to_proto(self.parent)

Expand Down Expand Up @@ -133,8 +126,6 @@ def to_proto(self):
resource = workforce_pool_pb2.IamWorkforcePool()
if Primitive.to_proto(self.name):
resource.name = Primitive.to_proto(self.name)
if Primitive.to_proto(self.self_link):
resource.self_link = Primitive.to_proto(self.self_link)
if Primitive.to_proto(self.parent):
resource.parent = Primitive.to_proto(self.parent)
if Primitive.to_proto(self.display_name):
Expand Down
1 change: 1 addition & 0 deletions services/google/iam/alpha/workforce_pool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ components:
selfLink:
type: string
x-dcl-go-name: SelfLink
readOnly: true
description: 'Output only. The resource name of the pool. Format: `locations/{location}/workforcePools/{workforce_pool_id}`'
x-kubernetes-immutable: true
sessionDuration:
Expand Down
6 changes: 3 additions & 3 deletions services/google/iam/alpha/workforce_pool_alpha_yaml_embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package alpha

// blaze-out/k8-fastbuild/genfiles/cloud/graphite/mmv2/services/google/iam/alpha/workforce_pool.yaml
var YAML_workforce_pool = []byte("info:\n title: Iam/WorkforcePool\n description: The Iam WorkforcePool resource\n x-dcl-struct-name: WorkforcePool\n x-dcl-has-iam: true\npaths:\n get:\n description: The function used to get information about a WorkforcePool\n parameters:\n - name: WorkforcePool\n required: true\n description: A full instance of a WorkforcePool\n apply:\n description: The function used to apply information about a WorkforcePool\n parameters:\n - name: WorkforcePool\n required: true\n description: A full instance of a WorkforcePool\n delete:\n description: The function used to delete a WorkforcePool\n parameters:\n - name: WorkforcePool\n required: true\n description: A full instance of a WorkforcePool\n deleteAll:\n description: The function used to delete all WorkforcePool\n parameters:\n - name: location\n required: true\n schema:\n type: string\n - name: parent\n required: true\n schema:\n type: string\n list:\n description: The function used to list information about many WorkforcePool\n parameters:\n - name: location\n required: true\n schema:\n type: string\n - name: parent\n required: true\n schema:\n type: string\ncomponents:\n schemas:\n WorkforcePool:\n title: WorkforcePool\n x-dcl-id: locations/{{location}}/workforcePools/{{name}}\n x-dcl-has-create: true\n x-dcl-has-iam: true\n x-dcl-read-timeout: 0\n x-dcl-apply-timeout: 0\n x-dcl-delete-timeout: 0\n type: object\n required:\n - name\n - parent\n - location\n properties:\n description:\n type: string\n x-dcl-go-name: Description\n description: A user-specified description of the pool. Cannot exceed 256\n characters.\n disabled:\n type: boolean\n x-dcl-go-name: Disabled\n description: Whether the pool is disabled. You cannot use a disabled pool\n to exchange tokens, or use existing tokens to access resources. If the\n pool is re-enabled, existing tokens grant access again.\n displayName:\n type: string\n x-dcl-go-name: DisplayName\n description: A user-specified display name of the pool in Google Cloud Console.\n Cannot exceed 32 characters.\n location:\n type: string\n x-dcl-go-name: Location\n description: The location for the resource\n x-kubernetes-immutable: true\n name:\n type: string\n x-dcl-go-name: Name\n description: The name of the pool. The ID must be a globally unique string\n of 6 to 63 lowercase letters, digits, or hyphens. It must start with a\n letter, and cannot have a trailing hyphen. The prefix `gcp-` is reserved\n for use by Google, and may not be specified.\n x-kubernetes-immutable: true\n parent:\n type: string\n x-dcl-go-name: Parent\n description: 'Immutable. The resource name of the parent. Format: `organizations/{org-id}`.'\n x-kubernetes-immutable: true\n x-dcl-forward-slash-allowed: true\n x-dcl-references:\n - resource: Cloudresourcemanager/Organization\n field: name\n parent: true\n selfLink:\n type: string\n x-dcl-go-name: SelfLink\n description: 'Output only. The resource name of the pool. Format: `locations/{location}/workforcePools/{workforce_pool_id}`'\n x-kubernetes-immutable: true\n sessionDuration:\n type: string\n x-dcl-go-name: SessionDuration\n description: How long the Google Cloud access tokens, console sign-in sessions,\n and gcloud sign-in sessions from this pool are valid. Must be greater\n than 15 minutes (900s) and less than 12 hours (43200s). If `session_duration`\n is not configured, minted credentials will have a default duration of\n one hour (3600s).\n state:\n type: string\n x-dcl-go-name: State\n x-dcl-go-type: WorkforcePoolStateEnum\n readOnly: true\n description: 'Output only. The state of the pool. Possible values: STATE_UNSPECIFIED,\n ACTIVE, DELETED'\n x-kubernetes-immutable: true\n enum:\n - STATE_UNSPECIFIED\n - ACTIVE\n - DELETED\n")
var YAML_workforce_pool = []byte("info:\n title: Iam/WorkforcePool\n description: The Iam WorkforcePool resource\n x-dcl-struct-name: WorkforcePool\n x-dcl-has-iam: true\npaths:\n get:\n description: The function used to get information about a WorkforcePool\n parameters:\n - name: WorkforcePool\n required: true\n description: A full instance of a WorkforcePool\n apply:\n description: The function used to apply information about a WorkforcePool\n parameters:\n - name: WorkforcePool\n required: true\n description: A full instance of a WorkforcePool\n delete:\n description: The function used to delete a WorkforcePool\n parameters:\n - name: WorkforcePool\n required: true\n description: A full instance of a WorkforcePool\n deleteAll:\n description: The function used to delete all WorkforcePool\n parameters:\n - name: location\n required: true\n schema:\n type: string\n - name: parent\n required: true\n schema:\n type: string\n list:\n description: The function used to list information about many WorkforcePool\n parameters:\n - name: location\n required: true\n schema:\n type: string\n - name: parent\n required: true\n schema:\n type: string\ncomponents:\n schemas:\n WorkforcePool:\n title: WorkforcePool\n x-dcl-id: locations/{{location}}/workforcePools/{{name}}\n x-dcl-has-create: true\n x-dcl-has-iam: true\n x-dcl-read-timeout: 0\n x-dcl-apply-timeout: 0\n x-dcl-delete-timeout: 0\n type: object\n required:\n - name\n - parent\n - location\n properties:\n description:\n type: string\n x-dcl-go-name: Description\n description: A user-specified description of the pool. Cannot exceed 256\n characters.\n disabled:\n type: boolean\n x-dcl-go-name: Disabled\n description: Whether the pool is disabled. You cannot use a disabled pool\n to exchange tokens, or use existing tokens to access resources. If the\n pool is re-enabled, existing tokens grant access again.\n displayName:\n type: string\n x-dcl-go-name: DisplayName\n description: A user-specified display name of the pool in Google Cloud Console.\n Cannot exceed 32 characters.\n location:\n type: string\n x-dcl-go-name: Location\n description: The location for the resource\n x-kubernetes-immutable: true\n name:\n type: string\n x-dcl-go-name: Name\n description: The name of the pool. The ID must be a globally unique string\n of 6 to 63 lowercase letters, digits, or hyphens. It must start with a\n letter, and cannot have a trailing hyphen. The prefix `gcp-` is reserved\n for use by Google, and may not be specified.\n x-kubernetes-immutable: true\n parent:\n type: string\n x-dcl-go-name: Parent\n description: 'Immutable. The resource name of the parent. Format: `organizations/{org-id}`.'\n x-kubernetes-immutable: true\n x-dcl-forward-slash-allowed: true\n x-dcl-references:\n - resource: Cloudresourcemanager/Organization\n field: name\n parent: true\n selfLink:\n type: string\n x-dcl-go-name: SelfLink\n readOnly: true\n description: 'Output only. The resource name of the pool. Format: `locations/{location}/workforcePools/{workforce_pool_id}`'\n x-kubernetes-immutable: true\n sessionDuration:\n type: string\n x-dcl-go-name: SessionDuration\n description: How long the Google Cloud access tokens, console sign-in sessions,\n and gcloud sign-in sessions from this pool are valid. Must be greater\n than 15 minutes (900s) and less than 12 hours (43200s). If `session_duration`\n is not configured, minted credentials will have a default duration of\n one hour (3600s).\n state:\n type: string\n x-dcl-go-name: State\n x-dcl-go-type: WorkforcePoolStateEnum\n readOnly: true\n description: 'Output only. The state of the pool. Possible values: STATE_UNSPECIFIED,\n ACTIVE, DELETED'\n x-kubernetes-immutable: true\n enum:\n - STATE_UNSPECIFIED\n - ACTIVE\n - DELETED\n")

// 4394 bytes
// MD5: 83a7c8c0ec2035e1700201ba02941531
// 4419 bytes
// MD5: 2680b88e1578109195e36396679f82e5
12 changes: 1 addition & 11 deletions services/google/iam/alpha/workforce_pool_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,6 @@ func canonicalizeWorkforcePoolDesiredState(rawDesired, rawInitial *WorkforcePool
} else {
canonicalDesired.Name = rawDesired.Name
}
if dcl.PartialSelfLinkToSelfLink(rawDesired.SelfLink, rawInitial.SelfLink) {
canonicalDesired.SelfLink = rawInitial.SelfLink
} else {
canonicalDesired.SelfLink = rawDesired.SelfLink
}
if dcl.StringCanonicalize(rawDesired.Parent, rawInitial.Parent) {
canonicalDesired.Parent = rawInitial.Parent
} else {
Expand Down Expand Up @@ -572,7 +567,7 @@ func diffWorkforcePool(c *Client, desired, actual *WorkforcePool, opts ...dcl.Ap
newDiffs = append(newDiffs, ds...)
}

if ds, err := dcl.Diff(desired.SelfLink, actual.SelfLink, dcl.DiffInfo{OperationSelector: dcl.RequiresRecreate()}, fn.AddNest("Name")); len(ds) != 0 || err != nil {
if ds, err := dcl.Diff(desired.SelfLink, actual.SelfLink, dcl.DiffInfo{OutputOnly: true, OperationSelector: dcl.RequiresRecreate()}, fn.AddNest("Name")); len(ds) != 0 || err != nil {
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -700,11 +695,6 @@ func expandWorkforcePool(c *Client, f *WorkforcePool) (map[string]interface{}, e
} else if !dcl.IsEmptyValueIndirect(v) {
m["name"] = v
}
if v, err := dcl.DeriveField("locations/%s/workforcePools/%s", f.SelfLink, dcl.SelfLinkToName(f.Location), dcl.SelfLinkToName(f.Name)); err != nil {
return nil, fmt.Errorf("error expanding SelfLink into name: %w", err)
} else if !dcl.IsEmptyValueIndirect(v) {
m["name"] = v
}
if v := f.Parent; dcl.ValueShouldBeSent(v) {
m["parent"] = v
}
Expand Down
1 change: 1 addition & 0 deletions services/google/iam/alpha/workforce_pool_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ func DCLWorkforcePoolSchema() *dcl.Schema {
"selfLink": &dcl.Property{
Type: "string",
GoName: "SelfLink",
ReadOnly: true,
Description: "Output only. The resource name of the pool. Format: `locations/{location}/workforcePools/{workforce_pool_id}`",
Immutable: true,
},
Expand Down
1 change: 1 addition & 0 deletions services/google/iam/beta/workforce_pool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ components:
selfLink:
type: string
x-dcl-go-name: SelfLink
readOnly: true
description: 'Output only. The resource name of the pool. Format: `locations/{location}/workforcePools/{workforce_pool_id}`'
x-kubernetes-immutable: true
sessionDuration:
Expand Down
Loading

0 comments on commit 4aff891

Please sign in to comment.