public abstract class OrganizationsClient
Reference documentation and code samples for the Cloud Resource Manager v3 API class OrganizationsClient.
Organizations client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.ResourceManager.V3Assembly
Google.Cloud.ResourceManager.V3.dll
Remarks
Allows users to manage their organization resources.
Properties
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the Organizations service, which is a host of "cloudresourcemanager.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
String |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default Organizations scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyList<String> |
The default Organizations scopes are:
GrpcClient
public virtual Organizations.OrganizationsClient GrpcClient { get; }
The underlying gRPC Organizations client
Property Value | |
---|---|
Type | Description |
Organizations.OrganizationsClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
ServiceMetadata |
Methods
Create()
public static OrganizationsClient Create()
Synchronously creates a OrganizationsClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use OrganizationsClientBuilder.
Returns | |
---|---|
Type | Description |
OrganizationsClient | The created OrganizationsClient. |
CreateAsync(CancellationToken)
public static Task<OrganizationsClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))
Asynchronously creates a OrganizationsClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use OrganizationsClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
Task<OrganizationsClient> | The task representing the created OrganizationsClient. |
GetIamPolicy(IResourceName, CallSettings)
public virtual Policy GetIamPolicy(IResourceName resource, CallSettings callSettings = null)
Gets the access control policy for an organization resource. The policy may
be empty if no such policy or resource exists. The resource
field should
be the organization's resource name, for example: "organizations/123".
Authorization requires the IAM permission
resourcemanager.organizations.getIamPolicy
on the specified organization.
Parameters | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Policy | The RPC response. |
// Create client
OrganizationsClient organizationsClient = OrganizationsClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = organizationsClient.GetIamPolicy(resource);
GetIamPolicy(GetIamPolicyRequest, CallSettings)
public virtual Policy GetIamPolicy(GetIamPolicyRequest request, CallSettings callSettings = null)
Gets the access control policy for an organization resource. The policy may
be empty if no such policy or resource exists. The resource
field should
be the organization's resource name, for example: "organizations/123".
Authorization requires the IAM permission
resourcemanager.organizations.getIamPolicy
on the specified organization.
Parameters | |
---|---|
Name | Description |
request | GetIamPolicyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Policy | The RPC response. |
// Create client
OrganizationsClient organizationsClient = OrganizationsClient.Create();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Options = new GetPolicyOptions(),
};
// Make the request
Policy response = organizationsClient.GetIamPolicy(request);
GetIamPolicy(String, CallSettings)
public virtual Policy GetIamPolicy(string resource, CallSettings callSettings = null)
Gets the access control policy for an organization resource. The policy may
be empty if no such policy or resource exists. The resource
field should
be the organization's resource name, for example: "organizations/123".
Authorization requires the IAM permission
resourcemanager.organizations.getIamPolicy
on the specified organization.
Parameters | |
---|---|
Name | Description |
resource | String REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Policy | The RPC response. |
// Create client
OrganizationsClient organizationsClient = OrganizationsClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = organizationsClient.GetIamPolicy(resource);
GetIamPolicyAsync(IResourceName, CallSettings)
public virtual Task<Policy> GetIamPolicyAsync(IResourceName resource, CallSettings callSettings = null)
Gets the access control policy for an organization resource. The policy may
be empty if no such policy or resource exists. The resource
field should
be the organization's resource name, for example: "organizations/123".
Authorization requires the IAM permission
resourcemanager.organizations.getIamPolicy
on the specified organization.
Parameters | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await organizationsClient.GetIamPolicyAsync(resource);
GetIamPolicyAsync(IResourceName, CancellationToken)
public virtual Task<Policy> GetIamPolicyAsync(IResourceName resource, CancellationToken cancellationToken)
Gets the access control policy for an organization resource. The policy may
be empty if no such policy or resource exists. The resource
field should
be the organization's resource name, for example: "organizations/123".
Authorization requires the IAM permission
resourcemanager.organizations.getIamPolicy
on the specified organization.
Parameters | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await organizationsClient.GetIamPolicyAsync(resource);
GetIamPolicyAsync(GetIamPolicyRequest, CallSettings)
public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CallSettings callSettings = null)
Gets the access control policy for an organization resource. The policy may
be empty if no such policy or resource exists. The resource
field should
be the organization's resource name, for example: "organizations/123".
Authorization requires the IAM permission
resourcemanager.organizations.getIamPolicy
on the specified organization.
Parameters | |
---|---|
Name | Description |
request | GetIamPolicyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await organizationsClient.GetIamPolicyAsync(request);
GetIamPolicyAsync(GetIamPolicyRequest, CancellationToken)
public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CancellationToken cancellationToken)
Gets the access control policy for an organization resource. The policy may
be empty if no such policy or resource exists. The resource
field should
be the organization's resource name, for example: "organizations/123".
Authorization requires the IAM permission
resourcemanager.organizations.getIamPolicy
on the specified organization.
Parameters | |
---|---|
Name | Description |
request | GetIamPolicyRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await organizationsClient.GetIamPolicyAsync(request);
GetIamPolicyAsync(String, CallSettings)
public virtual Task<Policy> GetIamPolicyAsync(string resource, CallSettings callSettings = null)
Gets the access control policy for an organization resource. The policy may
be empty if no such policy or resource exists. The resource
field should
be the organization's resource name, for example: "organizations/123".
Authorization requires the IAM permission
resourcemanager.organizations.getIamPolicy
on the specified organization.
Parameters | |
---|---|
Name | Description |
resource | String REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await organizationsClient.GetIamPolicyAsync(resource);
GetIamPolicyAsync(String, CancellationToken)
public virtual Task<Policy> GetIamPolicyAsync(string resource, CancellationToken cancellationToken)
Gets the access control policy for an organization resource. The policy may
be empty if no such policy or resource exists. The resource
field should
be the organization's resource name, for example: "organizations/123".
Authorization requires the IAM permission
resourcemanager.organizations.getIamPolicy
on the specified organization.
Parameters | |
---|---|
Name | Description |
resource | String REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await organizationsClient.GetIamPolicyAsync(resource);
GetOrganization(OrganizationName, CallSettings)
public virtual Organization GetOrganization(OrganizationName name, CallSettings callSettings = null)
Fetches an organization resource identified by the specified resource name.
Parameters | |
---|---|
Name | Description |
name | OrganizationName Required. The resource name of the Organization to fetch. This is the organization's relative path in the API, formatted as "organizations/[organizationId]". For example, "organizations/1234". |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Organization | The RPC response. |
// Create client
OrganizationsClient organizationsClient = OrganizationsClient.Create();
// Initialize request argument(s)
OrganizationName name = OrganizationName.FromOrganization("[ORGANIZATION]");
// Make the request
Organization response = organizationsClient.GetOrganization(name);
GetOrganization(GetOrganizationRequest, CallSettings)
public virtual Organization GetOrganization(GetOrganizationRequest request, CallSettings callSettings = null)
Fetches an organization resource identified by the specified resource name.
Parameters | |
---|---|
Name | Description |
request | GetOrganizationRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Organization | The RPC response. |
// Create client
OrganizationsClient organizationsClient = OrganizationsClient.Create();
// Initialize request argument(s)
GetOrganizationRequest request = new GetOrganizationRequest
{
OrganizationName = OrganizationName.FromOrganization("[ORGANIZATION]"),
};
// Make the request
Organization response = organizationsClient.GetOrganization(request);
GetOrganization(String, CallSettings)
public virtual Organization GetOrganization(string name, CallSettings callSettings = null)
Fetches an organization resource identified by the specified resource name.
Parameters | |
---|---|
Name | Description |
name | String Required. The resource name of the Organization to fetch. This is the organization's relative path in the API, formatted as "organizations/[organizationId]". For example, "organizations/1234". |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Organization | The RPC response. |
// Create client
OrganizationsClient organizationsClient = OrganizationsClient.Create();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]";
// Make the request
Organization response = organizationsClient.GetOrganization(name);
GetOrganizationAsync(OrganizationName, CallSettings)
public virtual Task<Organization> GetOrganizationAsync(OrganizationName name, CallSettings callSettings = null)
Fetches an organization resource identified by the specified resource name.
Parameters | |
---|---|
Name | Description |
name | OrganizationName Required. The resource name of the Organization to fetch. This is the organization's relative path in the API, formatted as "organizations/[organizationId]". For example, "organizations/1234". |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Organization> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
OrganizationName name = OrganizationName.FromOrganization("[ORGANIZATION]");
// Make the request
Organization response = await organizationsClient.GetOrganizationAsync(name);
GetOrganizationAsync(OrganizationName, CancellationToken)
public virtual Task<Organization> GetOrganizationAsync(OrganizationName name, CancellationToken cancellationToken)
Fetches an organization resource identified by the specified resource name.
Parameters | |
---|---|
Name | Description |
name | OrganizationName Required. The resource name of the Organization to fetch. This is the organization's relative path in the API, formatted as "organizations/[organizationId]". For example, "organizations/1234". |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Organization> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
OrganizationName name = OrganizationName.FromOrganization("[ORGANIZATION]");
// Make the request
Organization response = await organizationsClient.GetOrganizationAsync(name);
GetOrganizationAsync(GetOrganizationRequest, CallSettings)
public virtual Task<Organization> GetOrganizationAsync(GetOrganizationRequest request, CallSettings callSettings = null)
Fetches an organization resource identified by the specified resource name.
Parameters | |
---|---|
Name | Description |
request | GetOrganizationRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Organization> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
GetOrganizationRequest request = new GetOrganizationRequest
{
OrganizationName = OrganizationName.FromOrganization("[ORGANIZATION]"),
};
// Make the request
Organization response = await organizationsClient.GetOrganizationAsync(request);
GetOrganizationAsync(GetOrganizationRequest, CancellationToken)
public virtual Task<Organization> GetOrganizationAsync(GetOrganizationRequest request, CancellationToken cancellationToken)
Fetches an organization resource identified by the specified resource name.
Parameters | |
---|---|
Name | Description |
request | GetOrganizationRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Organization> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
GetOrganizationRequest request = new GetOrganizationRequest
{
OrganizationName = OrganizationName.FromOrganization("[ORGANIZATION]"),
};
// Make the request
Organization response = await organizationsClient.GetOrganizationAsync(request);
GetOrganizationAsync(String, CallSettings)
public virtual Task<Organization> GetOrganizationAsync(string name, CallSettings callSettings = null)
Fetches an organization resource identified by the specified resource name.
Parameters | |
---|---|
Name | Description |
name | String Required. The resource name of the Organization to fetch. This is the organization's relative path in the API, formatted as "organizations/[organizationId]". For example, "organizations/1234". |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Organization> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]";
// Make the request
Organization response = await organizationsClient.GetOrganizationAsync(name);
GetOrganizationAsync(String, CancellationToken)
public virtual Task<Organization> GetOrganizationAsync(string name, CancellationToken cancellationToken)
Fetches an organization resource identified by the specified resource name.
Parameters | |
---|---|
Name | Description |
name | String Required. The resource name of the Organization to fetch. This is the organization's relative path in the API, formatted as "organizations/[organizationId]". For example, "organizations/1234". |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Organization> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]";
// Make the request
Organization response = await organizationsClient.GetOrganizationAsync(name);
SearchOrganizations(SearchOrganizationsRequest, CallSettings)
public virtual PagedEnumerable<SearchOrganizationsResponse, Organization> SearchOrganizations(SearchOrganizationsRequest request, CallSettings callSettings = null)
Searches organization resources that are visible to the user and satisfy the specified filter. This method returns organizations in an unspecified order. New organizations do not necessarily appear at the end of the results, and may take a small amount of time to appear.
Search will only return organizations on which the user has the permission
resourcemanager.organizations.get
Parameters | |
---|---|
Name | Description |
request | SearchOrganizationsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<SearchOrganizationsResponse, Organization> | A pageable sequence of Organization resources. |
// Create client
OrganizationsClient organizationsClient = OrganizationsClient.Create();
// Initialize request argument(s)
SearchOrganizationsRequest request = new SearchOrganizationsRequest { Query = "", };
// Make the request
PagedEnumerable<SearchOrganizationsResponse, Organization> response = organizationsClient.SearchOrganizations(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Organization item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (SearchOrganizationsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Organization item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Organization> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Organization item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
SearchOrganizations(String, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<SearchOrganizationsResponse, Organization> SearchOrganizations(string query, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Searches organization resources that are visible to the user and satisfy the specified filter. This method returns organizations in an unspecified order. New organizations do not necessarily appear at the end of the results, and may take a small amount of time to appear.
Search will only return organizations on which the user has the permission
resourcemanager.organizations.get
Parameters | |
---|---|
Name | Description |
query | String Optional. An optional query string used to filter the Organizations to return in the response. Query rules are case-insensitive.
Organizations may be queried by
|
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<SearchOrganizationsResponse, Organization> | A pageable sequence of Organization resources. |
// Create client
OrganizationsClient organizationsClient = OrganizationsClient.Create();
// Initialize request argument(s)
string query = "";
// Make the request
PagedEnumerable<SearchOrganizationsResponse, Organization> response = organizationsClient.SearchOrganizations(query);
// Iterate over all response items, lazily performing RPCs as required
foreach (Organization item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (SearchOrganizationsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Organization item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Organization> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Organization item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
SearchOrganizationsAsync(SearchOrganizationsRequest, CallSettings)
public virtual PagedAsyncEnumerable<SearchOrganizationsResponse, Organization> SearchOrganizationsAsync(SearchOrganizationsRequest request, CallSettings callSettings = null)
Searches organization resources that are visible to the user and satisfy the specified filter. This method returns organizations in an unspecified order. New organizations do not necessarily appear at the end of the results, and may take a small amount of time to appear.
Search will only return organizations on which the user has the permission
resourcemanager.organizations.get
Parameters | |
---|---|
Name | Description |
request | SearchOrganizationsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<SearchOrganizationsResponse, Organization> | A pageable asynchronous sequence of Organization resources. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
SearchOrganizationsRequest request = new SearchOrganizationsRequest { Query = "", };
// Make the request
PagedAsyncEnumerable<SearchOrganizationsResponse, Organization> response = organizationsClient.SearchOrganizationsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Organization item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((SearchOrganizationsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Organization item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Organization> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Organization item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
SearchOrganizationsAsync(String, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<SearchOrganizationsResponse, Organization> SearchOrganizationsAsync(string query, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Searches organization resources that are visible to the user and satisfy the specified filter. This method returns organizations in an unspecified order. New organizations do not necessarily appear at the end of the results, and may take a small amount of time to appear.
Search will only return organizations on which the user has the permission
resourcemanager.organizations.get
Parameters | |
---|---|
Name | Description |
query | String Optional. An optional query string used to filter the Organizations to return in the response. Query rules are case-insensitive.
Organizations may be queried by
|
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<SearchOrganizationsResponse, Organization> | A pageable asynchronous sequence of Organization resources. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
string query = "";
// Make the request
PagedAsyncEnumerable<SearchOrganizationsResponse, Organization> response = organizationsClient.SearchOrganizationsAsync(query);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Organization item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((SearchOrganizationsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Organization item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Organization> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Organization item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
SetIamPolicy(IResourceName, CallSettings)
public virtual Policy SetIamPolicy(IResourceName resource, CallSettings callSettings = null)
Sets the access control policy on an organization resource. Replaces any
existing policy. The resource
field should be the organization's resource
name, for example: "organizations/123".
Authorization requires the IAM permission
resourcemanager.organizations.setIamPolicy
on the specified organization.
Parameters | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Policy | The RPC response. |
// Create client
OrganizationsClient organizationsClient = OrganizationsClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = organizationsClient.SetIamPolicy(resource);
SetIamPolicy(SetIamPolicyRequest, CallSettings)
public virtual Policy SetIamPolicy(SetIamPolicyRequest request, CallSettings callSettings = null)
Sets the access control policy on an organization resource. Replaces any
existing policy. The resource
field should be the organization's resource
name, for example: "organizations/123".
Authorization requires the IAM permission
resourcemanager.organizations.setIamPolicy
on the specified organization.
Parameters | |
---|---|
Name | Description |
request | SetIamPolicyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Policy | The RPC response. |
// Create client
OrganizationsClient organizationsClient = OrganizationsClient.Create();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Policy = new Policy(),
UpdateMask = new FieldMask(),
};
// Make the request
Policy response = organizationsClient.SetIamPolicy(request);
SetIamPolicy(String, CallSettings)
public virtual Policy SetIamPolicy(string resource, CallSettings callSettings = null)
Sets the access control policy on an organization resource. Replaces any
existing policy. The resource
field should be the organization's resource
name, for example: "organizations/123".
Authorization requires the IAM permission
resourcemanager.organizations.setIamPolicy
on the specified organization.
Parameters | |
---|---|
Name | Description |
resource | String REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Policy | The RPC response. |
// Create client
OrganizationsClient organizationsClient = OrganizationsClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = organizationsClient.SetIamPolicy(resource);
SetIamPolicyAsync(IResourceName, CallSettings)
public virtual Task<Policy> SetIamPolicyAsync(IResourceName resource, CallSettings callSettings = null)
Sets the access control policy on an organization resource. Replaces any
existing policy. The resource
field should be the organization's resource
name, for example: "organizations/123".
Authorization requires the IAM permission
resourcemanager.organizations.setIamPolicy
on the specified organization.
Parameters | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await organizationsClient.SetIamPolicyAsync(resource);
SetIamPolicyAsync(IResourceName, CancellationToken)
public virtual Task<Policy> SetIamPolicyAsync(IResourceName resource, CancellationToken cancellationToken)
Sets the access control policy on an organization resource. Replaces any
existing policy. The resource
field should be the organization's resource
name, for example: "organizations/123".
Authorization requires the IAM permission
resourcemanager.organizations.setIamPolicy
on the specified organization.
Parameters | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await organizationsClient.SetIamPolicyAsync(resource);
SetIamPolicyAsync(SetIamPolicyRequest, CallSettings)
public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CallSettings callSettings = null)
Sets the access control policy on an organization resource. Replaces any
existing policy. The resource
field should be the organization's resource
name, for example: "organizations/123".
Authorization requires the IAM permission
resourcemanager.organizations.setIamPolicy
on the specified organization.
Parameters | |
---|---|
Name | Description |
request | SetIamPolicyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Policy = new Policy(),
UpdateMask = new FieldMask(),
};
// Make the request
Policy response = await organizationsClient.SetIamPolicyAsync(request);
SetIamPolicyAsync(SetIamPolicyRequest, CancellationToken)
public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CancellationToken cancellationToken)
Sets the access control policy on an organization resource. Replaces any
existing policy. The resource
field should be the organization's resource
name, for example: "organizations/123".
Authorization requires the IAM permission
resourcemanager.organizations.setIamPolicy
on the specified organization.
Parameters | |
---|---|
Name | Description |
request | SetIamPolicyRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Policy = new Policy(),
UpdateMask = new FieldMask(),
};
// Make the request
Policy response = await organizationsClient.SetIamPolicyAsync(request);
SetIamPolicyAsync(String, CallSettings)
public virtual Task<Policy> SetIamPolicyAsync(string resource, CallSettings callSettings = null)
Sets the access control policy on an organization resource. Replaces any
existing policy. The resource
field should be the organization's resource
name, for example: "organizations/123".
Authorization requires the IAM permission
resourcemanager.organizations.setIamPolicy
on the specified organization.
Parameters | |
---|---|
Name | Description |
resource | String REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await organizationsClient.SetIamPolicyAsync(resource);
SetIamPolicyAsync(String, CancellationToken)
public virtual Task<Policy> SetIamPolicyAsync(string resource, CancellationToken cancellationToken)
Sets the access control policy on an organization resource. Replaces any
existing policy. The resource
field should be the organization's resource
name, for example: "organizations/123".
Authorization requires the IAM permission
resourcemanager.organizations.setIamPolicy
on the specified organization.
Parameters | |
---|---|
Name | Description |
resource | String REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await organizationsClient.SetIamPolicyAsync(resource);
ShutdownDefaultChannelsAsync()
public static Task ShutdownDefaultChannelsAsync()
Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.
Returns | |
---|---|
Type | Description |
Task | A task representing the asynchronous shutdown operation. |
After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.
TestIamPermissions(IResourceName, IEnumerable<String>, CallSettings)
public virtual TestIamPermissionsResponse TestIamPermissions(IResourceName resource, IEnumerable<string> permissions, CallSettings callSettings = null)
Returns the permissions that a caller has on the specified organization.
The resource
field should be the organization's resource name,
for example: "organizations/123".
There are no permissions required for making this API call.
Parameters | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
permissions | IEnumerable<String> The set of permissions to check for the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TestIamPermissionsResponse | The RPC response. |
// Create client
OrganizationsClient organizationsClient = OrganizationsClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = organizationsClient.TestIamPermissions(resource, permissions);
TestIamPermissions(TestIamPermissionsRequest, CallSettings)
public virtual TestIamPermissionsResponse TestIamPermissions(TestIamPermissionsRequest request, CallSettings callSettings = null)
Returns the permissions that a caller has on the specified organization.
The resource
field should be the organization's resource name,
for example: "organizations/123".
There are no permissions required for making this API call.
Parameters | |
---|---|
Name | Description |
request | TestIamPermissionsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TestIamPermissionsResponse | The RPC response. |
// Create client
OrganizationsClient organizationsClient = OrganizationsClient.Create();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = organizationsClient.TestIamPermissions(request);
TestIamPermissions(String, IEnumerable<String>, CallSettings)
public virtual TestIamPermissionsResponse TestIamPermissions(string resource, IEnumerable<string> permissions, CallSettings callSettings = null)
Returns the permissions that a caller has on the specified organization.
The resource
field should be the organization's resource name,
for example: "organizations/123".
There are no permissions required for making this API call.
Parameters | |
---|---|
Name | Description |
resource | String REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
permissions | IEnumerable<String> The set of permissions to check for the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TestIamPermissionsResponse | The RPC response. |
// Create client
OrganizationsClient organizationsClient = OrganizationsClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = organizationsClient.TestIamPermissions(resource, permissions);
TestIamPermissionsAsync(IResourceName, IEnumerable<String>, CallSettings)
public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(IResourceName resource, IEnumerable<string> permissions, CallSettings callSettings = null)
Returns the permissions that a caller has on the specified organization.
The resource
field should be the organization's resource name,
for example: "organizations/123".
There are no permissions required for making this API call.
Parameters | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
permissions | IEnumerable<String> The set of permissions to check for the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<TestIamPermissionsResponse> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await organizationsClient.TestIamPermissionsAsync(resource, permissions);
TestIamPermissionsAsync(IResourceName, IEnumerable<String>, CancellationToken)
public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(IResourceName resource, IEnumerable<string> permissions, CancellationToken cancellationToken)
Returns the permissions that a caller has on the specified organization.
The resource
field should be the organization's resource name,
for example: "organizations/123".
There are no permissions required for making this API call.
Parameters | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
permissions | IEnumerable<String> The set of permissions to check for the |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<TestIamPermissionsResponse> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await organizationsClient.TestIamPermissionsAsync(resource, permissions);
TestIamPermissionsAsync(TestIamPermissionsRequest, CallSettings)
public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CallSettings callSettings = null)
Returns the permissions that a caller has on the specified organization.
The resource
field should be the organization's resource name,
for example: "organizations/123".
There are no permissions required for making this API call.
Parameters | |
---|---|
Name | Description |
request | TestIamPermissionsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<TestIamPermissionsResponse> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await organizationsClient.TestIamPermissionsAsync(request);
TestIamPermissionsAsync(TestIamPermissionsRequest, CancellationToken)
public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CancellationToken cancellationToken)
Returns the permissions that a caller has on the specified organization.
The resource
field should be the organization's resource name,
for example: "organizations/123".
There are no permissions required for making this API call.
Parameters | |
---|---|
Name | Description |
request | TestIamPermissionsRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<TestIamPermissionsResponse> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await organizationsClient.TestIamPermissionsAsync(request);
TestIamPermissionsAsync(String, IEnumerable<String>, CallSettings)
public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(string resource, IEnumerable<string> permissions, CallSettings callSettings = null)
Returns the permissions that a caller has on the specified organization.
The resource
field should be the organization's resource name,
for example: "organizations/123".
There are no permissions required for making this API call.
Parameters | |
---|---|
Name | Description |
resource | String REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
permissions | IEnumerable<String> The set of permissions to check for the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<TestIamPermissionsResponse> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await organizationsClient.TestIamPermissionsAsync(resource, permissions);
TestIamPermissionsAsync(String, IEnumerable<String>, CancellationToken)
public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(string resource, IEnumerable<string> permissions, CancellationToken cancellationToken)
Returns the permissions that a caller has on the specified organization.
The resource
field should be the organization's resource name,
for example: "organizations/123".
There are no permissions required for making this API call.
Parameters | |
---|---|
Name | Description |
resource | String REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
permissions | IEnumerable<String> The set of permissions to check for the |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<TestIamPermissionsResponse> | A Task containing the RPC response. |
// Create client
OrganizationsClient organizationsClient = await OrganizationsClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await organizationsClient.TestIamPermissionsAsync(resource, permissions);