| { |
| "clientLibrary": { |
| "name": "cloud.google.com/go/orgpolicy/apiv2", |
| "version": "1.6.0", |
| "language": "GO", |
| "apis": [ |
| { |
| "id": "google.cloud.orgpolicy.v2", |
| "version": "v2" |
| } |
| ] |
| }, |
| "snippets": [ |
| { |
| "regionTag": "orgpolicy_v2_generated_OrgPolicy_CreatePolicy_sync", |
| "title": "orgpolicy CreatePolicy Sample", |
| "description": "CreatePolicy creates a Policy.\n\nReturns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the\nconstraint does not exist.\nReturns a google.rpc.Status with google.rpc.Code.ALREADY_EXISTS if the\npolicy already exists on the given Cloud resource.", |
| "file": "Client/CreatePolicy/main.go", |
| "language": "GO", |
| "clientMethod": { |
| "shortName": "CreatePolicy", |
| "fullName": "google.cloud.orgpolicy.v2.Client.CreatePolicy", |
| "parameters": [ |
| { |
| "type": "context.Context", |
| "name": "ctx" |
| }, |
| { |
| "type": "orgpolicypb.CreatePolicyRequest", |
| "name": "req" |
| }, |
| { |
| "type": "...gax.CallOption", |
| "name": "opts" |
| } |
| ], |
| "resultType": "orgpolicypb.Policy", |
| "client": { |
| "shortName": "Client", |
| "fullName": "google.cloud.orgpolicy.v2.Client" |
| }, |
| "method": { |
| "shortName": "CreatePolicy", |
| "fullName": "google.cloud.orgpolicy.v2.OrgPolicy.CreatePolicy", |
| "service": { |
| "shortName": "OrgPolicy", |
| "fullName": "google.cloud.orgpolicy.v2.OrgPolicy" |
| } |
| } |
| }, |
| "origin": "API_DEFINITION", |
| "segments": [ |
| { |
| "start": 18, |
| "end": 53, |
| "type": "FULL" |
| } |
| ] |
| }, |
| { |
| "regionTag": "orgpolicy_v2_generated_OrgPolicy_DeletePolicy_sync", |
| "title": "orgpolicy DeletePolicy Sample", |
| "description": "DeletePolicy deletes a Policy.\n\nReturns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the\nconstraint or Org Policy does not exist.", |
| "file": "Client/DeletePolicy/main.go", |
| "language": "GO", |
| "clientMethod": { |
| "shortName": "DeletePolicy", |
| "fullName": "google.cloud.orgpolicy.v2.Client.DeletePolicy", |
| "parameters": [ |
| { |
| "type": "context.Context", |
| "name": "ctx" |
| }, |
| { |
| "type": "orgpolicypb.DeletePolicyRequest", |
| "name": "req" |
| }, |
| { |
| "type": "...gax.CallOption", |
| "name": "opts" |
| } |
| ], |
| "client": { |
| "shortName": "Client", |
| "fullName": "google.cloud.orgpolicy.v2.Client" |
| }, |
| "method": { |
| "shortName": "DeletePolicy", |
| "fullName": "google.cloud.orgpolicy.v2.OrgPolicy.DeletePolicy", |
| "service": { |
| "shortName": "OrgPolicy", |
| "fullName": "google.cloud.orgpolicy.v2.OrgPolicy" |
| } |
| } |
| }, |
| "origin": "API_DEFINITION", |
| "segments": [ |
| { |
| "start": 18, |
| "end": 51, |
| "type": "FULL" |
| } |
| ] |
| }, |
| { |
| "regionTag": "orgpolicy_v2_generated_OrgPolicy_GetEffectivePolicy_sync", |
| "title": "orgpolicy GetEffectivePolicy Sample", |
| "description": "GetEffectivePolicy gets the effective Policy on a resource. This is the result of merging\nPolicies in the resource hierarchy and evaluating conditions. The\nreturned Policy will not have an etag or condition set because it is\na computed Policy across multiple resources.\nSubtrees of Resource Manager resource hierarchy with ‘under: ’ prefix will\nnot be expanded.", |
| "file": "Client/GetEffectivePolicy/main.go", |
| "language": "GO", |
| "clientMethod": { |
| "shortName": "GetEffectivePolicy", |
| "fullName": "google.cloud.orgpolicy.v2.Client.GetEffectivePolicy", |
| "parameters": [ |
| { |
| "type": "context.Context", |
| "name": "ctx" |
| }, |
| { |
| "type": "orgpolicypb.GetEffectivePolicyRequest", |
| "name": "req" |
| }, |
| { |
| "type": "...gax.CallOption", |
| "name": "opts" |
| } |
| ], |
| "resultType": "orgpolicypb.Policy", |
| "client": { |
| "shortName": "Client", |
| "fullName": "google.cloud.orgpolicy.v2.Client" |
| }, |
| "method": { |
| "shortName": "GetEffectivePolicy", |
| "fullName": "google.cloud.orgpolicy.v2.OrgPolicy.GetEffectivePolicy", |
| "service": { |
| "shortName": "OrgPolicy", |
| "fullName": "google.cloud.orgpolicy.v2.OrgPolicy" |
| } |
| } |
| }, |
| "origin": "API_DEFINITION", |
| "segments": [ |
| { |
| "start": 18, |
| "end": 53, |
| "type": "FULL" |
| } |
| ] |
| }, |
| { |
| "regionTag": "orgpolicy_v2_generated_OrgPolicy_GetPolicy_sync", |
| "title": "orgpolicy GetPolicy Sample", |
| "description": "GetPolicy gets a Policy on a resource.\n\nIf no Policy is set on the resource, NOT_FOUND is returned. The\netag value can be used with UpdatePolicy() to update a\nPolicy during read-modify-write.", |
| "file": "Client/GetPolicy/main.go", |
| "language": "GO", |
| "clientMethod": { |
| "shortName": "GetPolicy", |
| "fullName": "google.cloud.orgpolicy.v2.Client.GetPolicy", |
| "parameters": [ |
| { |
| "type": "context.Context", |
| "name": "ctx" |
| }, |
| { |
| "type": "orgpolicypb.GetPolicyRequest", |
| "name": "req" |
| }, |
| { |
| "type": "...gax.CallOption", |
| "name": "opts" |
| } |
| ], |
| "resultType": "orgpolicypb.Policy", |
| "client": { |
| "shortName": "Client", |
| "fullName": "google.cloud.orgpolicy.v2.Client" |
| }, |
| "method": { |
| "shortName": "GetPolicy", |
| "fullName": "google.cloud.orgpolicy.v2.OrgPolicy.GetPolicy", |
| "service": { |
| "shortName": "OrgPolicy", |
| "fullName": "google.cloud.orgpolicy.v2.OrgPolicy" |
| } |
| } |
| }, |
| "origin": "API_DEFINITION", |
| "segments": [ |
| { |
| "start": 18, |
| "end": 53, |
| "type": "FULL" |
| } |
| ] |
| }, |
| { |
| "regionTag": "orgpolicy_v2_generated_OrgPolicy_ListConstraints_sync", |
| "title": "orgpolicy ListConstraints Sample", |
| "description": "ListConstraints lists Constraints that could be applied on the specified resource.", |
| "file": "Client/ListConstraints/main.go", |
| "language": "GO", |
| "clientMethod": { |
| "shortName": "ListConstraints", |
| "fullName": "google.cloud.orgpolicy.v2.Client.ListConstraints", |
| "parameters": [ |
| { |
| "type": "context.Context", |
| "name": "ctx" |
| }, |
| { |
| "type": "orgpolicypb.ListConstraintsRequest", |
| "name": "req" |
| }, |
| { |
| "type": "...gax.CallOption", |
| "name": "opts" |
| } |
| ], |
| "resultType": "ConstraintIterator", |
| "client": { |
| "shortName": "Client", |
| "fullName": "google.cloud.orgpolicy.v2.Client" |
| }, |
| "method": { |
| "shortName": "ListConstraints", |
| "fullName": "google.cloud.orgpolicy.v2.OrgPolicy.ListConstraints", |
| "service": { |
| "shortName": "OrgPolicy", |
| "fullName": "google.cloud.orgpolicy.v2.OrgPolicy" |
| } |
| } |
| }, |
| "origin": "API_DEFINITION", |
| "segments": [ |
| { |
| "start": 18, |
| "end": 60, |
| "type": "FULL" |
| } |
| ] |
| }, |
| { |
| "regionTag": "orgpolicy_v2_generated_OrgPolicy_ListPolicies_sync", |
| "title": "orgpolicy ListPolicies Sample", |
| "description": "ListPolicies retrieves all of the Policies that exist on a particular resource.", |
| "file": "Client/ListPolicies/main.go", |
| "language": "GO", |
| "clientMethod": { |
| "shortName": "ListPolicies", |
| "fullName": "google.cloud.orgpolicy.v2.Client.ListPolicies", |
| "parameters": [ |
| { |
| "type": "context.Context", |
| "name": "ctx" |
| }, |
| { |
| "type": "orgpolicypb.ListPoliciesRequest", |
| "name": "req" |
| }, |
| { |
| "type": "...gax.CallOption", |
| "name": "opts" |
| } |
| ], |
| "resultType": "PolicyIterator", |
| "client": { |
| "shortName": "Client", |
| "fullName": "google.cloud.orgpolicy.v2.Client" |
| }, |
| "method": { |
| "shortName": "ListPolicies", |
| "fullName": "google.cloud.orgpolicy.v2.OrgPolicy.ListPolicies", |
| "service": { |
| "shortName": "OrgPolicy", |
| "fullName": "google.cloud.orgpolicy.v2.OrgPolicy" |
| } |
| } |
| }, |
| "origin": "API_DEFINITION", |
| "segments": [ |
| { |
| "start": 18, |
| "end": 60, |
| "type": "FULL" |
| } |
| ] |
| }, |
| { |
| "regionTag": "orgpolicy_v2_generated_OrgPolicy_UpdatePolicy_sync", |
| "title": "orgpolicy UpdatePolicy Sample", |
| "description": "UpdatePolicy updates a Policy.\n\nReturns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the\nconstraint or the policy do not exist.\nReturns a google.rpc.Status with google.rpc.Code.ABORTED if the etag\nsupplied in the request does not match the persisted etag of the policy\n\nNote: the supplied policy will perform a full overwrite of all\nfields.", |
| "file": "Client/UpdatePolicy/main.go", |
| "language": "GO", |
| "clientMethod": { |
| "shortName": "UpdatePolicy", |
| "fullName": "google.cloud.orgpolicy.v2.Client.UpdatePolicy", |
| "parameters": [ |
| { |
| "type": "context.Context", |
| "name": "ctx" |
| }, |
| { |
| "type": "orgpolicypb.UpdatePolicyRequest", |
| "name": "req" |
| }, |
| { |
| "type": "...gax.CallOption", |
| "name": "opts" |
| } |
| ], |
| "resultType": "orgpolicypb.Policy", |
| "client": { |
| "shortName": "Client", |
| "fullName": "google.cloud.orgpolicy.v2.Client" |
| }, |
| "method": { |
| "shortName": "UpdatePolicy", |
| "fullName": "google.cloud.orgpolicy.v2.OrgPolicy.UpdatePolicy", |
| "service": { |
| "shortName": "OrgPolicy", |
| "fullName": "google.cloud.orgpolicy.v2.OrgPolicy" |
| } |
| } |
| }, |
| "origin": "API_DEFINITION", |
| "segments": [ |
| { |
| "start": 18, |
| "end": 53, |
| "type": "FULL" |
| } |
| ] |
| } |
| ] |
| } |