Class OrganizationsClient (2.19.0)

Allows users to manage their organization resources.

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

OrganizationsClient(OrganizationsClient const &)

Copy and move support

Parameter
NameDescription
OrganizationsClient const &

OrganizationsClient(OrganizationsClient &&)

Copy and move support

Parameter
NameDescription
OrganizationsClient &&

OrganizationsClient(std::shared_ptr< OrganizationsConnection >, Options)

Parameters
NameDescription
connection std::shared_ptr< OrganizationsConnection >
opts Options

Operators

operator=(OrganizationsClient const &)

Copy and move support

Parameter
NameDescription
OrganizationsClient const &
Returns
TypeDescription
OrganizationsClient &

operator=(OrganizationsClient &&)

Copy and move support

Parameter
NameDescription
OrganizationsClient &&
Returns
TypeDescription
OrganizationsClient &

Functions

GetOrganization(std::string const &, Options)

Fetches an organization resource identified by the specified resource name.

Parameters
NameDescription
name std::string const &

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".

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::cloud::resourcemanager::v3::Organization >

the result of the RPC. The response message type (google.cloud.resourcemanager.v3.Organization) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetOrganization(google::cloud::resourcemanager::v3::GetOrganizationRequest const &, Options)

Fetches an organization resource identified by the specified resource name.

Parameters
NameDescription
request google::cloud::resourcemanager::v3::GetOrganizationRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.resourcemanager.v3.GetOrganizationRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::cloud::resourcemanager::v3::Organization >

the result of the RPC. The response message type (google.cloud.resourcemanager.v3.Organization) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

SearchOrganizations(std::string const &, Options)

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
NameDescription
query std::string const &

Optional. An optional query string used to filter the Organizations to return in the response. Query rules are case-insensitive.
```cpp

FieldDescription
directoryCustomerId, owner.directoryCustomerIdFilters by directory
customer id.
domainFilters by domain.
 Organizations may be queried by `directoryCustomerId` or by `domain`, where the domain is a G Suite domain, for example: <br>
- Query `directorycustomerid:123456789` returns Organization resources with `owner.directory_customer_id` equal to `123456789`.
- Query `domain:google.com` returns Organization resources corresponding to the domain `google.com`. 
opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StreamRange< google::cloud::resourcemanager::v3::Organization >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.resourcemanager.v3.Organization, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

SearchOrganizations(google::cloud::resourcemanager::v3::SearchOrganizationsRequest, Options)

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
NameDescription
request google::cloud::resourcemanager::v3::SearchOrganizationsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.resourcemanager.v3.SearchOrganizationsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StreamRange< google::cloud::resourcemanager::v3::Organization >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.resourcemanager.v3.Organization, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

GetIamPolicy(std::string const &, Options)

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
NameDescription
resource std::string const &

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::iam::v1::Policy >

the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetIamPolicy(google::iam::v1::GetIamPolicyRequest const &, Options)

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
NameDescription
request google::iam::v1::GetIamPolicyRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.iam.v1.GetIamPolicyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::iam::v1::Policy >

the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

SetIamPolicy(std::string const &, Options)

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
NameDescription
resource std::string const &

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::iam::v1::Policy >

the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

SetIamPolicy(google::iam::v1::SetIamPolicyRequest const &, Options)

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
NameDescription
request google::iam::v1::SetIamPolicyRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.iam.v1.SetIamPolicyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::iam::v1::Policy >

the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

TestIamPermissions(std::string const &, std::vector< std::string > const &, Options)

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
NameDescription
resource std::string const &

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissions std::vector< std::string > const &

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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::iam::v1::TestIamPermissionsResponse >

the result of the RPC. The response message type (google.iam.v1.TestIamPermissionsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const &, Options)

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
NameDescription
request google::iam::v1::TestIamPermissionsRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.iam.v1.TestIamPermissionsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::iam::v1::TestIamPermissionsResponse >

the result of the RPC. The response message type (google.iam.v1.TestIamPermissionsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.