0.7.2 (latest) 0.7.1 0.6.0 0.5.0 0.4.0 0.3.0 0.2.7

```python
ApiHubAsyncClient(
    *,
    credentials: typing.Optional[google.auth.credentials.Credentials] = None,
    transport: typing.Optional[
        typing.Union[
            str,
            google.cloud.apihub_v1.services.api_hub.transports.base.ApiHubTransport,
            typing.Callable[
                [...],
                google.cloud.apihub_v1.services.api_hub.transports.base.ApiHubTransport,
            ],
        ]
    ] = "grpc_asyncio",
    client_options: typing.Optional[
        google.api_core.client_options.ClientOptions
    ] = None,
    client_info: google.api_core.gapic_v1.client_info.ClientInfo = google.api_core.gapic_v1.client_info.ClientInfo
)
```
This service provides all methods related to the API hub.

## Properties

### api_endpoint

Return the API endpoint used by the client instance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `str` | The API endpoint used by the client instance. |

### transport

Returns the transport used by the client instance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ApiHubTransport` | The transport used by the client instance. |

### universe_domain

Return the universe domain used by the client instance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `str` | The universe domain used by the client instance. |

## Methods

### ApiHubAsyncClient

```python
ApiHubAsyncClient(
    *,
    credentials: typing.Optional[google.auth.credentials.Credentials] = None,
    transport: typing.Optional[
        typing.Union[
            str,
            google.cloud.apihub_v1.services.api_hub.transports.base.ApiHubTransport,
            typing.Callable[
                [...],
                google.cloud.apihub_v1.services.api_hub.transports.base.ApiHubTransport,
            ],
        ]
    ] = "grpc_asyncio",
    client_options: typing.Optional[
        google.api_core.client_options.ClientOptions
    ] = None,
    client_info: google.api_core.gapic_v1.client_info.ClientInfo = google.api_core.gapic_v1.client_info.ClientInfo
)
```
Instantiates the api hub async client.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `credentials` | `Optional[google.auth.credentials.Credentials]` The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment. |
| `transport` | `Optional[Union[str,ApiHubTransport,Callable[..., ApiHubTransport]]]` The transport to use, or a Callable that constructs and returns a new transport to use. If a Callable is given, it will be called with the same set of initialization arguments as used in the ApiHubTransport constructor. If set to None, a transport is chosen automatically. |
| `client_options` | `Optional[Union[google.api_core.client_options.ClientOptions, dict]]` Custom options for the client. 1. The `api_endpoint` property can be used to override the default endpoint provided by the client when `transport` is not explicitly provided. Only if this property is not set and `transport` was not explicitly provided, the endpoint is determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment variable, which have one of the following values: "always" (always use the default mTLS endpoint), "never" (always use the default regular endpoint) and "auto" (auto-switch to the default mTLS endpoint if client certificate is present; this is the default value). 2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "true", then the `client_cert_source` property can be used to provide a client certificate for mTLS transport. If not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not set, no client certificate will be used. 3. The `universe_domain` property can be used to override the default "googleapis.com" universe. Note that `api_endpoint` property still takes precedence; and `universe_domain` is currently not supported for mTLS. |
| `client_info` | `google.api_core.gapic_v1.client_info.ClientInfo` The client info used to send a user-agent string along with API requests. If `None`, then default info will be used. Generally, you only need to set this if you're developing your own client library. |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `google.auth.exceptions.MutualTlsChannelError` | If mutual TLS transport creation failed for any reason. |

### api_operation_path

```python
api_operation_path(
    project: str, location: str, api: str, version: str, operation: str
) -> str
```
Returns a fully-qualified api_operation string.

### api_path

```python
api_path(project: str, location: str, api: str) -> str
```
Returns a fully-qualified api string.

### attribute_path

```python
attribute_path(project: str, location: str, attribute: str) -> str
```
Returns a fully-qualified attribute string.

### cancel_operation

```python
cancel_operation(
    request: typing.Optional[
        typing.Union[google.longrunning.operations_pb2.CancelOperationRequest, dict]
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> None
```
Starts asynchronous cancellation on a long-running operation.

The server makes a best effort to cancel the operation, but success
is not guaranteed. If the server doesn't support this method, it returns
`google.rpc.Code.UNIMPLEMENTED`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `` `.operations_pb2.CancelOperationRequest` `` The request object. Request message for `CancelOperation` method. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

### common_billing_account_path

```python
common_billing_account_path(billing_account: str) -> str
```
Returns a fully-qualified billing_account string.

### common_folder_path

```python
common_folder_path(folder: str) -> str
```
Returns a fully-qualified folder string.

### common_location_path

```python
common_location_path(project: str, location: str) -> str
```
Returns a fully-qualified location string.

### common_organization_path

```python
common_organization_path(organization: str) -> str
```
Returns a fully-qualified organization string.

### common_project_path

```python
common_project_path(project: str) -> str
```
Returns a fully-qualified project string.

### configure_and_deploy_server

```python
configure_and_deploy_server(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.ConfigureAndDeployServerRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    mcp_server_config: typing.Optional[
        google.cloud.apihub_v1.types.apihub_service.McpServerConfig
    ] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation_async.AsyncOperation
```
Configures and deploys a given server config for
given target. Currently this API supports only deploying
MCP server in Apigee X. For mcp server deployment in
apigee X, if there is already a mcp proxy deployed, then
this method will try to overwrite it by creating new
revision i.e. all existing tools will be removed and new
set of tools will be deployed.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_configure_and_deploy_server():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    mcp_server_config = apihub_v1.McpServerConfig()
    mcp_server_config.apigee_x_target_details.environment = "environment_value"
    mcp_server_config.apigee_x_target_details.proxy = "proxy_value"
    mcp_server_config.apigee_x_target_details.target_project = "target_project_value"
    mcp_server_config.tools.tool_id = "tool_id_value"
    mcp_server_config.tools.description = "description_value"
    mcp_server_config.tools.operation.operation = "operation_value"

    request = apihub_v1.ConfigureAndDeployServerRequest(
        mcp_server_config=mcp_server_config,
        parent="parent_value",
    )

    # Make the request
    operation = await client.configure_and_deploy_server(request=request)

    print("Waiting for operation to complete...")

    response = await operation.result()

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.ConfigureAndDeployServerRequest, dict]]` The request object. Request message for ApiHub.ConfigureAndDeployServer. |
| `parent` | `` `str` `` Required. Format: `projects/{project}/locations/{location}` This corresponds to the `parent` field on the `request` instance; if `request` is provided, this should not be set. |
| `mcp_server_config` | `McpServerConfig` MCP (Model Context Protocol) server configuration. This corresponds to the `mcp_server_config` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.api_core.operation_async.AsyncOperation` | An object representing a long-running operation. The result type for the operation will be [ConfigureAndDeployServerResponse](https://docs.cloud.google.com/python/docs/reference/google-cloud-apihub/latest/google.cloud.apihub_v1.types.ConfigureAndDeployServerResponse) Response message for ApiHub.ConfigureAndDeployServer. |

### create_api

```python
create_api(
    request: typing.Optional[
        typing.Union[google.cloud.apihub_v1.types.apihub_service.CreateApiRequest, dict]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    api: typing.Optional[google.cloud.apihub_v1.types.common_fields.Api] = None,
    api_id: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.Api
```
Create an API resource in the API hub.
Once an API resource is created, versions can be added
to it.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_create_api():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    api = apihub_v1.Api()
    api.display_name = "display_name_value"

    request = apihub_v1.CreateApiRequest(
        parent="parent_value",
        api=api,
    )

    # Make the request
    response = await client.create_api(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.CreateApiRequest, dict]]` The request object. The CreateApi method's request. |
| `parent` | `` `str` `` Required. The parent resource for the API resource. Format: `projects/{project}/locations/{location}` This corresponds to the `parent` field on the `request` instance; if `request` is provided, this should not be set. |
| `api` | `Api` Required. The API resource to create. This corresponds to the `api` field on the `request` instance; if `request` is provided, this should not be set. |
| `api_id` | `` `str` `` Optional. The ID to use for the API resource, which will become the final component of the API's resource name. This field is optional. - If provided, the same will be used. The service will throw an error if the specified id is already used by another API resource in the API hub. - If not provided, a system generated id will be used. This value should be 4-500 characters, and valid characters are /`a-z][A-Z]`\[0-9\]-_/. This corresponds to the `api_id` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.Api` | An API resource in the API Hub. |

### create_api_operation

```python
create_api_operation(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.CreateApiOperationRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    api_operation: typing.Optional[
        google.cloud.apihub_v1.types.common_fields.ApiOperation
    ] = None,
    api_operation_id: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.ApiOperation
```
Create an apiOperation in an API version.
An apiOperation can be created only if the version has
no apiOperations which were created by parsing a spec.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_create_api_operation():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.CreateApiOperationRequest(
        parent="parent_value",
    )

    # Make the request
    response = await client.create_api_operation(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.CreateApiOperationRequest, dict]]` The request object. The CreateApiOperation method's request. |
| `parent` | `` `str` `` Required. The parent resource for the operation resource. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}` This corresponds to the `parent` field on the `request` instance; if `request` is provided, this should not be set. |
| `api_operation` | `ApiOperation` Required. The operation resource to create. This corresponds to the `api_operation` field on the `request` instance; if `request` is provided, this should not be set. |
| `api_operation_id` | `` `str` `` Optional. The ID to use for the operation resource, which will become the final component of the operation's resource name. This field is optional. - If provided, the same will be used. The service will throw an error if the specified id is already used by another operation resource in the API hub. - If not provided, a system generated id will be used. This value should be 4-500 characters, overall resource name which will be of format `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`, its length is limited to 1000 characters, and valid characters are /`a-z][A-Z]`\[0-9\]-_/. This corresponds to the `api_operation_id` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.ApiOperation` | Represents an operation contained in an API version in the API Hub. An operation is added/updated/deleted in an API version when a new spec is added or an existing spec is updated/deleted in a version. Currently, an operation will be created only corresponding to OpenAPI spec as parsing is supported for OpenAPI spec. Alternatively operations can be managed via create,update and delete APIs, creation of apiOperation can be possible only for version with no parsed operations and update/delete can be possible only for operations created via create API. |

### create_attribute

```python
create_attribute(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.CreateAttributeRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    attribute: typing.Optional[
        google.cloud.apihub_v1.types.common_fields.Attribute
    ] = None,
    attribute_id: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.Attribute
```
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
xref_ListAttributes
method. Allowed values for the same can be updated via
xref_UpdateAttribute
method.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_create_attribute():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    attribute = apihub_v1.Attribute()
    attribute.display_name = "display_name_value"
    attribute.scope = "PLUGIN"
    attribute.data_type = "URI"

    request = apihub_v1.CreateAttributeRequest(
        parent="parent_value",
        attribute=attribute,
    )

    # Make the request
    response = await client.create_attribute(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.CreateAttributeRequest, dict]]` The request object. The CreateAttribute method's request. |
| `parent` | `` `str` `` Required. The parent resource for Attribute. Format: `projects/{project}/locations/{location}` This corresponds to the `parent` field on the `request` instance; if `request` is provided, this should not be set. |
| `attribute` | `Attribute` Required. The attribute to create. This corresponds to the `attribute` field on the `request` instance; if `request` is provided, this should not be set. |
| `attribute_id` | `` `str` `` Optional. The ID to use for the attribute, which will become the final component of the attribute's resource name. This field is optional. - If provided, the same will be used. The service will throw an error if the specified id is already used by another attribute resource in the API hub. - If not provided, a system generated id will be used. This value should be 4-500 characters, and valid characters are /`a-z][A-Z]`\[0-9\]-_/. This corresponds to the `attribute_id` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.Attribute` | An attribute in the API Hub. An attribute is a name value pair which can be attached to different resources in the API hub based on the scope of the attribute. Attributes can either be pre-defined by the API Hub or created by users. |

### create_deployment

```python
create_deployment(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.CreateDeploymentRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    deployment: typing.Optional[
        google.cloud.apihub_v1.types.common_fields.Deployment
    ] = None,
    deployment_id: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.Deployment
```
Create a deployment resource in the API hub.
Once a deployment resource is created, it can be
associated with API versions.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_create_deployment():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    deployment = apihub_v1.Deployment()
    deployment.display_name = "display_name_value"
    deployment.deployment_type.enum_values.values.id = "id_value"
    deployment.deployment_type.enum_values.values.display_name = "display_name_value"
    deployment.resource_uri = "resource_uri_value"
    deployment.endpoints = ['endpoints_value1', 'endpoints_value2']

    request = apihub_v1.CreateDeploymentRequest(
        parent="parent_value",
        deployment=deployment,
    )

    # Make the request
    response = await client.create_deployment(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.CreateDeploymentRequest, dict]]` The request object. The CreateDeployment method's request. |
| `parent` | `` `str` `` Required. The parent resource for the deployment resource. Format: `projects/{project}/locations/{location}` This corresponds to the `parent` field on the `request` instance; if `request` is provided, this should not be set. |
| `deployment` | `Deployment` Required. The deployment resource to create. This corresponds to the `deployment` field on the `request` instance; if `request` is provided, this should not be set. |
| `deployment_id` | `` `str` `` Optional. The ID to use for the deployment resource, which will become the final component of the deployment's resource name. This field is optional. - If provided, the same will be used. The service will throw an error if the specified id is already used by another deployment resource in the API hub. - If not provided, a system generated id will be used. This value should be 4-500 characters, and valid characters are /`a-z][A-Z]`\[0-9\]-_/. This corresponds to the `deployment_id` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.Deployment` | Details of the deployment where APIs are hosted. A deployment could represent an Apigee proxy, API gateway, other Google Cloud services or non-Google Cloud services as well. A deployment entity is a root level entity in the API hub and exists independent of any API. |

### create_external_api

```python
create_external_api(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.CreateExternalApiRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    external_api: typing.Optional[
        google.cloud.apihub_v1.types.common_fields.ExternalApi
    ] = None,
    external_api_id: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.ExternalApi
```
Create an External API resource in the API hub.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_create_external_api():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    external_api = apihub_v1.ExternalApi()
    external_api.display_name = "display_name_value"

    request = apihub_v1.CreateExternalApiRequest(
        parent="parent_value",
        external_api=external_api,
    )

    # Make the request
    response = await client.create_external_api(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.CreateExternalApiRequest, dict]]` The request object. The CreateExternalApi method's request. |
| `parent` | `` `str` `` Required. The parent resource for the External API resource. Format: `projects/{project}/locations/{location}` This corresponds to the `parent` field on the `request` instance; if `request` is provided, this should not be set. |
| `external_api` | `ExternalApi` Required. The External API resource to create. This corresponds to the `external_api` field on the `request` instance; if `request` is provided, this should not be set. |
| `external_api_id` | `` `str` `` Optional. The ID to use for the External API resource, which will become the final component of the External API's resource name. This field is optional. - If provided, the same will be used. The service will throw an error if the specified id is already used by another External API resource in the API hub. - If not provided, a system generated id will be used. This value should be 4-500 characters, and valid characters are /`a-z][A-Z]`\[0-9\]-_/. This corresponds to the `external_api_id` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.ExternalApi` | An external API represents an API being provided by external sources. This can be used to model third-party APIs and can be used to define dependencies. |

### create_spec

```python
create_spec(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.CreateSpecRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    spec: typing.Optional[google.cloud.apihub_v1.types.common_fields.Spec] = None,
    spec_id: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.Spec
```
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
xref_GetSpec method. In
order to access the raw contents for a particular spec, use the
xref_GetSpecContents
method. In order to access the operations parsed from the spec,
use the
xref_ListAPIOperations
method.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_create_spec():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    spec = apihub_v1.Spec()
    spec.display_name = "display_name_value"
    spec.spec_type.enum_values.values.id = "id_value"
    spec.spec_type.enum_values.values.display_name = "display_name_value"

    request = apihub_v1.CreateSpecRequest(
        parent="parent_value",
        spec=spec,
    )

    # Make the request
    response = await client.create_spec(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.CreateSpecRequest, dict]]` The request object. The CreateSpec method's request. |
| `parent` | `` `str` `` Required. The parent resource for Spec. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}` This corresponds to the `parent` field on the `request` instance; if `request` is provided, this should not be set. |
| `spec` | `Spec` Required. The spec to create. This corresponds to the `spec` field on the `request` instance; if `request` is provided, this should not be set. |
| `spec_id` | `` `str` `` Optional. The ID to use for the spec, which will become the final component of the spec's resource name. This field is optional. - If provided, the same will be used. The service will throw an error if the specified id is already used by another spec in the API resource. - If not provided, a system generated id will be used. This value should be 4-500 characters, overall resource name which will be of format `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`, its length is limited to 1000 characters and valid characters are /`a-z][A-Z]`\[0-9\]-_/. This corresponds to the `spec_id` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.Spec` | Represents a spec associated with an API version in the API Hub. Note that specs of various types can be uploaded, however parsing of details is supported for OpenAPI spec currently. |

### create_version

```python
create_version(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.CreateVersionRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    version: typing.Optional[google.cloud.apihub_v1.types.common_fields.Version] = None,
    version_id: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.Version
```
Create an API version for an API resource in the API
hub.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_create_version():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    version = apihub_v1.Version()
    version.display_name = "display_name_value"

    request = apihub_v1.CreateVersionRequest(
        parent="parent_value",
        version=version,
    )

    # Make the request
    response = await client.create_version(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.CreateVersionRequest, dict]]` The request object. The CreateVersion method's request. |
| `parent` | `` `str` `` Required. The parent resource for API version. Format: `projects/{project}/locations/{location}/apis/{api}` This corresponds to the `parent` field on the `request` instance; if `request` is provided, this should not be set. |
| `version` | `Version` Required. The version to create. This corresponds to the `version` field on the `request` instance; if `request` is provided, this should not be set. |
| `version_id` | `` `str` `` Optional. The ID to use for the API version, which will become the final component of the version's resource name. This field is optional. - If provided, the same will be used. The service will throw an error if the specified id is already used by another version in the API resource. - If not provided, a system generated id will be used. This value should be 4-500 characters, overall resource name which will be of format `projects/{project}/locations/{location}/apis/{api}/versions/{version}`, its length is limited to 700 characters and valid characters are /`a-z][A-Z]`\[0-9\]-_/. This corresponds to the `version_id` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.Version` | Represents a version of the API resource in API hub. This is also referred to as the API version. |

### definition_path

```python
definition_path(
    project: str, location: str, api: str, version: str, definition: str
) -> str
```
Returns a fully-qualified definition string.

### delete_api

```python
delete_api(
    request: typing.Optional[
        typing.Union[google.cloud.apihub_v1.types.apihub_service.DeleteApiRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> None
```
Delete an API resource in the API hub. API can only
be deleted if all underlying versions are deleted.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_delete_api():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.DeleteApiRequest(
        name="name_value",
    )

    # Make the request
    await client.delete_api(request=request)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.DeleteApiRequest, dict]]` The request object. The DeleteApi method's request. |
| `name` | `` `str` `` Required. The name of the API resource to delete. Format: `projects/{project}/locations/{location}/apis/{api}` This corresponds to the `name` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

### delete_api_operation

```python
delete_api_operation(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.DeleteApiOperationRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> None
```
Delete an operation in an API version and we can
delete only the operations created via create API. If
the operation was created by parsing the spec, then it
can be deleted by editing or deleting the spec. Deleting
an operation will also remove any links between the
operation and deployments.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_delete_api_operation():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.DeleteApiOperationRequest(
        name="name_value",
    )

    # Make the request
    await client.delete_api_operation(request=request)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.DeleteApiOperationRequest, dict]]` The request object. The DeleteApiOperation method's request. |
| `name` | `` `str` `` Required. The name of the operation resource to delete. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` This corresponds to the `name` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

### delete_attribute

```python
delete_attribute(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.DeleteAttributeRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> None
```
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.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_delete_attribute():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.DeleteAttributeRequest(
        name="name_value",
    )

    # Make the request
    await client.delete_attribute(request=request)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.DeleteAttributeRequest, dict]]` The request object. The DeleteAttribute method's request. |
| `name` | `` `str` `` Required. The name of the attribute to delete. Format: `projects/{project}/locations/{location}/attributes/{attribute}` This corresponds to the `name` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

### delete_deployment

```python
delete_deployment(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.DeleteDeploymentRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> None
```
Deletes a deployment resource in the API hub. A
deployment can only be deleted after its links to any
versions, specs, and API operations have been removed.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_delete_deployment():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.DeleteDeploymentRequest(
        name="name_value",
    )

    # Make the request
    await client.delete_deployment(request=request)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.DeleteDeploymentRequest, dict]]` The request object. The DeleteDeployment method's request. |
| `name` | `` `str` `` Required. The name of the deployment resource to delete. Format: `projects/{project}/locations/{location}/deployments/{deployment}` This corresponds to the `name` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

### delete_external_api

```python
delete_external_api(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.DeleteExternalApiRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> None
```
Delete an External API resource in the API hub.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_delete_external_api():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.DeleteExternalApiRequest(
        name="name_value",
    )

    # Make the request
    await client.delete_external_api(request=request)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.DeleteExternalApiRequest, dict]]` The request object. The DeleteExternalApi method's request. |
| `name` | `` `str` `` Required. The name of the External API resource to delete. Format: `projects/{project}/locations/{location}/externalApis/{externalApi}` This corresponds to the `name` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

### delete_operation

```python
delete_operation(
    request: typing.Optional[
        typing.Union[google.longrunning.operations_pb2.DeleteOperationRequest, dict]
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> None
```
Deletes a long-running operation.

This method indicates that the client is no longer interested
in the operation result. It does not cancel the operation.
If the server doesn't support this method, it returns
`google.rpc.Code.UNIMPLEMENTED`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `` `.operations_pb2.DeleteOperationRequest` `` The request object. Request message for `DeleteOperation` method. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

### delete_spec

```python
delete_spec(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.DeleteSpecRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> None
```
Delete a spec.
Deleting a spec will also delete the associated
operations from the version and remove any links between
the spec and deployments.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_delete_spec():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.DeleteSpecRequest(
        name="name_value",
    )

    # Make the request
    await client.delete_spec(request=request)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.DeleteSpecRequest, dict]]` The request object. The DeleteSpec method's request. |
| `name` | `` `str` `` Required. The name of the spec to delete. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` This corresponds to the `name` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

### delete_version

```python
delete_version(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.DeleteVersionRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> None
```
Delete an API version. Version can only be deleted if
all underlying specs, operations, definitions and linked
deployments are deleted.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_delete_version():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.DeleteVersionRequest(
        name="name_value",
    )

    # Make the request
    await client.delete_version(request=request)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.DeleteVersionRequest, dict]]` The request object. The DeleteVersion method's request. |
| `name` | `` `str` `` Required. The name of the version to delete. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}` This corresponds to the `name` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

### deployment_path

```python
deployment_path(project: str, location: str, deployment: str) -> str
```
Returns a fully-qualified deployment string.

### external_api_path

```python
external_api_path(project: str, location: str, external_api: str) -> str
```
Returns a fully-qualified external_api string.

### fetch_additional_spec_content

```python
fetch_additional_spec_content(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.FetchAdditionalSpecContentRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    spec_content_type: typing.Optional[
        google.cloud.apihub_v1.types.common_fields.SpecContentType
    ] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.apihub_service.FetchAdditionalSpecContentResponse
```
Fetch additional spec content.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_fetch_additional_spec_content():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.FetchAdditionalSpecContentRequest(
        name="name_value",
    )

    # Make the request
    response = await client.fetch_additional_spec_content(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.FetchAdditionalSpecContentRequest, dict]]` The request object. The FetchAdditionalSpecContent method's request. |
| `name` | `` `str` `` Required. The name of the spec whose contents need to be retrieved. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` This corresponds to the `name` field on the `request` instance; if `request` is provided, this should not be set. |
| `spec_content_type` | `SpecContentType` Optional. The type of the spec contents to be retrieved. This corresponds to the `spec_content_type` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.FetchAdditionalSpecContentResponse` | The FetchAdditionalSpecContent method's response. |

### from_service_account_file

```python
from_service_account_file(filename: str, *args, **kwargs)
```
Creates an instance of this client using the provided credentials
file.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `filename` | `str` The path to the service account private key json file. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ApiHubAsyncClient` | The constructed client. |

### from_service_account_info

```python
from_service_account_info(info: dict, *args, **kwargs)
```
Creates an instance of this client using the provided credentials
info.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `info` | `dict` The service account private key info. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ApiHubAsyncClient` | The constructed client. |

### from_service_account_json

```python
from_service_account_json(filename: str, *args, **kwargs)
```
Creates an instance of this client using the provided credentials
file.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `filename` | `str` The path to the service account private key json file. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ApiHubAsyncClient` | The constructed client. |

### get_api

```python
get_api(
    request: typing.Optional[
        typing.Union[google.cloud.apihub_v1.types.apihub_service.GetApiRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.Api
```
Get API resource details including the API versions
contained in it.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_get_api():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.GetApiRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_api(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.GetApiRequest, dict]]` The request object. The GetApi method's request. |
| `name` | `` `str` `` Required. The name of the API resource to retrieve. Format: `projects/{project}/locations/{location}/apis/{api}` This corresponds to the `name` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.Api` | An API resource in the API Hub. |

### get_api_operation

```python
get_api_operation(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.GetApiOperationRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.ApiOperation
```
Get details about a particular operation in API
version.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_get_api_operation():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.GetApiOperationRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_api_operation(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.GetApiOperationRequest, dict]]` The request object. The GetApiOperation method's request. |
| `name` | `` `str` `` Required. The name of the operation to retrieve. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` This corresponds to the `name` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.ApiOperation` | Represents an operation contained in an API version in the API Hub. An operation is added/updated/deleted in an API version when a new spec is added or an existing spec is updated/deleted in a version. Currently, an operation will be created only corresponding to OpenAPI spec as parsing is supported for OpenAPI spec. Alternatively operations can be managed via create,update and delete APIs, creation of apiOperation can be possible only for version with no parsed operations and update/delete can be possible only for operations created via create API. |

### get_attribute

```python
get_attribute(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.GetAttributeRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.Attribute
```
Get details about the attribute.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_get_attribute():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.GetAttributeRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_attribute(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.GetAttributeRequest, dict]]` The request object. The GetAttribute method's request. |
| `name` | `` `str` `` Required. The name of the attribute to retrieve. Format: `projects/{project}/locations/{location}/attributes/{attribute}` This corresponds to the `name` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.Attribute` | An attribute in the API Hub. An attribute is a name value pair which can be attached to different resources in the API hub based on the scope of the attribute. Attributes can either be pre-defined by the API Hub or created by users. |

### get_definition

```python
get_definition(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.GetDefinitionRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.Definition
```
Get details about a definition in an API version.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_get_definition():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.GetDefinitionRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_definition(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.GetDefinitionRequest, dict]]` The request object. The GetDefinition method's request. |
| `name` | `` `str` `` Required. The name of the definition to retrieve. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` This corresponds to the `name` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.Definition` | Represents a definition for example schema, request, response definitions contained in an API version. A definition is added/updated/deleted in an API version when a new spec is added or an existing spec is updated/deleted in a version. Currently, definition will be created only corresponding to OpenAPI spec as parsing is supported for OpenAPI spec. Also, within OpenAPI spec, only schema object is supported. |

### get_deployment

```python
get_deployment(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.GetDeploymentRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.Deployment
```
Get details about a deployment and the API versions
linked to it.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_get_deployment():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.GetDeploymentRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_deployment(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.GetDeploymentRequest, dict]]` The request object. The GetDeployment method's request. |
| `name` | `` `str` `` Required. The name of the deployment resource to retrieve. Format: `projects/{project}/locations/{location}/deployments/{deployment}` This corresponds to the `name` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.Deployment` | Details of the deployment where APIs are hosted. A deployment could represent an Apigee proxy, API gateway, other Google Cloud services or non-Google Cloud services as well. A deployment entity is a root level entity in the API hub and exists independent of any API. |

### get_external_api

```python
get_external_api(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.GetExternalApiRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.ExternalApi
```
Get details about an External API resource in the API
hub.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_get_external_api():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.GetExternalApiRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_external_api(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.GetExternalApiRequest, dict]]` The request object. The GetExternalApi method's request. |
| `name` | `` `str` `` Required. The name of the External API resource to retrieve. Format: `projects/{project}/locations/{location}/externalApis/{externalApi}` This corresponds to the `name` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.ExternalApi` | An external API represents an API being provided by external sources. This can be used to model third-party APIs and can be used to define dependencies. |

### get_location

```python
get_location(
    request: typing.Optional[
        typing.Union[google.cloud.location.locations_pb2.GetLocationRequest, dict]
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.location.locations_pb2.Location
```
Gets information about a location.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `` `.location_pb2.GetLocationRequest` `` The request object. Request message for `GetLocation` method. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `` `.location_pb2.Location` `` | Location object. |

### get_mtls_endpoint_and_cert_source

```python
get_mtls_endpoint_and_cert_source(
    client_options: typing.Optional[
        google.api_core.client_options.ClientOptions
    ] = None,
)
```
Return the API endpoint and client cert source for mutual TLS.

The client cert source is determined in the following order:
(1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the
client cert source is None.
(2) if `client_options.client_cert_source` is provided, use the provided one; if the
default client cert source exists, use the default one; otherwise the client cert
source is None.

The API endpoint is determined in the following order:
(1) if `client_options.api_endpoint` if provided, use the provided one.
(2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the
default mTLS endpoint; if the environment variable is "never", use the default API
endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise
use the default API endpoint.

More details can be found at <https://google.aip.dev/auth/4114>.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `client_options` | `google.api_core.client_options.ClientOptions` Custom options for the client. Only the `api_endpoint` and `client_cert_source` properties may be used in this method. |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `google.auth.exceptions.MutualTLSChannelError` | If any errors happen. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Tuple[str, Callable[[], Tuple[bytes, bytes]]]` | returns the API endpoint and the client cert source to use. |

### get_operation

```python
get_operation(
    request: typing.Optional[
        typing.Union[google.longrunning.operations_pb2.GetOperationRequest, dict]
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.longrunning.operations_pb2.Operation
```
Gets the latest state of a long-running operation.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `` `.operations_pb2.GetOperationRequest` `` The request object. Request message for `GetOperation` method. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `` `.operations_pb2.Operation` `` | An `Operation` object. |

### get_spec

```python
get_spec(
    request: typing.Optional[
        typing.Union[google.cloud.apihub_v1.types.apihub_service.GetSpecRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.Spec
```
Get details about the information parsed from a spec. Note that
this method does not return the raw spec contents. Use
xref_GetSpecContents
method to retrieve the same.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_get_spec():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.GetSpecRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_spec(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.GetSpecRequest, dict]]` The request object. The GetSpec method's request. |
| `name` | `` `str` `` Required. The name of the spec to retrieve. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` This corresponds to the `name` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.Spec` | Represents a spec associated with an API version in the API Hub. Note that specs of various types can be uploaded, however parsing of details is supported for OpenAPI spec currently. |

### get_spec_contents

```python
get_spec_contents(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.GetSpecContentsRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.SpecContents
```
Get spec contents.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_get_spec_contents():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.GetSpecContentsRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_spec_contents(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.GetSpecContentsRequest, dict]]` The request object. The GetSpecContents method's request. |
| `name` | `` `str` `` Required. The name of the spec whose contents need to be retrieved. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` This corresponds to the `name` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.SpecContents` | The spec contents. |

### get_transport_class

```python
get_transport_class(
    label: typing.Optional[str] = None,
) -> typing.Type[
    google.cloud.apihub_v1.services.api_hub.transports.base.ApiHubTransport
]
```
Returns an appropriate transport class.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `label` | `typing.Optional[str]` The name of the desired transport. If none is provided, then the first transport in the registry is used. |

### get_version

```python
get_version(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.GetVersionRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.Version
```
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.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_get_version():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.GetVersionRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_version(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.GetVersionRequest, dict]]` The request object. The GetVersion method's request. |
| `name` | `` `str` `` Required. The name of the API version to retrieve. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}` This corresponds to the `name` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.Version` | Represents a version of the API resource in API hub. This is also referred to as the API version. |

### list_api_operations

```python
list_api_operations(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.ListApiOperationsRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.services.api_hub.pagers.ListApiOperationsAsyncPager
```
List operations in an API version.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_list_api_operations():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.ListApiOperationsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_api_operations(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.ListApiOperationsRequest, dict]]` The request object. The ListApiOperations method's request. |
| `parent` | `` `str` `` Required. The parent which owns this collection of operations i.e., the API version. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}` This corresponds to the `parent` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.services.api_hub.pagers.ListApiOperationsAsyncPager` | The ListApiOperations method's response. Iterating over this object will yield results and resolve additional pages automatically. |

### list_apis

```python
list_apis(
    request: typing.Optional[
        typing.Union[google.cloud.apihub_v1.types.apihub_service.ListApisRequest, dict]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.services.api_hub.pagers.ListApisAsyncPager
```
List API resources in the API hub.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_list_apis():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.ListApisRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_apis(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.ListApisRequest, dict]]` The request object. The ListApis method's request. |
| `parent` | `` `str` `` Required. The parent, which owns this collection of API resources. Format: `projects/{project}/locations/{location}` This corresponds to the `parent` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.services.api_hub.pagers.ListApisAsyncPager` | The ListApis method's response. Iterating over this object will yield results and resolve additional pages automatically. |

### list_attributes

```python
list_attributes(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.ListAttributesRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.services.api_hub.pagers.ListAttributesAsyncPager
```
List all attributes.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_list_attributes():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.ListAttributesRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_attributes(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.ListAttributesRequest, dict]]` The request object. The ListAttributes method's request. |
| `parent` | `` `str` `` Required. The parent resource for Attribute. Format: `projects/{project}/locations/{location}` This corresponds to the `parent` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.services.api_hub.pagers.ListAttributesAsyncPager` | The ListAttributes method's response. Iterating over this object will yield results and resolve additional pages automatically. |

### list_deployments

```python
list_deployments(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.ListDeploymentsRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.services.api_hub.pagers.ListDeploymentsAsyncPager
```
List deployment resources in the API hub.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_list_deployments():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.ListDeploymentsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_deployments(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.ListDeploymentsRequest, dict]]` The request object. The ListDeployments method's request. |
| `parent` | `` `str` `` Required. The parent, which owns this collection of deployment resources. Format: `projects/{project}/locations/{location}` This corresponds to the `parent` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.services.api_hub.pagers.ListDeploymentsAsyncPager` | The ListDeployments method's response. Iterating over this object will yield results and resolve additional pages automatically. |

### list_external_apis

```python
list_external_apis(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.ListExternalApisRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.services.api_hub.pagers.ListExternalApisAsyncPager
```
List External API resources in the API hub.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_list_external_apis():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.ListExternalApisRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_external_apis(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.ListExternalApisRequest, dict]]` The request object. The ListExternalApis method's request. |
| `parent` | `` `str` `` Required. The parent, which owns this collection of External API resources. Format: `projects/{project}/locations/{location}` This corresponds to the `parent` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.services.api_hub.pagers.ListExternalApisAsyncPager` | The ListExternalApis method's response. Iterating over this object will yield results and resolve additional pages automatically. |

### list_locations

```python
list_locations(
    request: typing.Optional[
        typing.Union[google.cloud.location.locations_pb2.ListLocationsRequest, dict]
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.location.locations_pb2.ListLocationsResponse
```
Lists information about the supported locations for this service.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `` `.location_pb2.ListLocationsRequest` `` The request object. Request message for `ListLocations` method. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `` `.location_pb2.ListLocationsResponse` `` | Response message for `ListLocations` method. |

### list_operations

```python
list_operations(
    request: typing.Optional[
        typing.Union[google.longrunning.operations_pb2.ListOperationsRequest, dict]
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.longrunning.operations_pb2.ListOperationsResponse
```
Lists operations that match the specified filter in the request.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `` `.operations_pb2.ListOperationsRequest` `` The request object. Request message for `ListOperations` method. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `` `.operations_pb2.ListOperationsResponse` `` | Response message for `ListOperations` method. |

### list_specs

```python
list_specs(
    request: typing.Optional[
        typing.Union[google.cloud.apihub_v1.types.apihub_service.ListSpecsRequest, dict]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.services.api_hub.pagers.ListSpecsAsyncPager
```
List specs corresponding to a particular API
resource.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_list_specs():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.ListSpecsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_specs(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.ListSpecsRequest, dict]]` The request object. The `ListSpecs][ListSpecs]` method's request. |
| `parent` | `` `str` `` Required. The parent, which owns this collection of specs. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}` This corresponds to the `parent` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.services.api_hub.pagers.ListSpecsAsyncPager` | The ListSpecs method's response. Iterating over this object will yield results and resolve additional pages automatically. |

### list_versions

```python
list_versions(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.ListVersionsRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.services.api_hub.pagers.ListVersionsAsyncPager
```
List API versions of an API resource in the API hub.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_list_versions():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.ListVersionsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_versions(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.ListVersionsRequest, dict]]` The request object. The ListVersions method's request. |
| `parent` | `` `str` `` Required. The parent which owns this collection of API versions i.e., the API resource Format: `projects/{project}/locations/{location}/apis/{api}` This corresponds to the `parent` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.services.api_hub.pagers.ListVersionsAsyncPager` | The ListVersions method's response. Iterating over this object will yield results and resolve additional pages automatically. |

### parse_api_operation_path

```python
parse_api_operation_path(path: str) -> typing.Dict[str, str]
```
Parses a api_operation path into its component segments.

### parse_api_path

```python
parse_api_path(path: str) -> typing.Dict[str, str]
```
Parses a api path into its component segments.

### parse_attribute_path

```python
parse_attribute_path(path: str) -> typing.Dict[str, str]
```
Parses a attribute path into its component segments.

### parse_common_billing_account_path

```python
parse_common_billing_account_path(path: str) -> typing.Dict[str, str]
```
Parse a billing_account path into its component segments.

### parse_common_folder_path

```python
parse_common_folder_path(path: str) -> typing.Dict[str, str]
```
Parse a folder path into its component segments.

### parse_common_location_path

```python
parse_common_location_path(path: str) -> typing.Dict[str, str]
```
Parse a location path into its component segments.

### parse_common_organization_path

```python
parse_common_organization_path(path: str) -> typing.Dict[str, str]
```
Parse a organization path into its component segments.

### parse_common_project_path

```python
parse_common_project_path(path: str) -> typing.Dict[str, str]
```
Parse a project path into its component segments.

### parse_definition_path

```python
parse_definition_path(path: str) -> typing.Dict[str, str]
```
Parses a definition path into its component segments.

### parse_deployment_path

```python
parse_deployment_path(path: str) -> typing.Dict[str, str]
```
Parses a deployment path into its component segments.

### parse_external_api_path

```python
parse_external_api_path(path: str) -> typing.Dict[str, str]
```
Parses a external_api path into its component segments.

### parse_plugin_instance_path

```python
parse_plugin_instance_path(path: str) -> typing.Dict[str, str]
```
Parses a plugin_instance path into its component segments.

### parse_spec_path

```python
parse_spec_path(path: str) -> typing.Dict[str, str]
```
Parses a spec path into its component segments.

### parse_version_path

```python
parse_version_path(path: str) -> typing.Dict[str, str]
```
Parses a version path into its component segments.

### plugin_instance_path

```python
plugin_instance_path(
    project: str, location: str, plugin: str, instance: str
) -> str
```
Returns a fully-qualified plugin_instance string.

### retrieve_api_views

```python
retrieve_api_views(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.RetrieveApiViewsRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    view: typing.Optional[
        google.cloud.apihub_v1.types.apihub_service.ApiViewType
    ] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.services.api_hub.pagers.RetrieveApiViewsAsyncPager
```
Retrieve API views.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_retrieve_api_views():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.RetrieveApiViewsRequest(
        parent="parent_value",
        view="MCP_TOOL",
    )

    # Make the request
    page_result = client.retrieve_api_views(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.RetrieveApiViewsRequest, dict]]` The request object. The RetrieveApiViews method's request. |
| `parent` | `` `str` `` Required. The parent resource name. Format: `projects/{project}/locations/{location}`. This corresponds to the `parent` field on the `request` instance; if `request` is provided, this should not be set. |
| `view` | `ApiViewType` Required. The view type to return. This corresponds to the `view` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.services.api_hub.pagers.RetrieveApiViewsAsyncPager` | The RetrieveApiViews method's response. Iterating over this object will yield results and resolve additional pages automatically. |

### search_resources

```python
search_resources(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.SearchResourcesRequest, dict
        ]
    ] = None,
    *,
    location: typing.Optional[str] = None,
    query: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.services.api_hub.pagers.SearchResourcesAsyncPager
```
Search across API-Hub resources.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_search_resources():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.SearchResourcesRequest(
        location="location_value",
        query="query_value",
    )

    # Make the request
    page_result = client.search_resources(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.SearchResourcesRequest, dict]]` The request object. The SearchResources method's request. |
| `location` | `` `str` `` Required. The resource name of the location which will be of the type `projects/{project_id}/locations/{location_id}`. This field is used to identify the instance of API-Hub in which resources should be searched. This corresponds to the `location` field on the `request` instance; if `request` is provided, this should not be set. |
| `query` | `` `str` `` Required. The free text search query. This query can contain keywords which could be related to any detail of the API-Hub resources such display names, descriptions, attributes etc. This corresponds to the `query` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.services.api_hub.pagers.SearchResourcesAsyncPager` | Response for the SearchResources method. Iterating over this object will yield results and resolve additional pages automatically. |

### spec_path

```python
spec_path(project: str, location: str, api: str, version: str, spec: str) -> str
```
Returns a fully-qualified spec string.

### update_api

```python
update_api(
    request: typing.Optional[
        typing.Union[google.cloud.apihub_v1.types.apihub_service.UpdateApiRequest, dict]
    ] = None,
    *,
    api: typing.Optional[google.cloud.apihub_v1.types.common_fields.Api] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.Api
```
Update an API resource in the API hub. The following fields in
the xref_API can be updated:

- xref_display_name
- xref_description
- xref_owner
- xref_documentation
- xref_target_user
- xref_team
- xref_business_unit
- xref_maturity_level
- xref_api_style
- xref_attributes
- xref_fingerprint

The
xref_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.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_update_api():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    api = apihub_v1.Api()
    api.display_name = "display_name_value"

    request = apihub_v1.UpdateApiRequest(
        api=api,
    )

    # Make the request
    response = await client.update_api(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.UpdateApiRequest, dict]]` The request object. The UpdateApi method's request. |
| `api` | `Api` Required. The API resource to update. The API resource's `name` field is used to identify the API resource to update. Format: `projects/{project}/locations/{location}/apis/{api}` This corresponds to the `api` field on the `request` instance; if `request` is provided, this should not be set. |
| `update_mask` | `` `google.protobuf.field_mask_pb2.FieldMask` `` Required. The list of fields to update. This corresponds to the `update_mask` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.Api` | An API resource in the API Hub. |

### update_api_operation

```python
update_api_operation(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.UpdateApiOperationRequest, dict
        ]
    ] = None,
    *,
    api_operation: typing.Optional[
        google.cloud.apihub_v1.types.common_fields.ApiOperation
    ] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.ApiOperation
```
Update an operation in an API version. The following fields in
the xref_ApiOperation resource
can be updated:

- `details.description][ApiOperation.details.description]`
- `details.documentation][ApiOperation.details.documentation]`
- `details.http_operation.path][ApiOperation.details.http_operation.path.path]`
- `details.http_operation.method][ApiOperation.details.http_operation.method]`
- `details.deprecated][ApiOperation.details.deprecated]`
- xref_attributes
- `details.mcp_tool.title][ApiOperation.details.mcp_tool.title]`
- `details.mcp_tool.description][ApiOperation.details.mcp_tool.description]`
- `details.mcp_tool.input_schema][ApiOperation.details.mcp_tool.input_schema]`
- `details.mcp_tool.output_schema][ApiOperation.details.mcp_tool.output_schema]`
- `details.input_schema][ApiOperation.details.input_schema]`
- `details.output_schema][ApiOperation.details.output_schema]`
- `details.mcp_tool.annotations.title][ApiOperation.details.mcp_tool.annotations.title]`
- `details.mcp_tool.annotations.read_only_hint][ApiOperation.details.mcp_tool.annotations.read_only_hint]`
- `details.mcp_tool.annotations.destructive_hint][ApiOperation.details.mcp_tool.annotations.destructive_hint]`
- `details.mcp_tool.annotations.idempotent_hint][ApiOperation.details.mcp_tool.annotations.idempotent_hint]`
- `details.mcp_tool.annotations.open_world_hint][ApiOperation.details.mcp_tool.annotations.open_world_hint]`
- `details.mcp_tool.annotations.additional_hints][ApiOperation.details.mcp_tool.annotations.additional_hints]`

The
xref_update_mask
should be used to specify the fields being updated.

An operation can be updated only if the operation was created
via
xref_CreateApiOperation
API. If the operation was created by parsing the spec, then it
can be edited by updating the spec.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_update_api_operation():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    request = apihub_v1.UpdateApiOperationRequest(
    )

    # Make the request
    response = await client.update_api_operation(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.UpdateApiOperationRequest, dict]]` The request object. The UpdateApiOperation method's request. |
| `api_operation` | `ApiOperation` Required. The apiOperation resource to update. The operation resource's `name` field is used to identify the operation resource to update. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` This corresponds to the `api_operation` field on the `request` instance; if `request` is provided, this should not be set. |
| `update_mask` | `` `google.protobuf.field_mask_pb2.FieldMask` `` Required. The list of fields to update. This corresponds to the `update_mask` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.ApiOperation` | Represents an operation contained in an API version in the API Hub. An operation is added/updated/deleted in an API version when a new spec is added or an existing spec is updated/deleted in a version. Currently, an operation will be created only corresponding to OpenAPI spec as parsing is supported for OpenAPI spec. Alternatively operations can be managed via create,update and delete APIs, creation of apiOperation can be possible only for version with no parsed operations and update/delete can be possible only for operations created via create API. |

### update_attribute

```python
update_attribute(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.UpdateAttributeRequest, dict
        ]
    ] = None,
    *,
    attribute: typing.Optional[
        google.cloud.apihub_v1.types.common_fields.Attribute
    ] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.Attribute
```
Update the attribute. The following fields in the \[Attribute
resource\]\[google.cloud.apihub.v1.Attribute\] can be updated:

- xref_display_name The display name can be updated for user defined attributes only.
- xref_description The description can be updated for user defined attributes only.
- xref_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.
- xref_cardinality The cardinality can be updated for user defined attributes only. Cardinality can only be increased during an update.

The
xref_update_mask
should be used to specify the fields being updated.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_update_attribute():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    attribute = apihub_v1.Attribute()
    attribute.display_name = "display_name_value"
    attribute.scope = "PLUGIN"
    attribute.data_type = "URI"

    request = apihub_v1.UpdateAttributeRequest(
        attribute=attribute,
    )

    # Make the request
    response = await client.update_attribute(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.UpdateAttributeRequest, dict]]` The request object. The UpdateAttribute method's request. |
| `attribute` | `Attribute` Required. The attribute to update. The attribute's `name` field is used to identify the attribute to update. Format: `projects/{project}/locations/{location}/attributes/{attribute}` This corresponds to the `attribute` field on the `request` instance; if `request` is provided, this should not be set. |
| `update_mask` | `` `google.protobuf.field_mask_pb2.FieldMask` `` Required. The list of fields to update. This corresponds to the `update_mask` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.Attribute` | An attribute in the API Hub. An attribute is a name value pair which can be attached to different resources in the API hub based on the scope of the attribute. Attributes can either be pre-defined by the API Hub or created by users. |

### update_deployment

```python
update_deployment(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.UpdateDeploymentRequest, dict
        ]
    ] = None,
    *,
    deployment: typing.Optional[
        google.cloud.apihub_v1.types.common_fields.Deployment
    ] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.Deployment
```
Update a deployment resource in the API hub. The following
fields in the \[deployment
resource\]\[google.cloud.apihub.v1.Deployment\] can be updated:

- xref_display_name
- xref_description
- xref_documentation
- xref_deployment_type
- xref_resource_uri
- xref_endpoints
- xref_slo
- xref_environment
- xref_attributes
- \[source_project\] \[google.cloud.apihub.v1.Deployment.source_project\]
- \[source_environment\] \[google.cloud.apihub.v1.Deployment.source_environment\]
- xref_management_url
- xref_source_uri The xref_update_mask should be used to specify the fields being updated.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_update_deployment():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    deployment = apihub_v1.Deployment()
    deployment.display_name = "display_name_value"
    deployment.deployment_type.enum_values.values.id = "id_value"
    deployment.deployment_type.enum_values.values.display_name = "display_name_value"
    deployment.resource_uri = "resource_uri_value"
    deployment.endpoints = ['endpoints_value1', 'endpoints_value2']

    request = apihub_v1.UpdateDeploymentRequest(
        deployment=deployment,
    )

    # Make the request
    response = await client.update_deployment(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.UpdateDeploymentRequest, dict]]` The request object. The UpdateDeployment method's request. |
| `deployment` | `Deployment` Required. The deployment resource to update. The deployment resource's `name` field is used to identify the deployment resource to update. Format: `projects/{project}/locations/{location}/deployments/{deployment}` This corresponds to the `deployment` field on the `request` instance; if `request` is provided, this should not be set. |
| `update_mask` | `` `google.protobuf.field_mask_pb2.FieldMask` `` Required. The list of fields to update. This corresponds to the `update_mask` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.Deployment` | Details of the deployment where APIs are hosted. A deployment could represent an Apigee proxy, API gateway, other Google Cloud services or non-Google Cloud services as well. A deployment entity is a root level entity in the API hub and exists independent of any API. |

### update_external_api

```python
update_external_api(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.UpdateExternalApiRequest, dict
        ]
    ] = None,
    *,
    external_api: typing.Optional[
        google.cloud.apihub_v1.types.common_fields.ExternalApi
    ] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.ExternalApi
```
Update an External API resource in the API hub. The following
fields can be updated:

- xref_display_name
- xref_description
- xref_documentation
- xref_endpoints
- xref_paths

The
xref_update_mask
should be used to specify the fields being updated.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_update_external_api():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    external_api = apihub_v1.ExternalApi()
    external_api.display_name = "display_name_value"

    request = apihub_v1.UpdateExternalApiRequest(
        external_api=external_api,
    )

    # Make the request
    response = await client.update_external_api(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.UpdateExternalApiRequest, dict]]` The request object. The UpdateExternalApi method's request. |
| `external_api` | `ExternalApi` Required. The External API resource to update. The External API resource's `name` field is used to identify the External API resource to update. Format: `projects/{project}/locations/{location}/externalApis/{externalApi}` This corresponds to the `external_api` field on the `request` instance; if `request` is provided, this should not be set. |
| `update_mask` | `` `google.protobuf.field_mask_pb2.FieldMask` `` Required. The list of fields to update. This corresponds to the `update_mask` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.ExternalApi` | An external API represents an API being provided by external sources. This can be used to model third-party APIs and can be used to define dependencies. |

### update_spec

```python
update_spec(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.UpdateSpecRequest, dict
        ]
    ] = None,
    *,
    spec: typing.Optional[google.cloud.apihub_v1.types.common_fields.Spec] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.Spec
```
Update spec. The following fields in the
xref_spec can be updated:

- xref_display_name
- xref_source_uri
- xref_lint_response
- xref_attributes
- xref_contents
- xref_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
xref_update_mask
should be used to specify the fields being updated.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_update_spec():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    spec = apihub_v1.Spec()
    spec.display_name = "display_name_value"
    spec.spec_type.enum_values.values.id = "id_value"
    spec.spec_type.enum_values.values.display_name = "display_name_value"

    request = apihub_v1.UpdateSpecRequest(
        spec=spec,
    )

    # Make the request
    response = await client.update_spec(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.UpdateSpecRequest, dict]]` The request object. The UpdateSpec method's request. |
| `spec` | `Spec` Required. The spec to update. The spec's `name` field is used to identify the spec to update. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` This corresponds to the `spec` field on the `request` instance; if `request` is provided, this should not be set. |
| `update_mask` | `` `google.protobuf.field_mask_pb2.FieldMask` `` Required. The list of fields to update. This corresponds to the `update_mask` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.Spec` | Represents a spec associated with an API version in the API Hub. Note that specs of various types can be uploaded, however parsing of details is supported for OpenAPI spec currently. |

### update_version

```python
update_version(
    request: typing.Optional[
        typing.Union[
            google.cloud.apihub_v1.types.apihub_service.UpdateVersionRequest, dict
        ]
    ] = None,
    *,
    version: typing.Optional[google.cloud.apihub_v1.types.common_fields.Version] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.apihub_v1.types.common_fields.Version
```
Update API version. The following fields in the
xref_version can be updated
currently:

- xref_display_name
- xref_description
- xref_documentation
- xref_deployments
- xref_lifecycle
- xref_compliance
- xref_accreditation
- xref_attributes

The
xref_update_mask
should be used to specify the fields being updated.

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import apihub_v1

async def sample_update_version():
    # Create a client
    client = apihub_v1.ApiHubAsyncClient()

    # Initialize request argument(s)
    version = apihub_v1.Version()
    version.display_name = "display_name_value"

    request = apihub_v1.UpdateVersionRequest(
        version=version,
    )

    # Make the request
    response = await client.update_version(request=request)

    # Handle the response
    print(response)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `Optional[Union[google.cloud.apihub_v1.types.UpdateVersionRequest, dict]]` The request object. The UpdateVersion method's request. |
| `version` | `Version` Required. The API version to update. The version's `name` field is used to identify the API version to update. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}` This corresponds to the `version` field on the `request` instance; if `request` is provided, this should not be set. |
| `update_mask` | `` `google.protobuf.field_mask_pb2.FieldMask` `` Required. The list of fields to update. This corresponds to the `update_mask` field on the `request` instance; if `request` is provided, this should not be set. |
| `retry` | `google.api_core.retry_async.AsyncRetry` Designation of what errors, if any, should be retried. |
| `timeout` | `float` The timeout for this request. |
| `metadata` | `Sequence[Tuple[str, Union[str, bytes]]]` Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `google.cloud.apihub_v1.types.Version` | Represents a version of the API resource in API hub. This is also referred to as the API version. |

### version_path

```python
version_path(project: str, location: str, api: str, version: str) -> str
```
Returns a fully-qualified version string.