Struct google_api_proto::google::cloud::apihub::v1::api_hub_client::ApiHubClient
source · pub struct ApiHubClient<T> { /* private fields */ }
Expand description
This service provides all methods related to the API hub.
Implementations§
source§impl<T> ApiHubClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> ApiHubClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> ApiHubClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>,
<T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
sourcepub async fn create_api(
&mut self,
request: impl IntoRequest<CreateApiRequest>,
) -> Result<Response<Api>, Status>
pub async fn create_api( &mut self, request: impl IntoRequest<CreateApiRequest>, ) -> Result<Response<Api>, Status>
Create an API resource in the API hub. Once an API resource is created, versions can be added to it.
sourcepub async fn get_api(
&mut self,
request: impl IntoRequest<GetApiRequest>,
) -> Result<Response<Api>, Status>
pub async fn get_api( &mut self, request: impl IntoRequest<GetApiRequest>, ) -> Result<Response<Api>, Status>
Get API resource details including the API versions contained in it.
sourcepub async fn list_apis(
&mut self,
request: impl IntoRequest<ListApisRequest>,
) -> Result<Response<ListApisResponse>, Status>
pub async fn list_apis( &mut self, request: impl IntoRequest<ListApisRequest>, ) -> Result<Response<ListApisResponse>, Status>
List API resources in the API hub.
sourcepub async fn update_api(
&mut self,
request: impl IntoRequest<UpdateApiRequest>,
) -> Result<Response<Api>, Status>
pub async fn update_api( &mut self, request: impl IntoRequest<UpdateApiRequest>, ) -> Result<Response<Api>, Status>
Update an API resource in the API hub. The following fields in the [API][] can be updated:
- [display_name][google.cloud.apihub.v1.Api.display_name]
- [description][google.cloud.apihub.v1.Api.description]
- [owner][google.cloud.apihub.v1.Api.owner]
- [documentation][google.cloud.apihub.v1.Api.documentation]
- [target_user][google.cloud.apihub.v1.Api.target_user]
- [team][google.cloud.apihub.v1.Api.team]
- [business_unit][google.cloud.apihub.v1.Api.business_unit]
- [maturity_level][google.cloud.apihub.v1.Api.maturity_level]
- [attributes][google.cloud.apihub.v1.Api.attributes]
The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask] should be used to specify the fields being updated.
Updating the owner field requires complete owner message and updates both owner and email fields.
sourcepub async fn delete_api(
&mut self,
request: impl IntoRequest<DeleteApiRequest>,
) -> Result<Response<()>, Status>
pub async fn delete_api( &mut self, request: impl IntoRequest<DeleteApiRequest>, ) -> Result<Response<()>, Status>
Delete an API resource in the API hub. API can only be deleted if all underlying versions are deleted.
sourcepub async fn create_version(
&mut self,
request: impl IntoRequest<CreateVersionRequest>,
) -> Result<Response<Version>, Status>
pub async fn create_version( &mut self, request: impl IntoRequest<CreateVersionRequest>, ) -> Result<Response<Version>, Status>
Create an API version for an API resource in the API hub.
sourcepub async fn get_version(
&mut self,
request: impl IntoRequest<GetVersionRequest>,
) -> Result<Response<Version>, Status>
pub async fn get_version( &mut self, request: impl IntoRequest<GetVersionRequest>, ) -> Result<Response<Version>, Status>
Get details about the API version of an API resource. This will include information about the specs and operations present in the API version as well as the deployments linked to it.
sourcepub async fn list_versions(
&mut self,
request: impl IntoRequest<ListVersionsRequest>,
) -> Result<Response<ListVersionsResponse>, Status>
pub async fn list_versions( &mut self, request: impl IntoRequest<ListVersionsRequest>, ) -> Result<Response<ListVersionsResponse>, Status>
List API versions of an API resource in the API hub.
sourcepub async fn update_version(
&mut self,
request: impl IntoRequest<UpdateVersionRequest>,
) -> Result<Response<Version>, Status>
pub async fn update_version( &mut self, request: impl IntoRequest<UpdateVersionRequest>, ) -> Result<Response<Version>, Status>
Update API version. The following fields in the [version][google.cloud.apihub.v1.Version] can be updated currently:
- [display_name][google.cloud.apihub.v1.Version.display_name]
- [description][google.cloud.apihub.v1.Version.description]
- [documentation][google.cloud.apihub.v1.Version.documentation]
- [deployments][google.cloud.apihub.v1.Version.deployments]
- [lifecycle][google.cloud.apihub.v1.Version.lifecycle]
- [compliance][google.cloud.apihub.v1.Version.compliance]
- [accreditation][google.cloud.apihub.v1.Version.accreditation]
- [attributes][google.cloud.apihub.v1.Version.attributes]
The [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask] should be used to specify the fields being updated.
sourcepub async fn delete_version(
&mut self,
request: impl IntoRequest<DeleteVersionRequest>,
) -> Result<Response<()>, Status>
pub async fn delete_version( &mut self, request: impl IntoRequest<DeleteVersionRequest>, ) -> Result<Response<()>, Status>
Delete an API version. Version can only be deleted if all underlying specs, operations, definitions and linked deployments are deleted.
sourcepub async fn create_spec(
&mut self,
request: impl IntoRequest<CreateSpecRequest>,
) -> Result<Response<Spec>, Status>
pub async fn create_spec( &mut self, request: impl IntoRequest<CreateSpecRequest>, ) -> Result<Response<Spec>, Status>
Add a spec to an API version in the API hub.
Multiple specs can be added to an API version.
Note, while adding a spec, at least one of contents
or source_uri
must
be provided. If contents
is provided, then spec_type
must also be
provided.
On adding a spec with contents to the version, the operations present in it
will be added to the version.Note that the file contents in the spec should
be of the same type as defined in the
projects/{project}/locations/{location}/attributes/system-spec-type
attribute associated with spec resource. Note that specs of various types
can be uploaded, however parsing of details is supported for OpenAPI spec
currently.
In order to access the information parsed from the spec, use the [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method. In order to access the operations parsed from the spec, use the [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] method.
sourcepub async fn get_spec(
&mut self,
request: impl IntoRequest<GetSpecRequest>,
) -> Result<Response<Spec>, Status>
pub async fn get_spec( &mut self, request: impl IntoRequest<GetSpecRequest>, ) -> Result<Response<Spec>, Status>
Get details about the information parsed from a spec. Note that this method does not return the raw spec contents. Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method to retrieve the same.
sourcepub async fn get_spec_contents(
&mut self,
request: impl IntoRequest<GetSpecContentsRequest>,
) -> Result<Response<SpecContents>, Status>
pub async fn get_spec_contents( &mut self, request: impl IntoRequest<GetSpecContentsRequest>, ) -> Result<Response<SpecContents>, Status>
Get spec contents.
sourcepub async fn list_specs(
&mut self,
request: impl IntoRequest<ListSpecsRequest>,
) -> Result<Response<ListSpecsResponse>, Status>
pub async fn list_specs( &mut self, request: impl IntoRequest<ListSpecsRequest>, ) -> Result<Response<ListSpecsResponse>, Status>
List specs corresponding to a particular API resource.
sourcepub async fn update_spec(
&mut self,
request: impl IntoRequest<UpdateSpecRequest>,
) -> Result<Response<Spec>, Status>
pub async fn update_spec( &mut self, request: impl IntoRequest<UpdateSpecRequest>, ) -> Result<Response<Spec>, Status>
Update spec. The following fields in the [spec][google.cloud.apihub.v1.Spec] can be updated:
- [display_name][google.cloud.apihub.v1.Spec.display_name]
- [source_uri][google.cloud.apihub.v1.Spec.source_uri]
- [lint_response][google.cloud.apihub.v1.Spec.lint_response]
- [attributes][google.cloud.apihub.v1.Spec.attributes]
- [contents][google.cloud.apihub.v1.Spec.contents]
- [spec_type][google.cloud.apihub.v1.Spec.spec_type]
In case of an OAS spec, updating spec contents can lead to:
- Creation, deletion and update of operations.
- Creation, deletion and update of definitions.
- Update of other info parsed out from the new spec.
In case of contents or source_uri being present in update mask, spec_type must also be present. Also, spec_type can not be present in update mask if contents or source_uri is not present.
The [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask] should be used to specify the fields being updated.
sourcepub async fn delete_spec(
&mut self,
request: impl IntoRequest<DeleteSpecRequest>,
) -> Result<Response<()>, Status>
pub async fn delete_spec( &mut self, request: impl IntoRequest<DeleteSpecRequest>, ) -> Result<Response<()>, Status>
Delete a spec. Deleting a spec will also delete the associated operations from the version.
sourcepub async fn get_api_operation(
&mut self,
request: impl IntoRequest<GetApiOperationRequest>,
) -> Result<Response<ApiOperation>, Status>
pub async fn get_api_operation( &mut self, request: impl IntoRequest<GetApiOperationRequest>, ) -> Result<Response<ApiOperation>, Status>
Get details about a particular operation in API version.
sourcepub async fn list_api_operations(
&mut self,
request: impl IntoRequest<ListApiOperationsRequest>,
) -> Result<Response<ListApiOperationsResponse>, Status>
pub async fn list_api_operations( &mut self, request: impl IntoRequest<ListApiOperationsRequest>, ) -> Result<Response<ListApiOperationsResponse>, Status>
List operations in an API version.
sourcepub async fn get_definition(
&mut self,
request: impl IntoRequest<GetDefinitionRequest>,
) -> Result<Response<Definition>, Status>
pub async fn get_definition( &mut self, request: impl IntoRequest<GetDefinitionRequest>, ) -> Result<Response<Definition>, Status>
Get details about a definition in an API version.
sourcepub async fn create_deployment(
&mut self,
request: impl IntoRequest<CreateDeploymentRequest>,
) -> Result<Response<Deployment>, Status>
pub async fn create_deployment( &mut self, request: impl IntoRequest<CreateDeploymentRequest>, ) -> Result<Response<Deployment>, Status>
Create a deployment resource in the API hub. Once a deployment resource is created, it can be associated with API versions.
sourcepub async fn get_deployment(
&mut self,
request: impl IntoRequest<GetDeploymentRequest>,
) -> Result<Response<Deployment>, Status>
pub async fn get_deployment( &mut self, request: impl IntoRequest<GetDeploymentRequest>, ) -> Result<Response<Deployment>, Status>
Get details about a deployment and the API versions linked to it.
sourcepub async fn list_deployments(
&mut self,
request: impl IntoRequest<ListDeploymentsRequest>,
) -> Result<Response<ListDeploymentsResponse>, Status>
pub async fn list_deployments( &mut self, request: impl IntoRequest<ListDeploymentsRequest>, ) -> Result<Response<ListDeploymentsResponse>, Status>
List deployment resources in the API hub.
sourcepub async fn update_deployment(
&mut self,
request: impl IntoRequest<UpdateDeploymentRequest>,
) -> Result<Response<Deployment>, Status>
pub async fn update_deployment( &mut self, request: impl IntoRequest<UpdateDeploymentRequest>, ) -> Result<Response<Deployment>, Status>
Update a deployment resource in the API hub. The following fields in the [deployment resource][google.cloud.apihub.v1.Deployment] can be updated:
- [display_name][google.cloud.apihub.v1.Deployment.display_name]
- [description][google.cloud.apihub.v1.Deployment.description]
- [documentation][google.cloud.apihub.v1.Deployment.documentation]
- [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type]
- [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri]
- [endpoints][google.cloud.apihub.v1.Deployment.endpoints]
- [slo][google.cloud.apihub.v1.Deployment.slo]
- [environment][google.cloud.apihub.v1.Deployment.environment]
- [attributes][google.cloud.apihub.v1.Deployment.attributes]
The [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask] should be used to specify the fields being updated.
sourcepub async fn delete_deployment(
&mut self,
request: impl IntoRequest<DeleteDeploymentRequest>,
) -> Result<Response<()>, Status>
pub async fn delete_deployment( &mut self, request: impl IntoRequest<DeleteDeploymentRequest>, ) -> Result<Response<()>, Status>
Delete a deployment resource in the API hub.
sourcepub async fn create_attribute(
&mut self,
request: impl IntoRequest<CreateAttributeRequest>,
) -> Result<Response<Attribute>, Status>
pub async fn create_attribute( &mut self, request: impl IntoRequest<CreateAttributeRequest>, ) -> Result<Response<Attribute>, Status>
Create a user defined attribute.
Certain pre defined attributes are already created by the API hub. These
attributes will have type as SYSTEM_DEFINED
and can be listed via
[ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method.
Allowed values for the same can be updated via
[UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method.
sourcepub async fn get_attribute(
&mut self,
request: impl IntoRequest<GetAttributeRequest>,
) -> Result<Response<Attribute>, Status>
pub async fn get_attribute( &mut self, request: impl IntoRequest<GetAttributeRequest>, ) -> Result<Response<Attribute>, Status>
Get details about the attribute.
sourcepub async fn update_attribute(
&mut self,
request: impl IntoRequest<UpdateAttributeRequest>,
) -> Result<Response<Attribute>, Status>
pub async fn update_attribute( &mut self, request: impl IntoRequest<UpdateAttributeRequest>, ) -> Result<Response<Attribute>, Status>
Update the attribute. The following fields in the [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated:
- [display_name][google.cloud.apihub.v1.Attribute.display_name] The display name can be updated for user defined attributes only.
- [description][google.cloud.apihub.v1.Attribute.description] The description can be updated for user defined attributes only.
- [allowed_values][google.cloud.apihub.v1.Attribute.allowed_values] To update the list of allowed values, clients need to use the fetched list of allowed values and add or remove values to or from the same list. The mutable allowed values can be updated for both user defined and System defined attributes. The immutable allowed values cannot be updated or deleted. The updated list of allowed values cannot be empty. If an allowed value that is already used by some resource’s attribute is deleted, then the association between the resource and the attribute value will also be deleted.
- [cardinality][google.cloud.apihub.v1.Attribute.cardinality] The cardinality can be updated for user defined attributes only. Cardinality can only be increased during an update.
The [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask] should be used to specify the fields being updated.
sourcepub async fn delete_attribute(
&mut self,
request: impl IntoRequest<DeleteAttributeRequest>,
) -> Result<Response<()>, Status>
pub async fn delete_attribute( &mut self, request: impl IntoRequest<DeleteAttributeRequest>, ) -> Result<Response<()>, Status>
Delete an attribute.
Note: System defined attributes cannot be deleted. All associations of the attribute being deleted with any API hub resource will also get deleted.
sourcepub async fn list_attributes(
&mut self,
request: impl IntoRequest<ListAttributesRequest>,
) -> Result<Response<ListAttributesResponse>, Status>
pub async fn list_attributes( &mut self, request: impl IntoRequest<ListAttributesRequest>, ) -> Result<Response<ListAttributesResponse>, Status>
List all attributes.
sourcepub async fn search_resources(
&mut self,
request: impl IntoRequest<SearchResourcesRequest>,
) -> Result<Response<SearchResourcesResponse>, Status>
pub async fn search_resources( &mut self, request: impl IntoRequest<SearchResourcesRequest>, ) -> Result<Response<SearchResourcesResponse>, Status>
Search across API-Hub resources.
sourcepub async fn create_external_api(
&mut self,
request: impl IntoRequest<CreateExternalApiRequest>,
) -> Result<Response<ExternalApi>, Status>
pub async fn create_external_api( &mut self, request: impl IntoRequest<CreateExternalApiRequest>, ) -> Result<Response<ExternalApi>, Status>
Create an External API resource in the API hub.
sourcepub async fn get_external_api(
&mut self,
request: impl IntoRequest<GetExternalApiRequest>,
) -> Result<Response<ExternalApi>, Status>
pub async fn get_external_api( &mut self, request: impl IntoRequest<GetExternalApiRequest>, ) -> Result<Response<ExternalApi>, Status>
Get details about an External API resource in the API hub.
sourcepub async fn update_external_api(
&mut self,
request: impl IntoRequest<UpdateExternalApiRequest>,
) -> Result<Response<ExternalApi>, Status>
pub async fn update_external_api( &mut self, request: impl IntoRequest<UpdateExternalApiRequest>, ) -> Result<Response<ExternalApi>, Status>
Update an External API resource in the API hub. The following fields can be updated:
- [display_name][google.cloud.apihub.v1.ExternalApi.display_name]
- [description][google.cloud.apihub.v1.ExternalApi.description]
- [documentation][google.cloud.apihub.v1.ExternalApi.documentation]
- [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints]
- [paths][google.cloud.apihub.v1.ExternalApi.paths]
The [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask] should be used to specify the fields being updated.
sourcepub async fn delete_external_api(
&mut self,
request: impl IntoRequest<DeleteExternalApiRequest>,
) -> Result<Response<()>, Status>
pub async fn delete_external_api( &mut self, request: impl IntoRequest<DeleteExternalApiRequest>, ) -> Result<Response<()>, Status>
Delete an External API resource in the API hub.
sourcepub async fn list_external_apis(
&mut self,
request: impl IntoRequest<ListExternalApisRequest>,
) -> Result<Response<ListExternalApisResponse>, Status>
pub async fn list_external_apis( &mut self, request: impl IntoRequest<ListExternalApisRequest>, ) -> Result<Response<ListExternalApisResponse>, Status>
List External API resources in the API hub.
Trait Implementations§
source§impl<T: Clone> Clone for ApiHubClient<T>
impl<T: Clone> Clone for ApiHubClient<T>
source§fn clone(&self) -> ApiHubClient<T>
fn clone(&self) -> ApiHubClient<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<T> !Freeze for ApiHubClient<T>
impl<T> RefUnwindSafe for ApiHubClient<T>where
T: RefUnwindSafe,
impl<T> Send for ApiHubClient<T>where
T: Send,
impl<T> Sync for ApiHubClient<T>where
T: Sync,
impl<T> Unpin for ApiHubClient<T>where
T: Unpin,
impl<T> UnwindSafe for ApiHubClient<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request