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,

source

pub fn new(inner: T) -> Self

source

pub fn with_origin(inner: T, origin: Uri) -> Self

source

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,

source

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.

source

pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self

Enable decompressing responses.

source

pub fn max_decoding_message_size(self, limit: usize) -> Self

Limits the maximum size of a decoded message.

Default: 4MB

source

pub fn max_encoding_message_size(self, limit: usize) -> Self

Limits the maximum size of an encoded message.

Default: usize::MAX

source

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.

source

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.

source

pub async fn list_apis( &mut self, request: impl IntoRequest<ListApisRequest>, ) -> Result<Response<ListApisResponse>, Status>

List API resources in the API hub.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

pub async fn get_spec_contents( &mut self, request: impl IntoRequest<GetSpecContentsRequest>, ) -> Result<Response<SpecContents>, Status>

Get spec contents.

source

pub async fn list_specs( &mut self, request: impl IntoRequest<ListSpecsRequest>, ) -> Result<Response<ListSpecsResponse>, Status>

List specs corresponding to a particular API resource.

source

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:

  1. Creation, deletion and update of operations.
  2. Creation, deletion and update of definitions.
  3. 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.

source

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.

source

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.

source

pub async fn list_api_operations( &mut self, request: impl IntoRequest<ListApiOperationsRequest>, ) -> Result<Response<ListApiOperationsResponse>, Status>

List operations in an API version.

source

pub async fn get_definition( &mut self, request: impl IntoRequest<GetDefinitionRequest>, ) -> Result<Response<Definition>, Status>

Get details about a definition in an API version.

source

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.

source

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.

source

pub async fn list_deployments( &mut self, request: impl IntoRequest<ListDeploymentsRequest>, ) -> Result<Response<ListDeploymentsResponse>, Status>

List deployment resources in the API hub.

source

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.

source

pub async fn delete_deployment( &mut self, request: impl IntoRequest<DeleteDeploymentRequest>, ) -> Result<Response<()>, Status>

Delete a deployment resource in the API hub.

source

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.

source

pub async fn get_attribute( &mut self, request: impl IntoRequest<GetAttributeRequest>, ) -> Result<Response<Attribute>, Status>

Get details about the attribute.

source

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.

source

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.

source

pub async fn list_attributes( &mut self, request: impl IntoRequest<ListAttributesRequest>, ) -> Result<Response<ListAttributesResponse>, Status>

List all attributes.

source

pub async fn search_resources( &mut self, request: impl IntoRequest<SearchResourcesRequest>, ) -> Result<Response<SearchResourcesResponse>, Status>

Search across API-Hub resources.

source

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.

source

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.

source

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.

source

pub async fn delete_external_api( &mut self, request: impl IntoRequest<DeleteExternalApiRequest>, ) -> Result<Response<()>, Status>

Delete an External API resource in the API hub.

source

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>

source§

fn clone(&self) -> ApiHubClient<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for ApiHubClient<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto 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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more