| 1 |
// Copyright 2025 Google LLC |
| 2 |
// |
| 3 |
// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
// you may not use this file except in compliance with the License. |
| 5 |
// You may obtain a copy of the License at |
| 6 |
// |
| 7 |
// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
// |
| 9 |
// Unless required by applicable law or agreed to in writing, software |
| 10 |
// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
// See the License for the specific language governing permissions and |
| 13 |
// limitations under the License. |
| 14 |
|
| 15 |
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. |
| 16 |
// versions: |
| 17 |
// - protoc-gen-go-grpc v1.3.0 |
| 18 |
// - protoc v4.25.7 |
| 19 |
// source: google/cloud/orgpolicy/v2/orgpolicy.proto |
| 20 |
|
| 21 |
package orgpolicypb |
| 22 |
|
| 23 |
import ( |
| 24 |
context "context" |
| 25 |
grpc "google.golang.org/grpc" |
| 26 |
codes "google.golang.org/grpc/codes" |
| 27 |
status "google.golang.org/grpc/status" |
| 28 |
emptypb "google.golang.org/protobuf/types/known/emptypb" |
| 29 |
) |
| 30 |
|
| 31 |
// This is a compile-time assertion to ensure that this generated file |
| 32 |
// is compatible with the grpc package it is being compiled against. |
| 33 |
// Requires gRPC-Go v1.32.0 or later. |
| 34 |
const _ = grpc.SupportPackageIsVersion7 |
| 35 |
|
| 36 |
const ( |
| 37 |
OrgPolicy_ListConstraints_FullMethodName = "/google.cloud.orgpolicy.v2.OrgPolicy/ListConstraints" |
| 38 |
OrgPolicy_ListPolicies_FullMethodName = "/google.cloud.orgpolicy.v2.OrgPolicy/ListPolicies" |
| 39 |
OrgPolicy_GetPolicy_FullMethodName = "/google.cloud.orgpolicy.v2.OrgPolicy/GetPolicy" |
| 40 |
OrgPolicy_GetEffectivePolicy_FullMethodName = "/google.cloud.orgpolicy.v2.OrgPolicy/GetEffectivePolicy" |
| 41 |
OrgPolicy_CreatePolicy_FullMethodName = "/google.cloud.orgpolicy.v2.OrgPolicy/CreatePolicy" |
| 42 |
OrgPolicy_UpdatePolicy_FullMethodName = "/google.cloud.orgpolicy.v2.OrgPolicy/UpdatePolicy" |
| 43 |
OrgPolicy_DeletePolicy_FullMethodName = "/google.cloud.orgpolicy.v2.OrgPolicy/DeletePolicy" |
| 44 |
OrgPolicy_CreateCustomConstraint_FullMethodName = "/google.cloud.orgpolicy.v2.OrgPolicy/CreateCustomConstraint" |
| 45 |
OrgPolicy_UpdateCustomConstraint_FullMethodName = "/google.cloud.orgpolicy.v2.OrgPolicy/UpdateCustomConstraint" |
| 46 |
OrgPolicy_GetCustomConstraint_FullMethodName = "/google.cloud.orgpolicy.v2.OrgPolicy/GetCustomConstraint" |
| 47 |
OrgPolicy_ListCustomConstraints_FullMethodName = "/google.cloud.orgpolicy.v2.OrgPolicy/ListCustomConstraints" |
| 48 |
OrgPolicy_DeleteCustomConstraint_FullMethodName = "/google.cloud.orgpolicy.v2.OrgPolicy/DeleteCustomConstraint" |
| 49 |
) |
| 50 |
|
| 51 |
// OrgPolicyClient is the client API for OrgPolicy service. |
| 52 |
// |
| 53 |
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. |
| 54 |
type OrgPolicyClient interface { |
| 55 |
// Lists constraints that could be applied on the specified resource. |
| 56 |
ListConstraints(ctx context.Context, in *ListConstraintsRequest, opts ...grpc.CallOption) (*ListConstraintsResponse, error) |
| 57 |
// Retrieves all of the policies that exist on a particular resource. |
| 58 |
ListPolicies(ctx context.Context, in *ListPoliciesRequest, opts ...grpc.CallOption) (*ListPoliciesResponse, error) |
| 59 |
// Gets a policy on a resource. |
| 60 |
// |
| 61 |
// If no policy is set on the resource, `NOT_FOUND` is returned. The |
| 62 |
// `etag` value can be used with `UpdatePolicy()` to update a |
| 63 |
// policy during read-modify-write. |
| 64 |
GetPolicy(ctx context.Context, in *GetPolicyRequest, opts ...grpc.CallOption) (*Policy, error) |
| 65 |
// Gets the effective policy on a resource. This is the result of merging |
| 66 |
// policies in the resource hierarchy and evaluating conditions. The |
| 67 |
// returned policy will not have an `etag` or `condition` set because it is |
| 68 |
// an evaluated policy across multiple resources. |
| 69 |
// Subtrees of Resource Manager resource hierarchy with 'under:' prefix will |
| 70 |
// not be expanded. |
| 71 |
GetEffectivePolicy(ctx context.Context, in *GetEffectivePolicyRequest, opts ...grpc.CallOption) (*Policy, error) |
| 72 |
// Creates a policy. |
| 73 |
// |
| 74 |
// Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the |
| 75 |
// constraint does not exist. |
| 76 |
// Returns a `google.rpc.Status` with `google.rpc.Code.ALREADY_EXISTS` if the |
| 77 |
// policy already exists on the given Google Cloud resource. |
| 78 |
CreatePolicy(ctx context.Context, in *CreatePolicyRequest, opts ...grpc.CallOption) (*Policy, error) |
| 79 |
// Updates a policy. |
| 80 |
// |
| 81 |
// Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the |
| 82 |
// constraint or the policy do not exist. |
| 83 |
// Returns a `google.rpc.Status` with `google.rpc.Code.ABORTED` if the etag |
| 84 |
// supplied in the request does not match the persisted etag of the policy |
| 85 |
// |
| 86 |
// Note: the supplied policy will perform a full overwrite of all |
| 87 |
// fields. |
| 88 |
UpdatePolicy(ctx context.Context, in *UpdatePolicyRequest, opts ...grpc.CallOption) (*Policy, error) |
| 89 |
// Deletes a policy. |
| 90 |
// |
| 91 |
// Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the |
| 92 |
// constraint or organization policy does not exist. |
| 93 |
DeletePolicy(ctx context.Context, in *DeletePolicyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) |
| 94 |
// Creates a custom constraint. |
| 95 |
// |
| 96 |
// Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the |
| 97 |
// organization does not exist. |
| 98 |
// Returns a `google.rpc.Status` with `google.rpc.Code.ALREADY_EXISTS` if the |
| 99 |
// constraint already exists on the given organization. |
| 100 |
CreateCustomConstraint(ctx context.Context, in *CreateCustomConstraintRequest, opts ...grpc.CallOption) (*CustomConstraint, error) |
| 101 |
// Updates a custom constraint. |
| 102 |
// |
| 103 |
// Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the |
| 104 |
// constraint does not exist. |
| 105 |
// |
| 106 |
// Note: the supplied policy will perform a full overwrite of all |
| 107 |
// fields. |
| 108 |
UpdateCustomConstraint(ctx context.Context, in *UpdateCustomConstraintRequest, opts ...grpc.CallOption) (*CustomConstraint, error) |
| 109 |
// Gets a custom or managed constraint. |
| 110 |
// |
| 111 |
// Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the |
| 112 |
// custom or managed constraint does not exist. |
| 113 |
GetCustomConstraint(ctx context.Context, in *GetCustomConstraintRequest, opts ...grpc.CallOption) (*CustomConstraint, error) |
| 114 |
// Retrieves all of the custom constraints that exist on a particular |
| 115 |
// organization resource. |
| 116 |
ListCustomConstraints(ctx context.Context, in *ListCustomConstraintsRequest, opts ...grpc.CallOption) (*ListCustomConstraintsResponse, error) |
| 117 |
// Deletes a custom constraint. |
| 118 |
// |
| 119 |
// Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the |
| 120 |
// constraint does not exist. |
| 121 |
DeleteCustomConstraint(ctx context.Context, in *DeleteCustomConstraintRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) |
| 122 |
} |
| 123 |
|
| 124 |
type orgPolicyClient struct { |
| 125 |
cc grpc.ClientConnInterface |
| 126 |
} |
| 127 |
|
| 128 |
func NewOrgPolicyClient(cc grpc.ClientConnInterface) OrgPolicyClient { |
| 129 |
return &orgPolicyClient{cc} |
| 130 |
} |
| 131 |
|
| 132 |
func (c *orgPolicyClient) ListConstraints(ctx context.Context, in *ListConstraintsRequest, opts ...grpc.CallOption) (*ListConstraintsResponse, error) { |
| 133 |
out := new(ListConstraintsResponse) |
| 134 |
err := c.cc.Invoke(ctx, OrgPolicy_ListConstraints_FullMethodName, in, out, opts...) |
| 135 |
if err != nil { |
| 136 |
return nil, err |
| 137 |
} |
| 138 |
return out, nil |
| 139 |
} |
| 140 |
|
| 141 |
func (c *orgPolicyClient) ListPolicies(ctx context.Context, in *ListPoliciesRequest, opts ...grpc.CallOption) (*ListPoliciesResponse, error) { |
| 142 |
out := new(ListPoliciesResponse) |
| 143 |
err := c.cc.Invoke(ctx, OrgPolicy_ListPolicies_FullMethodName, in, out, opts...) |
| 144 |
if err != nil { |
| 145 |
return nil, err |
| 146 |
} |
| 147 |
return out, nil |
| 148 |
} |
| 149 |
|
| 150 |
func (c *orgPolicyClient) GetPolicy(ctx context.Context, in *GetPolicyRequest, opts ...grpc.CallOption) (*Policy, error) { |
| 151 |
out := new(Policy) |
| 152 |
err := c.cc.Invoke(ctx, OrgPolicy_GetPolicy_FullMethodName, in, out, opts...) |
| 153 |
if err != nil { |
| 154 |
return nil, err |
| 155 |
} |
| 156 |
return out, nil |
| 157 |
} |
| 158 |
|
| 159 |
func (c *orgPolicyClient) GetEffectivePolicy(ctx context.Context, in *GetEffectivePolicyRequest, opts ...grpc.CallOption) (*Policy, error) { |
| 160 |
out := new(Policy) |
| 161 |
err := c.cc.Invoke(ctx, OrgPolicy_GetEffectivePolicy_FullMethodName, in, out, opts...) |
| 162 |
if err != nil { |
| 163 |
return nil, err |
| 164 |
} |
| 165 |
return out, nil |
| 166 |
} |
| 167 |
|
| 168 |
func (c *orgPolicyClient) CreatePolicy(ctx context.Context, in *CreatePolicyRequest, opts ...grpc.CallOption) (*Policy, error) { |
| 169 |
out := new(Policy) |
| 170 |
err := c.cc.Invoke(ctx, OrgPolicy_CreatePolicy_FullMethodName, in, out, opts...) |
| 171 |
if err != nil { |
| 172 |
return nil, err |
| 173 |
} |
| 174 |
return out, nil |
| 175 |
} |
| 176 |
|
| 177 |
func (c *orgPolicyClient) UpdatePolicy(ctx context.Context, in *UpdatePolicyRequest, opts ...grpc.CallOption) (*Policy, error) { |
| 178 |
out := new(Policy) |
| 179 |
err := c.cc.Invoke(ctx, OrgPolicy_UpdatePolicy_FullMethodName, in, out, opts...) |
| 180 |
if err != nil { |
| 181 |
return nil, err |
| 182 |
} |
| 183 |
return out, nil |
| 184 |
} |
| 185 |
|
| 186 |
func (c *orgPolicyClient) DeletePolicy(ctx context.Context, in *DeletePolicyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { |
| 187 |
out := new(emptypb.Empty) |
| 188 |
err := c.cc.Invoke(ctx, OrgPolicy_DeletePolicy_FullMethodName, in, out, opts...) |
| 189 |
if err != nil { |
| 190 |
return nil, err |
| 191 |
} |
| 192 |
return out, nil |
| 193 |
} |
| 194 |
|
| 195 |
func (c *orgPolicyClient) CreateCustomConstraint(ctx context.Context, in *CreateCustomConstraintRequest, opts ...grpc.CallOption) (*CustomConstraint, error) { |
| 196 |
out := new(CustomConstraint) |
| 197 |
err := c.cc.Invoke(ctx, OrgPolicy_CreateCustomConstraint_FullMethodName, in, out, opts...) |
| 198 |
if err != nil { |
| 199 |
return nil, err |
| 200 |
} |
| 201 |
return out, nil |
| 202 |
} |
| 203 |
|
| 204 |
func (c *orgPolicyClient) UpdateCustomConstraint(ctx context.Context, in *UpdateCustomConstraintRequest, opts ...grpc.CallOption) (*CustomConstraint, error) { |
| 205 |
out := new(CustomConstraint) |
| 206 |
err := c.cc.Invoke(ctx, OrgPolicy_UpdateCustomConstraint_FullMethodName, in, out, opts...) |
| 207 |
if err != nil { |
| 208 |
return nil, err |
| 209 |
} |
| 210 |
return out, nil |
| 211 |
} |
| 212 |
|
| 213 |
func (c *orgPolicyClient) GetCustomConstraint(ctx context.Context, in *GetCustomConstraintRequest, opts ...grpc.CallOption) (*CustomConstraint, error) { |
| 214 |
out := new(CustomConstraint) |
| 215 |
err := c.cc.Invoke(ctx, OrgPolicy_GetCustomConstraint_FullMethodName, in, out, opts...) |
| 216 |
if err != nil { |
| 217 |
return nil, err |
| 218 |
} |
| 219 |
return out, nil |
| 220 |
} |
| 221 |
|
| 222 |
func (c *orgPolicyClient) ListCustomConstraints(ctx context.Context, in *ListCustomConstraintsRequest, opts ...grpc.CallOption) (*ListCustomConstraintsResponse, error) { |
| 223 |
out := new(ListCustomConstraintsResponse) |
| 224 |
err := c.cc.Invoke(ctx, OrgPolicy_ListCustomConstraints_FullMethodName, in, out, opts...) |
| 225 |
if err != nil { |
| 226 |
return nil, err |
| 227 |
} |
| 228 |
return out, nil |
| 229 |
} |
| 230 |
|
| 231 |
func (c *orgPolicyClient) DeleteCustomConstraint(ctx context.Context, in *DeleteCustomConstraintRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { |
| 232 |
out := new(emptypb.Empty) |
| 233 |
err := c.cc.Invoke(ctx, OrgPolicy_DeleteCustomConstraint_FullMethodName, in, out, opts...) |
| 234 |
if err != nil { |
| 235 |
return nil, err |
| 236 |
} |
| 237 |
return out, nil |
| 238 |
} |
| 239 |
|
| 240 |
// OrgPolicyServer is the server API for OrgPolicy service. |
| 241 |
// All implementations should embed UnimplementedOrgPolicyServer |
| 242 |
// for forward compatibility |
| 243 |
type OrgPolicyServer interface { |
| 244 |
// Lists constraints that could be applied on the specified resource. |
| 245 |
ListConstraints(context.Context, *ListConstraintsRequest) (*ListConstraintsResponse, error) |
| 246 |
// Retrieves all of the policies that exist on a particular resource. |
| 247 |
ListPolicies(context.Context, *ListPoliciesRequest) (*ListPoliciesResponse, error) |
| 248 |
// Gets a policy on a resource. |
| 249 |
// |
| 250 |
// If no policy is set on the resource, `NOT_FOUND` is returned. The |
| 251 |
// `etag` value can be used with `UpdatePolicy()` to update a |
| 252 |
// policy during read-modify-write. |
| 253 |
GetPolicy(context.Context, *GetPolicyRequest) (*Policy, error) |
| 254 |
// Gets the effective policy on a resource. This is the result of merging |
| 255 |
// policies in the resource hierarchy and evaluating conditions. The |
| 256 |
// returned policy will not have an `etag` or `condition` set because it is |
| 257 |
// an evaluated policy across multiple resources. |
| 258 |
// Subtrees of Resource Manager resource hierarchy with 'under:' prefix will |
| 259 |
// not be expanded. |
| 260 |
GetEffectivePolicy(context.Context, *GetEffectivePolicyRequest) (*Policy, error) |
| 261 |
// Creates a policy. |
| 262 |
// |
| 263 |
// Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the |
| 264 |
// constraint does not exist. |
| 265 |
// Returns a `google.rpc.Status` with `google.rpc.Code.ALREADY_EXISTS` if the |
| 266 |
// policy already exists on the given Google Cloud resource. |
| 267 |
CreatePolicy(context.Context, *CreatePolicyRequest) (*Policy, error) |
| 268 |
// Updates a policy. |
| 269 |
// |
| 270 |
// Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the |
| 271 |
// constraint or the policy do not exist. |
| 272 |
// Returns a `google.rpc.Status` with `google.rpc.Code.ABORTED` if the etag |
| 273 |
// supplied in the request does not match the persisted etag of the policy |
| 274 |
// |
| 275 |
// Note: the supplied policy will perform a full overwrite of all |
| 276 |
// fields. |
| 277 |
UpdatePolicy(context.Context, *UpdatePolicyRequest) (*Policy, error) |
| 278 |
// Deletes a policy. |
| 279 |
// |
| 280 |
// Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the |
| 281 |
// constraint or organization policy does not exist. |
| 282 |
DeletePolicy(context.Context, *DeletePolicyRequest) (*emptypb.Empty, error) |
| 283 |
// Creates a custom constraint. |
| 284 |
// |
| 285 |
// Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the |
| 286 |
// organization does not exist. |
| 287 |
// Returns a `google.rpc.Status` with `google.rpc.Code.ALREADY_EXISTS` if the |
| 288 |
// constraint already exists on the given organization. |
| 289 |
CreateCustomConstraint(context.Context, *CreateCustomConstraintRequest) (*CustomConstraint, error) |
| 290 |
// Updates a custom constraint. |
| 291 |
// |
| 292 |
// Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the |
| 293 |
// constraint does not exist. |
| 294 |
// |
| 295 |
// Note: the supplied policy will perform a full overwrite of all |
| 296 |
// fields. |
| 297 |
UpdateCustomConstraint(context.Context, *UpdateCustomConstraintRequest) (*CustomConstraint, error) |
| 298 |
// Gets a custom or managed constraint. |
| 299 |
// |
| 300 |
// Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the |
| 301 |
// custom or managed constraint does not exist. |
| 302 |
GetCustomConstraint(context.Context, *GetCustomConstraintRequest) (*CustomConstraint, error) |
| 303 |
// Retrieves all of the custom constraints that exist on a particular |
| 304 |
// organization resource. |
| 305 |
ListCustomConstraints(context.Context, *ListCustomConstraintsRequest) (*ListCustomConstraintsResponse, error) |
| 306 |
// Deletes a custom constraint. |
| 307 |
// |
| 308 |
// Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the |
| 309 |
// constraint does not exist. |
| 310 |
DeleteCustomConstraint(context.Context, *DeleteCustomConstraintRequest) (*emptypb.Empty, error) |
| 311 |
} |
| 312 |
|
| 313 |
// UnimplementedOrgPolicyServer should be embedded to have forward compatible implementations. |
| 314 |
type UnimplementedOrgPolicyServer struct { |
| 315 |
} |
| 316 |
|
| 317 |
func (UnimplementedOrgPolicyServer) ListConstraints(context.Context, *ListConstraintsRequest) (*ListConstraintsResponse, error) { |
| 318 |
return nil, status.Errorf(codes.Unimplemented, "method ListConstraints not implemented") |
| 319 |
} |
| 320 |
func (UnimplementedOrgPolicyServer) ListPolicies(context.Context, *ListPoliciesRequest) (*ListPoliciesResponse, error) { |
| 321 |
return nil, status.Errorf(codes.Unimplemented, "method ListPolicies not implemented") |
| 322 |
} |
| 323 |
func (UnimplementedOrgPolicyServer) GetPolicy(context.Context, *GetPolicyRequest) (*Policy, error) { |
| 324 |
return nil, status.Errorf(codes.Unimplemented, "method GetPolicy not implemented") |
| 325 |
} |
| 326 |
func (UnimplementedOrgPolicyServer) GetEffectivePolicy(context.Context, *GetEffectivePolicyRequest) (*Policy, error) { |
| 327 |
return nil, status.Errorf(codes.Unimplemented, "method GetEffectivePolicy not implemented") |
| 328 |
} |
| 329 |
func (UnimplementedOrgPolicyServer) CreatePolicy(context.Context, *CreatePolicyRequest) (*Policy, error) { |
| 330 |
return nil, status.Errorf(codes.Unimplemented, "method CreatePolicy not implemented") |
| 331 |
} |
| 332 |
func (UnimplementedOrgPolicyServer) UpdatePolicy(context.Context, *UpdatePolicyRequest) (*Policy, error) { |
| 333 |
return nil, status.Errorf(codes.Unimplemented, "method UpdatePolicy not implemented") |
| 334 |
} |
| 335 |
func (UnimplementedOrgPolicyServer) DeletePolicy(context.Context, *DeletePolicyRequest) (*emptypb.Empty, error) { |
| 336 |
return nil, status.Errorf(codes.Unimplemented, "method DeletePolicy not implemented") |
| 337 |
} |
| 338 |
func (UnimplementedOrgPolicyServer) CreateCustomConstraint(context.Context, *CreateCustomConstraintRequest) (*CustomConstraint, error) { |
| 339 |
return nil, status.Errorf(codes.Unimplemented, "method CreateCustomConstraint not implemented") |
| 340 |
} |
| 341 |
func (UnimplementedOrgPolicyServer) UpdateCustomConstraint(context.Context, *UpdateCustomConstraintRequest) (*CustomConstraint, error) { |
| 342 |
return nil, status.Errorf(codes.Unimplemented, "method UpdateCustomConstraint not implemented") |
| 343 |
} |
| 344 |
func (UnimplementedOrgPolicyServer) GetCustomConstraint(context.Context, *GetCustomConstraintRequest) (*CustomConstraint, error) { |
| 345 |
return nil, status.Errorf(codes.Unimplemented, "method GetCustomConstraint not implemented") |
| 346 |
} |
| 347 |
func (UnimplementedOrgPolicyServer) ListCustomConstraints(context.Context, *ListCustomConstraintsRequest) (*ListCustomConstraintsResponse, error) { |
| 348 |
return nil, status.Errorf(codes.Unimplemented, "method ListCustomConstraints not implemented") |
| 349 |
} |
| 350 |
func (UnimplementedOrgPolicyServer) DeleteCustomConstraint(context.Context, *DeleteCustomConstraintRequest) (*emptypb.Empty, error) { |
| 351 |
return nil, status.Errorf(codes.Unimplemented, "method DeleteCustomConstraint not implemented") |
| 352 |
} |
| 353 |
|
| 354 |
// UnsafeOrgPolicyServer may be embedded to opt out of forward compatibility for this service. |
| 355 |
// Use of this interface is not recommended, as added methods to OrgPolicyServer will |
| 356 |
// result in compilation errors. |
| 357 |
type UnsafeOrgPolicyServer interface { |
| 358 |
mustEmbedUnimplementedOrgPolicyServer() |
| 359 |
} |
| 360 |
|
| 361 |
func RegisterOrgPolicyServer(s grpc.ServiceRegistrar, srv OrgPolicyServer) { |
| 362 |
s.RegisterService(&OrgPolicy_ServiceDesc, srv) |
| 363 |
} |
| 364 |
|
| 365 |
func _OrgPolicy_ListConstraints_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 366 |
in := new(ListConstraintsRequest) |
| 367 |
if err := dec(in); err != nil { |
| 368 |
return nil, err |
| 369 |
} |
| 370 |
if interceptor == nil { |
| 371 |
return srv.(OrgPolicyServer).ListConstraints(ctx, in) |
| 372 |
} |
| 373 |
info := &grpc.UnaryServerInfo{ |
| 374 |
Server: srv, |
| 375 |
FullMethod: OrgPolicy_ListConstraints_FullMethodName, |
| 376 |
} |
| 377 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 378 |
return srv.(OrgPolicyServer).ListConstraints(ctx, req.(*ListConstraintsRequest)) |
| 379 |
} |
| 380 |
return interceptor(ctx, in, info, handler) |
| 381 |
} |
| 382 |
|
| 383 |
func _OrgPolicy_ListPolicies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 384 |
in := new(ListPoliciesRequest) |
| 385 |
if err := dec(in); err != nil { |
| 386 |
return nil, err |
| 387 |
} |
| 388 |
if interceptor == nil { |
| 389 |
return srv.(OrgPolicyServer).ListPolicies(ctx, in) |
| 390 |
} |
| 391 |
info := &grpc.UnaryServerInfo{ |
| 392 |
Server: srv, |
| 393 |
FullMethod: OrgPolicy_ListPolicies_FullMethodName, |
| 394 |
} |
| 395 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 396 |
return srv.(OrgPolicyServer).ListPolicies(ctx, req.(*ListPoliciesRequest)) |
| 397 |
} |
| 398 |
return interceptor(ctx, in, info, handler) |
| 399 |
} |
| 400 |
|
| 401 |
func _OrgPolicy_GetPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 402 |
in := new(GetPolicyRequest) |
| 403 |
if err := dec(in); err != nil { |
| 404 |
return nil, err |
| 405 |
} |
| 406 |
if interceptor == nil { |
| 407 |
return srv.(OrgPolicyServer).GetPolicy(ctx, in) |
| 408 |
} |
| 409 |
info := &grpc.UnaryServerInfo{ |
| 410 |
Server: srv, |
| 411 |
FullMethod: OrgPolicy_GetPolicy_FullMethodName, |
| 412 |
} |
| 413 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 414 |
return srv.(OrgPolicyServer).GetPolicy(ctx, req.(*GetPolicyRequest)) |
| 415 |
} |
| 416 |
return interceptor(ctx, in, info, handler) |
| 417 |
} |
| 418 |
|
| 419 |
func _OrgPolicy_GetEffectivePolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 420 |
in := new(GetEffectivePolicyRequest) |
| 421 |
if err := dec(in); err != nil { |
| 422 |
return nil, err |
| 423 |
} |
| 424 |
if interceptor == nil { |
| 425 |
return srv.(OrgPolicyServer).GetEffectivePolicy(ctx, in) |
| 426 |
} |
| 427 |
info := &grpc.UnaryServerInfo{ |
| 428 |
Server: srv, |
| 429 |
FullMethod: OrgPolicy_GetEffectivePolicy_FullMethodName, |
| 430 |
} |
| 431 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 432 |
return srv.(OrgPolicyServer).GetEffectivePolicy(ctx, req.(*GetEffectivePolicyRequest)) |
| 433 |
} |
| 434 |
return interceptor(ctx, in, info, handler) |
| 435 |
} |
| 436 |
|
| 437 |
func _OrgPolicy_CreatePolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 438 |
in := new(CreatePolicyRequest) |
| 439 |
if err := dec(in); err != nil { |
| 440 |
return nil, err |
| 441 |
} |
| 442 |
if interceptor == nil { |
| 443 |
return srv.(OrgPolicyServer).CreatePolicy(ctx, in) |
| 444 |
} |
| 445 |
info := &grpc.UnaryServerInfo{ |
| 446 |
Server: srv, |
| 447 |
FullMethod: OrgPolicy_CreatePolicy_FullMethodName, |
| 448 |
} |
| 449 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 450 |
return srv.(OrgPolicyServer).CreatePolicy(ctx, req.(*CreatePolicyRequest)) |
| 451 |
} |
| 452 |
return interceptor(ctx, in, info, handler) |
| 453 |
} |
| 454 |
|
| 455 |
func _OrgPolicy_UpdatePolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 456 |
in := new(UpdatePolicyRequest) |
| 457 |
if err := dec(in); err != nil { |
| 458 |
return nil, err |
| 459 |
} |
| 460 |
if interceptor == nil { |
| 461 |
return srv.(OrgPolicyServer).UpdatePolicy(ctx, in) |
| 462 |
} |
| 463 |
info := &grpc.UnaryServerInfo{ |
| 464 |
Server: srv, |
| 465 |
FullMethod: OrgPolicy_UpdatePolicy_FullMethodName, |
| 466 |
} |
| 467 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 468 |
return srv.(OrgPolicyServer).UpdatePolicy(ctx, req.(*UpdatePolicyRequest)) |
| 469 |
} |
| 470 |
return interceptor(ctx, in, info, handler) |
| 471 |
} |
| 472 |
|
| 473 |
func _OrgPolicy_DeletePolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 474 |
in := new(DeletePolicyRequest) |
| 475 |
if err := dec(in); err != nil { |
| 476 |
return nil, err |
| 477 |
} |
| 478 |
if interceptor == nil { |
| 479 |
return srv.(OrgPolicyServer).DeletePolicy(ctx, in) |
| 480 |
} |
| 481 |
info := &grpc.UnaryServerInfo{ |
| 482 |
Server: srv, |
| 483 |
FullMethod: OrgPolicy_DeletePolicy_FullMethodName, |
| 484 |
} |
| 485 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 486 |
return srv.(OrgPolicyServer).DeletePolicy(ctx, req.(*DeletePolicyRequest)) |
| 487 |
} |
| 488 |
return interceptor(ctx, in, info, handler) |
| 489 |
} |
| 490 |
|
| 491 |
func _OrgPolicy_CreateCustomConstraint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 492 |
in := new(CreateCustomConstraintRequest) |
| 493 |
if err := dec(in); err != nil { |
| 494 |
return nil, err |
| 495 |
} |
| 496 |
if interceptor == nil { |
| 497 |
return srv.(OrgPolicyServer).CreateCustomConstraint(ctx, in) |
| 498 |
} |
| 499 |
info := &grpc.UnaryServerInfo{ |
| 500 |
Server: srv, |
| 501 |
FullMethod: OrgPolicy_CreateCustomConstraint_FullMethodName, |
| 502 |
} |
| 503 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 504 |
return srv.(OrgPolicyServer).CreateCustomConstraint(ctx, req.(*CreateCustomConstraintRequest)) |
| 505 |
} |
| 506 |
return interceptor(ctx, in, info, handler) |
| 507 |
} |
| 508 |
|
| 509 |
func _OrgPolicy_UpdateCustomConstraint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 510 |
in := new(UpdateCustomConstraintRequest) |
| 511 |
if err := dec(in); err != nil { |
| 512 |
return nil, err |
| 513 |
} |
| 514 |
if interceptor == nil { |
| 515 |
return srv.(OrgPolicyServer).UpdateCustomConstraint(ctx, in) |
| 516 |
} |
| 517 |
info := &grpc.UnaryServerInfo{ |
| 518 |
Server: srv, |
| 519 |
FullMethod: OrgPolicy_UpdateCustomConstraint_FullMethodName, |
| 520 |
} |
| 521 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 522 |
return srv.(OrgPolicyServer).UpdateCustomConstraint(ctx, req.(*UpdateCustomConstraintRequest)) |
| 523 |
} |
| 524 |
return interceptor(ctx, in, info, handler) |
| 525 |
} |
| 526 |
|
| 527 |
func _OrgPolicy_GetCustomConstraint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 528 |
in := new(GetCustomConstraintRequest) |
| 529 |
if err := dec(in); err != nil { |
| 530 |
return nil, err |
| 531 |
} |
| 532 |
if interceptor == nil { |
| 533 |
return srv.(OrgPolicyServer).GetCustomConstraint(ctx, in) |
| 534 |
} |
| 535 |
info := &grpc.UnaryServerInfo{ |
| 536 |
Server: srv, |
| 537 |
FullMethod: OrgPolicy_GetCustomConstraint_FullMethodName, |
| 538 |
} |
| 539 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 540 |
return srv.(OrgPolicyServer).GetCustomConstraint(ctx, req.(*GetCustomConstraintRequest)) |
| 541 |
} |
| 542 |
return interceptor(ctx, in, info, handler) |
| 543 |
} |
| 544 |
|
| 545 |
func _OrgPolicy_ListCustomConstraints_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 546 |
in := new(ListCustomConstraintsRequest) |
| 547 |
if err := dec(in); err != nil { |
| 548 |
return nil, err |
| 549 |
} |
| 550 |
if interceptor == nil { |
| 551 |
return srv.(OrgPolicyServer).ListCustomConstraints(ctx, in) |
| 552 |
} |
| 553 |
info := &grpc.UnaryServerInfo{ |
| 554 |
Server: srv, |
| 555 |
FullMethod: OrgPolicy_ListCustomConstraints_FullMethodName, |
| 556 |
} |
| 557 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 558 |
return srv.(OrgPolicyServer).ListCustomConstraints(ctx, req.(*ListCustomConstraintsRequest)) |
| 559 |
} |
| 560 |
return interceptor(ctx, in, info, handler) |
| 561 |
} |
| 562 |
|
| 563 |
func _OrgPolicy_DeleteCustomConstraint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 564 |
in := new(DeleteCustomConstraintRequest) |
| 565 |
if err := dec(in); err != nil { |
| 566 |
return nil, err |
| 567 |
} |
| 568 |
if interceptor == nil { |
| 569 |
return srv.(OrgPolicyServer).DeleteCustomConstraint(ctx, in) |
| 570 |
} |
| 571 |
info := &grpc.UnaryServerInfo{ |
| 572 |
Server: srv, |
| 573 |
FullMethod: OrgPolicy_DeleteCustomConstraint_FullMethodName, |
| 574 |
} |
| 575 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 576 |
return srv.(OrgPolicyServer).DeleteCustomConstraint(ctx, req.(*DeleteCustomConstraintRequest)) |
| 577 |
} |
| 578 |
return interceptor(ctx, in, info, handler) |
| 579 |
} |
| 580 |
|
| 581 |
// OrgPolicy_ServiceDesc is the grpc.ServiceDesc for OrgPolicy service. |
| 582 |
// It's only intended for direct use with grpc.RegisterService, |
| 583 |
// and not to be introspected or modified (even as a copy) |
| 584 |
var OrgPolicy_ServiceDesc = grpc.ServiceDesc{ |
| 585 |
ServiceName: "google.cloud.orgpolicy.v2.OrgPolicy", |
| 586 |
HandlerType: (*OrgPolicyServer)(nil), |
| 587 |
Methods: []grpc.MethodDesc{ |
| 588 |
{ |
| 589 |
MethodName: "ListConstraints", |
| 590 |
Handler: _OrgPolicy_ListConstraints_Handler, |
| 591 |
}, |
| 592 |
{ |
| 593 |
MethodName: "ListPolicies", |
| 594 |
Handler: _OrgPolicy_ListPolicies_Handler, |
| 595 |
}, |
| 596 |
{ |
| 597 |
MethodName: "GetPolicy", |
| 598 |
Handler: _OrgPolicy_GetPolicy_Handler, |
| 599 |
}, |
| 600 |
{ |
| 601 |
MethodName: "GetEffectivePolicy", |
| 602 |
Handler: _OrgPolicy_GetEffectivePolicy_Handler, |
| 603 |
}, |
| 604 |
{ |
| 605 |
MethodName: "CreatePolicy", |
| 606 |
Handler: _OrgPolicy_CreatePolicy_Handler, |
| 607 |
}, |
| 608 |
{ |
| 609 |
MethodName: "UpdatePolicy", |
| 610 |
Handler: _OrgPolicy_UpdatePolicy_Handler, |
| 611 |
}, |
| 612 |
{ |
| 613 |
MethodName: "DeletePolicy", |
| 614 |
Handler: _OrgPolicy_DeletePolicy_Handler, |
| 615 |
}, |
| 616 |
{ |
| 617 |
MethodName: "CreateCustomConstraint", |
| 618 |
Handler: _OrgPolicy_CreateCustomConstraint_Handler, |
| 619 |
}, |
| 620 |
{ |
| 621 |
MethodName: "UpdateCustomConstraint", |
| 622 |
Handler: _OrgPolicy_UpdateCustomConstraint_Handler, |
| 623 |
}, |
| 624 |
{ |
| 625 |
MethodName: "GetCustomConstraint", |
| 626 |
Handler: _OrgPolicy_GetCustomConstraint_Handler, |
| 627 |
}, |
| 628 |
{ |
| 629 |
MethodName: "ListCustomConstraints", |
| 630 |
Handler: _OrgPolicy_ListCustomConstraints_Handler, |
| 631 |
}, |
| 632 |
{ |
| 633 |
MethodName: "DeleteCustomConstraint", |
| 634 |
Handler: _OrgPolicy_DeleteCustomConstraint_Handler, |
| 635 |
}, |
| 636 |
}, |
| 637 |
Streams: []grpc.StreamDesc{}, |
| 638 |
Metadata: "google/cloud/orgpolicy/v2/orgpolicy.proto", |
| 639 |
} |