From ba7cd868aba5d60d8871449302212db526e31dfc Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:22:26 -0700 Subject: [PATCH] feat: [gdchardwaremanagement] add an order type field to distinguish a fulfillment request from a sales inquiry (#5685) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 PiperOrigin-RevId: 675275984 Source-Link: https://github.com/googleapis/googleapis/commit/fde103ca32090688564bc86d8a430450d59dded7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a58cb7449fccaa7e9c76bd5a137e79aefa45ede7 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWdkY2hhcmR3YXJlbWFuYWdlbWVudC8uT3dsQm90LnlhbWwiLCJoIjoiYTU4Y2I3NDQ5ZmNjYWE3ZTljNzZiZDVhMTM3ZTc5YWVmYTQ1ZWRlNyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- .../README.md | 1 + .../v1alpha/resources.proto | 78 ++ .../v1alpha/service.proto | 75 +- .../protos/protos.d.ts | 306 +++++++ .../protos/protos.js | 860 +++++++++++++++++- .../protos/protos.json | 148 +++ .../samples/README.md | 18 + ...are_management.record_action_on_comment.js | 68 ++ .../g_d_c_hardware_management.submit_order.js | 5 + ...e.cloud.gdchardwaremanagement.v1alpha.json | 50 +- .../g_d_c_hardware_management_client.ts | 107 +++ ...d_c_hardware_management_client_config.json | 4 + .../src/v1alpha/gapic_metadata.json | 10 + ...gapic_g_d_c_hardware_management_v1alpha.ts | 141 +++ 14 files changed, 1866 insertions(+), 5 deletions(-) create mode 100644 packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.record_action_on_comment.js diff --git a/packages/google-cloud-gdchardwaremanagement/README.md b/packages/google-cloud-gdchardwaremanagement/README.md index 33b3bcc73ab..99196c04501 100644 --- a/packages/google-cloud-gdchardwaremanagement/README.md +++ b/packages/google-cloud-gdchardwaremanagement/README.md @@ -144,6 +144,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | G_d_c_hardware_management.list_sites | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.list_sites.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.list_sites.js,packages/google-cloud-gdchardwaremanagement/samples/README.md) | | G_d_c_hardware_management.list_skus | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.list_skus.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.list_skus.js,packages/google-cloud-gdchardwaremanagement/samples/README.md) | | G_d_c_hardware_management.list_zones | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.list_zones.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.list_zones.js,packages/google-cloud-gdchardwaremanagement/samples/README.md) | +| G_d_c_hardware_management.record_action_on_comment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.record_action_on_comment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.record_action_on_comment.js,packages/google-cloud-gdchardwaremanagement/samples/README.md) | | G_d_c_hardware_management.signal_zone_state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.signal_zone_state.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.signal_zone_state.js,packages/google-cloud-gdchardwaremanagement/samples/README.md) | | G_d_c_hardware_management.submit_order | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.submit_order.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.submit_order.js,packages/google-cloud-gdchardwaremanagement/samples/README.md) | | G_d_c_hardware_management.update_hardware | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.update_hardware.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.update_hardware.js,packages/google-cloud-gdchardwaremanagement/samples/README.md) | diff --git a/packages/google-cloud-gdchardwaremanagement/protos/google/cloud/gdchardwaremanagement/v1alpha/resources.proto b/packages/google-cloud-gdchardwaremanagement/protos/google/cloud/gdchardwaremanagement/v1alpha/resources.proto index 86ff44fea19..ba8163c6e65 100644 --- a/packages/google-cloud-gdchardwaremanagement/protos/google/cloud/gdchardwaremanagement/v1alpha/resources.proto +++ b/packages/google-cloud-gdchardwaremanagement/protos/google/cloud/gdchardwaremanagement/v1alpha/resources.proto @@ -46,6 +46,21 @@ enum PowerSupply { POWER_SUPPLY_DC = 2; } +// Entity is used to denote an organization or party. +enum Entity { + // Entity is unspecified. + ENTITY_UNSPECIFIED = 0; + + // Google. + GOOGLE = 1; + + // Customer. + CUSTOMER = 2; + + // Vendor. + VENDOR = 3; +} + // An order for GDC hardware. message Order { option (google.api.resource) = { @@ -66,6 +81,10 @@ message Order { // Order has been submitted to Google. SUBMITTED = 2; + // All information required from the customer for fulfillment of the order + // is complete. + INFO_COMPLETE = 12; + // Order has been accepted by Google. ACCEPTED = 3; @@ -218,6 +237,12 @@ message Site { // Optional. The time periods when the site is accessible. // If this field is empty, the site is accessible at all times. + // + // This field is used by Google to schedule the initial installation as well + // as any later hardware maintenance. You may update this at any time. For + // example, if the initial installation is requested during off-hours but + // maintenance should be performed during regular business hours, you should + // update the access times after initial installation is complete. repeated TimePeriod access_times = 26 [(google.api.field_behavior) = OPTIONAL]; @@ -228,6 +253,10 @@ message Site { // - any special process or approval required to move the equipment // - whether a representative will be available during site visits string notes = 27 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Customer defined identifier for this Site. This can be used to + // identify the site in the customer's own systems. + string customer_site_id = 28 [(google.api.field_behavior) = OPTIONAL]; } // A group of hardware that is part of the same order, has the same SKU, and is @@ -473,6 +502,14 @@ message Comment { // Required. Text of this comment. The length of text must be <= 1000 // characters. string text = 5 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Timestamp of the first time this comment was viewed by the + // customer. If the comment wasn't viewed then this timestamp will be unset. + google.protobuf.Timestamp customer_viewed_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The entity the author belongs to. + Entity author_entity = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; } // A log entry of a change made to an order. @@ -637,6 +674,10 @@ message Zone { // Output only. Globally unique identifier generated for this Edge Zone. string globally_unique_id = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Subscription configurations for this zone. + repeated SubscriptionConfig subscription_configs = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Contact information of the customer organization. @@ -942,3 +983,40 @@ message HardwareLocation { // If unset, this location is assumed to be the entire rack. repeated RackSpace rack_space = 3 [(google.api.field_behavior) = OPTIONAL]; } + +// A message to store a subscription configuration. +message SubscriptionConfig { + // Enum to represent the state of the subscription. + enum SubscriptionState { + // State is unspecified. + SUBSCRIPTION_STATE_UNSPECIFIED = 0; + + // Active state means that the subscription has been created successfully + // and billing is happening. + ACTIVE = 1; + + // Inactive means that the subscription has been created successfully, but + // billing has not started yet. + INACTIVE = 2; + + // The subscription is in an erroneous state. + ERROR = 3; + + // The subscription state failed to be retrieved. This may be a transient + // issue. The user should retry the request. + FAILED_TO_RETRIEVE = 4; + + // The subscription has been completed, because it has reached the end date. + COMPLETED = 5; + } + + // Output only. The unique identifier of the subscription. + string subscription_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Google Cloud Billing ID that the subscription is created + // under. + string billing_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the subscription. + SubscriptionState state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-gdchardwaremanagement/protos/google/cloud/gdchardwaremanagement/v1alpha/service.proto b/packages/google-cloud-gdchardwaremanagement/protos/google/cloud/gdchardwaremanagement/v1alpha/service.proto index 572436ccf97..59cafb99b30 100644 --- a/packages/google-cloud-gdchardwaremanagement/protos/google/cloud/gdchardwaremanagement/v1alpha/service.proto +++ b/packages/google-cloud-gdchardwaremanagement/protos/google/cloud/gdchardwaremanagement/v1alpha/service.proto @@ -296,6 +296,18 @@ service GDCHardwareManagement { }; } + // Record Action on a Comment. If the Action specified in the request is READ, + // the viewed time in the comment is set to the time the request was received. + // If the comment is already marked as read, subsequent calls will be ignored. + // If the Action is UNREAD, the viewed time is cleared from the comment. + rpc RecordActionOnComment(RecordActionOnCommentRequest) returns (Comment) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/orders/*/comments/*}:recordAction" + body: "*" + }; + option (google.api.method_signature) = "name,action_type"; + } + // Lists the changes made to an order. rpc ListChangeLogEntries(ListChangeLogEntriesRequest) returns (ListChangeLogEntriesResponse) { @@ -516,6 +528,30 @@ message DeleteOrderRequest { // A request to submit an order. message SubmitOrderRequest { + // Valid types of submit order request. + enum Type { + // Request type is unspecified. This should not be used. + TYPE_UNSPECIFIED = 0; + + // Use this request type to submit your order and initiate conversation with + // Google. After this submission, you will not be able to modify the number + // or SKU of your ordered hardware. Please note that this order will not be + // ready for fulfillment yet until you provide more information, such as + // zone network configuration, hardware physical and installation + // information, etc. + // If you are submitting an order for a SKU type of RACK, please use this + // request type, as additional information will be required outside of the + // API. + INFO_PENDING = 1; + + // Use this request type if and when you are ready to submit your order for + // fulfillment. In addition to the information required for `INFO_PENDING`, + // the order must contain all required information, such as zone network + // configuration, hardware physical and installation information, etc. + // Further changes to any order information will no longer be allowed. + INFO_COMPLETE = 2; + } + // Required. The name of the order. // Format: `projects/{project}/locations/{location}/orders/{order}` string name = 1 [ @@ -528,6 +564,10 @@ message SubmitOrderRequest { // Optional. An optional unique identifier for this request. See // [AIP-155](https://google.aip.dev/155). string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Type of this request. If unset, the request type is assumed to be + // `INFO_PENDING`. + Type type = 3 [(google.api.field_behavior) = OPTIONAL]; } // A request to list sites. @@ -928,6 +968,34 @@ message CreateCommentRequest { string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; } +// A request to record an action on a comment. +message RecordActionOnCommentRequest { + // Valid action types of Comment. + enum ActionType { + // Action is unspecified. + ACTION_TYPE_UNSPECIFIED = 0; + + // Mark comment as read. + READ = 1; + + // Mark comment as unread. + UNREAD = 2; + } + + // Required. The name of the comment. + // Format: + // `projects/{project}/locations/{location}/orders/{order}/comments/{comment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gdchardwaremanagement.googleapis.com/Comment" + } + ]; + + // Required. The action type of the recorded action. + ActionType action_type = 2 [(google.api.field_behavior) = REQUIRED]; +} + // A request to list change log entries. message ListChangeLogEntriesRequest { // Required. The order to list change log entries for. @@ -1151,11 +1219,16 @@ message DeleteZoneRequest { message SignalZoneStateRequest { // Valid state signals for a zone. enum StateSignal { + option allow_alias = true; + // State signal of the zone is unspecified. STATE_SIGNAL_UNSPECIFIED = 0; // The Zone is ready for site turnup. - READY_FOR_SITE_TURNUP = 1; + FACTORY_TURNUP_CHECKS_PASSED = 1; + + // The Zone is ready for site turnup. Deprecated, but not deleted. + READY_FOR_SITE_TURNUP = 1 [deprecated = true]; // The Zone failed in factory turnup checks. FACTORY_TURNUP_CHECKS_FAILED = 2; diff --git a/packages/google-cloud-gdchardwaremanagement/protos/protos.d.ts b/packages/google-cloud-gdchardwaremanagement/protos/protos.d.ts index 80189f7076c..3a5ab66e514 100644 --- a/packages/google-cloud-gdchardwaremanagement/protos/protos.d.ts +++ b/packages/google-cloud-gdchardwaremanagement/protos/protos.d.ts @@ -33,6 +33,14 @@ export namespace google { POWER_SUPPLY_DC = 2 } + /** Entity enum. */ + enum Entity { + ENTITY_UNSPECIFIED = 0, + GOOGLE = 1, + CUSTOMER = 2, + VENDOR = 3 + } + /** Properties of an Order. */ interface IOrder { @@ -227,6 +235,7 @@ export namespace google { STATE_UNSPECIFIED = 0, DRAFT = 1, SUBMITTED = 2, + INFO_COMPLETE = 12, ACCEPTED = 3, ADDITIONAL_INFO_NEEDED = 4, BUILDING = 5, @@ -278,6 +287,9 @@ export namespace google { /** Site notes */ notes?: (string|null); + + /** Site customerSiteId */ + customerSiteId?: (string|null); } /** Represents a Site. */ @@ -319,6 +331,9 @@ export namespace google { /** Site notes. */ public notes: string; + /** Site customerSiteId. */ + public customerSiteId: string; + /** * Creates a new Site instance using the specified properties. * @param [properties] Properties to set @@ -787,6 +802,12 @@ export namespace google { /** Comment text */ text?: (string|null); + + /** Comment customerViewedTime */ + customerViewedTime?: (google.protobuf.ITimestamp|null); + + /** Comment authorEntity */ + authorEntity?: (google.cloud.gdchardwaremanagement.v1alpha.Entity|keyof typeof google.cloud.gdchardwaremanagement.v1alpha.Entity|null); } /** Represents a Comment. */ @@ -813,6 +834,12 @@ export namespace google { /** Comment text. */ public text: string; + /** Comment customerViewedTime. */ + public customerViewedTime?: (google.protobuf.ITimestamp|null); + + /** Comment authorEntity. */ + public authorEntity: (google.cloud.gdchardwaremanagement.v1alpha.Entity|keyof typeof google.cloud.gdchardwaremanagement.v1alpha.Entity); + /** * Creates a new Comment instance using the specified properties. * @param [properties] Properties to set @@ -1205,6 +1232,9 @@ export namespace google { /** Zone globallyUniqueId */ globallyUniqueId?: (string|null); + + /** Zone subscriptionConfigs */ + subscriptionConfigs?: (google.cloud.gdchardwaremanagement.v1alpha.ISubscriptionConfig[]|null); } /** Represents a Zone. */ @@ -1246,6 +1276,9 @@ export namespace google { /** Zone globallyUniqueId. */ public globallyUniqueId: string; + /** Zone subscriptionConfigs. */ + public subscriptionConfigs: google.cloud.gdchardwaremanagement.v1alpha.ISubscriptionConfig[]; + /** * Creates a new Zone instance using the specified properties. * @param [properties] Properties to set @@ -2862,6 +2895,128 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a SubscriptionConfig. */ + interface ISubscriptionConfig { + + /** SubscriptionConfig subscriptionId */ + subscriptionId?: (string|null); + + /** SubscriptionConfig billingId */ + billingId?: (string|null); + + /** SubscriptionConfig state */ + state?: (google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.SubscriptionState|keyof typeof google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.SubscriptionState|null); + } + + /** Represents a SubscriptionConfig. */ + class SubscriptionConfig implements ISubscriptionConfig { + + /** + * Constructs a new SubscriptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gdchardwaremanagement.v1alpha.ISubscriptionConfig); + + /** SubscriptionConfig subscriptionId. */ + public subscriptionId: string; + + /** SubscriptionConfig billingId. */ + public billingId: string; + + /** SubscriptionConfig state. */ + public state: (google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.SubscriptionState|keyof typeof google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.SubscriptionState); + + /** + * Creates a new SubscriptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SubscriptionConfig instance + */ + public static create(properties?: google.cloud.gdchardwaremanagement.v1alpha.ISubscriptionConfig): google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig; + + /** + * Encodes the specified SubscriptionConfig message. Does not implicitly {@link google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.verify|verify} messages. + * @param message SubscriptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gdchardwaremanagement.v1alpha.ISubscriptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubscriptionConfig message, length delimited. Does not implicitly {@link google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.verify|verify} messages. + * @param message SubscriptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gdchardwaremanagement.v1alpha.ISubscriptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubscriptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubscriptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig; + + /** + * Decodes a SubscriptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubscriptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig; + + /** + * Verifies a SubscriptionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubscriptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubscriptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig; + + /** + * Creates a plain object from a SubscriptionConfig message. Also converts values to other types if specified. + * @param message SubscriptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubscriptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubscriptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SubscriptionConfig { + + /** SubscriptionState enum. */ + enum SubscriptionState { + SUBSCRIPTION_STATE_UNSPECIFIED = 0, + ACTIVE = 1, + INACTIVE = 2, + ERROR = 3, + FAILED_TO_RETRIEVE = 4, + COMPLETED = 5 + } + } + /** Represents a GDCHardwareManagement */ class GDCHardwareManagement extends $protobuf.rpc.Service { @@ -3204,6 +3359,20 @@ export namespace google { */ public createComment(request: google.cloud.gdchardwaremanagement.v1alpha.ICreateCommentRequest): Promise; + /** + * Calls RecordActionOnComment. + * @param request RecordActionOnCommentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Comment + */ + public recordActionOnComment(request: google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest, callback: google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement.RecordActionOnCommentCallback): void; + + /** + * Calls RecordActionOnComment. + * @param request RecordActionOnCommentRequest message or plain object + * @returns Promise + */ + public recordActionOnComment(request: google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest): Promise; + /** * Calls ListChangeLogEntries. * @param request ListChangeLogEntriesRequest message or plain object @@ -3508,6 +3677,13 @@ export namespace google { */ type CreateCommentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * Callback as used by {@link google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement|recordActionOnComment}. + * @param error Error, if any + * @param [response] Comment + */ + type RecordActionOnCommentCallback = (error: (Error|null), response?: google.cloud.gdchardwaremanagement.v1alpha.Comment) => void; + /** * Callback as used by {@link google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement|listChangeLogEntries}. * @param error Error, if any @@ -4247,6 +4423,9 @@ export namespace google { /** SubmitOrderRequest requestId */ requestId?: (string|null); + + /** SubmitOrderRequest type */ + type?: (google.cloud.gdchardwaremanagement.v1alpha.SubmitOrderRequest.Type|keyof typeof google.cloud.gdchardwaremanagement.v1alpha.SubmitOrderRequest.Type|null); } /** Represents a SubmitOrderRequest. */ @@ -4264,6 +4443,9 @@ export namespace google { /** SubmitOrderRequest requestId. */ public requestId: string; + /** SubmitOrderRequest type. */ + public type: (google.cloud.gdchardwaremanagement.v1alpha.SubmitOrderRequest.Type|keyof typeof google.cloud.gdchardwaremanagement.v1alpha.SubmitOrderRequest.Type); + /** * Creates a new SubmitOrderRequest instance using the specified properties. * @param [properties] Properties to set @@ -4342,6 +4524,16 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace SubmitOrderRequest { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + INFO_PENDING = 1, + INFO_COMPLETE = 2 + } + } + /** Properties of a ListSitesRequest. */ interface IListSitesRequest { @@ -6637,6 +6829,119 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a RecordActionOnCommentRequest. */ + interface IRecordActionOnCommentRequest { + + /** RecordActionOnCommentRequest name */ + name?: (string|null); + + /** RecordActionOnCommentRequest actionType */ + actionType?: (google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest.ActionType|keyof typeof google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest.ActionType|null); + } + + /** Represents a RecordActionOnCommentRequest. */ + class RecordActionOnCommentRequest implements IRecordActionOnCommentRequest { + + /** + * Constructs a new RecordActionOnCommentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest); + + /** RecordActionOnCommentRequest name. */ + public name: string; + + /** RecordActionOnCommentRequest actionType. */ + public actionType: (google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest.ActionType|keyof typeof google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest.ActionType); + + /** + * Creates a new RecordActionOnCommentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RecordActionOnCommentRequest instance + */ + public static create(properties?: google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest): google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest; + + /** + * Encodes the specified RecordActionOnCommentRequest message. Does not implicitly {@link google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest.verify|verify} messages. + * @param message RecordActionOnCommentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecordActionOnCommentRequest message, length delimited. Does not implicitly {@link google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest.verify|verify} messages. + * @param message RecordActionOnCommentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecordActionOnCommentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecordActionOnCommentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest; + + /** + * Decodes a RecordActionOnCommentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecordActionOnCommentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest; + + /** + * Verifies a RecordActionOnCommentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecordActionOnCommentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecordActionOnCommentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest; + + /** + * Creates a plain object from a RecordActionOnCommentRequest message. Also converts values to other types if specified. + * @param message RecordActionOnCommentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecordActionOnCommentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecordActionOnCommentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RecordActionOnCommentRequest { + + /** ActionType enum. */ + enum ActionType { + ACTION_TYPE_UNSPECIFIED = 0, + READ = 1, + UNREAD = 2 + } + } + /** Properties of a ListChangeLogEntriesRequest. */ interface IListChangeLogEntriesRequest { @@ -8059,6 +8364,7 @@ export namespace google { /** StateSignal enum. */ enum StateSignal { STATE_SIGNAL_UNSPECIFIED = 0, + FACTORY_TURNUP_CHECKS_PASSED = 1, READY_FOR_SITE_TURNUP = 1, FACTORY_TURNUP_CHECKS_FAILED = 2 } diff --git a/packages/google-cloud-gdchardwaremanagement/protos/protos.js b/packages/google-cloud-gdchardwaremanagement/protos/protos.js index ede55044e97..3f0d3b3fbb4 100644 --- a/packages/google-cloud-gdchardwaremanagement/protos/protos.js +++ b/packages/google-cloud-gdchardwaremanagement/protos/protos.js @@ -82,6 +82,24 @@ return values; })(); + /** + * Entity enum. + * @name google.cloud.gdchardwaremanagement.v1alpha.Entity + * @enum {number} + * @property {number} ENTITY_UNSPECIFIED=0 ENTITY_UNSPECIFIED value + * @property {number} GOOGLE=1 GOOGLE value + * @property {number} CUSTOMER=2 CUSTOMER value + * @property {number} VENDOR=3 VENDOR value + */ + v1alpha.Entity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENTITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE"] = 1; + values[valuesById[2] = "CUSTOMER"] = 2; + values[valuesById[3] = "VENDOR"] = 3; + return values; + })(); + v1alpha.Order = (function() { /** @@ -498,6 +516,7 @@ case 0: case 1: case 2: + case 12: case 3: case 4: case 5: @@ -616,6 +635,10 @@ case 2: message.state = 2; break; + case "INFO_COMPLETE": + case 12: + message.state = 12; + break; case "ACCEPTED": case 3: message.state = 3; @@ -828,6 +851,7 @@ * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} DRAFT=1 DRAFT value * @property {number} SUBMITTED=2 SUBMITTED value + * @property {number} INFO_COMPLETE=12 INFO_COMPLETE value * @property {number} ACCEPTED=3 ACCEPTED value * @property {number} ADDITIONAL_INFO_NEEDED=4 ADDITIONAL_INFO_NEEDED value * @property {number} BUILDING=5 BUILDING value @@ -843,6 +867,7 @@ values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; values[valuesById[1] = "DRAFT"] = 1; values[valuesById[2] = "SUBMITTED"] = 2; + values[valuesById[12] = "INFO_COMPLETE"] = 12; values[valuesById[3] = "ACCEPTED"] = 3; values[valuesById[4] = "ADDITIONAL_INFO_NEEDED"] = 4; values[valuesById[5] = "BUILDING"] = 5; @@ -890,6 +915,7 @@ * @property {string|null} [googleMapsPinUri] Site googleMapsPinUri * @property {Array.|null} [accessTimes] Site accessTimes * @property {string|null} [notes] Site notes + * @property {string|null} [customerSiteId] Site customerSiteId */ /** @@ -989,6 +1015,14 @@ */ Site.prototype.notes = ""; + /** + * Site customerSiteId. + * @member {string} customerSiteId + * @memberof google.cloud.gdchardwaremanagement.v1alpha.Site + * @instance + */ + Site.prototype.customerSiteId = ""; + /** * Creates a new Site instance using the specified properties. * @function create @@ -1035,6 +1069,8 @@ $root.google.cloud.gdchardwaremanagement.v1alpha.TimePeriod.encode(message.accessTimes[i], writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); if (message.notes != null && Object.hasOwnProperty.call(message, "notes")) writer.uint32(/* id 27, wireType 2 =*/218).string(message.notes); + if (message.customerSiteId != null && Object.hasOwnProperty.call(message, "customerSiteId")) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.customerSiteId); return writer; }; @@ -1130,6 +1166,10 @@ message.notes = reader.string(); break; } + case 28: { + message.customerSiteId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -1212,6 +1252,9 @@ if (message.notes != null && message.hasOwnProperty("notes")) if (!$util.isString(message.notes)) return "notes: string expected"; + if (message.customerSiteId != null && message.hasOwnProperty("customerSiteId")) + if (!$util.isString(message.customerSiteId)) + return "customerSiteId: string expected"; return null; }; @@ -1269,6 +1312,8 @@ } if (object.notes != null) message.notes = String(object.notes); + if (object.customerSiteId != null) + message.customerSiteId = String(object.customerSiteId); return message; }; @@ -1298,6 +1343,7 @@ object.displayName = ""; object.description = ""; object.notes = ""; + object.customerSiteId = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -1326,6 +1372,8 @@ } if (message.notes != null && message.hasOwnProperty("notes")) object.notes = message.notes; + if (message.customerSiteId != null && message.hasOwnProperty("customerSiteId")) + object.customerSiteId = message.customerSiteId; return object; }; @@ -2627,6 +2675,8 @@ * @property {Object.|null} [labels] Comment labels * @property {string|null} [author] Comment author * @property {string|null} [text] Comment text + * @property {google.protobuf.ITimestamp|null} [customerViewedTime] Comment customerViewedTime + * @property {google.cloud.gdchardwaremanagement.v1alpha.Entity|null} [authorEntity] Comment authorEntity */ /** @@ -2685,6 +2735,22 @@ */ Comment.prototype.text = ""; + /** + * Comment customerViewedTime. + * @member {google.protobuf.ITimestamp|null|undefined} customerViewedTime + * @memberof google.cloud.gdchardwaremanagement.v1alpha.Comment + * @instance + */ + Comment.prototype.customerViewedTime = null; + + /** + * Comment authorEntity. + * @member {google.cloud.gdchardwaremanagement.v1alpha.Entity} authorEntity + * @memberof google.cloud.gdchardwaremanagement.v1alpha.Comment + * @instance + */ + Comment.prototype.authorEntity = 0; + /** * Creates a new Comment instance using the specified properties. * @function create @@ -2720,6 +2786,10 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.author); if (message.text != null && Object.hasOwnProperty.call(message, "text")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.text); + if (message.customerViewedTime != null && Object.hasOwnProperty.call(message, "customerViewedTime")) + $root.google.protobuf.Timestamp.encode(message.customerViewedTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.authorEntity != null && Object.hasOwnProperty.call(message, "authorEntity")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.authorEntity); return writer; }; @@ -2793,6 +2863,14 @@ message.text = reader.string(); break; } + case 6: { + message.customerViewedTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.authorEntity = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -2850,6 +2928,21 @@ if (message.text != null && message.hasOwnProperty("text")) if (!$util.isString(message.text)) return "text: string expected"; + if (message.customerViewedTime != null && message.hasOwnProperty("customerViewedTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.customerViewedTime); + if (error) + return "customerViewedTime." + error; + } + if (message.authorEntity != null && message.hasOwnProperty("authorEntity")) + switch (message.authorEntity) { + default: + return "authorEntity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } return null; }; @@ -2883,6 +2976,35 @@ message.author = String(object.author); if (object.text != null) message.text = String(object.text); + if (object.customerViewedTime != null) { + if (typeof object.customerViewedTime !== "object") + throw TypeError(".google.cloud.gdchardwaremanagement.v1alpha.Comment.customerViewedTime: object expected"); + message.customerViewedTime = $root.google.protobuf.Timestamp.fromObject(object.customerViewedTime); + } + switch (object.authorEntity) { + default: + if (typeof object.authorEntity === "number") { + message.authorEntity = object.authorEntity; + break; + } + break; + case "ENTITY_UNSPECIFIED": + case 0: + message.authorEntity = 0; + break; + case "GOOGLE": + case 1: + message.authorEntity = 1; + break; + case "CUSTOMER": + case 2: + message.authorEntity = 2; + break; + case "VENDOR": + case 3: + message.authorEntity = 3; + break; + } return message; }; @@ -2906,6 +3028,8 @@ object.createTime = null; object.author = ""; object.text = ""; + object.customerViewedTime = null; + object.authorEntity = options.enums === String ? "ENTITY_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -2921,6 +3045,10 @@ object.author = message.author; if (message.text != null && message.hasOwnProperty("text")) object.text = message.text; + if (message.customerViewedTime != null && message.hasOwnProperty("customerViewedTime")) + object.customerViewedTime = $root.google.protobuf.Timestamp.toObject(message.customerViewedTime, options); + if (message.authorEntity != null && message.hasOwnProperty("authorEntity")) + object.authorEntity = options.enums === String ? $root.google.cloud.gdchardwaremanagement.v1alpha.Entity[message.authorEntity] === undefined ? message.authorEntity : $root.google.cloud.gdchardwaremanagement.v1alpha.Entity[message.authorEntity] : message.authorEntity; return object; }; @@ -3794,6 +3922,7 @@ * @property {string|null} [ciqUri] Zone ciqUri * @property {google.cloud.gdchardwaremanagement.v1alpha.IZoneNetworkConfig|null} [networkConfig] Zone networkConfig * @property {string|null} [globallyUniqueId] Zone globallyUniqueId + * @property {Array.|null} [subscriptionConfigs] Zone subscriptionConfigs */ /** @@ -3807,6 +3936,7 @@ function Zone(properties) { this.labels = {}; this.contacts = []; + this.subscriptionConfigs = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3893,6 +4023,14 @@ */ Zone.prototype.globallyUniqueId = ""; + /** + * Zone subscriptionConfigs. + * @member {Array.} subscriptionConfigs + * @memberof google.cloud.gdchardwaremanagement.v1alpha.Zone + * @instance + */ + Zone.prototype.subscriptionConfigs = $util.emptyArray; + /** * Creates a new Zone instance using the specified properties. * @function create @@ -3939,6 +4077,9 @@ $root.google.cloud.gdchardwaremanagement.v1alpha.ZoneNetworkConfig.encode(message.networkConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.globallyUniqueId != null && Object.hasOwnProperty.call(message, "globallyUniqueId")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.globallyUniqueId); + if (message.subscriptionConfigs != null && message.subscriptionConfigs.length) + for (var i = 0; i < message.subscriptionConfigs.length; ++i) + $root.google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.encode(message.subscriptionConfigs[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); return writer; }; @@ -4034,6 +4175,12 @@ message.globallyUniqueId = reader.string(); break; } + case 13: { + if (!(message.subscriptionConfigs && message.subscriptionConfigs.length)) + message.subscriptionConfigs = []; + message.subscriptionConfigs.push($root.google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -4127,6 +4274,15 @@ if (message.globallyUniqueId != null && message.hasOwnProperty("globallyUniqueId")) if (!$util.isString(message.globallyUniqueId)) return "globallyUniqueId: string expected"; + if (message.subscriptionConfigs != null && message.hasOwnProperty("subscriptionConfigs")) { + if (!Array.isArray(message.subscriptionConfigs)) + return "subscriptionConfigs: array expected"; + for (var i = 0; i < message.subscriptionConfigs.length; ++i) { + var error = $root.google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.verify(message.subscriptionConfigs[i]); + if (error) + return "subscriptionConfigs." + error; + } + } return null; }; @@ -4222,6 +4378,16 @@ } if (object.globallyUniqueId != null) message.globallyUniqueId = String(object.globallyUniqueId); + if (object.subscriptionConfigs) { + if (!Array.isArray(object.subscriptionConfigs)) + throw TypeError(".google.cloud.gdchardwaremanagement.v1alpha.Zone.subscriptionConfigs: array expected"); + message.subscriptionConfigs = []; + for (var i = 0; i < object.subscriptionConfigs.length; ++i) { + if (typeof object.subscriptionConfigs[i] !== "object") + throw TypeError(".google.cloud.gdchardwaremanagement.v1alpha.Zone.subscriptionConfigs: object expected"); + message.subscriptionConfigs[i] = $root.google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.fromObject(object.subscriptionConfigs[i]); + } + } return message; }; @@ -4238,8 +4404,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.contacts = []; + object.subscriptionConfigs = []; + } if (options.objects || options.defaults) object.labels = {}; if (options.defaults) { @@ -4279,6 +4447,11 @@ object.networkConfig = $root.google.cloud.gdchardwaremanagement.v1alpha.ZoneNetworkConfig.toObject(message.networkConfig, options); if (message.globallyUniqueId != null && message.hasOwnProperty("globallyUniqueId")) object.globallyUniqueId = message.globallyUniqueId; + if (message.subscriptionConfigs && message.subscriptionConfigs.length) { + object.subscriptionConfigs = []; + for (var j = 0; j < message.subscriptionConfigs.length; ++j) + object.subscriptionConfigs[j] = $root.google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.toObject(message.subscriptionConfigs[j], options); + } return object; }; @@ -8258,7 +8431,318 @@ return typeUrlPrefix + "/google.cloud.gdchardwaremanagement.v1alpha.HardwareLocation"; }; - return HardwareLocation; + return HardwareLocation; + })(); + + v1alpha.SubscriptionConfig = (function() { + + /** + * Properties of a SubscriptionConfig. + * @memberof google.cloud.gdchardwaremanagement.v1alpha + * @interface ISubscriptionConfig + * @property {string|null} [subscriptionId] SubscriptionConfig subscriptionId + * @property {string|null} [billingId] SubscriptionConfig billingId + * @property {google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.SubscriptionState|null} [state] SubscriptionConfig state + */ + + /** + * Constructs a new SubscriptionConfig. + * @memberof google.cloud.gdchardwaremanagement.v1alpha + * @classdesc Represents a SubscriptionConfig. + * @implements ISubscriptionConfig + * @constructor + * @param {google.cloud.gdchardwaremanagement.v1alpha.ISubscriptionConfig=} [properties] Properties to set + */ + function SubscriptionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubscriptionConfig subscriptionId. + * @member {string} subscriptionId + * @memberof google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig + * @instance + */ + SubscriptionConfig.prototype.subscriptionId = ""; + + /** + * SubscriptionConfig billingId. + * @member {string} billingId + * @memberof google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig + * @instance + */ + SubscriptionConfig.prototype.billingId = ""; + + /** + * SubscriptionConfig state. + * @member {google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.SubscriptionState} state + * @memberof google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig + * @instance + */ + SubscriptionConfig.prototype.state = 0; + + /** + * Creates a new SubscriptionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig + * @static + * @param {google.cloud.gdchardwaremanagement.v1alpha.ISubscriptionConfig=} [properties] Properties to set + * @returns {google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig} SubscriptionConfig instance + */ + SubscriptionConfig.create = function create(properties) { + return new SubscriptionConfig(properties); + }; + + /** + * Encodes the specified SubscriptionConfig message. Does not implicitly {@link google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig + * @static + * @param {google.cloud.gdchardwaremanagement.v1alpha.ISubscriptionConfig} message SubscriptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscriptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscriptionId != null && Object.hasOwnProperty.call(message, "subscriptionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscriptionId); + if (message.billingId != null && Object.hasOwnProperty.call(message, "billingId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.billingId); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + return writer; + }; + + /** + * Encodes the specified SubscriptionConfig message, length delimited. Does not implicitly {@link google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig + * @static + * @param {google.cloud.gdchardwaremanagement.v1alpha.ISubscriptionConfig} message SubscriptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscriptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubscriptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig} SubscriptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscriptionConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.subscriptionId = reader.string(); + break; + } + case 2: { + message.billingId = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubscriptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig} SubscriptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscriptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubscriptionConfig message. + * @function verify + * @memberof google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubscriptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscriptionId != null && message.hasOwnProperty("subscriptionId")) + if (!$util.isString(message.subscriptionId)) + return "subscriptionId: string expected"; + if (message.billingId != null && message.hasOwnProperty("billingId")) + if (!$util.isString(message.billingId)) + return "billingId: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a SubscriptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig} SubscriptionConfig + */ + SubscriptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig) + return object; + var message = new $root.google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig(); + if (object.subscriptionId != null) + message.subscriptionId = String(object.subscriptionId); + if (object.billingId != null) + message.billingId = String(object.billingId); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "SUBSCRIPTION_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + case "ERROR": + case 3: + message.state = 3; + break; + case "FAILED_TO_RETRIEVE": + case 4: + message.state = 4; + break; + case "COMPLETED": + case 5: + message.state = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a SubscriptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig + * @static + * @param {google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig} message SubscriptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubscriptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subscriptionId = ""; + object.billingId = ""; + object.state = options.enums === String ? "SUBSCRIPTION_STATE_UNSPECIFIED" : 0; + } + if (message.subscriptionId != null && message.hasOwnProperty("subscriptionId")) + object.subscriptionId = message.subscriptionId; + if (message.billingId != null && message.hasOwnProperty("billingId")) + object.billingId = message.billingId; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.SubscriptionState[message.state] === undefined ? message.state : $root.google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.SubscriptionState[message.state] : message.state; + return object; + }; + + /** + * Converts this SubscriptionConfig to JSON. + * @function toJSON + * @memberof google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig + * @instance + * @returns {Object.} JSON object + */ + SubscriptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubscriptionConfig + * @function getTypeUrl + * @memberof google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubscriptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig"; + }; + + /** + * SubscriptionState enum. + * @name google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.SubscriptionState + * @enum {number} + * @property {number} SUBSCRIPTION_STATE_UNSPECIFIED=0 SUBSCRIPTION_STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} INACTIVE=2 INACTIVE value + * @property {number} ERROR=3 ERROR value + * @property {number} FAILED_TO_RETRIEVE=4 FAILED_TO_RETRIEVE value + * @property {number} COMPLETED=5 COMPLETED value + */ + SubscriptionConfig.SubscriptionState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SUBSCRIPTION_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "INACTIVE"] = 2; + values[valuesById[3] = "ERROR"] = 3; + values[valuesById[4] = "FAILED_TO_RETRIEVE"] = 4; + values[valuesById[5] = "COMPLETED"] = 5; + return values; + })(); + + return SubscriptionConfig; })(); v1alpha.GDCHardwareManagement = (function() { @@ -9052,6 +9536,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement|recordActionOnComment}. + * @memberof google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement + * @typedef RecordActionOnCommentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gdchardwaremanagement.v1alpha.Comment} [response] Comment + */ + + /** + * Calls RecordActionOnComment. + * @function recordActionOnComment + * @memberof google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement + * @instance + * @param {google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest} request RecordActionOnCommentRequest message or plain object + * @param {google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement.RecordActionOnCommentCallback} callback Node-style callback called with the error, if any, and Comment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GDCHardwareManagement.prototype.recordActionOnComment = function recordActionOnComment(request, callback) { + return this.rpcCall(recordActionOnComment, $root.google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest, $root.google.cloud.gdchardwaremanagement.v1alpha.Comment, request, callback); + }, "name", { value: "RecordActionOnComment" }); + + /** + * Calls RecordActionOnComment. + * @function recordActionOnComment + * @memberof google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement + * @instance + * @param {google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest} request RecordActionOnCommentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement|listChangeLogEntries}. * @memberof google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement @@ -10968,6 +11485,7 @@ * @interface ISubmitOrderRequest * @property {string|null} [name] SubmitOrderRequest name * @property {string|null} [requestId] SubmitOrderRequest requestId + * @property {google.cloud.gdchardwaremanagement.v1alpha.SubmitOrderRequest.Type|null} [type] SubmitOrderRequest type */ /** @@ -11001,6 +11519,14 @@ */ SubmitOrderRequest.prototype.requestId = ""; + /** + * SubmitOrderRequest type. + * @member {google.cloud.gdchardwaremanagement.v1alpha.SubmitOrderRequest.Type} type + * @memberof google.cloud.gdchardwaremanagement.v1alpha.SubmitOrderRequest + * @instance + */ + SubmitOrderRequest.prototype.type = 0; + /** * Creates a new SubmitOrderRequest instance using the specified properties. * @function create @@ -11029,6 +11555,8 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); return writer; }; @@ -11071,6 +11599,10 @@ message.requestId = reader.string(); break; } + case 3: { + message.type = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -11112,6 +11644,15 @@ if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -11131,6 +11672,26 @@ message.name = String(object.name); if (object.requestId != null) message.requestId = String(object.requestId); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "INFO_PENDING": + case 1: + message.type = 1; + break; + case "INFO_COMPLETE": + case 2: + message.type = 2; + break; + } return message; }; @@ -11150,11 +11711,14 @@ if (options.defaults) { object.name = ""; object.requestId = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.gdchardwaremanagement.v1alpha.SubmitOrderRequest.Type[message.type] === undefined ? message.type : $root.google.cloud.gdchardwaremanagement.v1alpha.SubmitOrderRequest.Type[message.type] : message.type; return object; }; @@ -11184,6 +11748,22 @@ return typeUrlPrefix + "/google.cloud.gdchardwaremanagement.v1alpha.SubmitOrderRequest"; }; + /** + * Type enum. + * @name google.cloud.gdchardwaremanagement.v1alpha.SubmitOrderRequest.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} INFO_PENDING=1 INFO_PENDING value + * @property {number} INFO_COMPLETE=2 INFO_COMPLETE value + */ + SubmitOrderRequest.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INFO_PENDING"] = 1; + values[valuesById[2] = "INFO_COMPLETE"] = 2; + return values; + })(); + return SubmitOrderRequest; })(); @@ -16658,6 +17238,273 @@ return CreateCommentRequest; })(); + v1alpha.RecordActionOnCommentRequest = (function() { + + /** + * Properties of a RecordActionOnCommentRequest. + * @memberof google.cloud.gdchardwaremanagement.v1alpha + * @interface IRecordActionOnCommentRequest + * @property {string|null} [name] RecordActionOnCommentRequest name + * @property {google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest.ActionType|null} [actionType] RecordActionOnCommentRequest actionType + */ + + /** + * Constructs a new RecordActionOnCommentRequest. + * @memberof google.cloud.gdchardwaremanagement.v1alpha + * @classdesc Represents a RecordActionOnCommentRequest. + * @implements IRecordActionOnCommentRequest + * @constructor + * @param {google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest=} [properties] Properties to set + */ + function RecordActionOnCommentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecordActionOnCommentRequest name. + * @member {string} name + * @memberof google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest + * @instance + */ + RecordActionOnCommentRequest.prototype.name = ""; + + /** + * RecordActionOnCommentRequest actionType. + * @member {google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest.ActionType} actionType + * @memberof google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest + * @instance + */ + RecordActionOnCommentRequest.prototype.actionType = 0; + + /** + * Creates a new RecordActionOnCommentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest + * @static + * @param {google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest=} [properties] Properties to set + * @returns {google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest} RecordActionOnCommentRequest instance + */ + RecordActionOnCommentRequest.create = function create(properties) { + return new RecordActionOnCommentRequest(properties); + }; + + /** + * Encodes the specified RecordActionOnCommentRequest message. Does not implicitly {@link google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest + * @static + * @param {google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest} message RecordActionOnCommentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecordActionOnCommentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.actionType != null && Object.hasOwnProperty.call(message, "actionType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.actionType); + return writer; + }; + + /** + * Encodes the specified RecordActionOnCommentRequest message, length delimited. Does not implicitly {@link google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest + * @static + * @param {google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest} message RecordActionOnCommentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecordActionOnCommentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecordActionOnCommentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest} RecordActionOnCommentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecordActionOnCommentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.actionType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecordActionOnCommentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest} RecordActionOnCommentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecordActionOnCommentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecordActionOnCommentRequest message. + * @function verify + * @memberof google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecordActionOnCommentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.actionType != null && message.hasOwnProperty("actionType")) + switch (message.actionType) { + default: + return "actionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a RecordActionOnCommentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest} RecordActionOnCommentRequest + */ + RecordActionOnCommentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest) + return object; + var message = new $root.google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.actionType) { + default: + if (typeof object.actionType === "number") { + message.actionType = object.actionType; + break; + } + break; + case "ACTION_TYPE_UNSPECIFIED": + case 0: + message.actionType = 0; + break; + case "READ": + case 1: + message.actionType = 1; + break; + case "UNREAD": + case 2: + message.actionType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a RecordActionOnCommentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest + * @static + * @param {google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest} message RecordActionOnCommentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecordActionOnCommentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.actionType = options.enums === String ? "ACTION_TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.actionType != null && message.hasOwnProperty("actionType")) + object.actionType = options.enums === String ? $root.google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest.ActionType[message.actionType] === undefined ? message.actionType : $root.google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest.ActionType[message.actionType] : message.actionType; + return object; + }; + + /** + * Converts this RecordActionOnCommentRequest to JSON. + * @function toJSON + * @memberof google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest + * @instance + * @returns {Object.} JSON object + */ + RecordActionOnCommentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecordActionOnCommentRequest + * @function getTypeUrl + * @memberof google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecordActionOnCommentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest"; + }; + + /** + * ActionType enum. + * @name google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest.ActionType + * @enum {number} + * @property {number} ACTION_TYPE_UNSPECIFIED=0 ACTION_TYPE_UNSPECIFIED value + * @property {number} READ=1 READ value + * @property {number} UNREAD=2 UNREAD value + */ + RecordActionOnCommentRequest.ActionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READ"] = 1; + values[valuesById[2] = "UNREAD"] = 2; + return values; + })(); + + return RecordActionOnCommentRequest; + })(); + v1alpha.ListChangeLogEntriesRequest = (function() { /** @@ -19957,6 +20804,7 @@ return "stateSignal: enum value expected"; case 0: case 1: + case 1: case 2: break; } @@ -19990,6 +20838,10 @@ case 0: message.stateSignal = 0; break; + case "FACTORY_TURNUP_CHECKS_PASSED": + case 1: + message.stateSignal = 1; + break; case "READY_FOR_SITE_TURNUP": case 1: message.stateSignal = 1; @@ -20060,13 +20912,15 @@ * @name google.cloud.gdchardwaremanagement.v1alpha.SignalZoneStateRequest.StateSignal * @enum {number} * @property {number} STATE_SIGNAL_UNSPECIFIED=0 STATE_SIGNAL_UNSPECIFIED value + * @property {number} FACTORY_TURNUP_CHECKS_PASSED=1 FACTORY_TURNUP_CHECKS_PASSED value * @property {number} READY_FOR_SITE_TURNUP=1 READY_FOR_SITE_TURNUP value * @property {number} FACTORY_TURNUP_CHECKS_FAILED=2 FACTORY_TURNUP_CHECKS_FAILED value */ SignalZoneStateRequest.StateSignal = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "STATE_SIGNAL_UNSPECIFIED"] = 0; - values[valuesById[1] = "READY_FOR_SITE_TURNUP"] = 1; + values[valuesById[1] = "FACTORY_TURNUP_CHECKS_PASSED"] = 1; + values["READY_FOR_SITE_TURNUP"] = 1; values[valuesById[2] = "FACTORY_TURNUP_CHECKS_FAILED"] = 2; return values; })(); diff --git a/packages/google-cloud-gdchardwaremanagement/protos/protos.json b/packages/google-cloud-gdchardwaremanagement/protos/protos.json index e89189232a5..2bf72c2425d 100644 --- a/packages/google-cloud-gdchardwaremanagement/protos/protos.json +++ b/packages/google-cloud-gdchardwaremanagement/protos/protos.json @@ -24,6 +24,14 @@ "POWER_SUPPLY_DC": 2 } }, + "Entity": { + "values": { + "ENTITY_UNSPECIFIED": 0, + "GOOGLE": 1, + "CUSTOMER": 2, + "VENDOR": 3 + } + }, "Order": { "options": { "(google.api.resource).type": "gdchardwaremanagement.googleapis.com/Order", @@ -154,6 +162,7 @@ "STATE_UNSPECIFIED": 0, "DRAFT": 1, "SUBMITTED": 2, + "INFO_COMPLETE": 12, "ACCEPTED": 3, "ADDITIONAL_INFO_NEEDED": 4, "BUILDING": 5, @@ -253,6 +262,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "customerSiteId": { + "type": "string", + "id": 28, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -543,6 +559,20 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "customerViewedTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "authorEntity": { + "type": "Entity", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -761,6 +791,14 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "subscriptionConfigs": { + "rule": "repeated", + "type": "SubscriptionConfig", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -1202,6 +1240,43 @@ } } }, + "SubscriptionConfig": { + "fields": { + "subscriptionId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "billingId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "SubscriptionState", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "SubscriptionState": { + "values": { + "SUBSCRIPTION_STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "INACTIVE": 2, + "ERROR": 3, + "FAILED_TO_RETRIEVE": 4, + "COMPLETED": 5 + } + } + } + }, "GDCHardwareManagement": { "options": { "(google.api.default_host)": "gdchardwaremanagement.googleapis.com", @@ -1746,6 +1821,26 @@ } ] }, + "RecordActionOnComment": { + "requestType": "RecordActionOnCommentRequest", + "responseType": "Comment", + "options": { + "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/orders/*/comments/*}:recordAction", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,action_type" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{name=projects/*/locations/*/orders/*/comments/*}:recordAction", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,action_type" + } + ] + }, "ListChangeLogEntries": { "requestType": "ListChangeLogEntriesRequest", "responseType": "ListChangeLogEntriesResponse", @@ -2136,6 +2231,22 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "type": { + "type": "Type", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "INFO_PENDING": 1, + "INFO_COMPLETE": 2 + } } } }, @@ -2658,6 +2769,34 @@ } } }, + "RecordActionOnCommentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gdchardwaremanagement.googleapis.com/Comment" + } + }, + "actionType": { + "type": "ActionType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "ActionType": { + "values": { + "ACTION_TYPE_UNSPECIFIED": 0, + "READ": 1, + "UNREAD": 2 + } + } + } + }, "ListChangeLogEntriesRequest": { "fields": { "parent": { @@ -2976,8 +3115,17 @@ }, "nested": { "StateSignal": { + "options": { + "allow_alias": true + }, + "valuesOptions": { + "READY_FOR_SITE_TURNUP": { + "deprecated": true + } + }, "values": { "STATE_SIGNAL_UNSPECIFIED": 0, + "FACTORY_TURNUP_CHECKS_PASSED": 1, "READY_FOR_SITE_TURNUP": 1, "FACTORY_TURNUP_CHECKS_FAILED": 2 } diff --git a/packages/google-cloud-gdchardwaremanagement/samples/README.md b/packages/google-cloud-gdchardwaremanagement/samples/README.md index d463f51f412..e40e0a0607d 100644 --- a/packages/google-cloud-gdchardwaremanagement/samples/README.md +++ b/packages/google-cloud-gdchardwaremanagement/samples/README.md @@ -38,6 +38,7 @@ * [G_d_c_hardware_management.list_sites](#g_d_c_hardware_management.list_sites) * [G_d_c_hardware_management.list_skus](#g_d_c_hardware_management.list_skus) * [G_d_c_hardware_management.list_zones](#g_d_c_hardware_management.list_zones) + * [G_d_c_hardware_management.record_action_on_comment](#g_d_c_hardware_management.record_action_on_comment) * [G_d_c_hardware_management.signal_zone_state](#g_d_c_hardware_management.signal_zone_state) * [G_d_c_hardware_management.submit_order](#g_d_c_hardware_management.submit_order) * [G_d_c_hardware_management.update_hardware](#g_d_c_hardware_management.update_hardware) @@ -504,6 +505,23 @@ __Usage:__ +### G_d_c_hardware_management.record_action_on_comment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.record_action_on_comment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.record_action_on_comment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.record_action_on_comment.js` + + +----- + + + + ### G_d_c_hardware_management.signal_zone_state View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.signal_zone_state.js). diff --git a/packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.record_action_on_comment.js b/packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.record_action_on_comment.js new file mode 100644 index 00000000000..351320fd310 --- /dev/null +++ b/packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.record_action_on_comment.js @@ -0,0 +1,68 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, actionType) { + // [START gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_RecordActionOnComment_async] + /** + * 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the comment. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/comments/{comment}` + */ + // const name = 'abc123' + /** + * Required. The action type of the recorded action. + */ + // const actionType = {} + + // Imports the Gdchardwaremanagement library + const {GDCHardwareManagementClient} = require('@google-cloud/gdchardwaremanagement').v1alpha; + + // Instantiates a client + const gdchardwaremanagementClient = new GDCHardwareManagementClient(); + + async function callRecordActionOnComment() { + // Construct request + const request = { + name, + actionType, + }; + + // Run request + const response = await gdchardwaremanagementClient.recordActionOnComment(request); + console.log(response); + } + + callRecordActionOnComment(); + // [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_RecordActionOnComment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.submit_order.js b/packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.submit_order.js index ddf64d3713c..805806d1ad7 100644 --- a/packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.submit_order.js +++ b/packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/g_d_c_hardware_management.submit_order.js @@ -38,6 +38,11 @@ function main(name) { * AIP-155 (https://google.aip.dev/155). */ // const requestId = 'abc123' + /** + * Optional. Type of this request. If unset, the request type is assumed to be + * `INFO_PENDING`. + */ + // const type = {} // Imports the Gdchardwaremanagement library const {GDCHardwareManagementClient} = require('@google-cloud/gdchardwaremanagement').v1alpha; diff --git a/packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/snippet_metadata_google.cloud.gdchardwaremanagement.v1alpha.json b/packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/snippet_metadata_google.cloud.gdchardwaremanagement.v1alpha.json index a78c35cc20c..b461632ee0c 100644 --- a/packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/snippet_metadata_google.cloud.gdchardwaremanagement.v1alpha.json +++ b/packages/google-cloud-gdchardwaremanagement/samples/generated/v1alpha/snippet_metadata_google.cloud.gdchardwaremanagement.v1alpha.json @@ -266,7 +266,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 65, "type": "FULL" } ], @@ -282,6 +282,10 @@ { "name": "request_id", "type": "TYPE_STRING" + }, + { + "name": "type", + "type": ".google.cloud.gdchardwaremanagement.v1alpha.SubmitOrderRequest.Type" } ], "resultType": ".google.longrunning.Operation", @@ -1119,6 +1123,50 @@ } } }, + { + "regionTag": "gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_RecordActionOnComment_async", + "title": "GDCHardwareManagement recordActionOnComment Sample", + "origin": "API_DEFINITION", + "description": " Record Action on a Comment. If the Action specified in the request is READ, the viewed time in the comment is set to the time the request was received. If the comment is already marked as read, subsequent calls will be ignored. If the Action is UNREAD, the viewed time is cleared from the comment.", + "canonical": true, + "file": "g_d_c_hardware_management.record_action_on_comment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RecordActionOnComment", + "fullName": "google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement.RecordActionOnComment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "action_type", + "type": ".google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest.ActionType" + } + ], + "resultType": ".google.cloud.gdchardwaremanagement.v1alpha.Comment", + "client": { + "shortName": "GDCHardwareManagementClient", + "fullName": "google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagementClient" + }, + "method": { + "shortName": "RecordActionOnComment", + "fullName": "google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement.RecordActionOnComment", + "service": { + "shortName": "GDCHardwareManagement", + "fullName": "google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement" + } + } + } + }, { "regionTag": "gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_ListChangeLogEntries_async", "title": "GDCHardwareManagement listChangeLogEntries Sample", diff --git a/packages/google-cloud-gdchardwaremanagement/src/v1alpha/g_d_c_hardware_management_client.ts b/packages/google-cloud-gdchardwaremanagement/src/v1alpha/g_d_c_hardware_management_client.ts index ecd0db7f2dc..51a1d078c82 100644 --- a/packages/google-cloud-gdchardwaremanagement/src/v1alpha/g_d_c_hardware_management_client.ts +++ b/packages/google-cloud-gdchardwaremanagement/src/v1alpha/g_d_c_hardware_management_client.ts @@ -594,6 +594,7 @@ export class GDCHardwareManagementClient { 'listComments', 'getComment', 'createComment', + 'recordActionOnComment', 'listChangeLogEntries', 'getChangeLogEntry', 'listSkus', @@ -1207,6 +1208,109 @@ export class GDCHardwareManagementClient { this.initialize(); return this.innerApiCalls.getComment(request, options, callback); } + /** + * Record Action on a Comment. If the Action specified in the request is READ, + * the viewed time in the comment is set to the time the request was received. + * If the comment is already marked as read, subsequent calls will be ignored. + * If the Action is UNREAD, the viewed time is cleared from the comment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the comment. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/comments/{comment}` + * @param {google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest.ActionType} request.actionType + * Required. The action type of the recorded action. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.gdchardwaremanagement.v1alpha.Comment|Comment}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/g_d_c_hardware_management.record_action_on_comment.js + * region_tag:gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_RecordActionOnComment_async + */ + recordActionOnComment( + request?: protos.google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gdchardwaremanagement.v1alpha.IComment, + ( + | protos.google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest + | undefined + ), + {} | undefined, + ] + >; + recordActionOnComment( + request: protos.google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gdchardwaremanagement.v1alpha.IComment, + | protos.google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + recordActionOnComment( + request: protos.google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest, + callback: Callback< + protos.google.cloud.gdchardwaremanagement.v1alpha.IComment, + | protos.google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + recordActionOnComment( + request?: protos.google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gdchardwaremanagement.v1alpha.IComment, + | protos.google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gdchardwaremanagement.v1alpha.IComment, + | protos.google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gdchardwaremanagement.v1alpha.IComment, + ( + | protos.google.cloud.gdchardwaremanagement.v1alpha.IRecordActionOnCommentRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.recordActionOnComment(request, options, callback); + } /** * Gets details of a change to an order. * @@ -1951,6 +2055,9 @@ export class GDCHardwareManagementClient { * @param {string} [request.requestId] * Optional. An optional unique identifier for this request. See * [AIP-155](https://google.aip.dev/155). + * @param {google.cloud.gdchardwaremanagement.v1alpha.SubmitOrderRequest.Type} [request.type] + * Optional. Type of this request. If unset, the request type is assumed to be + * `INFO_PENDING`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. diff --git a/packages/google-cloud-gdchardwaremanagement/src/v1alpha/g_d_c_hardware_management_client_config.json b/packages/google-cloud-gdchardwaremanagement/src/v1alpha/g_d_c_hardware_management_client_config.json index f2fe35ea9d7..cfbc6c74e09 100644 --- a/packages/google-cloud-gdchardwaremanagement/src/v1alpha/g_d_c_hardware_management_client_config.json +++ b/packages/google-cloud-gdchardwaremanagement/src/v1alpha/g_d_c_hardware_management_client_config.json @@ -147,6 +147,10 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "RecordActionOnComment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "ListChangeLogEntries": { "timeout_millis": 60000, "retry_codes_name": "unavailable", diff --git a/packages/google-cloud-gdchardwaremanagement/src/v1alpha/gapic_metadata.json b/packages/google-cloud-gdchardwaremanagement/src/v1alpha/gapic_metadata.json index bd11b571263..745009b9592 100644 --- a/packages/google-cloud-gdchardwaremanagement/src/v1alpha/gapic_metadata.json +++ b/packages/google-cloud-gdchardwaremanagement/src/v1alpha/gapic_metadata.json @@ -35,6 +35,11 @@ "getComment" ] }, + "RecordActionOnComment": { + "methods": [ + "recordActionOnComment" + ] + }, "GetChangeLogEntry": { "methods": [ "getChangeLogEntry" @@ -221,6 +226,11 @@ "getComment" ] }, + "RecordActionOnComment": { + "methods": [ + "recordActionOnComment" + ] + }, "GetChangeLogEntry": { "methods": [ "getChangeLogEntry" diff --git a/packages/google-cloud-gdchardwaremanagement/test/gapic_g_d_c_hardware_management_v1alpha.ts b/packages/google-cloud-gdchardwaremanagement/test/gapic_g_d_c_hardware_management_v1alpha.ts index f2d80a4f190..ece4fd2a9b9 100644 --- a/packages/google-cloud-gdchardwaremanagement/test/gapic_g_d_c_hardware_management_v1alpha.ts +++ b/packages/google-cloud-gdchardwaremanagement/test/gapic_g_d_c_hardware_management_v1alpha.ts @@ -1025,6 +1025,147 @@ describe('v1alpha.GDCHardwareManagementClient', () => { }); }); + describe('recordActionOnComment', () => { + it('invokes recordActionOnComment without error', async () => { + const client = + new gdchardwaremanagementModule.v1alpha.GDCHardwareManagementClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gdchardwaremanagement.v1alpha.Comment() + ); + client.innerApiCalls.recordActionOnComment = + stubSimpleCall(expectedResponse); + const [response] = await client.recordActionOnComment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.recordActionOnComment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.recordActionOnComment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes recordActionOnComment without error using callback', async () => { + const client = + new gdchardwaremanagementModule.v1alpha.GDCHardwareManagementClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gdchardwaremanagement.v1alpha.Comment() + ); + client.innerApiCalls.recordActionOnComment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.recordActionOnComment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gdchardwaremanagement.v1alpha.IComment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.recordActionOnComment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.recordActionOnComment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes recordActionOnComment with error', async () => { + const client = + new gdchardwaremanagementModule.v1alpha.GDCHardwareManagementClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.recordActionOnComment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.recordActionOnComment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.recordActionOnComment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.recordActionOnComment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes recordActionOnComment with closed client', async () => { + const client = + new gdchardwaremanagementModule.v1alpha.GDCHardwareManagementClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.recordActionOnComment(request), + expectedError + ); + }); + }); + describe('getChangeLogEntry', () => { it('invokes getChangeLogEntry without error', async () => { const client =