Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.1.18" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.1.18" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
from .services.feed_service import FeedServiceAsyncClient, FeedServiceClient
from .types.actor import Actor
from .types.attachment import Attachment
from .types.attachment_service import ListAttachmentsRequest, ListAttachmentsResponse
from .types.attachment_service import (
GetAttachmentRequest,
ListAttachmentsRequest,
ListAttachmentsResponse,
)
from .types.case import Case, CaseClassification, Product, ProductLine
from .types.case_service import (
CloseCaseRequest,
Expand All @@ -45,6 +49,7 @@
from .types.comment import Comment
from .types.comment_service import (
CreateCommentRequest,
GetCommentRequest,
ListCommentsRequest,
ListCommentsResponse,
)
Expand Down Expand Up @@ -75,7 +80,9 @@
"Escalation",
"FeedItem",
"FeedServiceClient",
"GetAttachmentRequest",
"GetCaseRequest",
"GetCommentRequest",
"ListAttachmentsRequest",
"ListAttachmentsResponse",
"ListCasesRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
"grpc": {
"libraryClient": "CaseAttachmentServiceClient",
"rpcs": {
"GetAttachment": {
"methods": [
"get_attachment"
]
},
"ListAttachments": {
"methods": [
"list_attachments"
Expand All @@ -20,6 +25,11 @@
"grpc-async": {
"libraryClient": "CaseAttachmentServiceAsyncClient",
"rpcs": {
"GetAttachment": {
"methods": [
"get_attachment"
]
},
"ListAttachments": {
"methods": [
"list_attachments"
Expand All @@ -30,6 +40,11 @@
"rest": {
"libraryClient": "CaseAttachmentServiceClient",
"rpcs": {
"GetAttachment": {
"methods": [
"get_attachment"
]
},
"ListAttachments": {
"methods": [
"list_attachments"
Expand Down Expand Up @@ -188,6 +203,11 @@
"create_comment"
]
},
"GetComment": {
"methods": [
"get_comment"
]
},
"ListComments": {
"methods": [
"list_comments"
Expand All @@ -203,6 +223,11 @@
"create_comment"
]
},
"GetComment": {
"methods": [
"get_comment"
]
},
"ListComments": {
"methods": [
"list_comments"
Expand All @@ -218,6 +243,11 @@
"create_comment"
]
},
"GetComment": {
"methods": [
"get_comment"
]
},
"ListComments": {
"methods": [
"list_comments"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.1.18" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore

from google.protobuf import timestamp_pb2 # type: ignore

from google.cloud.support_v2beta.services.case_attachment_service import pagers
from google.cloud.support_v2beta.types import attachment, attachment_service
from google.cloud.support_v2beta.types import actor, attachment, attachment_service

from .client import CaseAttachmentServiceClient
from .transports.base import DEFAULT_CLIENT_INFO, CaseAttachmentServiceTransport
Expand Down Expand Up @@ -428,6 +430,123 @@ async def sample_list_attachments():
# Done; return the response.
return response

async def get_attachment(
self,
request: Optional[Union[attachment_service.GetAttachmentRequest, dict]] = None,
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> attachment.Attachment:
r"""Retrieve an attachment.

.. code-block:: 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 support_v2beta

async def sample_get_attachment():
# Create a client
client = support_v2beta.CaseAttachmentServiceAsyncClient()

# Initialize request argument(s)
request = support_v2beta.GetAttachmentRequest(
name="name_value",
)

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

# Handle the response
print(response)

Args:
request (Optional[Union[google.cloud.support_v2beta.types.GetAttachmentRequest, dict]]):
The request object. Request for getting an attachment.
name (:class:`str`):
Required. The name of the attachment
to get.

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:
google.cloud.support_v2beta.types.Attachment:
An Attachment contains metadata about a file that was uploaded to a
case - it is NOT a file itself. That being said, the
name of an Attachment object can be used to download
its accompanying file through the media.download
endpoint.

While attachments can be uploaded in the console at
the same time as a comment, they're associated on a
"case" level, not a "comment" level.

"""
# Create or coerce a protobuf request object.
# - Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
flattened_params = [name]
has_flattened_params = (
len([param for param in flattened_params if param is not None]) > 0
)
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)

# - Use the request object if provided (there's no risk of modifying the input as
# there are no flattened fields), or create one.
if not isinstance(request, attachment_service.GetAttachmentRequest):
request = attachment_service.GetAttachmentRequest(request)

# If we have keyword arguments corresponding to fields on the
# request, apply these.
if name is not None:
request.name = name

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._client._transport._wrapped_methods[
self._client._transport.get_attachment
]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
)

# Validate the universe domain.
self._client._validate_universe_domain()

# Send the request.
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response

async def __aenter__(self) -> "CaseAttachmentServiceAsyncClient":
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@

_LOGGER = std_logging.getLogger(__name__)

from google.protobuf import timestamp_pb2 # type: ignore

from google.cloud.support_v2beta.services.case_attachment_service import pagers
from google.cloud.support_v2beta.types import attachment, attachment_service
from google.cloud.support_v2beta.types import actor, attachment, attachment_service

from .transports.base import DEFAULT_CLIENT_INFO, CaseAttachmentServiceTransport
from .transports.grpc import CaseAttachmentServiceGrpcTransport
Expand Down Expand Up @@ -862,6 +864,120 @@ def sample_list_attachments():
# Done; return the response.
return response

def get_attachment(
self,
request: Optional[Union[attachment_service.GetAttachmentRequest, dict]] = None,
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> attachment.Attachment:
r"""Retrieve an attachment.

.. code-block:: 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 support_v2beta

def sample_get_attachment():
# Create a client
client = support_v2beta.CaseAttachmentServiceClient()

# Initialize request argument(s)
request = support_v2beta.GetAttachmentRequest(
name="name_value",
)

# Make the request
response = client.get_attachment(request=request)

# Handle the response
print(response)

Args:
request (Union[google.cloud.support_v2beta.types.GetAttachmentRequest, dict]):
The request object. Request for getting an attachment.
name (str):
Required. The name of the attachment
to get.

This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): 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:
google.cloud.support_v2beta.types.Attachment:
An Attachment contains metadata about a file that was uploaded to a
case - it is NOT a file itself. That being said, the
name of an Attachment object can be used to download
its accompanying file through the media.download
endpoint.

While attachments can be uploaded in the console at
the same time as a comment, they're associated on a
"case" level, not a "comment" level.

"""
# Create or coerce a protobuf request object.
# - Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
flattened_params = [name]
has_flattened_params = (
len([param for param in flattened_params if param is not None]) > 0
)
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)

# - Use the request object if provided (there's no risk of modifying the input as
# there are no flattened fields), or create one.
if not isinstance(request, attachment_service.GetAttachmentRequest):
request = attachment_service.GetAttachmentRequest(request)
# If we have keyword arguments corresponding to fields on the
# request, apply these.
if name is not None:
request.name = name

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.get_attachment]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
)

# Validate the universe domain.
self._validate_universe_domain()

# Send the request.
response = rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response

def __enter__(self) -> "CaseAttachmentServiceClient":
return self

Expand Down
Loading
Loading