Skip to content

Commit e727cc0

Browse files
feat: [google-cloud-gdchardwaremanagement] add an order type field to distinguish a fulfillment request from a sales inquiry (googleapis#13090)
BEGIN_COMMIT_OVERRIDE feat: add an order type field to distinguish a fulfillment request from a sales inquiry feat: add support to mark comments as read or unread feat: rename zone state signal READY_FOR_SITE_TURNUP to FACTORY_TURNUP_CHECKS_PASSED docs: clarify how access_times are used END_COMMIT_OVERRIDE - [ ] Regenerate this pull request now. feat: add support to mark comments as read or unread feat: rename zone state signal READY_FOR_SITE_TURNUP to FACTORY_TURNUP_CHECKS_PASSED docs: clarify how access_times are used PiperOrigin-RevId: 675275984 Source-Link: googleapis/googleapis@fde103c Source-Link: https://github.com/googleapis/googleapis-gen/commit/a58cb7449fccaa7e9c76bd5a137e79aefa45ede7 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWdkY2hhcmR3YXJlbWFuYWdlbWVudC8uT3dsQm90LnlhbWwiLCJoIjoiYTU4Y2I3NDQ5ZmNjYWE3ZTljNzZiZDVhMTM3ZTc5YWVmYTQ1ZWRlNyJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: ohmayr <omairnaveed@ymail.com>
1 parent d6238e4 commit e727cc0

17 files changed

Lines changed: 5851 additions & 4098 deletions

packages/google-cloud-gdchardwaremanagement/google/cloud/gdchardwaremanagement/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
Comment,
3030
Contact,
3131
Dimensions,
32+
Entity,
3233
Hardware,
3334
HardwareConfig,
3435
HardwareGroup,
@@ -44,6 +45,7 @@
4445
SkuConfig,
4546
SkuInstance,
4647
Subnet,
48+
SubscriptionConfig,
4749
TimePeriod,
4850
Zone,
4951
ZoneNetworkConfig,
@@ -84,6 +86,7 @@
8486
ListZonesRequest,
8587
ListZonesResponse,
8688
OperationMetadata,
89+
RecordActionOnCommentRequest,
8790
SignalZoneStateRequest,
8891
SubmitOrderRequest,
8992
UpdateHardwareGroupRequest,
@@ -114,9 +117,11 @@
114117
"SkuConfig",
115118
"SkuInstance",
116119
"Subnet",
120+
"SubscriptionConfig",
117121
"TimePeriod",
118122
"Zone",
119123
"ZoneNetworkConfig",
124+
"Entity",
120125
"PowerSupply",
121126
"CreateCommentRequest",
122127
"CreateHardwareGroupRequest",
@@ -153,6 +158,7 @@
153158
"ListZonesRequest",
154159
"ListZonesResponse",
155160
"OperationMetadata",
161+
"RecordActionOnCommentRequest",
156162
"SignalZoneStateRequest",
157163
"SubmitOrderRequest",
158164
"UpdateHardwareGroupRequest",

packages/google-cloud-gdchardwaremanagement/google/cloud/gdchardwaremanagement_v1alpha/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
Comment,
2828
Contact,
2929
Dimensions,
30+
Entity,
3031
Hardware,
3132
HardwareConfig,
3233
HardwareGroup,
@@ -42,6 +43,7 @@
4243
SkuConfig,
4344
SkuInstance,
4445
Subnet,
46+
SubscriptionConfig,
4547
TimePeriod,
4648
Zone,
4749
ZoneNetworkConfig,
@@ -82,6 +84,7 @@
8284
ListZonesRequest,
8385
ListZonesResponse,
8486
OperationMetadata,
87+
RecordActionOnCommentRequest,
8588
SignalZoneStateRequest,
8689
SubmitOrderRequest,
8790
UpdateHardwareGroupRequest,
@@ -107,6 +110,7 @@
107110
"DeleteOrderRequest",
108111
"DeleteZoneRequest",
109112
"Dimensions",
113+
"Entity",
110114
"GDCHardwareManagementClient",
111115
"GetChangeLogEntryRequest",
112116
"GetCommentRequest",
@@ -143,13 +147,15 @@
143147
"OrganizationContact",
144148
"PowerSupply",
145149
"RackSpace",
150+
"RecordActionOnCommentRequest",
146151
"SignalZoneStateRequest",
147152
"Site",
148153
"Sku",
149154
"SkuConfig",
150155
"SkuInstance",
151156
"SubmitOrderRequest",
152157
"Subnet",
158+
"SubscriptionConfig",
153159
"TimePeriod",
154160
"UpdateHardwareGroupRequest",
155161
"UpdateHardwareRequest",

packages/google-cloud-gdchardwaremanagement/google/cloud/gdchardwaremanagement_v1alpha/gapic_metadata.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@
140140
"list_zones"
141141
]
142142
},
143+
"RecordActionOnComment": {
144+
"methods": [
145+
"record_action_on_comment"
146+
]
147+
},
143148
"SignalZoneState": {
144149
"methods": [
145150
"signal_zone_state"
@@ -310,6 +315,11 @@
310315
"list_zones"
311316
]
312317
},
318+
"RecordActionOnComment": {
319+
"methods": [
320+
"record_action_on_comment"
321+
]
322+
},
313323
"SignalZoneState": {
314324
"methods": [
315325
"signal_zone_state"
@@ -480,6 +490,11 @@
480490
"list_zones"
481491
]
482492
},
493+
"RecordActionOnComment": {
494+
"methods": [
495+
"record_action_on_comment"
496+
]
497+
},
483498
"SignalZoneState": {
484499
"methods": [
485500
"signal_zone_state"

packages/google-cloud-gdchardwaremanagement/google/cloud/gdchardwaremanagement_v1alpha/services/gdc_hardware_management/async_client.py

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3237,6 +3237,126 @@ async def sample_create_comment():
32373237
# Done; return the response.
32383238
return response
32393239

3240+
async def record_action_on_comment(
3241+
self,
3242+
request: Optional[Union[service.RecordActionOnCommentRequest, dict]] = None,
3243+
*,
3244+
name: Optional[str] = None,
3245+
action_type: Optional[service.RecordActionOnCommentRequest.ActionType] = None,
3246+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3247+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3248+
metadata: Sequence[Tuple[str, str]] = (),
3249+
) -> resources.Comment:
3250+
r"""Record Action on a Comment. If the Action specified
3251+
in the request is READ, the viewed time in the comment
3252+
is set to the time the request was received. If the
3253+
comment is already marked as read, subsequent calls will
3254+
be ignored. If the Action is UNREAD, the viewed time is
3255+
cleared from the comment.
3256+
3257+
.. code-block:: python
3258+
3259+
# This snippet has been automatically generated and should be regarded as a
3260+
# code template only.
3261+
# It will require modifications to work:
3262+
# - It may require correct/in-range values for request initialization.
3263+
# - It may require specifying regional endpoints when creating the service
3264+
# client as shown in:
3265+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
3266+
from google.cloud import gdchardwaremanagement_v1alpha
3267+
3268+
async def sample_record_action_on_comment():
3269+
# Create a client
3270+
client = gdchardwaremanagement_v1alpha.GDCHardwareManagementAsyncClient()
3271+
3272+
# Initialize request argument(s)
3273+
request = gdchardwaremanagement_v1alpha.RecordActionOnCommentRequest(
3274+
name="name_value",
3275+
action_type="UNREAD",
3276+
)
3277+
3278+
# Make the request
3279+
response = await client.record_action_on_comment(request=request)
3280+
3281+
# Handle the response
3282+
print(response)
3283+
3284+
Args:
3285+
request (Optional[Union[google.cloud.gdchardwaremanagement_v1alpha.types.RecordActionOnCommentRequest, dict]]):
3286+
The request object. A request to record an action on a
3287+
comment.
3288+
name (:class:`str`):
3289+
Required. The name of the comment. Format:
3290+
``projects/{project}/locations/{location}/orders/{order}/comments/{comment}``
3291+
3292+
This corresponds to the ``name`` field
3293+
on the ``request`` instance; if ``request`` is provided, this
3294+
should not be set.
3295+
action_type (:class:`google.cloud.gdchardwaremanagement_v1alpha.types.RecordActionOnCommentRequest.ActionType`):
3296+
Required. The action type of the
3297+
recorded action.
3298+
3299+
This corresponds to the ``action_type`` field
3300+
on the ``request`` instance; if ``request`` is provided, this
3301+
should not be set.
3302+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
3303+
should be retried.
3304+
timeout (float): The timeout for this request.
3305+
metadata (Sequence[Tuple[str, str]]): Strings which should be
3306+
sent along with the request as metadata.
3307+
3308+
Returns:
3309+
google.cloud.gdchardwaremanagement_v1alpha.types.Comment:
3310+
A comment on an order.
3311+
"""
3312+
# Create or coerce a protobuf request object.
3313+
# - Quick check: If we got a request object, we should *not* have
3314+
# gotten any keyword arguments that map to the request.
3315+
has_flattened_params = any([name, action_type])
3316+
if request is not None and has_flattened_params:
3317+
raise ValueError(
3318+
"If the `request` argument is set, then none of "
3319+
"the individual field arguments should be set."
3320+
)
3321+
3322+
# - Use the request object if provided (there's no risk of modifying the input as
3323+
# there are no flattened fields), or create one.
3324+
if not isinstance(request, service.RecordActionOnCommentRequest):
3325+
request = service.RecordActionOnCommentRequest(request)
3326+
3327+
# If we have keyword arguments corresponding to fields on the
3328+
# request, apply these.
3329+
if name is not None:
3330+
request.name = name
3331+
if action_type is not None:
3332+
request.action_type = action_type
3333+
3334+
# Wrap the RPC method; this adds retry and timeout information,
3335+
# and friendly error handling.
3336+
rpc = self._client._transport._wrapped_methods[
3337+
self._client._transport.record_action_on_comment
3338+
]
3339+
3340+
# Certain fields should be provided within the metadata header;
3341+
# add these here.
3342+
metadata = tuple(metadata) + (
3343+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
3344+
)
3345+
3346+
# Validate the universe domain.
3347+
self._client._validate_universe_domain()
3348+
3349+
# Send the request.
3350+
response = await rpc(
3351+
request,
3352+
retry=retry,
3353+
timeout=timeout,
3354+
metadata=metadata,
3355+
)
3356+
3357+
# Done; return the response.
3358+
return response
3359+
32403360
async def list_change_log_entries(
32413361
self,
32423362
request: Optional[Union[service.ListChangeLogEntriesRequest, dict]] = None,

packages/google-cloud-gdchardwaremanagement/google/cloud/gdchardwaremanagement_v1alpha/services/gdc_hardware_management/client.py

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3734,6 +3734,123 @@ def sample_create_comment():
37343734
# Done; return the response.
37353735
return response
37363736

3737+
def record_action_on_comment(
3738+
self,
3739+
request: Optional[Union[service.RecordActionOnCommentRequest, dict]] = None,
3740+
*,
3741+
name: Optional[str] = None,
3742+
action_type: Optional[service.RecordActionOnCommentRequest.ActionType] = None,
3743+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3744+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3745+
metadata: Sequence[Tuple[str, str]] = (),
3746+
) -> resources.Comment:
3747+
r"""Record Action on a Comment. If the Action specified
3748+
in the request is READ, the viewed time in the comment
3749+
is set to the time the request was received. If the
3750+
comment is already marked as read, subsequent calls will
3751+
be ignored. If the Action is UNREAD, the viewed time is
3752+
cleared from the comment.
3753+
3754+
.. code-block:: python
3755+
3756+
# This snippet has been automatically generated and should be regarded as a
3757+
# code template only.
3758+
# It will require modifications to work:
3759+
# - It may require correct/in-range values for request initialization.
3760+
# - It may require specifying regional endpoints when creating the service
3761+
# client as shown in:
3762+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
3763+
from google.cloud import gdchardwaremanagement_v1alpha
3764+
3765+
def sample_record_action_on_comment():
3766+
# Create a client
3767+
client = gdchardwaremanagement_v1alpha.GDCHardwareManagementClient()
3768+
3769+
# Initialize request argument(s)
3770+
request = gdchardwaremanagement_v1alpha.RecordActionOnCommentRequest(
3771+
name="name_value",
3772+
action_type="UNREAD",
3773+
)
3774+
3775+
# Make the request
3776+
response = client.record_action_on_comment(request=request)
3777+
3778+
# Handle the response
3779+
print(response)
3780+
3781+
Args:
3782+
request (Union[google.cloud.gdchardwaremanagement_v1alpha.types.RecordActionOnCommentRequest, dict]):
3783+
The request object. A request to record an action on a
3784+
comment.
3785+
name (str):
3786+
Required. The name of the comment. Format:
3787+
``projects/{project}/locations/{location}/orders/{order}/comments/{comment}``
3788+
3789+
This corresponds to the ``name`` field
3790+
on the ``request`` instance; if ``request`` is provided, this
3791+
should not be set.
3792+
action_type (google.cloud.gdchardwaremanagement_v1alpha.types.RecordActionOnCommentRequest.ActionType):
3793+
Required. The action type of the
3794+
recorded action.
3795+
3796+
This corresponds to the ``action_type`` field
3797+
on the ``request`` instance; if ``request`` is provided, this
3798+
should not be set.
3799+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
3800+
should be retried.
3801+
timeout (float): The timeout for this request.
3802+
metadata (Sequence[Tuple[str, str]]): Strings which should be
3803+
sent along with the request as metadata.
3804+
3805+
Returns:
3806+
google.cloud.gdchardwaremanagement_v1alpha.types.Comment:
3807+
A comment on an order.
3808+
"""
3809+
# Create or coerce a protobuf request object.
3810+
# - Quick check: If we got a request object, we should *not* have
3811+
# gotten any keyword arguments that map to the request.
3812+
has_flattened_params = any([name, action_type])
3813+
if request is not None and has_flattened_params:
3814+
raise ValueError(
3815+
"If the `request` argument is set, then none of "
3816+
"the individual field arguments should be set."
3817+
)
3818+
3819+
# - Use the request object if provided (there's no risk of modifying the input as
3820+
# there are no flattened fields), or create one.
3821+
if not isinstance(request, service.RecordActionOnCommentRequest):
3822+
request = service.RecordActionOnCommentRequest(request)
3823+
# If we have keyword arguments corresponding to fields on the
3824+
# request, apply these.
3825+
if name is not None:
3826+
request.name = name
3827+
if action_type is not None:
3828+
request.action_type = action_type
3829+
3830+
# Wrap the RPC method; this adds retry and timeout information,
3831+
# and friendly error handling.
3832+
rpc = self._transport._wrapped_methods[self._transport.record_action_on_comment]
3833+
3834+
# Certain fields should be provided within the metadata header;
3835+
# add these here.
3836+
metadata = tuple(metadata) + (
3837+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
3838+
)
3839+
3840+
# Validate the universe domain.
3841+
self._validate_universe_domain()
3842+
3843+
# Send the request.
3844+
response = rpc(
3845+
request,
3846+
retry=retry,
3847+
timeout=timeout,
3848+
metadata=metadata,
3849+
)
3850+
3851+
# Done; return the response.
3852+
return response
3853+
37373854
def list_change_log_entries(
37383855
self,
37393856
request: Optional[Union[service.ListChangeLogEntriesRequest, dict]] = None,

0 commit comments

Comments
 (0)