Skip to content

Commit

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

GitOrigin-RevId: 0b905c6c40e94e84d0776a8c1e03fef5bbab9dcf
  • Loading branch information
DCL Team authored and copybara-github committed Dec 17, 2022
1 parent 3f9c199 commit b2d522d
Show file tree
Hide file tree
Showing 32 changed files with 735 additions and 456 deletions.
1 change: 1 addition & 0 deletions python/proto/osconfig/alpha/os_policy_assignment.proto
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ message OsconfigAlphaOSPolicyAssignment {
string uid = 13;
string project = 14;
string location = 15;
bool skip_await_rollout = 16;
}

message OsconfigAlphaOSPolicyAssignmentOSPolicies {
Expand Down
1 change: 1 addition & 0 deletions python/proto/osconfig/beta/os_policy_assignment.proto
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ message OsconfigBetaOSPolicyAssignment {
string uid = 13;
string project = 14;
string location = 15;
bool skip_await_rollout = 16;
}

message OsconfigBetaOSPolicyAssignmentOSPolicies {
Expand Down
1 change: 1 addition & 0 deletions python/proto/osconfig/os_policy_assignment.proto
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ message OsconfigOSPolicyAssignment {
string uid = 13;
string project = 14;
string location = 15;
bool skip_await_rollout = 16;
}

message OsconfigOSPolicyAssignmentOSPolicies {
Expand Down
15 changes: 15 additions & 0 deletions python/services/osconfig/alpha/os_policy_assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def __init__(
uid: str = None,
project: str = None,
location: str = None,
skip_await_rollout: bool = None,
service_account_file: str = "",
):

Expand All @@ -51,6 +52,7 @@ def __init__(
self.rollout = rollout
self.project = project
self.location = location
self.skip_await_rollout = skip_await_rollout
self.service_account_file = service_account_file

def apply(self):
Expand Down Expand Up @@ -86,6 +88,11 @@ def apply(self):
if Primitive.to_proto(self.location):
request.resource.location = Primitive.to_proto(self.location)

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

request.service_account_file = self.service_account_file

response = stub.ApplyOsconfigAlphaOSPolicyAssignment(request)
Expand All @@ -110,6 +117,7 @@ def apply(self):
self.uid = Primitive.from_proto(response.uid)
self.project = Primitive.from_proto(response.project)
self.location = Primitive.from_proto(response.location)
self.skip_await_rollout = Primitive.from_proto(response.skip_await_rollout)

def delete(self):
stub = os_policy_assignment_pb2_grpc.OsconfigAlphaOSPolicyAssignmentServiceStub(
Expand Down Expand Up @@ -147,6 +155,11 @@ def delete(self):
if Primitive.to_proto(self.location):
request.resource.location = Primitive.to_proto(self.location)

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

response = stub.DeleteOsconfigAlphaOSPolicyAssignment(request)

@classmethod
Expand Down Expand Up @@ -186,6 +199,8 @@ def to_proto(self):
resource.project = Primitive.to_proto(self.project)
if Primitive.to_proto(self.location):
resource.location = Primitive.to_proto(self.location)
if Primitive.to_proto(self.skip_await_rollout):
resource.skip_await_rollout = Primitive.to_proto(self.skip_await_rollout)
return resource


Expand Down
2 changes: 2 additions & 0 deletions python/services/osconfig/alpha/os_policy_assignment_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@ func ProtoToOSPolicyAssignment(p *alphapb.OsconfigAlphaOSPolicyAssignment) *alph
Uid: dcl.StringOrNil(p.GetUid()),
Project: dcl.StringOrNil(p.GetProject()),
Location: dcl.StringOrNil(p.GetLocation()),
SkipAwaitRollout: dcl.Bool(p.GetSkipAwaitRollout()),
}
for _, r := range p.GetOsPolicies() {
obj.OSPolicies = append(obj.OSPolicies, *ProtoToOsconfigAlphaOSPolicyAssignmentOSPolicies(r))
Expand Down Expand Up @@ -1424,6 +1425,7 @@ func OSPolicyAssignmentToProto(resource *alpha.OSPolicyAssignment) *alphapb.Osco
p.SetUid(dcl.ValueOrEmptyString(resource.Uid))
p.SetProject(dcl.ValueOrEmptyString(resource.Project))
p.SetLocation(dcl.ValueOrEmptyString(resource.Location))
p.SetSkipAwaitRollout(dcl.ValueOrEmptyBool(resource.SkipAwaitRollout))
sOSPolicies := make([]*alphapb.OsconfigAlphaOSPolicyAssignmentOSPolicies, len(resource.OSPolicies))
for i, r := range resource.OSPolicies {
sOSPolicies[i] = OsconfigAlphaOSPolicyAssignmentOSPoliciesToProto(&r)
Expand Down
15 changes: 15 additions & 0 deletions python/services/osconfig/beta/os_policy_assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def __init__(
uid: str = None,
project: str = None,
location: str = None,
skip_await_rollout: bool = None,
service_account_file: str = "",
):

Expand All @@ -51,6 +52,7 @@ def __init__(
self.rollout = rollout
self.project = project
self.location = location
self.skip_await_rollout = skip_await_rollout
self.service_account_file = service_account_file

def apply(self):
Expand Down Expand Up @@ -86,6 +88,11 @@ def apply(self):
if Primitive.to_proto(self.location):
request.resource.location = Primitive.to_proto(self.location)

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

request.service_account_file = self.service_account_file

response = stub.ApplyOsconfigBetaOSPolicyAssignment(request)
Expand All @@ -110,6 +117,7 @@ def apply(self):
self.uid = Primitive.from_proto(response.uid)
self.project = Primitive.from_proto(response.project)
self.location = Primitive.from_proto(response.location)
self.skip_await_rollout = Primitive.from_proto(response.skip_await_rollout)

def delete(self):
stub = os_policy_assignment_pb2_grpc.OsconfigBetaOSPolicyAssignmentServiceStub(
Expand Down Expand Up @@ -145,6 +153,11 @@ def delete(self):
if Primitive.to_proto(self.location):
request.resource.location = Primitive.to_proto(self.location)

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

response = stub.DeleteOsconfigBetaOSPolicyAssignment(request)

@classmethod
Expand Down Expand Up @@ -184,6 +197,8 @@ def to_proto(self):
resource.project = Primitive.to_proto(self.project)
if Primitive.to_proto(self.location):
resource.location = Primitive.to_proto(self.location)
if Primitive.to_proto(self.skip_await_rollout):
resource.skip_await_rollout = Primitive.to_proto(self.skip_await_rollout)
return resource


Expand Down
2 changes: 2 additions & 0 deletions python/services/osconfig/beta/os_policy_assignment_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@ func ProtoToOSPolicyAssignment(p *betapb.OsconfigBetaOSPolicyAssignment) *beta.O
Uid: dcl.StringOrNil(p.GetUid()),
Project: dcl.StringOrNil(p.GetProject()),
Location: dcl.StringOrNil(p.GetLocation()),
SkipAwaitRollout: dcl.Bool(p.GetSkipAwaitRollout()),
}
for _, r := range p.GetOsPolicies() {
obj.OSPolicies = append(obj.OSPolicies, *ProtoToOsconfigBetaOSPolicyAssignmentOSPolicies(r))
Expand Down Expand Up @@ -1424,6 +1425,7 @@ func OSPolicyAssignmentToProto(resource *beta.OSPolicyAssignment) *betapb.Osconf
p.SetUid(dcl.ValueOrEmptyString(resource.Uid))
p.SetProject(dcl.ValueOrEmptyString(resource.Project))
p.SetLocation(dcl.ValueOrEmptyString(resource.Location))
p.SetSkipAwaitRollout(dcl.ValueOrEmptyBool(resource.SkipAwaitRollout))
sOSPolicies := make([]*betapb.OsconfigBetaOSPolicyAssignmentOSPolicies, len(resource.OSPolicies))
for i, r := range resource.OSPolicies {
sOSPolicies[i] = OsconfigBetaOSPolicyAssignmentOSPoliciesToProto(&r)
Expand Down
15 changes: 15 additions & 0 deletions python/services/osconfig/os_policy_assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def __init__(
uid: str = None,
project: str = None,
location: str = None,
skip_await_rollout: bool = None,
service_account_file: str = "",
):

Expand All @@ -51,6 +52,7 @@ def __init__(
self.rollout = rollout
self.project = project
self.location = location
self.skip_await_rollout = skip_await_rollout
self.service_account_file = service_account_file

def apply(self):
Expand Down Expand Up @@ -86,6 +88,11 @@ def apply(self):
if Primitive.to_proto(self.location):
request.resource.location = Primitive.to_proto(self.location)

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

request.service_account_file = self.service_account_file

response = stub.ApplyOsconfigOSPolicyAssignment(request)
Expand All @@ -110,6 +117,7 @@ def apply(self):
self.uid = Primitive.from_proto(response.uid)
self.project = Primitive.from_proto(response.project)
self.location = Primitive.from_proto(response.location)
self.skip_await_rollout = Primitive.from_proto(response.skip_await_rollout)

def delete(self):
stub = os_policy_assignment_pb2_grpc.OsconfigOSPolicyAssignmentServiceStub(
Expand Down Expand Up @@ -145,6 +153,11 @@ def delete(self):
if Primitive.to_proto(self.location):
request.resource.location = Primitive.to_proto(self.location)

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

response = stub.DeleteOsconfigOSPolicyAssignment(request)

@classmethod
Expand Down Expand Up @@ -184,6 +197,8 @@ def to_proto(self):
resource.project = Primitive.to_proto(self.project)
if Primitive.to_proto(self.location):
resource.location = Primitive.to_proto(self.location)
if Primitive.to_proto(self.skip_await_rollout):
resource.skip_await_rollout = Primitive.to_proto(self.skip_await_rollout)
return resource


Expand Down
2 changes: 2 additions & 0 deletions python/services/osconfig/os_policy_assignment_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@ func ProtoToOSPolicyAssignment(p *osconfigpb.OsconfigOSPolicyAssignment) *osconf
Uid: dcl.StringOrNil(p.GetUid()),
Project: dcl.StringOrNil(p.GetProject()),
Location: dcl.StringOrNil(p.GetLocation()),
SkipAwaitRollout: dcl.Bool(p.GetSkipAwaitRollout()),
}
for _, r := range p.GetOsPolicies() {
obj.OSPolicies = append(obj.OSPolicies, *ProtoToOsconfigOSPolicyAssignmentOSPolicies(r))
Expand Down Expand Up @@ -1424,6 +1425,7 @@ func OSPolicyAssignmentToProto(resource *osconfig.OSPolicyAssignment) *osconfigp
p.SetUid(dcl.ValueOrEmptyString(resource.Uid))
p.SetProject(dcl.ValueOrEmptyString(resource.Project))
p.SetLocation(dcl.ValueOrEmptyString(resource.Location))
p.SetSkipAwaitRollout(dcl.ValueOrEmptyBool(resource.SkipAwaitRollout))
sOSPolicies := make([]*osconfigpb.OsconfigOSPolicyAssignmentOSPolicies, len(resource.OSPolicies))
for i, r := range resource.OSPolicies {
sOSPolicies[i] = OsconfigOSPolicyAssignmentOSPoliciesToProto(&r)
Expand Down
2 changes: 2 additions & 0 deletions services/google/osconfig/alpha/os_policy_assignment.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type OSPolicyAssignment struct {
Uid *string `json:"uid"`
Project *string `json:"project"`
Location *string `json:"location"`
SkipAwaitRollout *bool `json:"skipAwaitRollout"`
}

func (r *OSPolicyAssignment) String() string {
Expand Down Expand Up @@ -2603,6 +2604,7 @@ func (r *OSPolicyAssignment) ID() (string, error) {
"uid": dcl.ValueOrEmptyString(nr.Uid),
"project": dcl.ValueOrEmptyString(nr.Project),
"location": dcl.ValueOrEmptyString(nr.Location),
"skip_await_rollout": dcl.ValueOrEmptyString(nr.SkipAwaitRollout),
}
return dcl.Nprintf("projects/{{project}}/locations/{{location}}/osPolicyAssignments/{{name}}", params), nil
}
Expand Down
7 changes: 7 additions & 0 deletions services/google/osconfig/alpha/os_policy_assignment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ components:
OSPolicyAssignment:
title: OSPolicyAssignment
x-dcl-id: projects/{{project}}/locations/{{location}}/osPolicyAssignments/{{name}}
x-dcl-uses-state-hint: true
x-dcl-parent-container: project
x-dcl-has-create: true
x-dcl-has-iam: false
Expand Down Expand Up @@ -1337,6 +1338,12 @@ components:
- CANCELLING
- CANCELLED
- SUCCEEDED
skipAwaitRollout:
type: boolean
x-dcl-go-name: SkipAwaitRollout
description: Set to true to skip awaiting rollout during resource creation
and update.
x-dcl-mutable-unreadable: true
uid:
type: string
x-dcl-go-name: Uid
Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit b2d522d

Please sign in to comment.