/// <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( gax::IResourceName resource, iam::Policy policy, st::CancellationToken cancellationToken) => SetIamPolicyAsync( resource, policy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Returns permissions that a caller has on the specified resource. If the /// resource does not exist, this will return an empty set of /// permissions, not a NOT_FOUND error. /// /// Note: This operation is designed to be used for building /// permission-aware UIs and command-line tools, not for authorization /// checking. This operation may "fail open" without warning. /// </summary> /// <param name="resource"> /// REQUIRED: The resource for which the policy detail is being requested. /// See the operation documentation for the appropriate value for this field. /// </param> /// <param name="permissions"> /// The set of permissions to check for the `resource`. Permissions with /// wildcards (such as '*' or 'storage.*') are not allowed. For more /// information see /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). /// </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::TestIamPermissionsResponse> TestIamPermissionsAsync( gax::IResourceName resource, scg::IEnumerable <string> permissions, st::CancellationToken cancellationToken) => TestIamPermissionsAsync( resource, permissions, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Gets the access control policy for a resource. Returns an empty policy /// if the resource exists and does not have a policy set. /// </summary> /// <param name="resource"> /// REQUIRED: The resource for which the policy is being requested. /// See the operation documentation for the appropriate value for this field. /// </param> /// <param name="callSettings"> /// If not null, applies overrides to this RPC call. /// </param> /// <returns> /// The RPC response. /// </returns> public virtual iam::Policy GetIamPolicy( gax::IResourceName resource, gaxgrpc::CallSettings callSettings = null) => GetIamPolicy( new iam::GetIamPolicyRequest { ResourceAsResourceName = gax::GaxPreconditions.CheckNotNull(resource, nameof(resource)), }, callSettings);
/// <summary> /// Constructs a new instance of the <see cref="KeyNameOneof"/> resource name class /// from a suitable <see cref="gax::IResourceName"/> instance. /// </summary> public KeyNameOneof(OneofType type, gax::IResourceName name) { Type = gax::GaxPreconditions.CheckEnumValue <OneofType>(type, nameof(type)); Name = gax::GaxPreconditions.CheckNotNull(name, nameof(name)); if (!IsValid(type, name)) { throw new sys::ArgumentException($"Mismatched OneofType '{type}' and resource name '{name}'"); } }
/// <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> /// Returns permissions that a caller has on the specified resource. If the /// resource does not exist, this will return an empty set of /// permissions, not a NOT_FOUND error. /// /// Note: This operation is designed to be used for building /// permission-aware UIs and command-line tools, not for authorization /// checking. This operation may "fail open" without warning. /// </summary> /// <param name="resource"> /// REQUIRED: The resource for which the policy detail is being requested. /// See the operation documentation for the appropriate value for this field. /// </param> /// <param name="permissions"> /// The set of permissions to check for the `resource`. Permissions with /// wildcards (such as '*' or 'storage.*') are not allowed. For more /// information see /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). /// </param> /// <param name="callSettings"> /// If not null, applies overrides to this RPC call. /// </param> /// <returns> /// The RPC response. /// </returns> public virtual iam::TestIamPermissionsResponse TestIamPermissions( gax::IResourceName resource, scg::IEnumerable <string> permissions, gaxgrpc::CallSettings callSettings = null) => TestIamPermissions( new iam::TestIamPermissionsRequest { ResourceAsResourceName = gax::GaxPreconditions.CheckNotNull(resource, nameof(resource)), Permissions = { gax::GaxPreconditions.CheckNotNull(permissions, nameof(permissions)) }, }, callSettings);
private static bool IsValid(OneofType type, gax::IResourceName name) { switch (type) { case OneofType.Unknown: return(true); case OneofType.OrganizationAssetName: return(name is OrganizationAssetName); case OneofType.OrganizationSourceFindingName: return(name is OrganizationSourceFindingName); default: return(false); } }
private static bool IsValid(OneofType type, gax::IResourceName name) { switch (type) { case OneofType.Unknown: return(true); // Anything goes with Unknown. case OneofType.KeyRingName: return(name is KeyRingName); case OneofType.CryptoKeyName: return(name is CryptoKeyName); default: return(false); } }
private static bool IsValid(OneofType type, gax::IResourceName name) { switch (type) { case OneofType.Unknown: return(true); // Anything goes with Unknown. case OneofType.AssetSecurityMarksName: return(name is AssetSecurityMarksName); case OneofType.FindingSecurityMarksName: return(name is FindingSecurityMarksName); default: return(false); } }
private static bool IsValid(OneofType type, gax::IResourceName name) { switch (type) { case OneofType.Unknown: return(true); // Anything goes with Unknown. case OneofType.TopicName: return(name is TopicName); case OneofType.DeletedTopicNameFixed: return(name is DeletedTopicNameFixed); default: return(false); } }
private static bool IsValid(OneofType type, gax::IResourceName name) { switch (type) { case OneofType.Unknown: return(true); // Anything goes with Unknown. case OneofType.NoteName: return(name is Grafeas.V1.NoteName); case OneofType.OccurrenceName: return(name is Grafeas.V1.OccurrenceName); default: return(false); } }
/// <summary> /// Lists the TagBindings for the given cloud resource, as specified with /// `parent`. /// /// NOTE: The `parent` field is expected to be a full resource name: /// https://cloud.google.com/apis/design/resource_names#full_resource_name /// </summary> /// <param name="parent"> /// Required. The full resource name of a resource for which you want to list existing /// TagBindings. /// E.g. "//cloudresourcemanager.googleapis.com/projects/123" /// </param> /// <param name="pageToken"> /// The token returned from the previous request. A value of <c>null</c> or an empty string retrieves the first /// page. /// </param> /// <param name="pageSize"> /// The size of page to request. The response will not be larger than this, but may be smaller. A value of /// <c>null</c> or <c>0</c> uses a server-defined page size. /// </param> /// <param name="callSettings">If not null, applies overrides to this RPC call.</param> /// <returns>A pageable asynchronous sequence of <see cref="TagBinding"/> resources.</returns> public virtual gax::PagedAsyncEnumerable <ListTagBindingsResponse, TagBinding> ListTagBindingsAsync(gax::IResourceName parent, string pageToken = null, int?pageSize = null, gaxgrpc::CallSettings callSettings = null) => ListTagBindingsAsync(new ListTagBindingsRequest { ParentAsResourceName = gax::GaxPreconditions.CheckNotNull(parent, nameof(parent)), PageToken = pageToken ?? "", PageSize = pageSize ?? 0, }, callSettings);
/// <summary> /// </summary> /// <param name="singleResourceName"> /// </param> /// <param name="repeatedResourceName"> /// </param> /// <param name="singleWildcardResource"> /// </param> /// <param name="repeatedWildcardResource"> /// </param> /// <param name="multiPatternResourceName"> /// </param> /// <param name="repeatedMultiPatternResourceName"> /// </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 <Response> MethodValuesAsync(AResourceName singleResourceName, scg::IEnumerable <AResourceName> repeatedResourceName, gax::IResourceName singleWildcardResource, scg::IEnumerable <gax::IResourceName> repeatedWildcardResource, MultiPatternResourceName multiPatternResourceName, scg::IEnumerable <MultiPatternResourceName> repeatedMultiPatternResourceName, st::CancellationToken cancellationToken) => MethodValuesAsync(singleResourceName, repeatedResourceName, singleWildcardResource, repeatedWildcardResource, multiPatternResourceName, repeatedMultiPatternResourceName, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// </summary> /// <param name="singleResourceName"> /// </param> /// <param name="repeatedResourceName"> /// </param> /// <param name="singleWildcardResource"> /// </param> /// <param name="repeatedWildcardResource"> /// </param> /// <param name="multiPatternResourceName"> /// </param> /// <param name="repeatedMultiPatternResourceName"> /// </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 <Response> MethodValuesAsync(AResourceName singleResourceName, scg::IEnumerable <AResourceName> repeatedResourceName, gax::IResourceName singleWildcardResource, scg::IEnumerable <gax::IResourceName> repeatedWildcardResource, MultiPatternResourceName multiPatternResourceName, scg::IEnumerable <MultiPatternResourceName> repeatedMultiPatternResourceName, gaxgrpc::CallSettings callSettings = null) => MethodValuesAsync(new ValuesRequest { SingleResourceNameAsAResourceName = singleResourceName, RepeatedResourceNameAsAResourceNames = { repeatedResourceName ?? linq::Enumerable.Empty <AResourceName>(), }, SingleWildcardResourceAsResourceName = singleWildcardResource, RepeatedWildcardResourceAsResourceNames = { repeatedWildcardResource ?? linq::Enumerable.Empty <gax::IResourceName>(), }, MultiPatternResourceNameAsMultiPatternResourceName = multiPatternResourceName, RepeatedMultiPatternResourceNameAsMultiPatternResourceNames = { repeatedMultiPatternResourceName ?? linq::Enumerable.Empty <MultiPatternResourceName>(), }, }, callSettings);
// TEST_START /// <summary> /// </summary> /// <param name="resource"> /// </param> /// <param name="callSettings">If not null, applies overrides to this RPC call.</param> /// <returns>The RPC response.</returns> public virtual Response AMethod(gax::IResourceName resource, gaxgrpc::CallSettings callSettings = null) => AMethod(new Request { ResourceAsResourceName = resource, }, callSettings);
/// <summary> /// </summary> /// <param name="resource"> /// </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 <Response> AMethodAsync(gax::IResourceName resource, gaxgrpc::CallSettings callSettings = null) => AMethodAsync(new Request { ResourceAsResourceName = resource, }, callSettings);
/// <summary> /// </summary> /// <param name="resource"> /// </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 <Response> AMethodAsync(gax::IResourceName resource, st::CancellationToken cancellationToken) => AMethodAsync(resource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));