/// <summary> /// Sets the access control policy on the specified resource. Replaces /// any existing policy. /// /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and /// PERMISSION_DENIED /// </summary> /// <param name="resource"> /// REQUIRED: The resource for which the policy is being specified. /// See the operation documentation for the appropriate value for this field. /// </param> /// <param name="policy"> /// REQUIRED: The complete policy to be applied to the `resource`. The size of /// the policy is limited to a few 10s of KB. An empty policy is a /// valid policy but certain Cloud Platform services (such as Projects) /// might reject them. /// </param> /// <param name="cancellationToken"> /// A <see cref="st::CancellationToken"/> to use for this RPC. /// </param> /// <returns> /// A Task containing the RPC response. /// </returns> public virtual stt::Task <iam::Policy> SetIamPolicyAsync( string resource, iam::Policy policy, st::CancellationToken cancellationToken) => SetIamPolicyAsync( resource, policy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Sets the access control policy on the specified resource. Replaces /// any existing policy. /// /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and /// PERMISSION_DENIED /// </summary> /// <param name="resource"> /// REQUIRED: The resource for which the policy is being specified. /// See the operation documentation for the appropriate value for this field. /// </param> /// <param name="policy"> /// REQUIRED: The complete policy to be applied to the `resource`. The size of /// the policy is limited to a few 10s of KB. An empty policy is a /// valid policy but certain Cloud Platform services (such as Projects) /// might reject them. /// </param> /// <param name="callSettings"> /// If not null, applies overrides to this RPC call. /// </param> /// <returns> /// A Task containing the RPC response. /// </returns> public virtual stt::Task <iam::Policy> SetIamPolicyAsync( gax::IResourceName resource, iam::Policy policy, gaxgrpc::CallSettings callSettings = null) => SetIamPolicyAsync( new iam::SetIamPolicyRequest { ResourceAsResourceName = gax::GaxPreconditions.CheckNotNull(resource, nameof(resource)), Policy = gax::GaxPreconditions.CheckNotNull(policy, nameof(policy)), }, callSettings);
/// <summary> /// Sets the access control policy on the specified resource. Replaces /// any existing policy. /// /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and /// PERMISSION_DENIED /// </summary> /// <param name="resource"> /// REQUIRED: The resource for which the policy is being specified. /// See the operation documentation for the appropriate value for this field. /// </param> /// <param name="policy"> /// REQUIRED: The complete policy to be applied to the `resource`. The size of /// the policy is limited to a few 10s of KB. An empty policy is a /// valid policy but certain Cloud Platform services (such as Projects) /// might reject them. /// </param> /// <param name="callSettings"> /// If not null, applies overrides to this RPC call. /// </param> /// <returns> /// The RPC response. /// </returns> public virtual iam::Policy SetIamPolicy( string resource, iam::Policy policy, gaxgrpc::CallSettings callSettings = null) => SetIamPolicy( new iam::SetIamPolicyRequest { Resource = gax::GaxPreconditions.CheckNotNullOrEmpty(resource, nameof(resource)), Policy = gax::GaxPreconditions.CheckNotNull(policy, nameof(policy)), }, callSettings);