From be0daf05c3f4597a99289d18ef54df112432cd13 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 12 Dec 2023 00:24:14 -0800 Subject: [PATCH] feat(all): auto-regenerate discovery clients (#2300) --- androidpublisher/v3/androidpublisher-api.json | 1108 +- androidpublisher/v3/androidpublisher-gen.go | 19617 +++++++++------- cloudbilling/v1/cloudbilling-api.json | 22 +- cloudbilling/v1/cloudbilling-gen.go | 72 +- cloudbilling/v1beta/cloudbilling-api.json | 186 +- cloudbilling/v1beta/cloudbilling-gen.go | 633 +- language/v1/language-api.json | 6 +- language/v1/language-gen.go | 6 +- language/v1beta2/language-api.json | 6 +- language/v1beta2/language-gen.go | 6 +- monitoring/v1/monitoring-api.json | 21 +- monitoring/v1/monitoring-gen.go | 38 + .../v1/paymentsresellersubscription-api.json | 10 +- .../v1/paymentsresellersubscription-gen.go | 16 +- .../v1alpha1/playdeveloperreporting-api.json | 6 +- .../v1alpha1/playdeveloperreporting-gen.go | 14 +- .../v1beta1/playdeveloperreporting-api.json | 6 +- .../v1beta1/playdeveloperreporting-gen.go | 14 +- policysimulator/v1/policysimulator-api.json | 6 +- policysimulator/v1/policysimulator-gen.go | 7 + .../v1alpha/policysimulator-api.json | 6 +- .../v1alpha/policysimulator-gen.go | 7 + .../v1beta/policysimulator-api.json | 6 +- policysimulator/v1beta/policysimulator-gen.go | 7 + retail/v2alpha/retail-api.json | 10 +- retail/v2alpha/retail-gen.go | 8 + script/v1/script-api.json | 6 +- script/v1/script-gen.go | 5 + securitycenter/v1/securitycenter-api.json | 899 +- securitycenter/v1/securitycenter-gen.go | 17986 ++++++++------ .../v1/serviceconsumermanagement-api.json | 6 +- .../v1/serviceconsumermanagement-gen.go | 5 + .../serviceconsumermanagement-api.json | 6 +- .../v1beta1/serviceconsumermanagement-gen.go | 5 + serviceusage/v1/serviceusage-api.json | 6 +- serviceusage/v1/serviceusage-gen.go | 5 + serviceusage/v1beta1/serviceusage-api.json | 6 +- serviceusage/v1beta1/serviceusage-gen.go | 5 + 38 files changed, 25106 insertions(+), 15678 deletions(-) diff --git a/androidpublisher/v3/androidpublisher-api.json b/androidpublisher/v3/androidpublisher-api.json index bb6304a9154..08b2560b661 100644 --- a/androidpublisher/v3/androidpublisher-api.json +++ b/androidpublisher/v3/androidpublisher-api.json @@ -2132,6 +2132,87 @@ }, "inappproducts": { "methods": { + "batchDelete": { + "description": "Deletes in-app products (managed products or subscriptions). Set the latencyTolerance field on nested requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update throughput. This method should not be used to delete subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.", + "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts:batchDelete", + "httpMethod": "POST", + "id": "androidpublisher.inappproducts.batchDelete", + "parameterOrder": [ + "packageName" + ], + "parameters": { + "packageName": { + "description": "Package name of the app.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/inappproducts:batchDelete", + "request": { + "$ref": "InappproductsBatchDeleteRequest" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "batchGet": { + "description": "Reads multiple in-app products, which can be managed products or subscriptions. This method should not be used to retrieve subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.", + "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts:batchGet", + "httpMethod": "GET", + "id": "androidpublisher.inappproducts.batchGet", + "parameterOrder": [ + "packageName" + ], + "parameters": { + "packageName": { + "description": "Package name of the app.", + "location": "path", + "required": true, + "type": "string" + }, + "sku": { + "description": "Unique identifier for the in-app products.", + "location": "query", + "repeated": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/inappproducts:batchGet", + "response": { + "$ref": "InappproductsBatchGetResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "batchUpdate": { + "description": "Updates or inserts one or more in-app products (managed products or subscriptions). Set the latencyTolerance field on nested requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update throughput. This method should no longer be used to update subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.", + "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts:batchUpdate", + "httpMethod": "POST", + "id": "androidpublisher.inappproducts.batchUpdate", + "parameterOrder": [ + "packageName" + ], + "parameters": { + "packageName": { + "description": "Package name of the app.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/inappproducts:batchUpdate", + "request": { + "$ref": "InappproductsBatchUpdateRequest" + }, + "response": { + "$ref": "InappproductsBatchUpdateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, "delete": { "description": "Deletes an in-app product (a managed product or a subscription). This method should no longer be used to delete subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.", "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", @@ -2142,6 +2223,21 @@ "sku" ], "parameters": { + "latencyTolerance": { + "description": "Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.", + "enum": [ + "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" + ], + "enumDescriptions": [ + "Defaults to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE.", + "The update will propagate to clients within several minutes on average and up to a few hours in rare cases. Throughput is limited to 7,200 updates per app per hour.", + "The update will propagate to clients within 24 hours. Supports high throughput of up to 720,000 updates per app per hour using batch modification methods." + ], + "location": "query", + "type": "string" + }, "packageName": { "description": "Package name of the app.", "location": "path", @@ -2281,6 +2377,21 @@ "location": "query", "type": "boolean" }, + "latencyTolerance": { + "description": "Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.", + "enum": [ + "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" + ], + "enumDescriptions": [ + "Defaults to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE.", + "The update will propagate to clients within several minutes on average and up to a few hours in rare cases. Throughput is limited to 7,200 updates per app per hour.", + "The update will propagate to clients within 24 hours. Supports high throughput of up to 720,000 updates per app per hour using batch modification methods." + ], + "location": "query", + "type": "string" + }, "packageName": { "description": "Package name of the app.", "location": "path", @@ -2325,6 +2436,21 @@ "location": "query", "type": "boolean" }, + "latencyTolerance": { + "description": "Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.", + "enum": [ + "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" + ], + "enumDescriptions": [ + "Defaults to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE.", + "The update will propagate to clients within several minutes on average and up to a few hours in rare cases. Throughput is limited to 7,200 updates per app per hour.", + "The update will propagate to clients within 24 hours. Supports high throughput of up to 720,000 updates per app per hour using batch modification methods." + ], + "location": "query", + "type": "string" + }, "packageName": { "description": "Package name of the app.", "location": "path", @@ -2505,6 +2631,63 @@ "https://www.googleapis.com/auth/androidpublisher" ] }, + "batchGet": { + "description": "Reads one or more subscriptions.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions:batchGet", + "httpMethod": "GET", + "id": "androidpublisher.monetization.subscriptions.batchGet", + "parameterOrder": [ + "packageName" + ], + "parameters": { + "packageName": { + "description": "Required. The parent app (package name) for which the subscriptions should be retrieved. Must be equal to the package_name field on all the requests.", + "location": "path", + "required": true, + "type": "string" + }, + "productIds": { + "description": "Required. A list of up to 100 subscription product IDs to retrieve. All the IDs must be different.", + "location": "query", + "repeated": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions:batchGet", + "response": { + "$ref": "BatchGetSubscriptionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "batchUpdate": { + "description": "Updates a batch of subscriptions. Set the latencyTolerance field on nested requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update throughput.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions:batchUpdate", + "httpMethod": "POST", + "id": "androidpublisher.monetization.subscriptions.batchUpdate", + "parameterOrder": [ + "packageName" + ], + "parameters": { + "packageName": { + "description": "Required. The parent app (package name) for which the subscriptions should be updated. Must be equal to the package_name field on all the Subscription resources.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions:batchUpdate", + "request": { + "$ref": "BatchUpdateSubscriptionsRequest" + }, + "response": { + "$ref": "BatchUpdateSubscriptionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, "create": { "description": "Creates a new subscription. Newly added base plans will remain in draft state until activated.", "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions", @@ -2651,6 +2834,26 @@ "productId" ], "parameters": { + "allowMissing": { + "description": "Optional. If set to true, and the subscription with the given package_name and product_id doesn't exist, the subscription will be created. If a new subscription is created, update_mask is ignored.", + "location": "query", + "type": "boolean" + }, + "latencyTolerance": { + "description": "Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.", + "enum": [ + "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" + ], + "enumDescriptions": [ + "Defaults to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE.", + "The update will propagate to clients within several minutes on average and up to a few hours in rare cases. Throughput is limited to 7,200 updates per app per hour.", + "The update will propagate to clients within 24 hours. Supports high throughput of up to 720,000 updates per app per hour using batch modification methods." + ], + "location": "query", + "type": "string" + }, "packageName": { "description": "Immutable. Package name of the parent app.", "location": "path", @@ -2731,6 +2934,74 @@ "https://www.googleapis.com/auth/androidpublisher" ] }, + "batchMigratePrices": { + "description": "Batch variant of the MigrateBasePlanPrices endpoint. Set the latencyTolerance field on nested requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update throughput.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans:batchMigratePrices", + "httpMethod": "POST", + "id": "androidpublisher.monetization.subscriptions.basePlans.batchMigratePrices", + "parameterOrder": [ + "packageName", + "productId" + ], + "parameters": { + "packageName": { + "description": "Required. The parent app (package name) for which the subscriptions should be created or updated. Must be equal to the package_name field on all the Subscription resources.", + "location": "path", + "required": true, + "type": "string" + }, + "productId": { + "description": "Required. The product ID of the parent subscription, if all updated offers belong to the same subscription. If this batch update spans multiple subscriptions, set this field to \"-\". Must be set.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans:batchMigratePrices", + "request": { + "$ref": "BatchMigrateBasePlanPricesRequest" + }, + "response": { + "$ref": "BatchMigrateBasePlanPricesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "batchUpdateStates": { + "description": "Activates or deactivates base plans across one or multiple subscriptions. Set the latencyTolerance field on nested requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update throughput.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans:batchUpdateStates", + "httpMethod": "POST", + "id": "androidpublisher.monetization.subscriptions.basePlans.batchUpdateStates", + "parameterOrder": [ + "packageName", + "productId" + ], + "parameters": { + "packageName": { + "description": "Required. The parent app (package name) of the updated base plans.", + "location": "path", + "required": true, + "type": "string" + }, + "productId": { + "description": "Required. The product ID of the parent subscription, if all updated base plans belong to the same subscription. If this batch update spans multiple subscriptions, set this field to \"-\". Must be set.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans:batchUpdateStates", + "request": { + "$ref": "BatchUpdateBasePlanStatesRequest" + }, + "response": { + "$ref": "BatchUpdateBasePlanStatesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, "deactivate": { "description": "Deactivates a base plan. Once deactivated, the base plan will become unavailable to new subscribers, but existing subscribers will maintain their subscription", "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:deactivate", @@ -2900,6 +3171,129 @@ "https://www.googleapis.com/auth/androidpublisher" ] }, + "batchGet": { + "description": "Reads one or more subscription offers.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers:batchGet", + "httpMethod": "POST", + "id": "androidpublisher.monetization.subscriptions.basePlans.offers.batchGet", + "parameterOrder": [ + "packageName", + "productId", + "basePlanId" + ], + "parameters": { + "basePlanId": { + "description": "Required. The parent base plan (ID) for which the offers should be read. May be specified as '-' to read offers from multiple base plans.", + "location": "path", + "required": true, + "type": "string" + }, + "packageName": { + "description": "Required. The parent app (package name) for which the subscriptions should be created or updated. Must be equal to the package_name field on all the requests.", + "location": "path", + "required": true, + "type": "string" + }, + "productId": { + "description": "Required. The product ID of the parent subscription, if all updated offers belong to the same subscription. If this request spans multiple subscriptions, set this field to \"-\". Must be set.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers:batchGet", + "request": { + "$ref": "BatchGetSubscriptionOffersRequest" + }, + "response": { + "$ref": "BatchGetSubscriptionOffersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "batchUpdate": { + "description": "Updates a batch of subscription offers. Set the latencyTolerance field on nested requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update throughput.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers:batchUpdate", + "httpMethod": "POST", + "id": "androidpublisher.monetization.subscriptions.basePlans.offers.batchUpdate", + "parameterOrder": [ + "packageName", + "productId", + "basePlanId" + ], + "parameters": { + "basePlanId": { + "description": "Required. The parent base plan (ID) for which the offers should be updated. May be specified as '-' to update offers from multiple base plans.", + "location": "path", + "required": true, + "type": "string" + }, + "packageName": { + "description": "Required. The parent app (package name) of the updated subscription offers. Must be equal to the package_name field on all the updated SubscriptionOffer resources.", + "location": "path", + "required": true, + "type": "string" + }, + "productId": { + "description": "Required. The product ID of the parent subscription, if all updated offers belong to the same subscription. If this request spans multiple subscriptions, set this field to \"-\". Must be set.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers:batchUpdate", + "request": { + "$ref": "BatchUpdateSubscriptionOffersRequest" + }, + "response": { + "$ref": "BatchUpdateSubscriptionOffersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "batchUpdateStates": { + "description": "Updates a batch of subscription offer states. Set the latencyTolerance field on nested requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update throughput.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers:batchUpdateStates", + "httpMethod": "POST", + "id": "androidpublisher.monetization.subscriptions.basePlans.offers.batchUpdateStates", + "parameterOrder": [ + "packageName", + "productId", + "basePlanId" + ], + "parameters": { + "basePlanId": { + "description": "Required. The parent base plan (ID) for which the offers should be updated. May be specified as '-' to update offers from multiple base plans.", + "location": "path", + "required": true, + "type": "string" + }, + "packageName": { + "description": "Required. The parent app (package name) of the updated subscription offers. Must be equal to the package_name field on all the updated SubscriptionOffer resources.", + "location": "path", + "required": true, + "type": "string" + }, + "productId": { + "description": "Required. The product ID of the parent subscription, if all updated offers belong to the same subscription. If this request spans multiple subscriptions, set this field to \"-\". Must be set.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers:batchUpdateStates", + "request": { + "$ref": "BatchUpdateSubscriptionOfferStatesRequest" + }, + "response": { + "$ref": "BatchUpdateSubscriptionOfferStatesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, "create": { "description": "Creates a new subscription offer. Only auto-renewing base plans can have subscription offers. The offer state will be DRAFT until it is activated.", "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers", @@ -3147,12 +3541,32 @@ "offerId" ], "parameters": { + "allowMissing": { + "description": "Optional. If set to true, and the subscription offer with the given package_name, product_id, base_plan_id and offer_id doesn't exist, an offer will be created. If a new offer is created, update_mask is ignored.", + "location": "query", + "type": "boolean" + }, "basePlanId": { "description": "Required. Immutable. The ID of the base plan to which this offer is an extension.", "location": "path", "required": true, "type": "string" }, + "latencyTolerance": { + "description": "Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.", + "enum": [ + "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" + ], + "enumDescriptions": [ + "Defaults to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE.", + "The update will propagate to clients within several minutes on average and up to a few hours in rare cases. Throughput is limited to 7,200 updates per app per hour.", + "The update will propagate to clients within 24 hours. Supports high throughput of up to 720,000 updates per app per hour using batch modification methods." + ], + "location": "query", + "type": "string" + }, "offerId": { "description": "Required. Immutable. Unique ID of this subscription offer. Must be unique within the base plan.", "location": "path", @@ -4081,7 +4495,7 @@ } } }, - "revision": "20231115", + "revision": "20231210", "rootUrl": "https://androidpublisher.googleapis.com/", "schemas": { "Abi": { @@ -4148,13 +4562,71 @@ "ActivateBasePlanRequest": { "description": "Request message for ActivateBasePlan.", "id": "ActivateBasePlanRequest", - "properties": {}, + "properties": { + "basePlanId": { + "description": "Required. The unique base plan ID of the base plan to activate.", + "type": "string" + }, + "latencyTolerance": { + "description": "Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.", + "enum": [ + "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" + ], + "enumDescriptions": [ + "Defaults to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE.", + "The update will propagate to clients within several minutes on average and up to a few hours in rare cases. Throughput is limited to 7,200 updates per app per hour.", + "The update will propagate to clients within 24 hours. Supports high throughput of up to 720,000 updates per app per hour using batch modification methods." + ], + "type": "string" + }, + "packageName": { + "description": "Required. The parent app (package name) of the base plan to activate.", + "type": "string" + }, + "productId": { + "description": "Required. The parent subscription (ID) of the base plan to activate.", + "type": "string" + } + }, "type": "object" }, "ActivateSubscriptionOfferRequest": { "description": "Request message for ActivateSubscriptionOffer.", "id": "ActivateSubscriptionOfferRequest", - "properties": {}, + "properties": { + "basePlanId": { + "description": "Required. The parent base plan (ID) of the offer to activate.", + "type": "string" + }, + "latencyTolerance": { + "description": "Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.", + "enum": [ + "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" + ], + "enumDescriptions": [ + "Defaults to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE.", + "The update will propagate to clients within several minutes on average and up to a few hours in rare cases. Throughput is limited to 7,200 updates per app per hour.", + "The update will propagate to clients within 24 hours. Supports high throughput of up to 720,000 updates per app per hour using batch modification methods." + ], + "type": "string" + }, + "offerId": { + "description": "Required. The unique offer ID of the offer to activate.", + "type": "string" + }, + "packageName": { + "description": "Required. The parent app (package name) of the offer to activate.", + "type": "string" + }, + "productId": { + "description": "Required. The parent subscription (ID) of the offer to activate.", + "type": "string" + } + }, "type": "object" }, "Apk": { @@ -4450,71 +4922,252 @@ }, "type": "object" }, - "AutoRenewingPlan": { - "description": "Information related to an auto renewing plan.", - "id": "AutoRenewingPlan", + "AutoRenewingPlan": { + "description": "Information related to an auto renewing plan.", + "id": "AutoRenewingPlan", + "properties": { + "autoRenewEnabled": { + "description": "If the subscription is currently set to auto-renew, e.g. the user has not canceled the subscription", + "type": "boolean" + }, + "priceChangeDetails": { + "$ref": "SubscriptionItemPriceChangeDetails", + "description": "The information of the last price change for the item since subscription signup." + } + }, + "type": "object" + }, + "BasePlan": { + "description": "A single base plan for a subscription.", + "id": "BasePlan", + "properties": { + "autoRenewingBasePlanType": { + "$ref": "AutoRenewingBasePlanType", + "description": "Set when the base plan automatically renews at a regular interval." + }, + "basePlanId": { + "description": "Required. Immutable. The unique identifier of this base plan. Must be unique within the subscription, and conform with RFC-1034. That is, this ID can only contain lower-case letters (a-z), numbers (0-9), and hyphens (-), and be at most 63 characters.", + "type": "string" + }, + "offerTags": { + "description": "List of up to 20 custom tags specified for this base plan, and returned to the app through the billing library. Subscription offers for this base plan will also receive these offer tags in the billing library.", + "items": { + "$ref": "OfferTag" + }, + "type": "array" + }, + "otherRegionsConfig": { + "$ref": "OtherRegionsBasePlanConfig", + "description": "Pricing information for any new locations Play may launch in the future. If omitted, the BasePlan will not be automatically available any new locations Play may launch in the future." + }, + "prepaidBasePlanType": { + "$ref": "PrepaidBasePlanType", + "description": "Set when the base plan does not automatically renew at the end of the billing period." + }, + "regionalConfigs": { + "description": "Region-specific information for this base plan.", + "items": { + "$ref": "RegionalBasePlanConfig" + }, + "type": "array" + }, + "state": { + "description": "Output only. The state of the base plan, i.e. whether it's active. Draft and inactive base plans can be activated or deleted. Active base plans can be made inactive. Inactive base plans can be canceled. This field cannot be changed by updating the resource. Use the dedicated endpoints instead.", + "enum": [ + "STATE_UNSPECIFIED", + "DRAFT", + "ACTIVE", + "INACTIVE" + ], + "enumDescriptions": [ + "Unspecified state.", + "The base plan is currently in a draft state, and hasn't been activated. It can be safely deleted at this point.", + "The base plan is active and available for new subscribers.", + "The base plan is inactive and only available for existing subscribers." + ], + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "BatchGetSubscriptionOffersRequest": { + "description": "Request message for BatchGetSubscriptionOffers endpoint.", + "id": "BatchGetSubscriptionOffersRequest", + "properties": { + "requests": { + "description": "Required. A list of update requests of up to 100 elements. All requests must update different subscriptions.", + "items": { + "$ref": "GetSubscriptionOfferRequest" + }, + "type": "array" + } + }, + "type": "object" + }, + "BatchGetSubscriptionOffersResponse": { + "description": "Response message for BatchGetSubscriptionOffers endpoint.", + "id": "BatchGetSubscriptionOffersResponse", + "properties": { + "subscriptionOffers": { + "items": { + "$ref": "SubscriptionOffer" + }, + "type": "array" + } + }, + "type": "object" + }, + "BatchGetSubscriptionsResponse": { + "description": "Response message for BatchGetSubscriptions endpoint.", + "id": "BatchGetSubscriptionsResponse", + "properties": { + "subscriptions": { + "description": "The list of requested subscriptions, in the same order as the request.", + "items": { + "$ref": "Subscription" + }, + "type": "array" + } + }, + "type": "object" + }, + "BatchMigrateBasePlanPricesRequest": { + "description": "Request message for BatchMigrateBasePlanPrices.", + "id": "BatchMigrateBasePlanPricesRequest", + "properties": { + "requests": { + "description": "Required. Up to 100 price migration requests. All requests must update different base plans.", + "items": { + "$ref": "MigrateBasePlanPricesRequest" + }, + "type": "array" + } + }, + "type": "object" + }, + "BatchMigrateBasePlanPricesResponse": { + "description": "Response message for BatchMigrateBasePlanPrices.", + "id": "BatchMigrateBasePlanPricesResponse", + "properties": { + "responses": { + "description": "Contains one response per requested price migration, in the same order as the request.", + "items": { + "$ref": "MigrateBasePlanPricesResponse" + }, + "type": "array" + } + }, + "type": "object" + }, + "BatchUpdateBasePlanStatesRequest": { + "description": "Request message for BatchUpdateBasePlanStates.", + "id": "BatchUpdateBasePlanStatesRequest", + "properties": { + "requests": { + "description": "Required. The update request list of up to 100 elements. All requests must update different base plans.", + "items": { + "$ref": "UpdateBasePlanStateRequest" + }, + "type": "array" + } + }, + "type": "object" + }, + "BatchUpdateBasePlanStatesResponse": { + "description": "Response message for BatchUpdateBasePlanStates.", + "id": "BatchUpdateBasePlanStatesResponse", + "properties": { + "subscriptions": { + "description": "The list of updated subscriptions. This list will match the requests one to one, in the same order.", + "items": { + "$ref": "Subscription" + }, + "type": "array" + } + }, + "type": "object" + }, + "BatchUpdateSubscriptionOfferStatesRequest": { + "description": "Request message for BatchUpdateSubscriptionOfferStates.", + "id": "BatchUpdateSubscriptionOfferStatesRequest", + "properties": { + "requests": { + "description": "Required. The update request list of up to 100 elements. All requests must update different offers.", + "items": { + "$ref": "UpdateSubscriptionOfferStateRequest" + }, + "type": "array" + } + }, + "type": "object" + }, + "BatchUpdateSubscriptionOfferStatesResponse": { + "description": "Response message for BatchUpdateSubscriptionOfferStates.", + "id": "BatchUpdateSubscriptionOfferStatesResponse", + "properties": { + "subscriptionOffers": { + "description": "The updated subscription offers list.", + "items": { + "$ref": "SubscriptionOffer" + }, + "type": "array" + } + }, + "type": "object" + }, + "BatchUpdateSubscriptionOffersRequest": { + "description": "Request message for BatchUpdateSubscriptionOffers.", + "id": "BatchUpdateSubscriptionOffersRequest", + "properties": { + "requests": { + "description": "Required. A list of update requests of up to 100 elements. All requests must update different subscription offers.", + "items": { + "$ref": "UpdateSubscriptionOfferRequest" + }, + "type": "array" + } + }, + "type": "object" + }, + "BatchUpdateSubscriptionOffersResponse": { + "description": "Response message for BatchUpdateSubscriptionOffers.", + "id": "BatchUpdateSubscriptionOffersResponse", "properties": { - "autoRenewEnabled": { - "description": "If the subscription is currently set to auto-renew, e.g. the user has not canceled the subscription", - "type": "boolean" - }, - "priceChangeDetails": { - "$ref": "SubscriptionItemPriceChangeDetails", - "description": "The information of the last price change for the item since subscription signup." + "subscriptionOffers": { + "description": "The updated subscription offers list.", + "items": { + "$ref": "SubscriptionOffer" + }, + "type": "array" } }, "type": "object" }, - "BasePlan": { - "description": "A single base plan for a subscription.", - "id": "BasePlan", + "BatchUpdateSubscriptionsRequest": { + "description": "Request message for BatchUpdateSubscription.", + "id": "BatchUpdateSubscriptionsRequest", "properties": { - "autoRenewingBasePlanType": { - "$ref": "AutoRenewingBasePlanType", - "description": "Set when the base plan automatically renews at a regular interval." - }, - "basePlanId": { - "description": "Required. Immutable. The unique identifier of this base plan. Must be unique within the subscription, and conform with RFC-1034. That is, this ID can only contain lower-case letters (a-z), numbers (0-9), and hyphens (-), and be at most 63 characters.", - "type": "string" - }, - "offerTags": { - "description": "List of up to 20 custom tags specified for this base plan, and returned to the app through the billing library. Subscription offers for this base plan will also receive these offer tags in the billing library.", + "requests": { + "description": "Required. A list of update requests of up to 100 elements. All requests must update different subscriptions.", "items": { - "$ref": "OfferTag" + "$ref": "UpdateSubscriptionRequest" }, "type": "array" - }, - "otherRegionsConfig": { - "$ref": "OtherRegionsBasePlanConfig", - "description": "Pricing information for any new locations Play may launch in the future. If omitted, the BasePlan will not be automatically available any new locations Play may launch in the future." - }, - "prepaidBasePlanType": { - "$ref": "PrepaidBasePlanType", - "description": "Set when the base plan does not automatically renew at the end of the billing period." - }, - "regionalConfigs": { - "description": "Region-specific information for this base plan.", + } + }, + "type": "object" + }, + "BatchUpdateSubscriptionsResponse": { + "description": "Response message for BatchUpdateSubscription.", + "id": "BatchUpdateSubscriptionsResponse", + "properties": { + "subscriptions": { + "description": "The updated subscriptions list.", "items": { - "$ref": "RegionalBasePlanConfig" + "$ref": "Subscription" }, "type": "array" - }, - "state": { - "description": "Output only. The state of the base plan, i.e. whether it's active. Draft and inactive base plans can be activated or deleted. Active base plans can be made inactive. Inactive base plans can be canceled. This field cannot be changed by updating the resource. Use the dedicated endpoints instead.", - "enum": [ - "STATE_UNSPECIFIED", - "DRAFT", - "ACTIVE", - "INACTIVE" - ], - "enumDescriptions": [ - "Unspecified state.", - "The base plan is currently in a draft state, and hasn't been activated. It can be safely deleted at this point.", - "The base plan is active and available for new subscribers.", - "The base plan is inactive and only available for existing subscribers." - ], - "readOnly": true, - "type": "string" } }, "type": "object" @@ -4710,13 +5363,71 @@ "DeactivateBasePlanRequest": { "description": "Request message for DeactivateBasePlan.", "id": "DeactivateBasePlanRequest", - "properties": {}, + "properties": { + "basePlanId": { + "description": "Required. The unique base plan ID of the base plan to deactivate.", + "type": "string" + }, + "latencyTolerance": { + "description": "Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.", + "enum": [ + "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" + ], + "enumDescriptions": [ + "Defaults to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE.", + "The update will propagate to clients within several minutes on average and up to a few hours in rare cases. Throughput is limited to 7,200 updates per app per hour.", + "The update will propagate to clients within 24 hours. Supports high throughput of up to 720,000 updates per app per hour using batch modification methods." + ], + "type": "string" + }, + "packageName": { + "description": "Required. The parent app (package name) of the base plan to deactivate.", + "type": "string" + }, + "productId": { + "description": "Required. The parent subscription (ID) of the base plan to deactivate.", + "type": "string" + } + }, "type": "object" }, "DeactivateSubscriptionOfferRequest": { "description": "Request message for DeactivateSubscriptionOffer.", "id": "DeactivateSubscriptionOfferRequest", - "properties": {}, + "properties": { + "basePlanId": { + "description": "Required. The parent base plan (ID) of the offer to deactivate.", + "type": "string" + }, + "latencyTolerance": { + "description": "Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.", + "enum": [ + "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" + ], + "enumDescriptions": [ + "Defaults to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE.", + "The update will propagate to clients within several minutes on average and up to a few hours in rare cases. Throughput is limited to 7,200 updates per app per hour.", + "The update will propagate to clients within 24 hours. Supports high throughput of up to 720,000 updates per app per hour using batch modification methods." + ], + "type": "string" + }, + "offerId": { + "description": "Required. The unique offer ID of the offer to deactivate.", + "type": "string" + }, + "packageName": { + "description": "Required. The parent app (package name) of the offer to deactivate.", + "type": "string" + }, + "productId": { + "description": "Required. The parent subscription (ID) of the offer to deactivate.", + "type": "string" + } + }, "type": "object" }, "DeferredItemReplacement": { @@ -5430,6 +6141,29 @@ }, "type": "object" }, + "GetSubscriptionOfferRequest": { + "description": "Request message for GetSubscriptionOffer.", + "id": "GetSubscriptionOfferRequest", + "properties": { + "basePlanId": { + "description": "Required. The parent base plan (ID) of the offer to get.", + "type": "string" + }, + "offerId": { + "description": "Required. The unique offer ID of the offer to get.", + "type": "string" + }, + "packageName": { + "description": "Required. The parent app (package name) of the offer to get.", + "type": "string" + }, + "productId": { + "description": "Required. The parent subscription (ID) of the offer to get.", + "type": "string" + } + }, + "type": "object" + }, "Grant": { "description": "An access grant resource.", "id": "Grant", @@ -5669,6 +6403,91 @@ }, "type": "object" }, + "InappproductsBatchDeleteRequest": { + "description": "Request to delete multiple in-app products.", + "id": "InappproductsBatchDeleteRequest", + "properties": { + "requests": { + "description": "Individual delete requests. At least one request is required. Can contain up to 100 requests. All requests must correspond to different in-app products.", + "items": { + "$ref": "InappproductsDeleteRequest" + }, + "type": "array" + } + }, + "type": "object" + }, + "InappproductsBatchGetResponse": { + "description": "Response message for BatchGetSubscriptions endpoint.", + "id": "InappproductsBatchGetResponse", + "properties": { + "inappproduct": { + "description": "The list of requested in-app products, in the same order as the request.", + "items": { + "$ref": "InAppProduct" + }, + "type": "array" + } + }, + "type": "object" + }, + "InappproductsBatchUpdateRequest": { + "description": "Request to update or insert one or more in-app products.", + "id": "InappproductsBatchUpdateRequest", + "properties": { + "requests": { + "description": "Required. Individual update requests. At least one request is required. Can contain up to 100 requests. All requests must correspond to different in-app products.", + "items": { + "$ref": "InappproductsUpdateRequest" + }, + "type": "array" + } + }, + "type": "object" + }, + "InappproductsBatchUpdateResponse": { + "description": "Response for a batch in-app product update.", + "id": "InappproductsBatchUpdateResponse", + "properties": { + "inappproducts": { + "description": "The updated or inserted in-app products.", + "items": { + "$ref": "InAppProduct" + }, + "type": "array" + } + }, + "type": "object" + }, + "InappproductsDeleteRequest": { + "description": "Request to delete an in-app product.", + "id": "InappproductsDeleteRequest", + "properties": { + "latencyTolerance": { + "description": "Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.", + "enum": [ + "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" + ], + "enumDescriptions": [ + "Defaults to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE.", + "The update will propagate to clients within several minutes on average and up to a few hours in rare cases. Throughput is limited to 7,200 updates per app per hour.", + "The update will propagate to clients within 24 hours. Supports high throughput of up to 720,000 updates per app per hour using batch modification methods." + ], + "type": "string" + }, + "packageName": { + "description": "Package name of the app.", + "type": "string" + }, + "sku": { + "description": "Unique identifier for the in-app product.", + "type": "string" + } + }, + "type": "object" + }, "InappproductsListResponse": { "description": "Response listing all in-app products.", "id": "InappproductsListResponse", @@ -5696,6 +6515,47 @@ }, "type": "object" }, + "InappproductsUpdateRequest": { + "description": "Request to update an in-app product.", + "id": "InappproductsUpdateRequest", + "properties": { + "allowMissing": { + "description": "If set to true, and the in-app product with the given package_name and sku doesn't exist, the in-app product will be created.", + "type": "boolean" + }, + "autoConvertMissingPrices": { + "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", + "type": "boolean" + }, + "inappproduct": { + "$ref": "InAppProduct", + "description": "The new in-app product." + }, + "latencyTolerance": { + "description": "Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.", + "enum": [ + "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" + ], + "enumDescriptions": [ + "Defaults to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE.", + "The update will propagate to clients within several minutes on average and up to a few hours in rare cases. Throughput is limited to 7,200 updates per app per hour.", + "The update will propagate to clients within 24 hours. Supports high throughput of up to 720,000 updates per app per hour using batch modification methods." + ], + "type": "string" + }, + "packageName": { + "description": "Package name of the app.", + "type": "string" + }, + "sku": { + "description": "Unique identifier for the in-app product.", + "type": "string" + } + }, + "type": "object" + }, "InternalAppSharingArtifact": { "description": "An artifact resource which gets created when uploading an APK or Android App Bundle through internal app sharing.", "id": "InternalAppSharingArtifact", @@ -5929,6 +6789,32 @@ "description": "Request message for MigrateBasePlanPrices.", "id": "MigrateBasePlanPricesRequest", "properties": { + "basePlanId": { + "description": "Required. The unique base plan ID of the base plan to update prices on.", + "type": "string" + }, + "latencyTolerance": { + "description": "Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.", + "enum": [ + "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" + ], + "enumDescriptions": [ + "Defaults to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE.", + "The update will propagate to clients within several minutes on average and up to a few hours in rare cases. Throughput is limited to 7,200 updates per app per hour.", + "The update will propagate to clients within 24 hours. Supports high throughput of up to 720,000 updates per app per hour using batch modification methods." + ], + "type": "string" + }, + "packageName": { + "description": "Required. Package name of the parent app. Must be equal to the package_name field on the Subscription resource.", + "type": "string" + }, + "productId": { + "description": "Required. The ID of the subscription to update. Must be equal to the product_id field on the Subscription resource.", + "type": "string" + }, "regionalPriceMigrations": { "description": "Required. The regional prices to update.", "items": { @@ -7787,6 +8673,112 @@ }, "type": "object" }, + "UpdateBasePlanStateRequest": { + "description": "Request message to update the state of a subscription base plan.", + "id": "UpdateBasePlanStateRequest", + "properties": { + "activateBasePlanRequest": { + "$ref": "ActivateBasePlanRequest", + "description": "Activates a base plan. Once activated, base plans will be available to new subscribers." + }, + "deactivateBasePlanRequest": { + "$ref": "DeactivateBasePlanRequest", + "description": "Deactivates a base plan. Once deactivated, the base plan will become unavailable to new subscribers, but existing subscribers will maintain their subscription" + } + }, + "type": "object" + }, + "UpdateSubscriptionOfferRequest": { + "description": "Request message for UpdateSubscriptionOffer.", + "id": "UpdateSubscriptionOfferRequest", + "properties": { + "allowMissing": { + "description": "Optional. If set to true, and the subscription offer with the given package_name, product_id, base_plan_id and offer_id doesn't exist, an offer will be created. If a new offer is created, update_mask is ignored.", + "type": "boolean" + }, + "latencyTolerance": { + "description": "Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.", + "enum": [ + "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" + ], + "enumDescriptions": [ + "Defaults to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE.", + "The update will propagate to clients within several minutes on average and up to a few hours in rare cases. Throughput is limited to 7,200 updates per app per hour.", + "The update will propagate to clients within 24 hours. Supports high throughput of up to 720,000 updates per app per hour using batch modification methods." + ], + "type": "string" + }, + "regionsVersion": { + "$ref": "RegionsVersion", + "description": "Required. The version of the available regions being used for the subscription_offer." + }, + "subscriptionOffer": { + "$ref": "SubscriptionOffer", + "description": "Required. The subscription offer to update." + }, + "updateMask": { + "description": "Required. The list of fields to be updated.", + "format": "google-fieldmask", + "type": "string" + } + }, + "type": "object" + }, + "UpdateSubscriptionOfferStateRequest": { + "description": "Request message to update the state of a subscription offer.", + "id": "UpdateSubscriptionOfferStateRequest", + "properties": { + "activateSubscriptionOfferRequest": { + "$ref": "ActivateSubscriptionOfferRequest", + "description": "Activates an offer. Once activated, the offer will be available to new subscribers." + }, + "deactivateSubscriptionOfferRequest": { + "$ref": "DeactivateSubscriptionOfferRequest", + "description": "Deactivates an offer. Once deactivated, the offer will become unavailable to new subscribers, but existing subscribers will maintain their subscription" + } + }, + "type": "object" + }, + "UpdateSubscriptionRequest": { + "description": "Request message for UpdateSubscription.", + "id": "UpdateSubscriptionRequest", + "properties": { + "allowMissing": { + "description": "Optional. If set to true, and the subscription with the given package_name and product_id doesn't exist, the subscription will be created. If a new subscription is created, update_mask is ignored.", + "type": "boolean" + }, + "latencyTolerance": { + "description": "Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.", + "enum": [ + "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE", + "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" + ], + "enumDescriptions": [ + "Defaults to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE.", + "The update will propagate to clients within several minutes on average and up to a few hours in rare cases. Throughput is limited to 7,200 updates per app per hour.", + "The update will propagate to clients within 24 hours. Supports high throughput of up to 720,000 updates per app per hour using batch modification methods." + ], + "type": "string" + }, + "regionsVersion": { + "$ref": "RegionsVersion", + "description": "Required. The version of the available regions being used for the subscription." + }, + "subscription": { + "$ref": "Subscription", + "description": "Required. The subscription to update." + }, + "updateMask": { + "description": "Required. The list of fields to be updated.", + "format": "google-fieldmask", + "type": "string" + } + }, + "type": "object" + }, "UpgradeTargetingRule": { "description": "Represents a targeting rule of the form: User currently has {scope} [with billing period {billing_period}].", "id": "UpgradeTargetingRule", diff --git a/androidpublisher/v3/androidpublisher-gen.go b/androidpublisher/v3/androidpublisher-gen.go index baeb81374a2..025fe4f27bc 100644 --- a/androidpublisher/v3/androidpublisher-gen.go +++ b/androidpublisher/v3/androidpublisher-gen.go @@ -632,11 +632,112 @@ func (s *AcquisitionTargetingRule) MarshalJSON() ([]byte, error) { // ActivateBasePlanRequest: Request message for ActivateBasePlan. type ActivateBasePlanRequest struct { + // BasePlanId: Required. The unique base plan ID of the base plan to + // activate. + BasePlanId string `json:"basePlanId,omitempty"` + + // LatencyTolerance: Optional. The latency tolerance for the propagation + // of this product update. Defaults to latency-sensitive. + // + // Possible values: + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" - Defaults to + // PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE. + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" - The update + // will propagate to clients within several minutes on average and up to + // a few hours in rare cases. Throughput is limited to 7,200 updates per + // app per hour. + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" - The update + // will propagate to clients within 24 hours. Supports high throughput + // of up to 720,000 updates per app per hour using batch modification + // methods. + LatencyTolerance string `json:"latencyTolerance,omitempty"` + + // PackageName: Required. The parent app (package name) of the base plan + // to activate. + PackageName string `json:"packageName,omitempty"` + + // ProductId: Required. The parent subscription (ID) of the base plan to + // activate. + ProductId string `json:"productId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BasePlanId") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "BasePlanId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ActivateBasePlanRequest) MarshalJSON() ([]byte, error) { + type NoMethod ActivateBasePlanRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ActivateSubscriptionOfferRequest: Request message for // ActivateSubscriptionOffer. type ActivateSubscriptionOfferRequest struct { + // BasePlanId: Required. The parent base plan (ID) of the offer to + // activate. + BasePlanId string `json:"basePlanId,omitempty"` + + // LatencyTolerance: Optional. The latency tolerance for the propagation + // of this product update. Defaults to latency-sensitive. + // + // Possible values: + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" - Defaults to + // PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE. + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" - The update + // will propagate to clients within several minutes on average and up to + // a few hours in rare cases. Throughput is limited to 7,200 updates per + // app per hour. + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" - The update + // will propagate to clients within 24 hours. Supports high throughput + // of up to 720,000 updates per app per hour using batch modification + // methods. + LatencyTolerance string `json:"latencyTolerance,omitempty"` + + // OfferId: Required. The unique offer ID of the offer to activate. + OfferId string `json:"offerId,omitempty"` + + // PackageName: Required. The parent app (package name) of the offer to + // activate. + PackageName string `json:"packageName,omitempty"` + + // ProductId: Required. The parent subscription (ID) of the offer to + // activate. + ProductId string `json:"productId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BasePlanId") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "BasePlanId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ActivateSubscriptionOfferRequest) MarshalJSON() ([]byte, error) { + type NoMethod ActivateSubscriptionOfferRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // Apk: Information about an APK. The resource for ApksService. @@ -1277,26 +1378,14 @@ func (s *BasePlan) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Bundle: Information about an app bundle. The resource for -// BundlesService. -type Bundle struct { - // Sha1: A sha1 hash of the upload payload, encoded as a hex string and - // matching the output of the sha1sum command. - Sha1 string `json:"sha1,omitempty"` - - // Sha256: A sha256 hash of the upload payload, encoded as a hex string - // and matching the output of the sha256sum command. - Sha256 string `json:"sha256,omitempty"` - - // VersionCode: The version code of the Android App Bundle, as specified - // in the Android App Bundle's base module APK manifest file. - VersionCode int64 `json:"versionCode,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` +// BatchGetSubscriptionOffersRequest: Request message for +// BatchGetSubscriptionOffers endpoint. +type BatchGetSubscriptionOffersRequest struct { + // Requests: Required. A list of update requests of up to 100 elements. + // All requests must update different subscriptions. + Requests []*GetSubscriptionOfferRequest `json:"requests,omitempty"` - // ForceSendFields is a list of field names (e.g. "Sha1") to + // ForceSendFields is a list of field names (e.g. "Requests") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1304,8 +1393,8 @@ type Bundle struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Sha1") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Requests") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -1313,71 +1402,57 @@ type Bundle struct { NullFields []string `json:"-"` } -func (s *Bundle) MarshalJSON() ([]byte, error) { - type NoMethod Bundle +func (s *BatchGetSubscriptionOffersRequest) MarshalJSON() ([]byte, error) { + type NoMethod BatchGetSubscriptionOffersRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// BundlesListResponse: Response listing all app bundles. -type BundlesListResponse struct { - // Bundles: All app bundles. - Bundles []*Bundle `json:"bundles,omitempty"` - - // Kind: The kind of this response - // ("androidpublisher#bundlesListResponse"). - Kind string `json:"kind,omitempty"` +// BatchGetSubscriptionOffersResponse: Response message for +// BatchGetSubscriptionOffers endpoint. +type BatchGetSubscriptionOffersResponse struct { + SubscriptionOffers []*SubscriptionOffer `json:"subscriptionOffers,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Bundles") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "SubscriptionOffers") + // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Bundles") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "SubscriptionOffers") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *BundlesListResponse) MarshalJSON() ([]byte, error) { - type NoMethod BundlesListResponse +func (s *BatchGetSubscriptionOffersResponse) MarshalJSON() ([]byte, error) { + type NoMethod BatchGetSubscriptionOffersResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// CancelSurveyResult: Result of the cancel survey when the subscription -// was canceled by the user. -type CancelSurveyResult struct { - // Reason: The reason the user selected in the cancel survey. - // - // Possible values: - // "CANCEL_SURVEY_REASON_UNSPECIFIED" - Unspecified cancel survey - // reason. - // "CANCEL_SURVEY_REASON_NOT_ENOUGH_USAGE" - Not enough usage of the - // subscription. - // "CANCEL_SURVEY_REASON_TECHNICAL_ISSUES" - Technical issues while - // using the app. - // "CANCEL_SURVEY_REASON_COST_RELATED" - Cost related issues. - // "CANCEL_SURVEY_REASON_FOUND_BETTER_APP" - The user found a better - // app. - // "CANCEL_SURVEY_REASON_OTHERS" - Other reasons. - Reason string `json:"reason,omitempty"` +// BatchGetSubscriptionsResponse: Response message for +// BatchGetSubscriptions endpoint. +type BatchGetSubscriptionsResponse struct { + // Subscriptions: The list of requested subscriptions, in the same order + // as the request. + Subscriptions []*Subscription `json:"subscriptions,omitempty"` - // ReasonUserInput: Only set for CANCEL_SURVEY_REASON_OTHERS. This is - // the user's freeform response to the survey. - ReasonUserInput string `json:"reasonUserInput,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Reason") to + // ForceSendFields is a list of field names (e.g. "Subscriptions") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1385,73 +1460,63 @@ type CancelSurveyResult struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Reason") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Subscriptions") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *CancelSurveyResult) MarshalJSON() ([]byte, error) { - type NoMethod CancelSurveyResult +func (s *BatchGetSubscriptionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod BatchGetSubscriptionsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// CanceledStateContext: Information specific to a subscription in -// canceled state. -type CanceledStateContext struct { - // DeveloperInitiatedCancellation: Subscription was canceled by the - // developer. - DeveloperInitiatedCancellation *DeveloperInitiatedCancellation `json:"developerInitiatedCancellation,omitempty"` - - // ReplacementCancellation: Subscription was replaced by a new - // subscription. - ReplacementCancellation *ReplacementCancellation `json:"replacementCancellation,omitempty"` - - // SystemInitiatedCancellation: Subscription was canceled by the system, - // for example because of a billing problem. - SystemInitiatedCancellation *SystemInitiatedCancellation `json:"systemInitiatedCancellation,omitempty"` - - // UserInitiatedCancellation: Subscription was canceled by user. - UserInitiatedCancellation *UserInitiatedCancellation `json:"userInitiatedCancellation,omitempty"` +// BatchMigrateBasePlanPricesRequest: Request message for +// BatchMigrateBasePlanPrices. +type BatchMigrateBasePlanPricesRequest struct { + // Requests: Required. Up to 100 price migration requests. All requests + // must update different base plans. + Requests []*MigrateBasePlanPricesRequest `json:"requests,omitempty"` - // ForceSendFields is a list of field names (e.g. - // "DeveloperInitiatedCancellation") to unconditionally include in API - // requests. By default, fields with empty or default values are omitted - // from API requests. However, any non-pointer, non-interface field - // appearing in ForceSendFields will be sent to the server regardless of - // whether the field is empty or not. This may be used to include empty - // fields in Patch requests. + // ForceSendFields is a list of field names (e.g. "Requests") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. - // "DeveloperInitiatedCancellation") to include in API requests with the - // JSON null value. By default, fields with empty values are omitted - // from API requests. However, any field with an empty value appearing - // in NullFields will be sent to the server as null. It is an error if a - // field in this list has a non-empty value. This may be used to include - // null fields in Patch requests. + // NullFields is a list of field names (e.g. "Requests") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *CanceledStateContext) MarshalJSON() ([]byte, error) { - type NoMethod CanceledStateContext +func (s *BatchMigrateBasePlanPricesRequest) MarshalJSON() ([]byte, error) { + type NoMethod BatchMigrateBasePlanPricesRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Comment: An entry of conversation between user and developer. -type Comment struct { - // DeveloperComment: A comment from a developer. - DeveloperComment *DeveloperComment `json:"developerComment,omitempty"` +// BatchMigrateBasePlanPricesResponse: Response message for +// BatchMigrateBasePlanPrices. +type BatchMigrateBasePlanPricesResponse struct { + // Responses: Contains one response per requested price migration, in + // the same order as the request. + Responses []*MigrateBasePlanPricesResponse `json:"responses,omitempty"` - // UserComment: A comment from a user. - UserComment *UserComment `json:"userComment,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "DeveloperComment") to + // ForceSendFields is a list of field names (e.g. "Responses") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1459,29 +1524,29 @@ type Comment struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DeveloperComment") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "Responses") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *Comment) MarshalJSON() ([]byte, error) { - type NoMethod Comment +func (s *BatchMigrateBasePlanPricesResponse) MarshalJSON() ([]byte, error) { + type NoMethod BatchMigrateBasePlanPricesResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ConvertRegionPricesRequest: Request message for ConvertRegionPrices. -type ConvertRegionPricesRequest struct { - // Price: The intital price to convert other regions from. Tax - // exclusive. - Price *Money `json:"price,omitempty"` +// BatchUpdateBasePlanStatesRequest: Request message for +// BatchUpdateBasePlanStates. +type BatchUpdateBasePlanStatesRequest struct { + // Requests: Required. The update request list of up to 100 elements. + // All requests must update different base plans. + Requests []*UpdateBasePlanStateRequest `json:"requests,omitempty"` - // ForceSendFields is a list of field names (e.g. "Price") to + // ForceSendFields is a list of field names (e.g. "Requests") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1489,8 +1554,8 @@ type ConvertRegionPricesRequest struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Price") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Requests") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -1498,64 +1563,54 @@ type ConvertRegionPricesRequest struct { NullFields []string `json:"-"` } -func (s *ConvertRegionPricesRequest) MarshalJSON() ([]byte, error) { - type NoMethod ConvertRegionPricesRequest +func (s *BatchUpdateBasePlanStatesRequest) MarshalJSON() ([]byte, error) { + type NoMethod BatchUpdateBasePlanStatesRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ConvertRegionPricesResponse: Response message for -// ConvertRegionPrices. -type ConvertRegionPricesResponse struct { - // ConvertedOtherRegionsPrice: Converted other regions prices in USD and - // EUR, to use for countries where Play doesn't support a country's - // local currency. - ConvertedOtherRegionsPrice *ConvertedOtherRegionsPrice `json:"convertedOtherRegionsPrice,omitempty"` - - // ConvertedRegionPrices: Map from region code to converted region - // price. - ConvertedRegionPrices map[string]ConvertedRegionPrice `json:"convertedRegionPrices,omitempty"` +// BatchUpdateBasePlanStatesResponse: Response message for +// BatchUpdateBasePlanStates. +type BatchUpdateBasePlanStatesResponse struct { + // Subscriptions: The list of updated subscriptions. This list will + // match the requests one to one, in the same order. + Subscriptions []*Subscription `json:"subscriptions,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. - // "ConvertedOtherRegionsPrice") to unconditionally include in API - // requests. By default, fields with empty or default values are omitted - // from API requests. However, any non-pointer, non-interface field - // appearing in ForceSendFields will be sent to the server regardless of - // whether the field is empty or not. This may be used to include empty - // fields in Patch requests. + // ForceSendFields is a list of field names (e.g. "Subscriptions") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. - // "ConvertedOtherRegionsPrice") to include in API requests with the - // JSON null value. By default, fields with empty values are omitted - // from API requests. However, any field with an empty value appearing - // in NullFields will be sent to the server as null. It is an error if a - // field in this list has a non-empty value. This may be used to include - // null fields in Patch requests. + // NullFields is a list of field names (e.g. "Subscriptions") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *ConvertRegionPricesResponse) MarshalJSON() ([]byte, error) { - type NoMethod ConvertRegionPricesResponse +func (s *BatchUpdateBasePlanStatesResponse) MarshalJSON() ([]byte, error) { + type NoMethod BatchUpdateBasePlanStatesResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ConvertedOtherRegionsPrice: Converted other regions prices. -type ConvertedOtherRegionsPrice struct { - // EurPrice: Price in EUR to use for the "Other regions" location - // exclusive of taxes. - EurPrice *Money `json:"eurPrice,omitempty"` - - // UsdPrice: Price in USD to use for the "Other regions" location - // exclusive of taxes. - UsdPrice *Money `json:"usdPrice,omitempty"` +// BatchUpdateSubscriptionOfferStatesRequest: Request message for +// BatchUpdateSubscriptionOfferStates. +type BatchUpdateSubscriptionOfferStatesRequest struct { + // Requests: Required. The update request list of up to 100 elements. + // All requests must update different offers. + Requests []*UpdateSubscriptionOfferStateRequest `json:"requests,omitempty"` - // ForceSendFields is a list of field names (e.g. "EurPrice") to + // ForceSendFields is a list of field names (e.g. "Requests") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1563,7 +1618,7 @@ type ConvertedOtherRegionsPrice struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "EurPrice") to include in + // NullFields is a list of field names (e.g. "Requests") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -1572,57 +1627,54 @@ type ConvertedOtherRegionsPrice struct { NullFields []string `json:"-"` } -func (s *ConvertedOtherRegionsPrice) MarshalJSON() ([]byte, error) { - type NoMethod ConvertedOtherRegionsPrice +func (s *BatchUpdateSubscriptionOfferStatesRequest) MarshalJSON() ([]byte, error) { + type NoMethod BatchUpdateSubscriptionOfferStatesRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ConvertedRegionPrice: A converted region price. -type ConvertedRegionPrice struct { - // Price: The converted price tax inclusive. - Price *Money `json:"price,omitempty"` - - // RegionCode: The region code of the region. - RegionCode string `json:"regionCode,omitempty"` +// BatchUpdateSubscriptionOfferStatesResponse: Response message for +// BatchUpdateSubscriptionOfferStates. +type BatchUpdateSubscriptionOfferStatesResponse struct { + // SubscriptionOffers: The updated subscription offers list. + SubscriptionOffers []*SubscriptionOffer `json:"subscriptionOffers,omitempty"` - // TaxAmount: The tax amount of the converted price. - TaxAmount *Money `json:"taxAmount,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Price") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "SubscriptionOffers") + // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Price") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "SubscriptionOffers") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *ConvertedRegionPrice) MarshalJSON() ([]byte, error) { - type NoMethod ConvertedRegionPrice +func (s *BatchUpdateSubscriptionOfferStatesResponse) MarshalJSON() ([]byte, error) { + type NoMethod BatchUpdateSubscriptionOfferStatesResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// CountryTargeting: Country targeting specification. -type CountryTargeting struct { - // Countries: Countries to target, specified as two letter CLDR codes - // (https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html). - Countries []string `json:"countries,omitempty"` - - // IncludeRestOfWorld: Include "rest of world" as well as explicitly - // targeted countries. - IncludeRestOfWorld bool `json:"includeRestOfWorld,omitempty"` +// BatchUpdateSubscriptionOffersRequest: Request message for +// BatchUpdateSubscriptionOffers. +type BatchUpdateSubscriptionOffersRequest struct { + // Requests: Required. A list of update requests of up to 100 elements. + // All requests must update different subscription offers. + Requests []*UpdateSubscriptionOfferRequest `json:"requests,omitempty"` - // ForceSendFields is a list of field names (e.g. "Countries") to + // ForceSendFields is a list of field names (e.g. "Requests") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1630,7 +1682,7 @@ type CountryTargeting struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Countries") to include in + // NullFields is a list of field names (e.g. "Requests") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -1639,62 +1691,54 @@ type CountryTargeting struct { NullFields []string `json:"-"` } -func (s *CountryTargeting) MarshalJSON() ([]byte, error) { - type NoMethod CountryTargeting +func (s *BatchUpdateSubscriptionOffersRequest) MarshalJSON() ([]byte, error) { + type NoMethod BatchUpdateSubscriptionOffersRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// DeactivateBasePlanRequest: Request message for DeactivateBasePlan. -type DeactivateBasePlanRequest struct { -} - -// DeactivateSubscriptionOfferRequest: Request message for -// DeactivateSubscriptionOffer. -type DeactivateSubscriptionOfferRequest struct { -} +// BatchUpdateSubscriptionOffersResponse: Response message for +// BatchUpdateSubscriptionOffers. +type BatchUpdateSubscriptionOffersResponse struct { + // SubscriptionOffers: The updated subscription offers list. + SubscriptionOffers []*SubscriptionOffer `json:"subscriptionOffers,omitempty"` -// DeferredItemReplacement: Information related to deferred item -// replacement. -type DeferredItemReplacement struct { - // ProductId: The product_id going to replace the existing product_id. - ProductId string `json:"productId,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "ProductId") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "SubscriptionOffers") + // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ProductId") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "SubscriptionOffers") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *DeferredItemReplacement) MarshalJSON() ([]byte, error) { - type NoMethod DeferredItemReplacement +func (s *BatchUpdateSubscriptionOffersResponse) MarshalJSON() ([]byte, error) { + type NoMethod BatchUpdateSubscriptionOffersResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// DeobfuscationFile: Represents a deobfuscation file. -type DeobfuscationFile struct { - // SymbolType: The type of the deobfuscation file. - // - // Possible values: - // "deobfuscationFileTypeUnspecified" - Unspecified deobfuscation file - // type. - // "proguard" - Proguard deobfuscation file type. - // "nativeCode" - Native debugging symbols file type. - SymbolType string `json:"symbolType,omitempty"` +// BatchUpdateSubscriptionsRequest: Request message for +// BatchUpdateSubscription. +type BatchUpdateSubscriptionsRequest struct { + // Requests: Required. A list of update requests of up to 100 elements. + // All requests must update different subscriptions. + Requests []*UpdateSubscriptionRequest `json:"requests,omitempty"` - // ForceSendFields is a list of field names (e.g. "SymbolType") to + // ForceSendFields is a list of field names (e.g. "Requests") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1702,7 +1746,7 @@ type DeobfuscationFile struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "SymbolType") to include in + // NullFields is a list of field names (e.g. "Requests") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -1711,55 +1755,65 @@ type DeobfuscationFile struct { NullFields []string `json:"-"` } -func (s *DeobfuscationFile) MarshalJSON() ([]byte, error) { - type NoMethod DeobfuscationFile +func (s *BatchUpdateSubscriptionsRequest) MarshalJSON() ([]byte, error) { + type NoMethod BatchUpdateSubscriptionsRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// DeobfuscationFilesUploadResponse: Responses for the upload. -type DeobfuscationFilesUploadResponse struct { - // DeobfuscationFile: The uploaded Deobfuscation File configuration. - DeobfuscationFile *DeobfuscationFile `json:"deobfuscationFile,omitempty"` +// BatchUpdateSubscriptionsResponse: Response message for +// BatchUpdateSubscription. +type BatchUpdateSubscriptionsResponse struct { + // Subscriptions: The updated subscriptions list. + Subscriptions []*Subscription `json:"subscriptions,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "DeobfuscationFile") - // to unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "Subscriptions") to + // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DeobfuscationFile") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "Subscriptions") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *DeobfuscationFilesUploadResponse) MarshalJSON() ([]byte, error) { - type NoMethod DeobfuscationFilesUploadResponse +func (s *BatchUpdateSubscriptionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod BatchUpdateSubscriptionsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// DeveloperComment: Developer entry from conversation between user and -// developer. -type DeveloperComment struct { - // LastModified: The last time at which this comment was updated. - LastModified *Timestamp `json:"lastModified,omitempty"` +// Bundle: Information about an app bundle. The resource for +// BundlesService. +type Bundle struct { + // Sha1: A sha1 hash of the upload payload, encoded as a hex string and + // matching the output of the sha1sum command. + Sha1 string `json:"sha1,omitempty"` - // Text: The content of the comment, i.e. reply body. - Text string `json:"text,omitempty"` + // Sha256: A sha256 hash of the upload payload, encoded as a hex string + // and matching the output of the sha256sum command. + Sha256 string `json:"sha256,omitempty"` - // ForceSendFields is a list of field names (e.g. "LastModified") to + // VersionCode: The version code of the Android App Bundle, as specified + // in the Android App Bundle's base module APK manifest file. + VersionCode int64 `json:"versionCode,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Sha1") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1767,36 +1821,35 @@ type DeveloperComment struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "LastModified") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Sha1") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *DeveloperComment) MarshalJSON() ([]byte, error) { - type NoMethod DeveloperComment +func (s *Bundle) MarshalJSON() ([]byte, error) { + type NoMethod Bundle raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// DeveloperInitiatedCancellation: Information specific to cancellations -// initiated by developers. -type DeveloperInitiatedCancellation struct { -} +// BundlesListResponse: Response listing all app bundles. +type BundlesListResponse struct { + // Bundles: All app bundles. + Bundles []*Bundle `json:"bundles,omitempty"` -// DeviceFeature: Represents a device feature. -type DeviceFeature struct { - // FeatureName: Name of the feature. - FeatureName string `json:"featureName,omitempty"` + // Kind: The kind of this response + // ("androidpublisher#bundlesListResponse"). + Kind string `json:"kind,omitempty"` - // FeatureVersion: The feature version specified by android:glEsVersion - // or android:version in in the AndroidManifest. - FeatureVersion int64 `json:"featureVersion,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "FeatureName") to + // ForceSendFields is a list of field names (e.g. "Bundles") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1804,27 +1857,44 @@ type DeviceFeature struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "FeatureName") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Bundles") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *DeviceFeature) MarshalJSON() ([]byte, error) { - type NoMethod DeviceFeature +func (s *BundlesListResponse) MarshalJSON() ([]byte, error) { + type NoMethod BundlesListResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// DeviceFeatureTargeting: Targeting for a device feature. -type DeviceFeatureTargeting struct { - // RequiredFeature: Feature of the device. - RequiredFeature *DeviceFeature `json:"requiredFeature,omitempty"` +// CancelSurveyResult: Result of the cancel survey when the subscription +// was canceled by the user. +type CancelSurveyResult struct { + // Reason: The reason the user selected in the cancel survey. + // + // Possible values: + // "CANCEL_SURVEY_REASON_UNSPECIFIED" - Unspecified cancel survey + // reason. + // "CANCEL_SURVEY_REASON_NOT_ENOUGH_USAGE" - Not enough usage of the + // subscription. + // "CANCEL_SURVEY_REASON_TECHNICAL_ISSUES" - Technical issues while + // using the app. + // "CANCEL_SURVEY_REASON_COST_RELATED" - Cost related issues. + // "CANCEL_SURVEY_REASON_FOUND_BETTER_APP" - The user found a better + // app. + // "CANCEL_SURVEY_REASON_OTHERS" - Other reasons. + Reason string `json:"reason,omitempty"` - // ForceSendFields is a list of field names (e.g. "RequiredFeature") to + // ReasonUserInput: Only set for CANCEL_SURVEY_REASON_OTHERS. This is + // the user's freeform response to the survey. + ReasonUserInput string `json:"reasonUserInput,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Reason") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1832,34 +1902,73 @@ type DeviceFeatureTargeting struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "RequiredFeature") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "Reason") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *DeviceFeatureTargeting) MarshalJSON() ([]byte, error) { - type NoMethod DeviceFeatureTargeting +func (s *CancelSurveyResult) MarshalJSON() ([]byte, error) { + type NoMethod CancelSurveyResult raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// DeviceGroup: A group of devices. A group is defined by a set of -// device selectors. A device belongs to the group if it matches any -// selector (logical OR). -type DeviceGroup struct { - // DeviceSelectors: Device selectors for this group. A device matching - // any of the selectors is included in this group. - DeviceSelectors []*DeviceSelector `json:"deviceSelectors,omitempty"` +// CanceledStateContext: Information specific to a subscription in +// canceled state. +type CanceledStateContext struct { + // DeveloperInitiatedCancellation: Subscription was canceled by the + // developer. + DeveloperInitiatedCancellation *DeveloperInitiatedCancellation `json:"developerInitiatedCancellation,omitempty"` - // Name: The name of the group. - Name string `json:"name,omitempty"` + // ReplacementCancellation: Subscription was replaced by a new + // subscription. + ReplacementCancellation *ReplacementCancellation `json:"replacementCancellation,omitempty"` - // ForceSendFields is a list of field names (e.g. "DeviceSelectors") to + // SystemInitiatedCancellation: Subscription was canceled by the system, + // for example because of a billing problem. + SystemInitiatedCancellation *SystemInitiatedCancellation `json:"systemInitiatedCancellation,omitempty"` + + // UserInitiatedCancellation: Subscription was canceled by user. + UserInitiatedCancellation *UserInitiatedCancellation `json:"userInitiatedCancellation,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "DeveloperInitiatedCancellation") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. + // "DeveloperInitiatedCancellation") to include in API requests with the + // JSON null value. By default, fields with empty values are omitted + // from API requests. However, any field with an empty value appearing + // in NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *CanceledStateContext) MarshalJSON() ([]byte, error) { + type NoMethod CanceledStateContext + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Comment: An entry of conversation between user and developer. +type Comment struct { + // DeveloperComment: A comment from a developer. + DeveloperComment *DeveloperComment `json:"developerComment,omitempty"` + + // UserComment: A comment from a user. + UserComment *UserComment `json:"userComment,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DeveloperComment") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1867,7 +1976,7 @@ type DeviceGroup struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DeviceSelectors") to + // NullFields is a list of field names (e.g. "DeveloperComment") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -1877,21 +1986,19 @@ type DeviceGroup struct { NullFields []string `json:"-"` } -func (s *DeviceGroup) MarshalJSON() ([]byte, error) { - type NoMethod DeviceGroup +func (s *Comment) MarshalJSON() ([]byte, error) { + type NoMethod Comment raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// DeviceId: Identifier of a device. -type DeviceId struct { - // BuildBrand: Value of Build.BRAND. - BuildBrand string `json:"buildBrand,omitempty"` - - // BuildDevice: Value of Build.DEVICE. - BuildDevice string `json:"buildDevice,omitempty"` +// ConvertRegionPricesRequest: Request message for ConvertRegionPrices. +type ConvertRegionPricesRequest struct { + // Price: The intital price to convert other regions from. Tax + // exclusive. + Price *Money `json:"price,omitempty"` - // ForceSendFields is a list of field names (e.g. "BuildBrand") to + // ForceSendFields is a list of field names (e.g. "Price") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1899,8 +2006,8 @@ type DeviceId struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "BuildBrand") to include in - // API requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Price") to include in API + // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -1908,49 +2015,64 @@ type DeviceId struct { NullFields []string `json:"-"` } -func (s *DeviceId) MarshalJSON() ([]byte, error) { - type NoMethod DeviceId +func (s *ConvertRegionPricesRequest) MarshalJSON() ([]byte, error) { + type NoMethod ConvertRegionPricesRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// DeviceMetadata: Characteristics of the user's device. -type DeviceMetadata struct { - // CpuMake: Device CPU make, e.g. "Qualcomm" - CpuMake string `json:"cpuMake,omitempty"` - - // CpuModel: Device CPU model, e.g. "MSM8974" - CpuModel string `json:"cpuModel,omitempty"` - - // DeviceClass: Device class (e.g. tablet) - DeviceClass string `json:"deviceClass,omitempty"` - - // GlEsVersion: OpenGL version - GlEsVersion int64 `json:"glEsVersion,omitempty"` +// ConvertRegionPricesResponse: Response message for +// ConvertRegionPrices. +type ConvertRegionPricesResponse struct { + // ConvertedOtherRegionsPrice: Converted other regions prices in USD and + // EUR, to use for countries where Play doesn't support a country's + // local currency. + ConvertedOtherRegionsPrice *ConvertedOtherRegionsPrice `json:"convertedOtherRegionsPrice,omitempty"` - // Manufacturer: Device manufacturer (e.g. Motorola) - Manufacturer string `json:"manufacturer,omitempty"` + // ConvertedRegionPrices: Map from region code to converted region + // price. + ConvertedRegionPrices map[string]ConvertedRegionPrice `json:"convertedRegionPrices,omitempty"` - // NativePlatform: Comma separated list of native platforms (e.g. "arm", - // "arm7") - NativePlatform string `json:"nativePlatform,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // ProductName: Device model name (e.g. Droid) - ProductName string `json:"productName,omitempty"` + // ForceSendFields is a list of field names (e.g. + // "ConvertedOtherRegionsPrice") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` - // RamMb: Device RAM in Megabytes, e.g. "2048" - RamMb int64 `json:"ramMb,omitempty"` + // NullFields is a list of field names (e.g. + // "ConvertedOtherRegionsPrice") to include in API requests with the + // JSON null value. By default, fields with empty values are omitted + // from API requests. However, any field with an empty value appearing + // in NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. + NullFields []string `json:"-"` +} - // ScreenDensityDpi: Screen density in DPI - ScreenDensityDpi int64 `json:"screenDensityDpi,omitempty"` +func (s *ConvertRegionPricesResponse) MarshalJSON() ([]byte, error) { + type NoMethod ConvertRegionPricesResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // ScreenHeightPx: Screen height in pixels - ScreenHeightPx int64 `json:"screenHeightPx,omitempty"` +// ConvertedOtherRegionsPrice: Converted other regions prices. +type ConvertedOtherRegionsPrice struct { + // EurPrice: Price in EUR to use for the "Other regions" location + // exclusive of taxes. + EurPrice *Money `json:"eurPrice,omitempty"` - // ScreenWidthPx: Screen width in pixels - ScreenWidthPx int64 `json:"screenWidthPx,omitempty"` + // UsdPrice: Price in USD to use for the "Other regions" location + // exclusive of taxes. + UsdPrice *Money `json:"usdPrice,omitempty"` - // ForceSendFields is a list of field names (e.g. "CpuMake") to + // ForceSendFields is a list of field names (e.g. "EurPrice") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1958,7 +2080,7 @@ type DeviceMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CpuMake") to include in + // NullFields is a list of field names (e.g. "EurPrice") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -1967,21 +2089,24 @@ type DeviceMetadata struct { NullFields []string `json:"-"` } -func (s *DeviceMetadata) MarshalJSON() ([]byte, error) { - type NoMethod DeviceMetadata +func (s *ConvertedOtherRegionsPrice) MarshalJSON() ([]byte, error) { + type NoMethod ConvertedOtherRegionsPrice raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// DeviceRam: Conditions about a device's RAM capabilities. -type DeviceRam struct { - // MaxBytes: Maximum RAM in bytes (bound excluded). - MaxBytes int64 `json:"maxBytes,omitempty,string"` +// ConvertedRegionPrice: A converted region price. +type ConvertedRegionPrice struct { + // Price: The converted price tax inclusive. + Price *Money `json:"price,omitempty"` - // MinBytes: Minimum RAM in bytes (bound included). - MinBytes int64 `json:"minBytes,omitempty,string"` + // RegionCode: The region code of the region. + RegionCode string `json:"regionCode,omitempty"` - // ForceSendFields is a list of field names (e.g. "MaxBytes") to + // TaxAmount: The tax amount of the converted price. + TaxAmount *Money `json:"taxAmount,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Price") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1989,8 +2114,8 @@ type DeviceRam struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "MaxBytes") to include in - // API requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Price") to include in API + // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -1998,40 +2123,23 @@ type DeviceRam struct { NullFields []string `json:"-"` } -func (s *DeviceRam) MarshalJSON() ([]byte, error) { - type NoMethod DeviceRam +func (s *ConvertedRegionPrice) MarshalJSON() ([]byte, error) { + type NoMethod ConvertedRegionPrice raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// DeviceSelector: Selector for a device group. A selector consists of a -// set of conditions on the device that should all match (logical AND) -// to determine a device group eligibility. For instance, if a selector -// specifies RAM conditions, device model inclusion and device model -// exclusion, a device is considered to match if: device matches RAM -// conditions AND device matches one of the included device models AND -// device doesn't match excluded device models -type DeviceSelector struct { - // DeviceRam: Conditions on the device's RAM. - DeviceRam *DeviceRam `json:"deviceRam,omitempty"` - - // ExcludedDeviceIds: Device models excluded by this selector, even if - // they match all other conditions. - ExcludedDeviceIds []*DeviceId `json:"excludedDeviceIds,omitempty"` - - // ForbiddenSystemFeatures: A device that has any of these system - // features is excluded by this selector, even if it matches all other - // conditions. - ForbiddenSystemFeatures []*SystemFeature `json:"forbiddenSystemFeatures,omitempty"` - - // IncludedDeviceIds: Device models included by this selector. - IncludedDeviceIds []*DeviceId `json:"includedDeviceIds,omitempty"` +// CountryTargeting: Country targeting specification. +type CountryTargeting struct { + // Countries: Countries to target, specified as two letter CLDR codes + // (https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html). + Countries []string `json:"countries,omitempty"` - // RequiredSystemFeatures: A device needs to have all these system - // features to be included by the selector. - RequiredSystemFeatures []*SystemFeature `json:"requiredSystemFeatures,omitempty"` + // IncludeRestOfWorld: Include "rest of world" as well as explicitly + // targeted countries. + IncludeRestOfWorld bool `json:"includeRestOfWorld,omitempty"` - // ForceSendFields is a list of field names (e.g. "DeviceRam") to + // ForceSendFields is a list of field names (e.g. "Countries") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2039,7 +2147,7 @@ type DeviceSelector struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DeviceRam") to include in + // NullFields is a list of field names (e.g. "Countries") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -2048,27 +2156,43 @@ type DeviceSelector struct { NullFields []string `json:"-"` } -func (s *DeviceSelector) MarshalJSON() ([]byte, error) { - type NoMethod DeviceSelector +func (s *CountryTargeting) MarshalJSON() ([]byte, error) { + type NoMethod CountryTargeting raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// DeviceSpec: The device spec used to generate a system APK. -type DeviceSpec struct { - // ScreenDensity: Screen dpi. - ScreenDensity int64 `json:"screenDensity,omitempty"` +// DeactivateBasePlanRequest: Request message for DeactivateBasePlan. +type DeactivateBasePlanRequest struct { + // BasePlanId: Required. The unique base plan ID of the base plan to + // deactivate. + BasePlanId string `json:"basePlanId,omitempty"` - // SupportedAbis: Supported ABI architectures in the order of - // preference. The values should be the string as reported by the - // platform, e.g. "armeabi-v7a", "x86_64". - SupportedAbis []string `json:"supportedAbis,omitempty"` + // LatencyTolerance: Optional. The latency tolerance for the propagation + // of this product update. Defaults to latency-sensitive. + // + // Possible values: + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" - Defaults to + // PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE. + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" - The update + // will propagate to clients within several minutes on average and up to + // a few hours in rare cases. Throughput is limited to 7,200 updates per + // app per hour. + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" - The update + // will propagate to clients within 24 hours. Supports high throughput + // of up to 720,000 updates per app per hour using batch modification + // methods. + LatencyTolerance string `json:"latencyTolerance,omitempty"` + + // PackageName: Required. The parent app (package name) of the base plan + // to deactivate. + PackageName string `json:"packageName,omitempty"` - // SupportedLocales: All installed locales represented as BCP-47 - // strings, e.g. "en-US". - SupportedLocales []string `json:"supportedLocales,omitempty"` + // ProductId: Required. The parent subscription (ID) of the base plan to + // deactivate. + ProductId string `json:"productId,omitempty"` - // ForceSendFields is a list of field names (e.g. "ScreenDensity") to + // ForceSendFields is a list of field names (e.g. "BasePlanId") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2076,42 +2200,56 @@ type DeviceSpec struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ScreenDensity") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "BasePlanId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *DeviceSpec) MarshalJSON() ([]byte, error) { - type NoMethod DeviceSpec +func (s *DeactivateBasePlanRequest) MarshalJSON() ([]byte, error) { + type NoMethod DeactivateBasePlanRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// DeviceTier: A single device tier. Devices matching any of the device -// groups in device_group_names are considered to match the tier. -type DeviceTier struct { - // DeviceGroupNames: Groups of devices included in this tier. These - // groups must be defined explicitly under device_groups in this - // configuration. - DeviceGroupNames []string `json:"deviceGroupNames,omitempty"` +// DeactivateSubscriptionOfferRequest: Request message for +// DeactivateSubscriptionOffer. +type DeactivateSubscriptionOfferRequest struct { + // BasePlanId: Required. The parent base plan (ID) of the offer to + // deactivate. + BasePlanId string `json:"basePlanId,omitempty"` - // Level: The priority level of the tier. Tiers are evaluated in - // descending order of level: the highest level tier has the highest - // priority. The highest tier matching a given device is selected for - // that device. You should use a contiguous range of levels for your - // tiers in a tier set; tier levels in a tier set must be unique. For - // instance, if your tier set has 4 tiers (including the global - // fallback), you should define tiers 1, 2 and 3 in this configuration. - // Note: tier 0 is implicitly defined as a global fallback and selected - // for devices that don't match any of the tiers explicitly defined - // here. You mustn't define level 0 explicitly in this configuration. - Level int64 `json:"level,omitempty"` + // LatencyTolerance: Optional. The latency tolerance for the propagation + // of this product update. Defaults to latency-sensitive. + // + // Possible values: + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" - Defaults to + // PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE. + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" - The update + // will propagate to clients within several minutes on average and up to + // a few hours in rare cases. Throughput is limited to 7,200 updates per + // app per hour. + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" - The update + // will propagate to clients within 24 hours. Supports high throughput + // of up to 720,000 updates per app per hour using batch modification + // methods. + LatencyTolerance string `json:"latencyTolerance,omitempty"` + + // OfferId: Required. The unique offer ID of the offer to deactivate. + OfferId string `json:"offerId,omitempty"` - // ForceSendFields is a list of field names (e.g. "DeviceGroupNames") to + // PackageName: Required. The parent app (package name) of the offer to + // deactivate. + PackageName string `json:"packageName,omitempty"` + + // ProductId: Required. The parent subscription (ID) of the offer to + // deactivate. + ProductId string `json:"productId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BasePlanId") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2119,42 +2257,28 @@ type DeviceTier struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DeviceGroupNames") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "BasePlanId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *DeviceTier) MarshalJSON() ([]byte, error) { - type NoMethod DeviceTier +func (s *DeactivateSubscriptionOfferRequest) MarshalJSON() ([]byte, error) { + type NoMethod DeactivateSubscriptionOfferRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// DeviceTierConfig: Configuration describing device targeting criteria -// for the content of an app. -type DeviceTierConfig struct { - // DeviceGroups: Definition of device groups for the app. - DeviceGroups []*DeviceGroup `json:"deviceGroups,omitempty"` - - // DeviceTierConfigId: Output only. The device tier config ID. - DeviceTierConfigId int64 `json:"deviceTierConfigId,omitempty,string"` - - // DeviceTierSet: Definition of the set of device tiers for the app. - DeviceTierSet *DeviceTierSet `json:"deviceTierSet,omitempty"` - - // UserCountrySets: Definition of user country sets for the app. - UserCountrySets []*UserCountrySet `json:"userCountrySets,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` +// DeferredItemReplacement: Information related to deferred item +// replacement. +type DeferredItemReplacement struct { + // ProductId: The product_id going to replace the existing product_id. + ProductId string `json:"productId,omitempty"` - // ForceSendFields is a list of field names (e.g. "DeviceGroups") to + // ForceSendFields is a list of field names (e.g. "ProductId") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2162,31 +2286,33 @@ type DeviceTierConfig struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DeviceGroups") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "ProductId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *DeviceTierConfig) MarshalJSON() ([]byte, error) { - type NoMethod DeviceTierConfig +func (s *DeferredItemReplacement) MarshalJSON() ([]byte, error) { + type NoMethod DeferredItemReplacement raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// DeviceTierSet: A set of device tiers. A tier set determines what -// variation of app content gets served to a specific device, for -// device-targeted content. You should assign a priority level to each -// tier, which determines the ordering by which they are evaluated by -// Play. See the documentation of DeviceTier.level for more details. -type DeviceTierSet struct { - // DeviceTiers: Device tiers belonging to the set. - DeviceTiers []*DeviceTier `json:"deviceTiers,omitempty"` +// DeobfuscationFile: Represents a deobfuscation file. +type DeobfuscationFile struct { + // SymbolType: The type of the deobfuscation file. + // + // Possible values: + // "deobfuscationFileTypeUnspecified" - Unspecified deobfuscation file + // type. + // "proguard" - Proguard deobfuscation file type. + // "nativeCode" - Native debugging symbols file type. + SymbolType string `json:"symbolType,omitempty"` - // ForceSendFields is a list of field names (e.g. "DeviceTiers") to + // ForceSendFields is a list of field names (e.g. "SymbolType") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2194,72 +2320,64 @@ type DeviceTierSet struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DeviceTiers") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "SymbolType") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *DeviceTierSet) MarshalJSON() ([]byte, error) { - type NoMethod DeviceTierSet +func (s *DeobfuscationFile) MarshalJSON() ([]byte, error) { + type NoMethod DeobfuscationFile raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ExpansionFile: An expansion file. The resource for -// ExpansionFilesService. -type ExpansionFile struct { - // FileSize: If set, this field indicates that this APK has an expansion - // file uploaded to it: this APK does not reference another APK's - // expansion file. The field's value is the size of the uploaded - // expansion file in bytes. - FileSize int64 `json:"fileSize,omitempty,string"` - - // ReferencesVersion: If set, this APK's expansion file references - // another APK's expansion file. The file_size field will not be set. - ReferencesVersion int64 `json:"referencesVersion,omitempty"` +// DeobfuscationFilesUploadResponse: Responses for the upload. +type DeobfuscationFilesUploadResponse struct { + // DeobfuscationFile: The uploaded Deobfuscation File configuration. + DeobfuscationFile *DeobfuscationFile `json:"deobfuscationFile,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "FileSize") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "DeobfuscationFile") + // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "FileSize") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "DeobfuscationFile") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *ExpansionFile) MarshalJSON() ([]byte, error) { - type NoMethod ExpansionFile +func (s *DeobfuscationFilesUploadResponse) MarshalJSON() ([]byte, error) { + type NoMethod DeobfuscationFilesUploadResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ExpansionFilesUploadResponse: Response for uploading an expansion -// file. -type ExpansionFilesUploadResponse struct { - // ExpansionFile: The uploaded expansion file configuration. - ExpansionFile *ExpansionFile `json:"expansionFile,omitempty"` +// DeveloperComment: Developer entry from conversation between user and +// developer. +type DeveloperComment struct { + // LastModified: The last time at which this comment was updated. + LastModified *Timestamp `json:"lastModified,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // Text: The content of the comment, i.e. reply body. + Text string `json:"text,omitempty"` - // ForceSendFields is a list of field names (e.g. "ExpansionFile") to + // ForceSendFields is a list of field names (e.g. "LastModified") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2267,7 +2385,7 @@ type ExpansionFilesUploadResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ExpansionFile") to include + // NullFields is a list of field names (e.g. "LastModified") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as @@ -2276,72 +2394,55 @@ type ExpansionFilesUploadResponse struct { NullFields []string `json:"-"` } -func (s *ExpansionFilesUploadResponse) MarshalJSON() ([]byte, error) { - type NoMethod ExpansionFilesUploadResponse +func (s *DeveloperComment) MarshalJSON() ([]byte, error) { + type NoMethod DeveloperComment raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ExternalAccountIdentifiers: User account identifier in the -// third-party service. -type ExternalAccountIdentifiers struct { - // ExternalAccountId: User account identifier in the third-party - // service. Only present if account linking happened as part of the - // subscription purchase flow. - ExternalAccountId string `json:"externalAccountId,omitempty"` +// DeveloperInitiatedCancellation: Information specific to cancellations +// initiated by developers. +type DeveloperInitiatedCancellation struct { +} - // ObfuscatedExternalAccountId: An obfuscated version of the id that is - // uniquely associated with the user's account in your app. Present for - // the following purchases: * If account linking happened as part of the - // subscription purchase flow. * It was specified using - // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedaccountid - // when the purchase was made. - ObfuscatedExternalAccountId string `json:"obfuscatedExternalAccountId,omitempty"` +// DeviceFeature: Represents a device feature. +type DeviceFeature struct { + // FeatureName: Name of the feature. + FeatureName string `json:"featureName,omitempty"` - // ObfuscatedExternalProfileId: An obfuscated version of the id that is - // uniquely associated with the user's profile in your app. Only present - // if specified using - // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedprofileid - // when the purchase was made. - ObfuscatedExternalProfileId string `json:"obfuscatedExternalProfileId,omitempty"` + // FeatureVersion: The feature version specified by android:glEsVersion + // or android:version in in the AndroidManifest. + FeatureVersion int64 `json:"featureVersion,omitempty"` - // ForceSendFields is a list of field names (e.g. "ExternalAccountId") - // to unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "FeatureName") to + // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ExternalAccountId") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "FeatureName") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *ExternalAccountIdentifiers) MarshalJSON() ([]byte, error) { - type NoMethod ExternalAccountIdentifiers +func (s *DeviceFeature) MarshalJSON() ([]byte, error) { + type NoMethod DeviceFeature raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ExternalSubscription: Details of an external subscription. -type ExternalSubscription struct { - // SubscriptionType: Required. The type of the external subscription. - // - // Possible values: - // "SUBSCRIPTION_TYPE_UNSPECIFIED" - Unspecified, do not use. - // "RECURRING" - This is a recurring subscription where the user is - // charged every billing cycle. - // "PREPAID" - This is a prepaid subscription where the user pays up - // front. - SubscriptionType string `json:"subscriptionType,omitempty"` +// DeviceFeatureTargeting: Targeting for a device feature. +type DeviceFeatureTargeting struct { + // RequiredFeature: Feature of the device. + RequiredFeature *DeviceFeature `json:"requiredFeature,omitempty"` - // ForceSendFields is a list of field names (e.g. "SubscriptionType") to + // ForceSendFields is a list of field names (e.g. "RequiredFeature") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2349,7 +2450,7 @@ type ExternalSubscription struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "SubscriptionType") to + // NullFields is a list of field names (e.g. "RequiredFeature") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -2359,82 +2460,24 @@ type ExternalSubscription struct { NullFields []string `json:"-"` } -func (s *ExternalSubscription) MarshalJSON() ([]byte, error) { - type NoMethod ExternalSubscription +func (s *DeviceFeatureTargeting) MarshalJSON() ([]byte, error) { + type NoMethod DeviceFeatureTargeting raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ExternalTransaction: The details of an external transaction. -type ExternalTransaction struct { - // CreateTime: Output only. The time when this transaction was created. - // This is the time when Google was notified of the transaction. - CreateTime string `json:"createTime,omitempty"` +// DeviceGroup: A group of devices. A group is defined by a set of +// device selectors. A device belongs to the group if it matches any +// selector (logical OR). +type DeviceGroup struct { + // DeviceSelectors: Device selectors for this group. A device matching + // any of the selectors is included in this group. + DeviceSelectors []*DeviceSelector `json:"deviceSelectors,omitempty"` - // CurrentPreTaxAmount: Output only. The current transaction amount - // before tax. This represents the current pre-tax amount including any - // refunds that may have been applied to this transaction. - CurrentPreTaxAmount *Price `json:"currentPreTaxAmount,omitempty"` - - // CurrentTaxAmount: Output only. The current tax amount. This - // represents the current tax amount including any refunds that may have - // been applied to this transaction. - CurrentTaxAmount *Price `json:"currentTaxAmount,omitempty"` - - // ExternalTransactionId: Output only. The id of this transaction. All - // transaction ids under the same package name must be unique. Set when - // creating the external transaction. - ExternalTransactionId string `json:"externalTransactionId,omitempty"` - - // OneTimeTransaction: This is a one-time transaction and not part of a - // subscription. - OneTimeTransaction *OneTimeExternalTransaction `json:"oneTimeTransaction,omitempty"` - - // OriginalPreTaxAmount: Required. The original transaction amount - // before taxes. This represents the pre-tax amount originally notified - // to Google before any refunds were applied. - OriginalPreTaxAmount *Price `json:"originalPreTaxAmount,omitempty"` - - // OriginalTaxAmount: Required. The original tax amount. This represents - // the tax amount originally notified to Google before any refunds were - // applied. - OriginalTaxAmount *Price `json:"originalTaxAmount,omitempty"` - - // PackageName: Output only. The resource name of the external - // transaction. The package name of the application the inapp products - // were sold (for example, 'com.some.app'). - PackageName string `json:"packageName,omitempty"` - - // RecurringTransaction: This transaction is part of a recurring series - // of transactions. - RecurringTransaction *RecurringExternalTransaction `json:"recurringTransaction,omitempty"` - - // TestPurchase: Output only. If set, this transaction was a test - // purchase. Google will not charge for a test transaction. - TestPurchase *ExternalTransactionTestPurchase `json:"testPurchase,omitempty"` - - // TransactionState: Output only. The current state of the transaction. - // - // Possible values: - // "TRANSACTION_STATE_UNSPECIFIED" - Unspecified transaction state. - // Not used. - // "TRANSACTION_REPORTED" - The transaction has been successfully - // reported to Google. - // "TRANSACTION_CANCELED" - The transaction has been fully refunded. - TransactionState string `json:"transactionState,omitempty"` - - // TransactionTime: Required. The time when the transaction was - // completed. - TransactionTime string `json:"transactionTime,omitempty"` - - // UserTaxAddress: Required. User address for tax computation. - UserTaxAddress *ExternalTransactionAddress `json:"userTaxAddress,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // Name: The name of the group. + Name string `json:"name,omitempty"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to + // ForceSendFields is a list of field names (e.g. "DeviceSelectors") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2442,130 +2485,90 @@ type ExternalTransaction struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreateTime") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "DeviceSelectors") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *ExternalTransaction) MarshalJSON() ([]byte, error) { - type NoMethod ExternalTransaction +func (s *DeviceGroup) MarshalJSON() ([]byte, error) { + type NoMethod DeviceGroup raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ExternalTransactionAddress: User's address for the external -// transaction. -type ExternalTransactionAddress struct { - // AdministrativeArea: Optional. Top-level administrative subdivision of - // the country/region. Only required for transactions in India. Valid - // values are "ANDAMAN AND NICOBAR ISLANDS", "ANDHRA PRADESH", - // "ARUNACHAL PRADESH", "ASSAM", "BIHAR", "CHANDIGARH", "CHHATTISGARH", - // "DADRA AND NAGAR HAVELI", "DADRA AND NAGAR HAVELI AND DAMAN AND DIU", - // "DAMAN AND DIU", "DELHI", "GOA", "GUJARAT", "HARYANA", "HIMACHAL - // PRADESH", "JAMMU AND KASHMIR", "JHARKHAND", "KARNATAKA", "KERALA", - // "LADAKH", "LAKSHADWEEP", "MADHYA PRADESH", "MAHARASHTRA", "MANIPUR", - // "MEGHALAYA", "MIZORAM", "NAGALAND", "ODISHA", "PUDUCHERRY", "PUNJAB", - // "RAJASTHAN", "SIKKIM", "TAMIL NADU", "TELANGANA", "TRIPURA", "UTTAR - // PRADESH", "UTTARAKHAND", and "WEST BENGAL". - AdministrativeArea string `json:"administrativeArea,omitempty"` +// DeviceId: Identifier of a device. +type DeviceId struct { + // BuildBrand: Value of Build.BRAND. + BuildBrand string `json:"buildBrand,omitempty"` - // RegionCode: Required. Two letter region code based on ISO-3166-1 - // Alpha-2 (UN region codes). - RegionCode string `json:"regionCode,omitempty"` + // BuildDevice: Value of Build.DEVICE. + BuildDevice string `json:"buildDevice,omitempty"` - // ForceSendFields is a list of field names (e.g. "AdministrativeArea") - // to unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "BuildBrand") to + // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AdministrativeArea") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "BuildBrand") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *ExternalTransactionAddress) MarshalJSON() ([]byte, error) { - type NoMethod ExternalTransactionAddress +func (s *DeviceId) MarshalJSON() ([]byte, error) { + type NoMethod DeviceId raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ExternalTransactionTestPurchase: Represents a transaction performed -// using a test account. These transactions will not be charged by -// Google. -type ExternalTransactionTestPurchase struct { -} - -// ExternallyHostedApk: Defines an APK available for this application -// that is hosted externally and not uploaded to Google Play. This -// function is only available to organizations using Managed Play whose -// application is configured to restrict distribution to the -// organizations. -type ExternallyHostedApk struct { - // ApplicationLabel: The application label. - ApplicationLabel string `json:"applicationLabel,omitempty"` - - // CertificateBase64s: A certificate (or array of certificates if a - // certificate-chain is used) used to sign this APK, represented as a - // base64 encoded byte array. - CertificateBase64s []string `json:"certificateBase64s,omitempty"` - - // ExternallyHostedUrl: The URL at which the APK is hosted. This must be - // an https URL. - ExternallyHostedUrl string `json:"externallyHostedUrl,omitempty"` - - // FileSha1Base64: The sha1 checksum of this APK, represented as a - // base64 encoded byte array. - FileSha1Base64 string `json:"fileSha1Base64,omitempty"` - - // FileSha256Base64: The sha256 checksum of this APK, represented as a - // base64 encoded byte array. - FileSha256Base64 string `json:"fileSha256Base64,omitempty"` +// DeviceMetadata: Characteristics of the user's device. +type DeviceMetadata struct { + // CpuMake: Device CPU make, e.g. "Qualcomm" + CpuMake string `json:"cpuMake,omitempty"` - // FileSize: The file size in bytes of this APK. - FileSize int64 `json:"fileSize,omitempty,string"` + // CpuModel: Device CPU model, e.g. "MSM8974" + CpuModel string `json:"cpuModel,omitempty"` - // IconBase64: The icon image from the APK, as a base64 encoded byte - // array. - IconBase64 string `json:"iconBase64,omitempty"` + // DeviceClass: Device class (e.g. tablet) + DeviceClass string `json:"deviceClass,omitempty"` - // MaximumSdk: The maximum SDK supported by this APK (optional). - MaximumSdk int64 `json:"maximumSdk,omitempty"` + // GlEsVersion: OpenGL version + GlEsVersion int64 `json:"glEsVersion,omitempty"` - // MinimumSdk: The minimum SDK targeted by this APK. - MinimumSdk int64 `json:"minimumSdk,omitempty"` + // Manufacturer: Device manufacturer (e.g. Motorola) + Manufacturer string `json:"manufacturer,omitempty"` - // NativeCodes: The native code environments supported by this APK - // (optional). - NativeCodes []string `json:"nativeCodes,omitempty"` + // NativePlatform: Comma separated list of native platforms (e.g. "arm", + // "arm7") + NativePlatform string `json:"nativePlatform,omitempty"` - // PackageName: The package name. - PackageName string `json:"packageName,omitempty"` + // ProductName: Device model name (e.g. Droid) + ProductName string `json:"productName,omitempty"` - // UsesFeatures: The features required by this APK (optional). - UsesFeatures []string `json:"usesFeatures,omitempty"` + // RamMb: Device RAM in Megabytes, e.g. "2048" + RamMb int64 `json:"ramMb,omitempty"` - // UsesPermissions: The permissions requested by this APK. - UsesPermissions []*UsesPermission `json:"usesPermissions,omitempty"` + // ScreenDensityDpi: Screen density in DPI + ScreenDensityDpi int64 `json:"screenDensityDpi,omitempty"` - // VersionCode: The version code of this APK. - VersionCode int64 `json:"versionCode,omitempty"` + // ScreenHeightPx: Screen height in pixels + ScreenHeightPx int64 `json:"screenHeightPx,omitempty"` - // VersionName: The version name of this APK. - VersionName string `json:"versionName,omitempty"` + // ScreenWidthPx: Screen width in pixels + ScreenWidthPx int64 `json:"screenWidthPx,omitempty"` - // ForceSendFields is a list of field names (e.g. "ApplicationLabel") to + // ForceSendFields is a list of field names (e.g. "CpuMake") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2573,36 +2576,30 @@ type ExternallyHostedApk struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ApplicationLabel") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "CpuMake") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *ExternallyHostedApk) MarshalJSON() ([]byte, error) { - type NoMethod ExternallyHostedApk +func (s *DeviceMetadata) MarshalJSON() ([]byte, error) { + type NoMethod DeviceMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// FullRefund: A full refund of the remaining amount of a transaction. -type FullRefund struct { -} - -// GeneratedApksListResponse: Response to list generated APKs. -type GeneratedApksListResponse struct { - // GeneratedApks: All generated APKs, grouped by the APK signing key. - GeneratedApks []*GeneratedApksPerSigningKey `json:"generatedApks,omitempty"` +// DeviceRam: Conditions about a device's RAM capabilities. +type DeviceRam struct { + // MaxBytes: Maximum RAM in bytes (bound excluded). + MaxBytes int64 `json:"maxBytes,omitempty,string"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // MinBytes: Minimum RAM in bytes (bound included). + MinBytes int64 `json:"minBytes,omitempty,string"` - // ForceSendFields is a list of field names (e.g. "GeneratedApks") to + // ForceSendFields is a list of field names (e.g. "MaxBytes") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2610,92 +2607,86 @@ type GeneratedApksListResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "GeneratedApks") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "MaxBytes") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GeneratedApksListResponse) MarshalJSON() ([]byte, error) { - type NoMethod GeneratedApksListResponse +func (s *DeviceRam) MarshalJSON() ([]byte, error) { + type NoMethod DeviceRam raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GeneratedApksPerSigningKey: Download metadata for split, standalone -// and universal APKs, as well as asset pack slices, signed with a given -// key. -type GeneratedApksPerSigningKey struct { - // CertificateSha256Hash: SHA256 hash of the APK signing public key - // certificate. - CertificateSha256Hash string `json:"certificateSha256Hash,omitempty"` - - // GeneratedAssetPackSlices: List of asset pack slices which will be - // served for this app bundle, signed with a key corresponding to - // certificate_sha256_hash. - GeneratedAssetPackSlices []*GeneratedAssetPackSlice `json:"generatedAssetPackSlices,omitempty"` +// DeviceSelector: Selector for a device group. A selector consists of a +// set of conditions on the device that should all match (logical AND) +// to determine a device group eligibility. For instance, if a selector +// specifies RAM conditions, device model inclusion and device model +// exclusion, a device is considered to match if: device matches RAM +// conditions AND device matches one of the included device models AND +// device doesn't match excluded device models +type DeviceSelector struct { + // DeviceRam: Conditions on the device's RAM. + DeviceRam *DeviceRam `json:"deviceRam,omitempty"` - // GeneratedSplitApks: List of generated split APKs, signed with a key - // corresponding to certificate_sha256_hash. - GeneratedSplitApks []*GeneratedSplitApk `json:"generatedSplitApks,omitempty"` + // ExcludedDeviceIds: Device models excluded by this selector, even if + // they match all other conditions. + ExcludedDeviceIds []*DeviceId `json:"excludedDeviceIds,omitempty"` - // GeneratedStandaloneApks: List of generated standalone APKs, signed - // with a key corresponding to certificate_sha256_hash. - GeneratedStandaloneApks []*GeneratedStandaloneApk `json:"generatedStandaloneApks,omitempty"` + // ForbiddenSystemFeatures: A device that has any of these system + // features is excluded by this selector, even if it matches all other + // conditions. + ForbiddenSystemFeatures []*SystemFeature `json:"forbiddenSystemFeatures,omitempty"` - // GeneratedUniversalApk: Generated universal APK, signed with a key - // corresponding to certificate_sha256_hash. This field is not set if no - // universal APK was generated for this signing key. - GeneratedUniversalApk *GeneratedUniversalApk `json:"generatedUniversalApk,omitempty"` + // IncludedDeviceIds: Device models included by this selector. + IncludedDeviceIds []*DeviceId `json:"includedDeviceIds,omitempty"` - // TargetingInfo: Contains targeting information about the generated - // apks. - TargetingInfo *TargetingInfo `json:"targetingInfo,omitempty"` + // RequiredSystemFeatures: A device needs to have all these system + // features to be included by the selector. + RequiredSystemFeatures []*SystemFeature `json:"requiredSystemFeatures,omitempty"` - // ForceSendFields is a list of field names (e.g. - // "CertificateSha256Hash") to unconditionally include in API requests. - // By default, fields with empty or default values are omitted from API - // requests. However, any non-pointer, non-interface field appearing in - // ForceSendFields will be sent to the server regardless of whether the - // field is empty or not. This may be used to include empty fields in - // Patch requests. + // ForceSendFields is a list of field names (e.g. "DeviceRam") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CertificateSha256Hash") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "DeviceRam") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GeneratedApksPerSigningKey) MarshalJSON() ([]byte, error) { - type NoMethod GeneratedApksPerSigningKey +func (s *DeviceSelector) MarshalJSON() ([]byte, error) { + type NoMethod DeviceSelector raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GeneratedAssetPackSlice: Download metadata for an asset pack slice. -type GeneratedAssetPackSlice struct { - // DownloadId: Download ID, which uniquely identifies the APK to - // download. Should be supplied to `generatedapks.download` method. - DownloadId string `json:"downloadId,omitempty"` - - // ModuleName: Name of the module that this asset slice belongs to. - ModuleName string `json:"moduleName,omitempty"` +// DeviceSpec: The device spec used to generate a system APK. +type DeviceSpec struct { + // ScreenDensity: Screen dpi. + ScreenDensity int64 `json:"screenDensity,omitempty"` - // SliceId: Asset slice ID. - SliceId string `json:"sliceId,omitempty"` + // SupportedAbis: Supported ABI architectures in the order of + // preference. The values should be the string as reported by the + // platform, e.g. "armeabi-v7a", "x86_64". + SupportedAbis []string `json:"supportedAbis,omitempty"` - // Version: Asset module version. - Version int64 `json:"version,omitempty,string"` + // SupportedLocales: All installed locales represented as BCP-47 + // strings, e.g. "en-US". + SupportedLocales []string `json:"supportedLocales,omitempty"` - // ForceSendFields is a list of field names (e.g. "DownloadId") to + // ForceSendFields is a list of field names (e.g. "ScreenDensity") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2703,37 +2694,85 @@ type GeneratedAssetPackSlice struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DownloadId") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "ScreenDensity") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GeneratedAssetPackSlice) MarshalJSON() ([]byte, error) { - type NoMethod GeneratedAssetPackSlice +func (s *DeviceSpec) MarshalJSON() ([]byte, error) { + type NoMethod DeviceSpec raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GeneratedSplitApk: Download metadata for a split APK. -type GeneratedSplitApk struct { - // DownloadId: Download ID, which uniquely identifies the APK to - // download. Should be supplied to `generatedapks.download` method. - DownloadId string `json:"downloadId,omitempty"` +// DeviceTier: A single device tier. Devices matching any of the device +// groups in device_group_names are considered to match the tier. +type DeviceTier struct { + // DeviceGroupNames: Groups of devices included in this tier. These + // groups must be defined explicitly under device_groups in this + // configuration. + DeviceGroupNames []string `json:"deviceGroupNames,omitempty"` - // ModuleName: Name of the module that this APK belongs to. - ModuleName string `json:"moduleName,omitempty"` + // Level: The priority level of the tier. Tiers are evaluated in + // descending order of level: the highest level tier has the highest + // priority. The highest tier matching a given device is selected for + // that device. You should use a contiguous range of levels for your + // tiers in a tier set; tier levels in a tier set must be unique. For + // instance, if your tier set has 4 tiers (including the global + // fallback), you should define tiers 1, 2 and 3 in this configuration. + // Note: tier 0 is implicitly defined as a global fallback and selected + // for devices that don't match any of the tiers explicitly defined + // here. You mustn't define level 0 explicitly in this configuration. + Level int64 `json:"level,omitempty"` - // SplitId: Split ID. Empty for the main split of the base module. - SplitId string `json:"splitId,omitempty"` + // ForceSendFields is a list of field names (e.g. "DeviceGroupNames") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // VariantId: ID of the generated variant. - VariantId int64 `json:"variantId,omitempty"` + // NullFields is a list of field names (e.g. "DeviceGroupNames") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} - // ForceSendFields is a list of field names (e.g. "DownloadId") to +func (s *DeviceTier) MarshalJSON() ([]byte, error) { + type NoMethod DeviceTier + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// DeviceTierConfig: Configuration describing device targeting criteria +// for the content of an app. +type DeviceTierConfig struct { + // DeviceGroups: Definition of device groups for the app. + DeviceGroups []*DeviceGroup `json:"deviceGroups,omitempty"` + + // DeviceTierConfigId: Output only. The device tier config ID. + DeviceTierConfigId int64 `json:"deviceTierConfigId,omitempty,string"` + + // DeviceTierSet: Definition of the set of device tiers for the app. + DeviceTierSet *DeviceTierSet `json:"deviceTierSet,omitempty"` + + // UserCountrySets: Definition of user country sets for the app. + UserCountrySets []*UserCountrySet `json:"userCountrySets,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DeviceGroups") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2741,31 +2780,31 @@ type GeneratedSplitApk struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DownloadId") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "DeviceGroups") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GeneratedSplitApk) MarshalJSON() ([]byte, error) { - type NoMethod GeneratedSplitApk +func (s *DeviceTierConfig) MarshalJSON() ([]byte, error) { + type NoMethod DeviceTierConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GeneratedStandaloneApk: Download metadata for a standalone APK. -type GeneratedStandaloneApk struct { - // DownloadId: Download ID, which uniquely identifies the APK to - // download. Should be supplied to `generatedapks.download` method. - DownloadId string `json:"downloadId,omitempty"` - - // VariantId: ID of the generated variant. - VariantId int64 `json:"variantId,omitempty"` +// DeviceTierSet: A set of device tiers. A tier set determines what +// variation of app content gets served to a specific device, for +// device-targeted content. You should assign a priority level to each +// tier, which determines the ordering by which they are evaluated by +// Play. See the documentation of DeviceTier.level for more details. +type DeviceTierSet struct { + // DeviceTiers: Device tiers belonging to the set. + DeviceTiers []*DeviceTier `json:"deviceTiers,omitempty"` - // ForceSendFields is a list of field names (e.g. "DownloadId") to + // ForceSendFields is a list of field names (e.g. "DeviceTiers") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2773,28 +2812,39 @@ type GeneratedStandaloneApk struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DownloadId") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "DeviceTiers") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GeneratedStandaloneApk) MarshalJSON() ([]byte, error) { - type NoMethod GeneratedStandaloneApk +func (s *DeviceTierSet) MarshalJSON() ([]byte, error) { + type NoMethod DeviceTierSet raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GeneratedUniversalApk: Download metadata for a universal APK. -type GeneratedUniversalApk struct { - // DownloadId: Download ID, which uniquely identifies the APK to - // download. Should be supplied to `generatedapks.download` method. - DownloadId string `json:"downloadId,omitempty"` +// ExpansionFile: An expansion file. The resource for +// ExpansionFilesService. +type ExpansionFile struct { + // FileSize: If set, this field indicates that this APK has an expansion + // file uploaded to it: this APK does not reference another APK's + // expansion file. The field's value is the size of the uploaded + // expansion file in bytes. + FileSize int64 `json:"fileSize,omitempty,string"` - // ForceSendFields is a list of field names (e.g. "DownloadId") to + // ReferencesVersion: If set, this APK's expansion file references + // another APK's expansion file. The file_size field will not be set. + ReferencesVersion int64 `json:"referencesVersion,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "FileSize") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2802,7 +2852,7 @@ type GeneratedUniversalApk struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DownloadId") to include in + // NullFields is a list of field names (e.g. "FileSize") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -2811,125 +2861,105 @@ type GeneratedUniversalApk struct { NullFields []string `json:"-"` } -func (s *GeneratedUniversalApk) MarshalJSON() ([]byte, error) { - type NoMethod GeneratedUniversalApk - raw := NoMethod(*s) +func (s *ExpansionFile) MarshalJSON() ([]byte, error) { + type NoMethod ExpansionFile + raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Grant: An access grant resource. -type Grant struct { - // AppLevelPermissions: The permissions granted to the user for this - // app. - // - // Possible values: - // "APP_LEVEL_PERMISSION_UNSPECIFIED" - Unknown or unspecified - // permission. - // "CAN_ACCESS_APP" - View app information (read-only). Deprecated: - // Try defining a more granular capability. Otherwise, check - // AppLevelPermission.CAN_VIEW_NON_FINANCIAL_DATA. - // "CAN_VIEW_FINANCIAL_DATA" - View financial data. - // "CAN_MANAGE_PERMISSIONS" - Admin (all permissions). - // "CAN_REPLY_TO_REVIEWS" - Reply to reviews. - // "CAN_MANAGE_PUBLIC_APKS" - Release to production, exclude devices, - // and use app signing by Google Play. - // "CAN_MANAGE_TRACK_APKS" - Release to testing tracks. - // "CAN_MANAGE_TRACK_USERS" - Manage testing tracks and edit tester - // lists. - // "CAN_MANAGE_PUBLIC_LISTING" - Manage store presence. - // "CAN_MANAGE_DRAFT_APPS" - Edit and delete draft apps. - // "CAN_MANAGE_ORDERS" - Manage orders and subscriptions. - // "CAN_MANAGE_APP_CONTENT" - Manage policy related pages. - // "CAN_VIEW_NON_FINANCIAL_DATA" - View app information (read-only). - // "CAN_VIEW_APP_QUALITY" - View app quality data such as Vitals, - // Crashes etc. - AppLevelPermissions []string `json:"appLevelPermissions,omitempty"` - - // Name: Required. Resource name for this grant, following the pattern - // "developers/{developer}/users/{email}/grants/{package_name}". If this - // grant is for a draft app, the app ID will be used in this resource - // name instead of the package name. - Name string `json:"name,omitempty"` - - // PackageName: Immutable. The package name of the app. This will be - // empty for draft apps. - PackageName string `json:"packageName,omitempty"` +// ExpansionFilesUploadResponse: Response for uploading an expansion +// file. +type ExpansionFilesUploadResponse struct { + // ExpansionFile: The uploaded expansion file configuration. + ExpansionFile *ExpansionFile `json:"expansionFile,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "AppLevelPermissions") - // to unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "ExpansionFile") to + // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AppLevelPermissions") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "ExpansionFile") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *Grant) MarshalJSON() ([]byte, error) { - type NoMethod Grant +func (s *ExpansionFilesUploadResponse) MarshalJSON() ([]byte, error) { + type NoMethod ExpansionFilesUploadResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Image: An uploaded image. The resource for ImagesService. -type Image struct { - // Id: A unique id representing this image. - Id string `json:"id,omitempty"` - - // Sha1: A sha1 hash of the image. - Sha1 string `json:"sha1,omitempty"` +// ExternalAccountIdentifiers: User account identifier in the +// third-party service. +type ExternalAccountIdentifiers struct { + // ExternalAccountId: User account identifier in the third-party + // service. Only present if account linking happened as part of the + // subscription purchase flow. + ExternalAccountId string `json:"externalAccountId,omitempty"` - // Sha256: A sha256 hash of the image. - Sha256 string `json:"sha256,omitempty"` + // ObfuscatedExternalAccountId: An obfuscated version of the id that is + // uniquely associated with the user's account in your app. Present for + // the following purchases: * If account linking happened as part of the + // subscription purchase flow. * It was specified using + // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedaccountid + // when the purchase was made. + ObfuscatedExternalAccountId string `json:"obfuscatedExternalAccountId,omitempty"` - // Url: A URL that will serve a preview of the image. - Url string `json:"url,omitempty"` + // ObfuscatedExternalProfileId: An obfuscated version of the id that is + // uniquely associated with the user's profile in your app. Only present + // if specified using + // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedprofileid + // when the purchase was made. + ObfuscatedExternalProfileId string `json:"obfuscatedExternalProfileId,omitempty"` - // ForceSendFields is a list of field names (e.g. "Id") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "ExternalAccountId") + // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Id") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "ExternalAccountId") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *Image) MarshalJSON() ([]byte, error) { - type NoMethod Image +func (s *ExternalAccountIdentifiers) MarshalJSON() ([]byte, error) { + type NoMethod ExternalAccountIdentifiers raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ImagesDeleteAllResponse: Response for deleting all images. -type ImagesDeleteAllResponse struct { - // Deleted: The deleted images. - Deleted []*Image `json:"deleted,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` +// ExternalSubscription: Details of an external subscription. +type ExternalSubscription struct { + // SubscriptionType: Required. The type of the external subscription. + // + // Possible values: + // "SUBSCRIPTION_TYPE_UNSPECIFIED" - Unspecified, do not use. + // "RECURRING" - This is a recurring subscription where the user is + // charged every billing cycle. + // "PREPAID" - This is a prepaid subscription where the user pays up + // front. + SubscriptionType string `json:"subscriptionType,omitempty"` - // ForceSendFields is a list of field names (e.g. "Deleted") to + // ForceSendFields is a list of field names (e.g. "SubscriptionType") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2937,63 +2967,92 @@ type ImagesDeleteAllResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Deleted") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "SubscriptionType") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *ImagesDeleteAllResponse) MarshalJSON() ([]byte, error) { - type NoMethod ImagesDeleteAllResponse +func (s *ExternalSubscription) MarshalJSON() ([]byte, error) { + type NoMethod ExternalSubscription raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ImagesListResponse: Response listing all images. -type ImagesListResponse struct { - // Images: All listed Images. - Images []*Image `json:"images,omitempty"` +// ExternalTransaction: The details of an external transaction. +type ExternalTransaction struct { + // CreateTime: Output only. The time when this transaction was created. + // This is the time when Google was notified of the transaction. + CreateTime string `json:"createTime,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // CurrentPreTaxAmount: Output only. The current transaction amount + // before tax. This represents the current pre-tax amount including any + // refunds that may have been applied to this transaction. + CurrentPreTaxAmount *Price `json:"currentPreTaxAmount,omitempty"` - // ForceSendFields is a list of field names (e.g. "Images") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` + // CurrentTaxAmount: Output only. The current tax amount. This + // represents the current tax amount including any refunds that may have + // been applied to this transaction. + CurrentTaxAmount *Price `json:"currentTaxAmount,omitempty"` - // NullFields is a list of field names (e.g. "Images") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} + // ExternalTransactionId: Output only. The id of this transaction. All + // transaction ids under the same package name must be unique. Set when + // creating the external transaction. + ExternalTransactionId string `json:"externalTransactionId,omitempty"` -func (s *ImagesListResponse) MarshalJSON() ([]byte, error) { - type NoMethod ImagesListResponse - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} + // OneTimeTransaction: This is a one-time transaction and not part of a + // subscription. + OneTimeTransaction *OneTimeExternalTransaction `json:"oneTimeTransaction,omitempty"` -// ImagesUploadResponse: Response for uploading an image. -type ImagesUploadResponse struct { - // Image: The uploaded image. - Image *Image `json:"image,omitempty"` + // OriginalPreTaxAmount: Required. The original transaction amount + // before taxes. This represents the pre-tax amount originally notified + // to Google before any refunds were applied. + OriginalPreTaxAmount *Price `json:"originalPreTaxAmount,omitempty"` + + // OriginalTaxAmount: Required. The original tax amount. This represents + // the tax amount originally notified to Google before any refunds were + // applied. + OriginalTaxAmount *Price `json:"originalTaxAmount,omitempty"` + + // PackageName: Output only. The resource name of the external + // transaction. The package name of the application the inapp products + // were sold (for example, 'com.some.app'). + PackageName string `json:"packageName,omitempty"` + + // RecurringTransaction: This transaction is part of a recurring series + // of transactions. + RecurringTransaction *RecurringExternalTransaction `json:"recurringTransaction,omitempty"` + + // TestPurchase: Output only. If set, this transaction was a test + // purchase. Google will not charge for a test transaction. + TestPurchase *ExternalTransactionTestPurchase `json:"testPurchase,omitempty"` + + // TransactionState: Output only. The current state of the transaction. + // + // Possible values: + // "TRANSACTION_STATE_UNSPECIFIED" - Unspecified transaction state. + // Not used. + // "TRANSACTION_REPORTED" - The transaction has been successfully + // reported to Google. + // "TRANSACTION_CANCELED" - The transaction has been fully refunded. + TransactionState string `json:"transactionState,omitempty"` + + // TransactionTime: Required. The time when the transaction was + // completed. + TransactionTime string `json:"transactionTime,omitempty"` + + // UserTaxAddress: Required. User address for tax computation. + UserTaxAddress *ExternalTransactionAddress `json:"userTaxAddress,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Image") to + // ForceSendFields is a list of field names (e.g. "CreateTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3001,8 +3060,8 @@ type ImagesUploadResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Image") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -3010,93 +3069,41 @@ type ImagesUploadResponse struct { NullFields []string `json:"-"` } -func (s *ImagesUploadResponse) MarshalJSON() ([]byte, error) { - type NoMethod ImagesUploadResponse +func (s *ExternalTransaction) MarshalJSON() ([]byte, error) { + type NoMethod ExternalTransaction raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// InAppProduct: An in-app product. The resource for -// InappproductsService. -type InAppProduct struct { - // DefaultLanguage: Default language of the localized data, as defined - // by BCP-47. e.g. "en-US". - DefaultLanguage string `json:"defaultLanguage,omitempty"` - - // DefaultPrice: Default price. Cannot be zero, as in-app products are - // never free. Always in the developer's Checkout merchant currency. - DefaultPrice *Price `json:"defaultPrice,omitempty"` - - // GracePeriod: Grace period of the subscription, specified in ISO 8601 - // format. Allows developers to give their subscribers a grace period - // when the payment for the new recurrence period is declined. - // Acceptable values are P0D (zero days), P3D (three days), P7D (seven - // days), P14D (14 days), and P30D (30 days). - GracePeriod string `json:"gracePeriod,omitempty"` - - // Listings: List of localized title and description data. Map key is - // the language of the localized data, as defined by BCP-47, e.g. - // "en-US". - Listings map[string]InAppProductListing `json:"listings,omitempty"` - - // ManagedProductTaxesAndComplianceSettings: Details about taxes and - // legal compliance. Only applicable to managed products. - ManagedProductTaxesAndComplianceSettings *ManagedProductTaxAndComplianceSettings `json:"managedProductTaxesAndComplianceSettings,omitempty"` - - // PackageName: Package name of the parent app. - PackageName string `json:"packageName,omitempty"` - - // Prices: Prices per buyer region. None of these can be zero, as in-app - // products are never free. Map key is region code, as defined by ISO - // 3166-2. - Prices map[string]Price `json:"prices,omitempty"` - - // PurchaseType: The type of the product, e.g. a recurring subscription. - // - // Possible values: - // "purchaseTypeUnspecified" - Unspecified purchase type. - // "managedUser" - The default product type - one time purchase. - // "subscription" - In-app product with a recurring period. - PurchaseType string `json:"purchaseType,omitempty"` - - // Sku: Stock-keeping-unit (SKU) of the product, unique within an app. - Sku string `json:"sku,omitempty"` - - // Status: The status of the product, e.g. whether it's active. - // - // Possible values: - // "statusUnspecified" - Unspecified status. - // "active" - The product is published and active in the store. - // "inactive" - The product is not published and therefore inactive in - // the store. - Status string `json:"status,omitempty"` - - // SubscriptionPeriod: Subscription period, specified in ISO 8601 - // format. Acceptable values are P1W (one week), P1M (one month), P3M - // (three months), P6M (six months), and P1Y (one year). - SubscriptionPeriod string `json:"subscriptionPeriod,omitempty"` - - // SubscriptionTaxesAndComplianceSettings: Details about taxes and legal - // compliance. Only applicable to subscription products. - SubscriptionTaxesAndComplianceSettings *SubscriptionTaxAndComplianceSettings `json:"subscriptionTaxesAndComplianceSettings,omitempty"` - - // TrialPeriod: Trial period, specified in ISO 8601 format. Acceptable - // values are anything between P7D (seven days) and P999D (999 days). - TrialPeriod string `json:"trialPeriod,omitempty"` +// ExternalTransactionAddress: User's address for the external +// transaction. +type ExternalTransactionAddress struct { + // AdministrativeArea: Optional. Top-level administrative subdivision of + // the country/region. Only required for transactions in India. Valid + // values are "ANDAMAN AND NICOBAR ISLANDS", "ANDHRA PRADESH", + // "ARUNACHAL PRADESH", "ASSAM", "BIHAR", "CHANDIGARH", "CHHATTISGARH", + // "DADRA AND NAGAR HAVELI", "DADRA AND NAGAR HAVELI AND DAMAN AND DIU", + // "DAMAN AND DIU", "DELHI", "GOA", "GUJARAT", "HARYANA", "HIMACHAL + // PRADESH", "JAMMU AND KASHMIR", "JHARKHAND", "KARNATAKA", "KERALA", + // "LADAKH", "LAKSHADWEEP", "MADHYA PRADESH", "MAHARASHTRA", "MANIPUR", + // "MEGHALAYA", "MIZORAM", "NAGALAND", "ODISHA", "PUDUCHERRY", "PUNJAB", + // "RAJASTHAN", "SIKKIM", "TAMIL NADU", "TELANGANA", "TRIPURA", "UTTAR + // PRADESH", "UTTARAKHAND", and "WEST BENGAL". + AdministrativeArea string `json:"administrativeArea,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // RegionCode: Required. Two letter region code based on ISO-3166-1 + // Alpha-2 (UN region codes). + RegionCode string `json:"regionCode,omitempty"` - // ForceSendFields is a list of field names (e.g. "DefaultLanguage") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "AdministrativeArea") + // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DefaultLanguage") to + // NullFields is a list of field names (e.g. "AdministrativeArea") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -3106,24 +3113,77 @@ type InAppProduct struct { NullFields []string `json:"-"` } -func (s *InAppProduct) MarshalJSON() ([]byte, error) { - type NoMethod InAppProduct +func (s *ExternalTransactionAddress) MarshalJSON() ([]byte, error) { + type NoMethod ExternalTransactionAddress raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// InAppProductListing: Store listing of a single in-app product. -type InAppProductListing struct { - // Benefits: Localized entitlement benefits for a subscription. - Benefits []string `json:"benefits,omitempty"` +// ExternalTransactionTestPurchase: Represents a transaction performed +// using a test account. These transactions will not be charged by +// Google. +type ExternalTransactionTestPurchase struct { +} - // Description: Description for the store listing. - Description string `json:"description,omitempty"` +// ExternallyHostedApk: Defines an APK available for this application +// that is hosted externally and not uploaded to Google Play. This +// function is only available to organizations using Managed Play whose +// application is configured to restrict distribution to the +// organizations. +type ExternallyHostedApk struct { + // ApplicationLabel: The application label. + ApplicationLabel string `json:"applicationLabel,omitempty"` - // Title: Title for the store listing. - Title string `json:"title,omitempty"` + // CertificateBase64s: A certificate (or array of certificates if a + // certificate-chain is used) used to sign this APK, represented as a + // base64 encoded byte array. + CertificateBase64s []string `json:"certificateBase64s,omitempty"` - // ForceSendFields is a list of field names (e.g. "Benefits") to + // ExternallyHostedUrl: The URL at which the APK is hosted. This must be + // an https URL. + ExternallyHostedUrl string `json:"externallyHostedUrl,omitempty"` + + // FileSha1Base64: The sha1 checksum of this APK, represented as a + // base64 encoded byte array. + FileSha1Base64 string `json:"fileSha1Base64,omitempty"` + + // FileSha256Base64: The sha256 checksum of this APK, represented as a + // base64 encoded byte array. + FileSha256Base64 string `json:"fileSha256Base64,omitempty"` + + // FileSize: The file size in bytes of this APK. + FileSize int64 `json:"fileSize,omitempty,string"` + + // IconBase64: The icon image from the APK, as a base64 encoded byte + // array. + IconBase64 string `json:"iconBase64,omitempty"` + + // MaximumSdk: The maximum SDK supported by this APK (optional). + MaximumSdk int64 `json:"maximumSdk,omitempty"` + + // MinimumSdk: The minimum SDK targeted by this APK. + MinimumSdk int64 `json:"minimumSdk,omitempty"` + + // NativeCodes: The native code environments supported by this APK + // (optional). + NativeCodes []string `json:"nativeCodes,omitempty"` + + // PackageName: The package name. + PackageName string `json:"packageName,omitempty"` + + // UsesFeatures: The features required by this APK (optional). + UsesFeatures []string `json:"usesFeatures,omitempty"` + + // UsesPermissions: The permissions requested by this APK. + UsesPermissions []*UsesPermission `json:"usesPermissions,omitempty"` + + // VersionCode: The version code of this APK. + VersionCode int64 `json:"versionCode,omitempty"` + + // VersionName: The version name of this APK. + VersionName string `json:"versionName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApplicationLabel") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3131,42 +3191,36 @@ type InAppProductListing struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Benefits") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "ApplicationLabel") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *InAppProductListing) MarshalJSON() ([]byte, error) { - type NoMethod InAppProductListing +func (s *ExternallyHostedApk) MarshalJSON() ([]byte, error) { + type NoMethod ExternallyHostedApk raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// InappproductsListResponse: Response listing all in-app products. -type InappproductsListResponse struct { - // Inappproduct: All in-app products. - Inappproduct []*InAppProduct `json:"inappproduct,omitempty"` - - // Kind: The kind of this response - // ("androidpublisher#inappproductsListResponse"). - Kind string `json:"kind,omitempty"` - - // PageInfo: Deprecated and unset. - PageInfo *PageInfo `json:"pageInfo,omitempty"` +// FullRefund: A full refund of the remaining amount of a transaction. +type FullRefund struct { +} - // TokenPagination: Pagination token, to handle a number of products - // that is over one page. - TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` +// GeneratedApksListResponse: Response to list generated APKs. +type GeneratedApksListResponse struct { + // GeneratedApks: All generated APKs, grouped by the APK signing key. + GeneratedApks []*GeneratedApksPerSigningKey `json:"generatedApks,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Inappproduct") to + // ForceSendFields is a list of field names (e.g. "GeneratedApks") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3174,7 +3228,7 @@ type InappproductsListResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Inappproduct") to include + // NullFields is a list of field names (e.g. "GeneratedApks") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as @@ -3183,118 +3237,83 @@ type InappproductsListResponse struct { NullFields []string `json:"-"` } -func (s *InappproductsListResponse) MarshalJSON() ([]byte, error) { - type NoMethod InappproductsListResponse +func (s *GeneratedApksListResponse) MarshalJSON() ([]byte, error) { + type NoMethod GeneratedApksListResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// InternalAppSharingArtifact: An artifact resource which gets created -// when uploading an APK or Android App Bundle through internal app -// sharing. -type InternalAppSharingArtifact struct { - // CertificateFingerprint: The sha256 fingerprint of the certificate - // used to sign the generated artifact. - CertificateFingerprint string `json:"certificateFingerprint,omitempty"` +// GeneratedApksPerSigningKey: Download metadata for split, standalone +// and universal APKs, as well as asset pack slices, signed with a given +// key. +type GeneratedApksPerSigningKey struct { + // CertificateSha256Hash: SHA256 hash of the APK signing public key + // certificate. + CertificateSha256Hash string `json:"certificateSha256Hash,omitempty"` - // DownloadUrl: The download URL generated for the uploaded artifact. - // Users that are authorized to download can follow the link to the Play - // Store app to install it. - DownloadUrl string `json:"downloadUrl,omitempty"` + // GeneratedAssetPackSlices: List of asset pack slices which will be + // served for this app bundle, signed with a key corresponding to + // certificate_sha256_hash. + GeneratedAssetPackSlices []*GeneratedAssetPackSlice `json:"generatedAssetPackSlices,omitempty"` - // Sha256: The sha256 hash of the artifact represented as a lowercase - // hexadecimal number, matching the output of the sha256sum command. - Sha256 string `json:"sha256,omitempty"` + // GeneratedSplitApks: List of generated split APKs, signed with a key + // corresponding to certificate_sha256_hash. + GeneratedSplitApks []*GeneratedSplitApk `json:"generatedSplitApks,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // GeneratedStandaloneApks: List of generated standalone APKs, signed + // with a key corresponding to certificate_sha256_hash. + GeneratedStandaloneApks []*GeneratedStandaloneApk `json:"generatedStandaloneApks,omitempty"` - // ForceSendFields is a list of field names (e.g. - // "CertificateFingerprint") to unconditionally include in API requests. - // By default, fields with empty or default values are omitted from API - // requests. However, any non-pointer, non-interface field appearing in - // ForceSendFields will be sent to the server regardless of whether the - // field is empty or not. This may be used to include empty fields in - // Patch requests. + // GeneratedUniversalApk: Generated universal APK, signed with a key + // corresponding to certificate_sha256_hash. This field is not set if no + // universal APK was generated for this signing key. + GeneratedUniversalApk *GeneratedUniversalApk `json:"generatedUniversalApk,omitempty"` + + // TargetingInfo: Contains targeting information about the generated + // apks. + TargetingInfo *TargetingInfo `json:"targetingInfo,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "CertificateSha256Hash") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CertificateFingerprint") - // to include in API requests with the JSON null value. By default, - // fields with empty values are omitted from API requests. However, any - // field with an empty value appearing in NullFields will be sent to the + // NullFields is a list of field names (e.g. "CertificateSha256Hash") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } -func (s *InternalAppSharingArtifact) MarshalJSON() ([]byte, error) { - type NoMethod InternalAppSharingArtifact +func (s *GeneratedApksPerSigningKey) MarshalJSON() ([]byte, error) { + type NoMethod GeneratedApksPerSigningKey raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// IntroductoryPriceInfo: Contains the introductory price information -// for a subscription. -type IntroductoryPriceInfo struct { - // IntroductoryPriceAmountMicros: Introductory price of the - // subscription, not including tax. The currency is the same as - // price_currency_code. Price is expressed in micro-units, where - // 1,000,000 micro-units represents one unit of the currency. For - // example, if the subscription price is €1.99, price_amount_micros is - // 1990000. - IntroductoryPriceAmountMicros int64 `json:"introductoryPriceAmountMicros,omitempty,string"` - - // IntroductoryPriceCurrencyCode: ISO 4217 currency code for the - // introductory subscription price. For example, if the price is - // specified in British pounds sterling, price_currency_code is "GBP". - IntroductoryPriceCurrencyCode string `json:"introductoryPriceCurrencyCode,omitempty"` - - // IntroductoryPriceCycles: The number of billing period to offer - // introductory pricing. - IntroductoryPriceCycles int64 `json:"introductoryPriceCycles,omitempty"` - - // IntroductoryPricePeriod: Introductory price period, specified in ISO - // 8601 format. Common values are (but not limited to) "P1W" (one week), - // "P1M" (one month), "P3M" (three months), "P6M" (six months), and - // "P1Y" (one year). - IntroductoryPricePeriod string `json:"introductoryPricePeriod,omitempty"` - - // ForceSendFields is a list of field names (e.g. - // "IntroductoryPriceAmountMicros") to unconditionally include in API - // requests. By default, fields with empty or default values are omitted - // from API requests. However, any non-pointer, non-interface field - // appearing in ForceSendFields will be sent to the server regardless of - // whether the field is empty or not. This may be used to include empty - // fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. - // "IntroductoryPriceAmountMicros") to include in API requests with the - // JSON null value. By default, fields with empty values are omitted - // from API requests. However, any field with an empty value appearing - // in NullFields will be sent to the server as null. It is an error if a - // field in this list has a non-empty value. This may be used to include - // null fields in Patch requests. - NullFields []string `json:"-"` -} +// GeneratedAssetPackSlice: Download metadata for an asset pack slice. +type GeneratedAssetPackSlice struct { + // DownloadId: Download ID, which uniquely identifies the APK to + // download. Should be supplied to `generatedapks.download` method. + DownloadId string `json:"downloadId,omitempty"` -func (s *IntroductoryPriceInfo) MarshalJSON() ([]byte, error) { - type NoMethod IntroductoryPriceInfo - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} + // ModuleName: Name of the module that this asset slice belongs to. + ModuleName string `json:"moduleName,omitempty"` -// LanguageTargeting: Targeting based on language. -type LanguageTargeting struct { - // Alternatives: Alternative languages. - Alternatives []string `json:"alternatives,omitempty"` + // SliceId: Asset slice ID. + SliceId string `json:"sliceId,omitempty"` - // Value: ISO-639: 2 or 3 letter language code. - Value []string `json:"value,omitempty"` + // Version: Asset module version. + Version int64 `json:"version,omitempty,string"` - // ForceSendFields is a list of field names (e.g. "Alternatives") to + // ForceSendFields is a list of field names (e.g. "DownloadId") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3302,77 +3321,69 @@ type LanguageTargeting struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Alternatives") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "DownloadId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *LanguageTargeting) MarshalJSON() ([]byte, error) { - type NoMethod LanguageTargeting +func (s *GeneratedAssetPackSlice) MarshalJSON() ([]byte, error) { + type NoMethod GeneratedAssetPackSlice raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ListDeviceTierConfigsResponse: Response listing existing device tier -// configs. -type ListDeviceTierConfigsResponse struct { - // DeviceTierConfigs: Device tier configs created by the developer. - DeviceTierConfigs []*DeviceTierConfig `json:"deviceTierConfigs,omitempty"` +// GeneratedSplitApk: Download metadata for a split APK. +type GeneratedSplitApk struct { + // DownloadId: Download ID, which uniquely identifies the APK to + // download. Should be supplied to `generatedapks.download` method. + DownloadId string `json:"downloadId,omitempty"` - // NextPageToken: A token, which can be sent as `page_token` to retrieve - // the next page. If this field is omitted, there are no subsequent - // pages. - NextPageToken string `json:"nextPageToken,omitempty"` + // ModuleName: Name of the module that this APK belongs to. + ModuleName string `json:"moduleName,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // SplitId: Split ID. Empty for the main split of the base module. + SplitId string `json:"splitId,omitempty"` - // ForceSendFields is a list of field names (e.g. "DeviceTierConfigs") - // to unconditionally include in API requests. By default, fields with + // VariantId: ID of the generated variant. + VariantId int64 `json:"variantId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DownloadId") to + // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DeviceTierConfigs") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "DownloadId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *ListDeviceTierConfigsResponse) MarshalJSON() ([]byte, error) { - type NoMethod ListDeviceTierConfigsResponse +func (s *GeneratedSplitApk) MarshalJSON() ([]byte, error) { + type NoMethod GeneratedSplitApk raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ListSubscriptionOffersResponse: Response message for -// ListSubscriptionOffers. -type ListSubscriptionOffersResponse struct { - // NextPageToken: A token, which can be sent as `page_token` to retrieve - // the next page. If this field is omitted, there are no subsequent - // pages. - NextPageToken string `json:"nextPageToken,omitempty"` - - // SubscriptionOffers: The subscription offers from the specified - // subscription. - SubscriptionOffers []*SubscriptionOffer `json:"subscriptionOffers,omitempty"` +// GeneratedStandaloneApk: Download metadata for a standalone APK. +type GeneratedStandaloneApk struct { + // DownloadId: Download ID, which uniquely identifies the APK to + // download. Should be supplied to `generatedapks.download` method. + DownloadId string `json:"downloadId,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // VariantId: ID of the generated variant. + VariantId int64 `json:"variantId,omitempty"` - // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // ForceSendFields is a list of field names (e.g. "DownloadId") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3380,36 +3391,28 @@ type ListSubscriptionOffersResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "NextPageToken") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "DownloadId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *ListSubscriptionOffersResponse) MarshalJSON() ([]byte, error) { - type NoMethod ListSubscriptionOffersResponse +func (s *GeneratedStandaloneApk) MarshalJSON() ([]byte, error) { + type NoMethod GeneratedStandaloneApk raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ListSubscriptionsResponse: Response message for ListSubscriptions. -type ListSubscriptionsResponse struct { - // NextPageToken: A token, which can be sent as `page_token` to retrieve - // the next page. If this field is omitted, there are no subsequent - // pages. - NextPageToken string `json:"nextPageToken,omitempty"` - - // Subscriptions: The subscriptions from the specified app. - Subscriptions []*Subscription `json:"subscriptions,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` +// GeneratedUniversalApk: Download metadata for a universal APK. +type GeneratedUniversalApk struct { + // DownloadId: Download ID, which uniquely identifies the APK to + // download. Should be supplied to `generatedapks.download` method. + DownloadId string `json:"downloadId,omitempty"` - // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // ForceSendFields is a list of field names (e.g. "DownloadId") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3417,37 +3420,39 @@ type ListSubscriptionsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "NextPageToken") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "DownloadId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *ListSubscriptionsResponse) MarshalJSON() ([]byte, error) { - type NoMethod ListSubscriptionsResponse +func (s *GeneratedUniversalApk) MarshalJSON() ([]byte, error) { + type NoMethod GeneratedUniversalApk raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ListUsersResponse: A response containing one or more users with -// access to an account. -type ListUsersResponse struct { - // NextPageToken: A token to pass to subsequent calls in order to - // retrieve subsequent results. This will not be set if there are no - // more results to return. - NextPageToken string `json:"nextPageToken,omitempty"` +// GetSubscriptionOfferRequest: Request message for +// GetSubscriptionOffer. +type GetSubscriptionOfferRequest struct { + // BasePlanId: Required. The parent base plan (ID) of the offer to get. + BasePlanId string `json:"basePlanId,omitempty"` - // Users: The resulting users. - Users []*User `json:"users,omitempty"` + // OfferId: Required. The unique offer ID of the offer to get. + OfferId string `json:"offerId,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // PackageName: Required. The parent app (package name) of the offer to + // get. + PackageName string `json:"packageName,omitempty"` - // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // ProductId: Required. The parent subscription (ID) of the offer to + // get. + ProductId string `json:"productId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BasePlanId") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3455,52 +3460,72 @@ type ListUsersResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "NextPageToken") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "BasePlanId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *ListUsersResponse) MarshalJSON() ([]byte, error) { - type NoMethod ListUsersResponse +func (s *GetSubscriptionOfferRequest) MarshalJSON() ([]byte, error) { + type NoMethod GetSubscriptionOfferRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Listing: A localized store listing. The resource for ListingsService. -type Listing struct { - // FullDescription: Full description of the app. - FullDescription string `json:"fullDescription,omitempty"` - - // Language: Language localization code (a BCP-47 language tag; for - // example, "de-AT" for Austrian German). - Language string `json:"language,omitempty"` - - // ShortDescription: Short description of the app. - ShortDescription string `json:"shortDescription,omitempty"` +// Grant: An access grant resource. +type Grant struct { + // AppLevelPermissions: The permissions granted to the user for this + // app. + // + // Possible values: + // "APP_LEVEL_PERMISSION_UNSPECIFIED" - Unknown or unspecified + // permission. + // "CAN_ACCESS_APP" - View app information (read-only). Deprecated: + // Try defining a more granular capability. Otherwise, check + // AppLevelPermission.CAN_VIEW_NON_FINANCIAL_DATA. + // "CAN_VIEW_FINANCIAL_DATA" - View financial data. + // "CAN_MANAGE_PERMISSIONS" - Admin (all permissions). + // "CAN_REPLY_TO_REVIEWS" - Reply to reviews. + // "CAN_MANAGE_PUBLIC_APKS" - Release to production, exclude devices, + // and use app signing by Google Play. + // "CAN_MANAGE_TRACK_APKS" - Release to testing tracks. + // "CAN_MANAGE_TRACK_USERS" - Manage testing tracks and edit tester + // lists. + // "CAN_MANAGE_PUBLIC_LISTING" - Manage store presence. + // "CAN_MANAGE_DRAFT_APPS" - Edit and delete draft apps. + // "CAN_MANAGE_ORDERS" - Manage orders and subscriptions. + // "CAN_MANAGE_APP_CONTENT" - Manage policy related pages. + // "CAN_VIEW_NON_FINANCIAL_DATA" - View app information (read-only). + // "CAN_VIEW_APP_QUALITY" - View app quality data such as Vitals, + // Crashes etc. + AppLevelPermissions []string `json:"appLevelPermissions,omitempty"` - // Title: Localized title of the app. - Title string `json:"title,omitempty"` + // Name: Required. Resource name for this grant, following the pattern + // "developers/{developer}/users/{email}/grants/{package_name}". If this + // grant is for a draft app, the app ID will be used in this resource + // name instead of the package name. + Name string `json:"name,omitempty"` - // Video: URL of a promotional YouTube video for the app. - Video string `json:"video,omitempty"` + // PackageName: Immutable. The package name of the app. This will be + // empty for draft apps. + PackageName string `json:"packageName,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "FullDescription") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "AppLevelPermissions") + // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "FullDescription") to + // NullFields is a list of field names (e.g. "AppLevelPermissions") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -3510,26 +3535,27 @@ type Listing struct { NullFields []string `json:"-"` } -func (s *Listing) MarshalJSON() ([]byte, error) { - type NoMethod Listing +func (s *Grant) MarshalJSON() ([]byte, error) { + type NoMethod Grant raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ListingsListResponse: Response listing all localized listings. -type ListingsListResponse struct { - // Kind: The kind of this response - // ("androidpublisher#listingsListResponse"). - Kind string `json:"kind,omitempty"` +// Image: An uploaded image. The resource for ImagesService. +type Image struct { + // Id: A unique id representing this image. + Id string `json:"id,omitempty"` - // Listings: All localized listings. - Listings []*Listing `json:"listings,omitempty"` + // Sha1: A sha1 hash of the image. + Sha1 string `json:"sha1,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // Sha256: A sha256 hash of the image. + Sha256 string `json:"sha256,omitempty"` - // ForceSendFields is a list of field names (e.g. "Kind") to + // Url: A URL that will serve a preview of the image. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3537,7 +3563,7 @@ type ListingsListResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Kind") to include in API + // NullFields is a list of field names (e.g. "Id") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -3546,22 +3572,22 @@ type ListingsListResponse struct { NullFields []string `json:"-"` } -func (s *ListingsListResponse) MarshalJSON() ([]byte, error) { - type NoMethod ListingsListResponse +func (s *Image) MarshalJSON() ([]byte, error) { + type NoMethod Image raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// LocalizedText: Localized text in given language. -type LocalizedText struct { - // Language: Language localization code (a BCP-47 language tag; for - // example, "de-AT" for Austrian German). - Language string `json:"language,omitempty"` +// ImagesDeleteAllResponse: Response for deleting all images. +type ImagesDeleteAllResponse struct { + // Deleted: The deleted images. + Deleted []*Image `json:"deleted,omitempty"` - // Text: The text in the given language. - Text string `json:"text,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Language") to + // ForceSendFields is a list of field names (e.g. "Deleted") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3569,7 +3595,7 @@ type LocalizedText struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Language") to include in + // NullFields is a list of field names (e.g. "Deleted") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -3578,140 +3604,54 @@ type LocalizedText struct { NullFields []string `json:"-"` } -func (s *LocalizedText) MarshalJSON() ([]byte, error) { - type NoMethod LocalizedText +func (s *ImagesDeleteAllResponse) MarshalJSON() ([]byte, error) { + type NoMethod ImagesDeleteAllResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ManagedProductTaxAndComplianceSettings: Details about taxation and -// legal compliance for managed products. -type ManagedProductTaxAndComplianceSettings struct { - // EeaWithdrawalRightType: Digital content or service classification for - // products distributed to users in the European Economic Area (EEA). - // The withdrawal regime under EEA consumer laws depends on this - // classification. Refer to the Help Center article - // (https://support.google.com/googleplay/android-developer/answer/10463498) - // for more information. - // - // Possible values: - // "WITHDRAWAL_RIGHT_TYPE_UNSPECIFIED" - // "WITHDRAWAL_RIGHT_DIGITAL_CONTENT" - // "WITHDRAWAL_RIGHT_SERVICE" - EeaWithdrawalRightType string `json:"eeaWithdrawalRightType,omitempty"` - - // IsTokenizedDigitalAsset: Whether this in-app product is declared as a - // product representing a tokenized digital asset. - IsTokenizedDigitalAsset bool `json:"isTokenizedDigitalAsset,omitempty"` +// ImagesListResponse: Response listing all images. +type ImagesListResponse struct { + // Images: All listed Images. + Images []*Image `json:"images,omitempty"` - // TaxRateInfoByRegionCode: A mapping from region code to tax rate - // details. The keys are region codes as defined by Unicode's "CLDR". - TaxRateInfoByRegionCode map[string]RegionalTaxRateInfo `json:"taxRateInfoByRegionCode,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. - // "EeaWithdrawalRightType") to unconditionally include in API requests. - // By default, fields with empty or default values are omitted from API - // requests. However, any non-pointer, non-interface field appearing in - // ForceSendFields will be sent to the server regardless of whether the - // field is empty or not. This may be used to include empty fields in - // Patch requests. + // ForceSendFields is a list of field names (e.g. "Images") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "EeaWithdrawalRightType") - // to include in API requests with the JSON null value. By default, - // fields with empty values are omitted from API requests. However, any - // field with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "Images") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *ManagedProductTaxAndComplianceSettings) MarshalJSON() ([]byte, error) { - type NoMethod ManagedProductTaxAndComplianceSettings +func (s *ImagesListResponse) MarshalJSON() ([]byte, error) { + type NoMethod ImagesListResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// MigrateBasePlanPricesRequest: Request message for -// MigrateBasePlanPrices. -type MigrateBasePlanPricesRequest struct { - // RegionalPriceMigrations: Required. The regional prices to update. - RegionalPriceMigrations []*RegionalPriceMigrationConfig `json:"regionalPriceMigrations,omitempty"` - - // RegionsVersion: Required. The version of the available regions being - // used for the regional_price_migrations. - RegionsVersion *RegionsVersion `json:"regionsVersion,omitempty"` - - // ForceSendFields is a list of field names (e.g. - // "RegionalPriceMigrations") to unconditionally include in API - // requests. By default, fields with empty or default values are omitted - // from API requests. However, any non-pointer, non-interface field - // appearing in ForceSendFields will be sent to the server regardless of - // whether the field is empty or not. This may be used to include empty - // fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "RegionalPriceMigrations") - // to include in API requests with the JSON null value. By default, - // fields with empty values are omitted from API requests. However, any - // field with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} - -func (s *MigrateBasePlanPricesRequest) MarshalJSON() ([]byte, error) { - type NoMethod MigrateBasePlanPricesRequest - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} +// ImagesUploadResponse: Response for uploading an image. +type ImagesUploadResponse struct { + // Image: The uploaded image. + Image *Image `json:"image,omitempty"` -// MigrateBasePlanPricesResponse: Response message for -// MigrateBasePlanPrices. -type MigrateBasePlanPricesResponse struct { // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` -} - -// ModuleMetadata: Metadata of a module. -type ModuleMetadata struct { - // DeliveryType: Indicates the delivery type (e.g. on-demand) of the - // module. - // - // Possible values: - // "UNKNOWN_DELIVERY_TYPE" - Unspecified delivery type. - // "INSTALL_TIME" - This module will always be downloaded as part of - // the initial install of the app. - // "ON_DEMAND" - This module is requested on-demand, which means it - // will not be part of the initial install, and will only be sent when - // requested by the client. - // "FAST_FOLLOW" - This module will be downloaded immediately after - // initial install finishes. The app can be opened before these modules - // are downloaded. - DeliveryType string `json:"deliveryType,omitempty"` - - // Dependencies: Names of the modules that this module directly depends - // on. Each module implicitly depends on the base module. - Dependencies []string `json:"dependencies,omitempty"` - // ModuleType: Indicates the type of this feature module. - // - // Possible values: - // "UNKNOWN_MODULE_TYPE" - Unknown feature module. - // "FEATURE_MODULE" - Regular feature module. - ModuleType string `json:"moduleType,omitempty"` - - // Name: Module name. - Name string `json:"name,omitempty"` - - // Targeting: The targeting that makes a conditional module installed. - // Relevant only for Split APKs. - Targeting *ModuleTargeting `json:"targeting,omitempty"` - - // ForceSendFields is a list of field names (e.g. "DeliveryType") to + // ForceSendFields is a list of field names (e.g. "Image") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3719,75 +3659,129 @@ type ModuleMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DeliveryType") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Image") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *ModuleMetadata) MarshalJSON() ([]byte, error) { - type NoMethod ModuleMetadata +func (s *ImagesUploadResponse) MarshalJSON() ([]byte, error) { + type NoMethod ImagesUploadResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ModuleTargeting: Targeting on the module level. -type ModuleTargeting struct { - // DeviceFeatureTargeting: Targeting for device features. - DeviceFeatureTargeting []*DeviceFeatureTargeting `json:"deviceFeatureTargeting,omitempty"` +// InAppProduct: An in-app product. The resource for +// InappproductsService. +type InAppProduct struct { + // DefaultLanguage: Default language of the localized data, as defined + // by BCP-47. e.g. "en-US". + DefaultLanguage string `json:"defaultLanguage,omitempty"` - // SdkVersionTargeting: The sdk version that the variant targets - SdkVersionTargeting *SdkVersionTargeting `json:"sdkVersionTargeting,omitempty"` + // DefaultPrice: Default price. Cannot be zero, as in-app products are + // never free. Always in the developer's Checkout merchant currency. + DefaultPrice *Price `json:"defaultPrice,omitempty"` - // UserCountriesTargeting: Countries-level targeting - UserCountriesTargeting *UserCountriesTargeting `json:"userCountriesTargeting,omitempty"` + // GracePeriod: Grace period of the subscription, specified in ISO 8601 + // format. Allows developers to give their subscribers a grace period + // when the payment for the new recurrence period is declined. + // Acceptable values are P0D (zero days), P3D (three days), P7D (seven + // days), P14D (14 days), and P30D (30 days). + GracePeriod string `json:"gracePeriod,omitempty"` - // ForceSendFields is a list of field names (e.g. - // "DeviceFeatureTargeting") to unconditionally include in API requests. - // By default, fields with empty or default values are omitted from API - // requests. However, any non-pointer, non-interface field appearing in - // ForceSendFields will be sent to the server regardless of whether the - // field is empty or not. This may be used to include empty fields in - // Patch requests. + // Listings: List of localized title and description data. Map key is + // the language of the localized data, as defined by BCP-47, e.g. + // "en-US". + Listings map[string]InAppProductListing `json:"listings,omitempty"` + + // ManagedProductTaxesAndComplianceSettings: Details about taxes and + // legal compliance. Only applicable to managed products. + ManagedProductTaxesAndComplianceSettings *ManagedProductTaxAndComplianceSettings `json:"managedProductTaxesAndComplianceSettings,omitempty"` + + // PackageName: Package name of the parent app. + PackageName string `json:"packageName,omitempty"` + + // Prices: Prices per buyer region. None of these can be zero, as in-app + // products are never free. Map key is region code, as defined by ISO + // 3166-2. + Prices map[string]Price `json:"prices,omitempty"` + + // PurchaseType: The type of the product, e.g. a recurring subscription. + // + // Possible values: + // "purchaseTypeUnspecified" - Unspecified purchase type. + // "managedUser" - The default product type - one time purchase. + // "subscription" - In-app product with a recurring period. + PurchaseType string `json:"purchaseType,omitempty"` + + // Sku: Stock-keeping-unit (SKU) of the product, unique within an app. + Sku string `json:"sku,omitempty"` + + // Status: The status of the product, e.g. whether it's active. + // + // Possible values: + // "statusUnspecified" - Unspecified status. + // "active" - The product is published and active in the store. + // "inactive" - The product is not published and therefore inactive in + // the store. + Status string `json:"status,omitempty"` + + // SubscriptionPeriod: Subscription period, specified in ISO 8601 + // format. Acceptable values are P1W (one week), P1M (one month), P3M + // (three months), P6M (six months), and P1Y (one year). + SubscriptionPeriod string `json:"subscriptionPeriod,omitempty"` + + // SubscriptionTaxesAndComplianceSettings: Details about taxes and legal + // compliance. Only applicable to subscription products. + SubscriptionTaxesAndComplianceSettings *SubscriptionTaxAndComplianceSettings `json:"subscriptionTaxesAndComplianceSettings,omitempty"` + + // TrialPeriod: Trial period, specified in ISO 8601 format. Acceptable + // values are anything between P7D (seven days) and P999D (999 days). + TrialPeriod string `json:"trialPeriod,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DefaultLanguage") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DeviceFeatureTargeting") - // to include in API requests with the JSON null value. By default, - // fields with empty values are omitted from API requests. However, any - // field with an empty value appearing in NullFields will be sent to the + // NullFields is a list of field names (e.g. "DefaultLanguage") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } -func (s *ModuleTargeting) MarshalJSON() ([]byte, error) { - type NoMethod ModuleTargeting +func (s *InAppProduct) MarshalJSON() ([]byte, error) { + type NoMethod InAppProduct raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Money: Represents an amount of money with its currency type. -type Money struct { - // CurrencyCode: The three-letter currency code defined in ISO 4217. - CurrencyCode string `json:"currencyCode,omitempty"` +// InAppProductListing: Store listing of a single in-app product. +type InAppProductListing struct { + // Benefits: Localized entitlement benefits for a subscription. + Benefits []string `json:"benefits,omitempty"` - // Nanos: Number of nano (10^-9) units of the amount. The value must be - // between -999,999,999 and +999,999,999 inclusive. If `units` is - // positive, `nanos` must be positive or zero. If `units` is zero, - // `nanos` can be positive, zero, or negative. If `units` is negative, - // `nanos` must be negative or zero. For example $-1.75 is represented - // as `units`=-1 and `nanos`=-750,000,000. - Nanos int64 `json:"nanos,omitempty"` + // Description: Description for the store listing. + Description string `json:"description,omitempty"` - // Units: The whole units of the amount. For example if `currencyCode` - // is "USD", then 1 unit is one US dollar. - Units int64 `json:"units,omitempty,string"` + // Title: Title for the store listing. + Title string `json:"title,omitempty"` - // ForceSendFields is a list of field names (e.g. "CurrencyCode") to + // ForceSendFields is a list of field names (e.g. "Benefits") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3795,27 +3789,30 @@ type Money struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CurrencyCode") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Benefits") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *Money) MarshalJSON() ([]byte, error) { - type NoMethod Money +func (s *InAppProductListing) MarshalJSON() ([]byte, error) { + type NoMethod InAppProductListing raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// MultiAbi: Represents a list of apis. -type MultiAbi struct { - // Abi: A list of targeted ABIs, as represented by the Android Platform - Abi []*Abi `json:"abi,omitempty"` +// InappproductsBatchDeleteRequest: Request to delete multiple in-app +// products. +type InappproductsBatchDeleteRequest struct { + // Requests: Individual delete requests. At least one request is + // required. Can contain up to 100 requests. All requests must + // correspond to different in-app products. + Requests []*InappproductsDeleteRequest `json:"requests,omitempty"` - // ForceSendFields is a list of field names (e.g. "Abi") to + // ForceSendFields is a list of field names (e.g. "Requests") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3823,8 +3820,8 @@ type MultiAbi struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Abi") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Requests") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -3832,22 +3829,24 @@ type MultiAbi struct { NullFields []string `json:"-"` } -func (s *MultiAbi) MarshalJSON() ([]byte, error) { - type NoMethod MultiAbi +func (s *InappproductsBatchDeleteRequest) MarshalJSON() ([]byte, error) { + type NoMethod InappproductsBatchDeleteRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// MultiAbiTargeting: Targeting based on multiple abis. -type MultiAbiTargeting struct { - // Alternatives: Targeting of other sibling directories that were in the - // Bundle. For main splits this is targeting of other main splits. - Alternatives []*MultiAbi `json:"alternatives,omitempty"` +// InappproductsBatchGetResponse: Response message for +// BatchGetSubscriptions endpoint. +type InappproductsBatchGetResponse struct { + // Inappproduct: The list of requested in-app products, in the same + // order as the request. + Inappproduct []*InAppProduct `json:"inappproduct,omitempty"` - // Value: Value of a multi abi. - Value []*MultiAbi `json:"value,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Alternatives") to + // ForceSendFields is a list of field names (e.g. "Inappproduct") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3855,7 +3854,7 @@ type MultiAbiTargeting struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Alternatives") to include + // NullFields is a list of field names (e.g. "Inappproduct") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as @@ -3864,26 +3863,21 @@ type MultiAbiTargeting struct { NullFields []string `json:"-"` } -func (s *MultiAbiTargeting) MarshalJSON() ([]byte, error) { - type NoMethod MultiAbiTargeting +func (s *InappproductsBatchGetResponse) MarshalJSON() ([]byte, error) { + type NoMethod InappproductsBatchGetResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// OfferDetails: Offer details information related to a purchase line -// item. -type OfferDetails struct { - // BasePlanId: The base plan ID. Present for all base plan and offers. - BasePlanId string `json:"basePlanId,omitempty"` - - // OfferId: The offer ID. Only present for discounted offers. - OfferId string `json:"offerId,omitempty"` - - // OfferTags: The latest offer tags associated with the offer. It - // includes tags inherited from the base plan. - OfferTags []string `json:"offerTags,omitempty"` +// InappproductsBatchUpdateRequest: Request to update or insert one or +// more in-app products. +type InappproductsBatchUpdateRequest struct { + // Requests: Required. Individual update requests. At least one request + // is required. Can contain up to 100 requests. All requests must + // correspond to different in-app products. + Requests []*InappproductsUpdateRequest `json:"requests,omitempty"` - // ForceSendFields is a list of field names (e.g. "BasePlanId") to + // ForceSendFields is a list of field names (e.g. "Requests") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3891,7 +3885,7 @@ type OfferDetails struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "BasePlanId") to include in + // NullFields is a list of field names (e.g. "Requests") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -3900,21 +3894,23 @@ type OfferDetails struct { NullFields []string `json:"-"` } -func (s *OfferDetails) MarshalJSON() ([]byte, error) { - type NoMethod OfferDetails +func (s *InappproductsBatchUpdateRequest) MarshalJSON() ([]byte, error) { + type NoMethod InappproductsBatchUpdateRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// OfferTag: Represents a custom tag specified for base plans and -// subscription offers. -type OfferTag struct { - // Tag: Must conform with RFC-1034. That is, this string can only - // contain lower-case letters (a-z), numbers (0-9), and hyphens (-), and - // be at most 20 characters. - Tag string `json:"tag,omitempty"` +// InappproductsBatchUpdateResponse: Response for a batch in-app product +// update. +type InappproductsBatchUpdateResponse struct { + // Inappproducts: The updated or inserted in-app products. + Inappproducts []*InAppProduct `json:"inappproducts,omitempty"` - // ForceSendFields is a list of field names (e.g. "Tag") to + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Inappproducts") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3922,242 +3918,279 @@ type OfferTag struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Tag") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Inappproducts") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *OfferTag) MarshalJSON() ([]byte, error) { - type NoMethod OfferTag +func (s *InappproductsBatchUpdateResponse) MarshalJSON() ([]byte, error) { + type NoMethod InappproductsBatchUpdateResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// OneTimeExternalTransaction: Represents a one-time transaction. -type OneTimeExternalTransaction struct { - // ExternalTransactionToken: Input only. Provided during the call to - // Create. Retrieved from the client when the alternative billing flow - // is launched. - ExternalTransactionToken string `json:"externalTransactionToken,omitempty"` +// InappproductsDeleteRequest: Request to delete an in-app product. +type InappproductsDeleteRequest struct { + // LatencyTolerance: Optional. The latency tolerance for the propagation + // of this product update. Defaults to latency-sensitive. + // + // Possible values: + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" - Defaults to + // PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE. + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" - The update + // will propagate to clients within several minutes on average and up to + // a few hours in rare cases. Throughput is limited to 7,200 updates per + // app per hour. + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" - The update + // will propagate to clients within 24 hours. Supports high throughput + // of up to 720,000 updates per app per hour using batch modification + // methods. + LatencyTolerance string `json:"latencyTolerance,omitempty"` + + // PackageName: Package name of the app. + PackageName string `json:"packageName,omitempty"` - // ForceSendFields is a list of field names (e.g. - // "ExternalTransactionToken") to unconditionally include in API - // requests. By default, fields with empty or default values are omitted - // from API requests. However, any non-pointer, non-interface field - // appearing in ForceSendFields will be sent to the server regardless of - // whether the field is empty or not. This may be used to include empty - // fields in Patch requests. + // Sku: Unique identifier for the in-app product. + Sku string `json:"sku,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LatencyTolerance") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ExternalTransactionToken") - // to include in API requests with the JSON null value. By default, - // fields with empty values are omitted from API requests. However, any - // field with an empty value appearing in NullFields will be sent to the + // NullFields is a list of field names (e.g. "LatencyTolerance") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } -func (s *OneTimeExternalTransaction) MarshalJSON() ([]byte, error) { - type NoMethod OneTimeExternalTransaction +func (s *InappproductsDeleteRequest) MarshalJSON() ([]byte, error) { + type NoMethod InappproductsDeleteRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// OtherRegionsBasePlanConfig: Pricing information for any new locations -// Play may launch in. -type OtherRegionsBasePlanConfig struct { - // EurPrice: Required. Price in EUR to use for any new locations Play - // may launch in. - EurPrice *Money `json:"eurPrice,omitempty"` +// InappproductsListResponse: Response listing all in-app products. +type InappproductsListResponse struct { + // Inappproduct: All in-app products. + Inappproduct []*InAppProduct `json:"inappproduct,omitempty"` - // NewSubscriberAvailability: Whether the base plan is available for new - // subscribers in any new locations Play may launch in. If not - // specified, this will default to false. - NewSubscriberAvailability bool `json:"newSubscriberAvailability,omitempty"` + // Kind: The kind of this response + // ("androidpublisher#inappproductsListResponse"). + Kind string `json:"kind,omitempty"` - // UsdPrice: Required. Price in USD to use for any new locations Play - // may launch in. - UsdPrice *Money `json:"usdPrice,omitempty"` + // PageInfo: Deprecated and unset. + PageInfo *PageInfo `json:"pageInfo,omitempty"` - // ForceSendFields is a list of field names (e.g. "EurPrice") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be + // TokenPagination: Pagination token, to handle a number of products + // that is over one page. + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Inappproduct") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "EurPrice") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Inappproduct") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *OtherRegionsBasePlanConfig) MarshalJSON() ([]byte, error) { - type NoMethod OtherRegionsBasePlanConfig +func (s *InappproductsListResponse) MarshalJSON() ([]byte, error) { + type NoMethod InappproductsListResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// OtherRegionsSubscriptionOfferConfig: Configuration for any new -// locations Play may launch in specified on a subscription offer. -type OtherRegionsSubscriptionOfferConfig struct { - // OtherRegionsNewSubscriberAvailability: Whether the subscription offer - // in any new locations Play may launch in the future. If not specified, - // this will default to false. - OtherRegionsNewSubscriberAvailability bool `json:"otherRegionsNewSubscriberAvailability,omitempty"` +// InappproductsUpdateRequest: Request to update an in-app product. +type InappproductsUpdateRequest struct { + // AllowMissing: If set to true, and the in-app product with the given + // package_name and sku doesn't exist, the in-app product will be + // created. + AllowMissing bool `json:"allowMissing,omitempty"` - // ForceSendFields is a list of field names (e.g. - // "OtherRegionsNewSubscriberAvailability") to unconditionally include - // in API requests. By default, fields with empty or default values are - // omitted from API requests. However, any non-pointer, non-interface - // field appearing in ForceSendFields will be sent to the server - // regardless of whether the field is empty or not. This may be used to - // include empty fields in Patch requests. + // AutoConvertMissingPrices: If true the prices for all regions targeted + // by the parent app that don't have a price specified for this in-app + // product will be auto converted to the target currency based on the + // default price. Defaults to false. + AutoConvertMissingPrices bool `json:"autoConvertMissingPrices,omitempty"` + + // Inappproduct: The new in-app product. + Inappproduct *InAppProduct `json:"inappproduct,omitempty"` + + // LatencyTolerance: Optional. The latency tolerance for the propagation + // of this product update. Defaults to latency-sensitive. + // + // Possible values: + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" - Defaults to + // PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE. + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" - The update + // will propagate to clients within several minutes on average and up to + // a few hours in rare cases. Throughput is limited to 7,200 updates per + // app per hour. + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" - The update + // will propagate to clients within 24 hours. Supports high throughput + // of up to 720,000 updates per app per hour using batch modification + // methods. + LatencyTolerance string `json:"latencyTolerance,omitempty"` + + // PackageName: Package name of the app. + PackageName string `json:"packageName,omitempty"` + + // Sku: Unique identifier for the in-app product. + Sku string `json:"sku,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AllowMissing") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. - // "OtherRegionsNewSubscriberAvailability") to include in API requests - // with the JSON null value. By default, fields with empty values are - // omitted from API requests. However, any field with an empty value - // appearing in NullFields will be sent to the server as null. It is an - // error if a field in this list has a non-empty value. This may be used - // to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "AllowMissing") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *OtherRegionsSubscriptionOfferConfig) MarshalJSON() ([]byte, error) { - type NoMethod OtherRegionsSubscriptionOfferConfig +func (s *InappproductsUpdateRequest) MarshalJSON() ([]byte, error) { + type NoMethod InappproductsUpdateRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// OtherRegionsSubscriptionOfferPhaseConfig: Configuration for any new -// locations Play may launch in for a single offer phase. -type OtherRegionsSubscriptionOfferPhaseConfig struct { - // AbsoluteDiscounts: The absolute amount of money subtracted from the - // base plan price prorated over the phase duration that the user pays - // for this offer phase. For example, if the base plan price for this - // region is $12 for a period of 1 year, then a $1 absolute discount for - // a phase of a duration of 3 months would correspond to a price of $2. - // The resulting price may not be smaller than the minimum price allowed - // for any new locations Play may launch in. - AbsoluteDiscounts *OtherRegionsSubscriptionOfferPhasePrices `json:"absoluteDiscounts,omitempty"` +// InternalAppSharingArtifact: An artifact resource which gets created +// when uploading an APK or Android App Bundle through internal app +// sharing. +type InternalAppSharingArtifact struct { + // CertificateFingerprint: The sha256 fingerprint of the certificate + // used to sign the generated artifact. + CertificateFingerprint string `json:"certificateFingerprint,omitempty"` - // OtherRegionsPrices: The absolute price the user pays for this offer - // phase. The price must not be smaller than the minimum price allowed - // for any new locations Play may launch in. - OtherRegionsPrices *OtherRegionsSubscriptionOfferPhasePrices `json:"otherRegionsPrices,omitempty"` + // DownloadUrl: The download URL generated for the uploaded artifact. + // Users that are authorized to download can follow the link to the Play + // Store app to install it. + DownloadUrl string `json:"downloadUrl,omitempty"` - // RelativeDiscount: The fraction of the base plan price prorated over - // the phase duration that the user pays for this offer phase. For - // example, if the base plan price for this region is $12 for a period - // of 1 year, then a 50% discount for a phase of a duration of 3 months - // would correspond to a price of $1.50. The discount must be specified - // as a fraction strictly larger than 0 and strictly smaller than 1. The - // resulting price will be rounded to the nearest billable unit (e.g. - // cents for USD). The relative discount is considered invalid if the - // discounted price ends up being smaller than the minimum price allowed - // in any new locations Play may launch in. - RelativeDiscount float64 `json:"relativeDiscount,omitempty"` + // Sha256: The sha256 hash of the artifact represented as a lowercase + // hexadecimal number, matching the output of the sha256sum command. + Sha256 string `json:"sha256,omitempty"` - // ForceSendFields is a list of field names (e.g. "AbsoluteDiscounts") - // to unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "CertificateFingerprint") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AbsoluteDiscounts") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the + // NullFields is a list of field names (e.g. "CertificateFingerprint") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } -func (s *OtherRegionsSubscriptionOfferPhaseConfig) MarshalJSON() ([]byte, error) { - type NoMethod OtherRegionsSubscriptionOfferPhaseConfig +func (s *InternalAppSharingArtifact) MarshalJSON() ([]byte, error) { + type NoMethod InternalAppSharingArtifact raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *OtherRegionsSubscriptionOfferPhaseConfig) UnmarshalJSON(data []byte) error { - type NoMethod OtherRegionsSubscriptionOfferPhaseConfig - var s1 struct { - RelativeDiscount gensupport.JSONFloat64 `json:"relativeDiscount"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.RelativeDiscount = float64(s1.RelativeDiscount) - return nil -} +// IntroductoryPriceInfo: Contains the introductory price information +// for a subscription. +type IntroductoryPriceInfo struct { + // IntroductoryPriceAmountMicros: Introductory price of the + // subscription, not including tax. The currency is the same as + // price_currency_code. Price is expressed in micro-units, where + // 1,000,000 micro-units represents one unit of the currency. For + // example, if the subscription price is €1.99, price_amount_micros is + // 1990000. + IntroductoryPriceAmountMicros int64 `json:"introductoryPriceAmountMicros,omitempty,string"` -// OtherRegionsSubscriptionOfferPhasePrices: Pricing information for any -// new locations Play may launch in. -type OtherRegionsSubscriptionOfferPhasePrices struct { - // EurPrice: Required. Price in EUR to use for any new locations Play - // may launch in. - EurPrice *Money `json:"eurPrice,omitempty"` + // IntroductoryPriceCurrencyCode: ISO 4217 currency code for the + // introductory subscription price. For example, if the price is + // specified in British pounds sterling, price_currency_code is "GBP". + IntroductoryPriceCurrencyCode string `json:"introductoryPriceCurrencyCode,omitempty"` - // UsdPrice: Required. Price in USD to use for any new locations Play - // may launch in. - UsdPrice *Money `json:"usdPrice,omitempty"` + // IntroductoryPriceCycles: The number of billing period to offer + // introductory pricing. + IntroductoryPriceCycles int64 `json:"introductoryPriceCycles,omitempty"` - // ForceSendFields is a list of field names (e.g. "EurPrice") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. + // IntroductoryPricePeriod: Introductory price period, specified in ISO + // 8601 format. Common values are (but not limited to) "P1W" (one week), + // "P1M" (one month), "P3M" (three months), "P6M" (six months), and + // "P1Y" (one year). + IntroductoryPricePeriod string `json:"introductoryPricePeriod,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "IntroductoryPriceAmountMicros") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "EurPrice") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. + // "IntroductoryPriceAmountMicros") to include in API requests with the + // JSON null value. By default, fields with empty values are omitted + // from API requests. However, any field with an empty value appearing + // in NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. NullFields []string `json:"-"` } -func (s *OtherRegionsSubscriptionOfferPhasePrices) MarshalJSON() ([]byte, error) { - type NoMethod OtherRegionsSubscriptionOfferPhasePrices +func (s *IntroductoryPriceInfo) MarshalJSON() ([]byte, error) { + type NoMethod IntroductoryPriceInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// PageInfo: Information about the current page. List operations that -// supports paging return only one "page" of results. This protocol -// buffer message describes the page that has been returned. -type PageInfo struct { - // ResultPerPage: Maximum number of results returned in one page. ! The - // number of results included in the API response. - ResultPerPage int64 `json:"resultPerPage,omitempty"` - - // StartIndex: Index of the first result returned in the current page. - StartIndex int64 `json:"startIndex,omitempty"` +// LanguageTargeting: Targeting based on language. +type LanguageTargeting struct { + // Alternatives: Alternative languages. + Alternatives []string `json:"alternatives,omitempty"` - // TotalResults: Total number of results available on the backend ! The - // total number of results in the result set. - TotalResults int64 `json:"totalResults,omitempty"` + // Value: ISO-639: 2 or 3 letter language code. + Value []string `json:"value,omitempty"` - // ForceSendFields is a list of field names (e.g. "ResultPerPage") to + // ForceSendFields is a list of field names (e.g. "Alternatives") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4165,7 +4198,7 @@ type PageInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ResultPerPage") to include + // NullFields is a list of field names (e.g. "Alternatives") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as @@ -4174,25 +4207,68 @@ type PageInfo struct { NullFields []string `json:"-"` } -func (s *PageInfo) MarshalJSON() ([]byte, error) { - type NoMethod PageInfo +func (s *LanguageTargeting) MarshalJSON() ([]byte, error) { + type NoMethod LanguageTargeting raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// PartialRefund: A partial refund of a transaction. -type PartialRefund struct { - // RefundId: Required. A unique id distinguishing this partial refund. - // If the refund is successful, subsequent refunds with the same id will - // fail. Must be unique across refunds for one individual transaction. - RefundId string `json:"refundId,omitempty"` +// ListDeviceTierConfigsResponse: Response listing existing device tier +// configs. +type ListDeviceTierConfigsResponse struct { + // DeviceTierConfigs: Device tier configs created by the developer. + DeviceTierConfigs []*DeviceTierConfig `json:"deviceTierConfigs,omitempty"` - // RefundPreTaxAmount: Required. The pre-tax amount of the partial - // refund. Should be less than the remaining pre-tax amount of the - // transaction. - RefundPreTaxAmount *Price `json:"refundPreTaxAmount,omitempty"` + // NextPageToken: A token, which can be sent as `page_token` to retrieve + // the next page. If this field is omitted, there are no subsequent + // pages. + NextPageToken string `json:"nextPageToken,omitempty"` - // ForceSendFields is a list of field names (e.g. "RefundId") to + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DeviceTierConfigs") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "DeviceTierConfigs") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *ListDeviceTierConfigsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListDeviceTierConfigsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ListSubscriptionOffersResponse: Response message for +// ListSubscriptionOffers. +type ListSubscriptionOffersResponse struct { + // NextPageToken: A token, which can be sent as `page_token` to retrieve + // the next page. If this field is omitted, there are no subsequent + // pages. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SubscriptionOffers: The subscription offers from the specified + // subscription. + SubscriptionOffers []*SubscriptionOffer `json:"subscriptionOffers,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4200,29 +4276,36 @@ type PartialRefund struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "RefundId") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *PartialRefund) MarshalJSON() ([]byte, error) { - type NoMethod PartialRefund +func (s *ListSubscriptionOffersResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListSubscriptionOffersResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// PausedStateContext: Information specific to a subscription in paused -// state. -type PausedStateContext struct { - // AutoResumeTime: Time at which the subscription will be automatically - // resumed. - AutoResumeTime string `json:"autoResumeTime,omitempty"` +// ListSubscriptionsResponse: Response message for ListSubscriptions. +type ListSubscriptionsResponse struct { + // NextPageToken: A token, which can be sent as `page_token` to retrieve + // the next page. If this field is omitted, there are no subsequent + // pages. + NextPageToken string `json:"nextPageToken,omitempty"` - // ForceSendFields is a list of field names (e.g. "AutoResumeTime") to + // Subscriptions: The subscriptions from the specified app. + Subscriptions []*Subscription `json:"subscriptions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4230,85 +4313,90 @@ type PausedStateContext struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AutoResumeTime") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *PausedStateContext) MarshalJSON() ([]byte, error) { - type NoMethod PausedStateContext +func (s *ListSubscriptionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListSubscriptionsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// PrepaidBasePlanType: Represents a base plan that does not -// automatically renew at the end of the base plan, and must be manually -// renewed by the user. -type PrepaidBasePlanType struct { - // BillingPeriodDuration: Required. Subscription period, specified in - // ISO 8601 format. For a list of acceptable billing periods, refer to - // the help center. - BillingPeriodDuration string `json:"billingPeriodDuration,omitempty"` +// ListUsersResponse: A response containing one or more users with +// access to an account. +type ListUsersResponse struct { + // NextPageToken: A token to pass to subsequent calls in order to + // retrieve subsequent results. This will not be set if there are no + // more results to return. + NextPageToken string `json:"nextPageToken,omitempty"` - // TimeExtension: Whether users should be able to extend this prepaid - // base plan in Google Play surfaces. Defaults to TIME_EXTENSION_ACTIVE - // if not specified. - // - // Possible values: - // "TIME_EXTENSION_UNSPECIFIED" - Unspecified state. - // "TIME_EXTENSION_ACTIVE" - Time extension is active. Users are - // allowed to top-up or extend their prepaid plan. - // "TIME_EXTENSION_INACTIVE" - Time extension is inactive. Users - // cannot top-up or extend their prepaid plan. - TimeExtension string `json:"timeExtension,omitempty"` + // Users: The resulting users. + Users []*User `json:"users,omitempty"` - // ForceSendFields is a list of field names (e.g. - // "BillingPeriodDuration") to unconditionally include in API requests. - // By default, fields with empty or default values are omitted from API - // requests. However, any non-pointer, non-interface field appearing in - // ForceSendFields will be sent to the server regardless of whether the - // field is empty or not. This may be used to include empty fields in - // Patch requests. + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "BillingPeriodDuration") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *PrepaidBasePlanType) MarshalJSON() ([]byte, error) { - type NoMethod PrepaidBasePlanType +func (s *ListUsersResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListUsersResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// PrepaidPlan: Information related to a prepaid plan. -type PrepaidPlan struct { - // AllowExtendAfterTime: If present, this is the time after which top up - // purchases are allowed for the prepaid plan. Will not be present for - // expired prepaid plans. - AllowExtendAfterTime string `json:"allowExtendAfterTime,omitempty"` +// Listing: A localized store listing. The resource for ListingsService. +type Listing struct { + // FullDescription: Full description of the app. + FullDescription string `json:"fullDescription,omitempty"` - // ForceSendFields is a list of field names (e.g. - // "AllowExtendAfterTime") to unconditionally include in API requests. - // By default, fields with empty or default values are omitted from API - // requests. However, any non-pointer, non-interface field appearing in - // ForceSendFields will be sent to the server regardless of whether the - // field is empty or not. This may be used to include empty fields in - // Patch requests. + // Language: Language localization code (a BCP-47 language tag; for + // example, "de-AT" for Austrian German). + Language string `json:"language,omitempty"` + + // ShortDescription: Short description of the app. + ShortDescription string `json:"shortDescription,omitempty"` + + // Title: Localized title of the app. + Title string `json:"title,omitempty"` + + // Video: URL of a promotional YouTube video for the app. + Video string `json:"video,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "FullDescription") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AllowExtendAfterTime") to + // NullFields is a list of field names (e.g. "FullDescription") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -4318,23 +4406,26 @@ type PrepaidPlan struct { NullFields []string `json:"-"` } -func (s *PrepaidPlan) MarshalJSON() ([]byte, error) { - type NoMethod PrepaidPlan +func (s *Listing) MarshalJSON() ([]byte, error) { + type NoMethod Listing raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Price: Definition of a price, i.e. currency and units. -type Price struct { - // Currency: 3 letter Currency code, as defined by ISO 4217. See - // java/com/google/common/money/CurrencyCode.java - Currency string `json:"currency,omitempty"` +// ListingsListResponse: Response listing all localized listings. +type ListingsListResponse struct { + // Kind: The kind of this response + // ("androidpublisher#listingsListResponse"). + Kind string `json:"kind,omitempty"` - // PriceMicros: Price in 1/million of the currency base unit, - // represented as a string. - PriceMicros string `json:"priceMicros,omitempty"` + // Listings: All localized listings. + Listings []*Listing `json:"listings,omitempty"` - // ForceSendFields is a list of field names (e.g. "Currency") to + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4342,8 +4433,8 @@ type Price struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Currency") to include in - // API requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Kind") to include in API + // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -4351,85 +4442,70 @@ type Price struct { NullFields []string `json:"-"` } -func (s *Price) MarshalJSON() ([]byte, error) { - type NoMethod Price +func (s *ListingsListResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListingsListResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ProductPurchase: A ProductPurchase resource indicates the status of a -// user's inapp product purchase. -type ProductPurchase struct { - // AcknowledgementState: The acknowledgement state of the inapp product. - // Possible values are: 0. Yet to be acknowledged 1. Acknowledged - AcknowledgementState int64 `json:"acknowledgementState,omitempty"` - - // ConsumptionState: The consumption state of the inapp product. - // Possible values are: 0. Yet to be consumed 1. Consumed - ConsumptionState int64 `json:"consumptionState,omitempty"` - - // DeveloperPayload: A developer-specified string that contains - // supplemental information about an order. - DeveloperPayload string `json:"developerPayload,omitempty"` +// LocalizedText: Localized text in given language. +type LocalizedText struct { + // Language: Language localization code (a BCP-47 language tag; for + // example, "de-AT" for Austrian German). + Language string `json:"language,omitempty"` - // Kind: This kind represents an inappPurchase object in the - // androidpublisher service. - Kind string `json:"kind,omitempty"` + // Text: The text in the given language. + Text string `json:"text,omitempty"` - // ObfuscatedExternalAccountId: An obfuscated version of the id that is - // uniquely associated with the user's account in your app. Only present - // if specified using - // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedaccountid - // when the purchase was made. - ObfuscatedExternalAccountId string `json:"obfuscatedExternalAccountId,omitempty"` - - // ObfuscatedExternalProfileId: An obfuscated version of the id that is - // uniquely associated with the user's profile in your app. Only present - // if specified using - // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedprofileid - // when the purchase was made. - ObfuscatedExternalProfileId string `json:"obfuscatedExternalProfileId,omitempty"` - - // OrderId: The order id associated with the purchase of the inapp - // product. - OrderId string `json:"orderId,omitempty"` - - // ProductId: The inapp product SKU. May not be present. - ProductId string `json:"productId,omitempty"` - - // PurchaseState: The purchase state of the order. Possible values are: - // 0. Purchased 1. Canceled 2. Pending - PurchaseState int64 `json:"purchaseState,omitempty"` - - // PurchaseTimeMillis: The time the product was purchased, in - // milliseconds since the epoch (Jan 1, 1970). - PurchaseTimeMillis int64 `json:"purchaseTimeMillis,omitempty,string"` + // ForceSendFields is a list of field names (e.g. "Language") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // PurchaseToken: The purchase token generated to identify this - // purchase. May not be present. - PurchaseToken string `json:"purchaseToken,omitempty"` + // NullFields is a list of field names (e.g. "Language") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} - // PurchaseType: The type of purchase of the inapp product. This field - // is only set if this purchase was not made using the standard in-app - // billing flow. Possible values are: 0. Test (i.e. purchased from a - // license testing account) 1. Promo (i.e. purchased using a promo code) - // 2. Rewarded (i.e. from watching a video ad instead of paying) - PurchaseType *int64 `json:"purchaseType,omitempty"` +func (s *LocalizedText) MarshalJSON() ([]byte, error) { + type NoMethod LocalizedText + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // Quantity: The quantity associated with the purchase of the inapp - // product. If not present, the quantity is 1. - Quantity int64 `json:"quantity,omitempty"` +// ManagedProductTaxAndComplianceSettings: Details about taxation and +// legal compliance for managed products. +type ManagedProductTaxAndComplianceSettings struct { + // EeaWithdrawalRightType: Digital content or service classification for + // products distributed to users in the European Economic Area (EEA). + // The withdrawal regime under EEA consumer laws depends on this + // classification. Refer to the Help Center article + // (https://support.google.com/googleplay/android-developer/answer/10463498) + // for more information. + // + // Possible values: + // "WITHDRAWAL_RIGHT_TYPE_UNSPECIFIED" + // "WITHDRAWAL_RIGHT_DIGITAL_CONTENT" + // "WITHDRAWAL_RIGHT_SERVICE" + EeaWithdrawalRightType string `json:"eeaWithdrawalRightType,omitempty"` - // RegionCode: ISO 3166-1 alpha-2 billing region code of the user at the - // time the product was granted. - RegionCode string `json:"regionCode,omitempty"` + // IsTokenizedDigitalAsset: Whether this in-app product is declared as a + // product representing a tokenized digital asset. + IsTokenizedDigitalAsset bool `json:"isTokenizedDigitalAsset,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // TaxRateInfoByRegionCode: A mapping from region code to tax rate + // details. The keys are region codes as defined by Unicode's "CLDR". + TaxRateInfoByRegionCode map[string]RegionalTaxRateInfo `json:"taxRateInfoByRegionCode,omitempty"` // ForceSendFields is a list of field names (e.g. - // "AcknowledgementState") to unconditionally include in API requests. + // "EeaWithdrawalRightType") to unconditionally include in API requests. // By default, fields with empty or default values are omitted from API // requests. However, any non-pointer, non-interface field appearing in // ForceSendFields will be sent to the server regardless of whether the @@ -4437,29 +4513,61 @@ type ProductPurchase struct { // Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AcknowledgementState") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the + // NullFields is a list of field names (e.g. "EeaWithdrawalRightType") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } -func (s *ProductPurchase) MarshalJSON() ([]byte, error) { - type NoMethod ProductPurchase +func (s *ManagedProductTaxAndComplianceSettings) MarshalJSON() ([]byte, error) { + type NoMethod ManagedProductTaxAndComplianceSettings raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ProductPurchasesAcknowledgeRequest: Request for the -// product.purchases.acknowledge API. -type ProductPurchasesAcknowledgeRequest struct { - // DeveloperPayload: Payload to attach to the purchase. - DeveloperPayload string `json:"developerPayload,omitempty"` +// MigrateBasePlanPricesRequest: Request message for +// MigrateBasePlanPrices. +type MigrateBasePlanPricesRequest struct { + // BasePlanId: Required. The unique base plan ID of the base plan to + // update prices on. + BasePlanId string `json:"basePlanId,omitempty"` - // ForceSendFields is a list of field names (e.g. "DeveloperPayload") to + // LatencyTolerance: Optional. The latency tolerance for the propagation + // of this product update. Defaults to latency-sensitive. + // + // Possible values: + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" - Defaults to + // PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE. + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" - The update + // will propagate to clients within several minutes on average and up to + // a few hours in rare cases. Throughput is limited to 7,200 updates per + // app per hour. + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" - The update + // will propagate to clients within 24 hours. Supports high throughput + // of up to 720,000 updates per app per hour using batch modification + // methods. + LatencyTolerance string `json:"latencyTolerance,omitempty"` + + // PackageName: Required. Package name of the parent app. Must be equal + // to the package_name field on the Subscription resource. + PackageName string `json:"packageName,omitempty"` + + // ProductId: Required. The ID of the subscription to update. Must be + // equal to the product_id field on the Subscription resource. + ProductId string `json:"productId,omitempty"` + + // RegionalPriceMigrations: Required. The regional prices to update. + RegionalPriceMigrations []*RegionalPriceMigrationConfig `json:"regionalPriceMigrations,omitempty"` + + // RegionsVersion: Required. The version of the available regions being + // used for the regional_price_migrations. + RegionsVersion *RegionsVersion `json:"regionsVersion,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BasePlanId") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4467,92 +4575,65 @@ type ProductPurchasesAcknowledgeRequest struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DeveloperPayload") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "BasePlanId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *ProductPurchasesAcknowledgeRequest) MarshalJSON() ([]byte, error) { - type NoMethod ProductPurchasesAcknowledgeRequest +func (s *MigrateBasePlanPricesRequest) MarshalJSON() ([]byte, error) { + type NoMethod MigrateBasePlanPricesRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// RecurringExternalTransaction: Represents a transaction that is part -// of a recurring series of payments. This can be a subscription or a -// one-time product with multiple payments (such as preorder). -type RecurringExternalTransaction struct { - // ExternalSubscription: Details of an external subscription. - ExternalSubscription *ExternalSubscription `json:"externalSubscription,omitempty"` - - // ExternalTransactionToken: Input only. Provided during the call to - // Create. Retrieved from the client when the alternative billing flow - // is launched. Required only for the initial purchase. - ExternalTransactionToken string `json:"externalTransactionToken,omitempty"` - - // InitialExternalTransactionId: The external transaction id of the - // first transaction of this recurring series of transactions. For - // example, for a subscription this would be the transaction id of the - // first payment. Required when creating recurring external - // transactions. - InitialExternalTransactionId string `json:"initialExternalTransactionId,omitempty"` +// MigrateBasePlanPricesResponse: Response message for +// MigrateBasePlanPrices. +type MigrateBasePlanPricesResponse struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} - // MigratedTransactionProgram: Input only. Provided during the call to - // Create. Must only be used when migrating a subscription from manual - // monthly reporting to automated reporting. +// ModuleMetadata: Metadata of a module. +type ModuleMetadata struct { + // DeliveryType: Indicates the delivery type (e.g. on-demand) of the + // module. // // Possible values: - // "EXTERNAL_TRANSACTION_PROGRAM_UNSPECIFIED" - Unspecified - // transaction program. Not used. - // "USER_CHOICE_BILLING" - User choice billing, where a user may - // choose between Google Play Billing developer-managed billing. - // "ALTERTNATIVE_BILLING_ONLY" - Alternatively billing only, where - // users may only use developer-manager billing. - MigratedTransactionProgram string `json:"migratedTransactionProgram,omitempty"` - - // ForceSendFields is a list of field names (e.g. - // "ExternalSubscription") to unconditionally include in API requests. - // By default, fields with empty or default values are omitted from API - // requests. However, any non-pointer, non-interface field appearing in - // ForceSendFields will be sent to the server regardless of whether the - // field is empty or not. This may be used to include empty fields in - // Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "ExternalSubscription") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} + // "UNKNOWN_DELIVERY_TYPE" - Unspecified delivery type. + // "INSTALL_TIME" - This module will always be downloaded as part of + // the initial install of the app. + // "ON_DEMAND" - This module is requested on-demand, which means it + // will not be part of the initial install, and will only be sent when + // requested by the client. + // "FAST_FOLLOW" - This module will be downloaded immediately after + // initial install finishes. The app can be opened before these modules + // are downloaded. + DeliveryType string `json:"deliveryType,omitempty"` -func (s *RecurringExternalTransaction) MarshalJSON() ([]byte, error) { - type NoMethod RecurringExternalTransaction - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} + // Dependencies: Names of the modules that this module directly depends + // on. Each module implicitly depends on the base module. + Dependencies []string `json:"dependencies,omitempty"` -// RefundExternalTransactionRequest: A request to refund an existing -// external transaction. -type RefundExternalTransactionRequest struct { - // FullRefund: A full-amount refund. - FullRefund *FullRefund `json:"fullRefund,omitempty"` + // ModuleType: Indicates the type of this feature module. + // + // Possible values: + // "UNKNOWN_MODULE_TYPE" - Unknown feature module. + // "FEATURE_MODULE" - Regular feature module. + ModuleType string `json:"moduleType,omitempty"` - // PartialRefund: A partial refund. - PartialRefund *PartialRefund `json:"partialRefund,omitempty"` + // Name: Module name. + Name string `json:"name,omitempty"` - // RefundTime: Required. The time that the transaction was refunded. - RefundTime string `json:"refundTime,omitempty"` + // Targeting: The targeting that makes a conditional module installed. + // Relevant only for Split APKs. + Targeting *ModuleTargeting `json:"targeting,omitempty"` - // ForceSendFields is a list of field names (e.g. "FullRefund") to + // ForceSendFields is a list of field names (e.g. "DeliveryType") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4560,191 +4641,135 @@ type RefundExternalTransactionRequest struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "FullRefund") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "DeliveryType") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *RefundExternalTransactionRequest) MarshalJSON() ([]byte, error) { - type NoMethod RefundExternalTransactionRequest +func (s *ModuleMetadata) MarshalJSON() ([]byte, error) { + type NoMethod ModuleMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// RegionalBasePlanConfig: Configuration for a base plan specific to a -// region. -type RegionalBasePlanConfig struct { - // NewSubscriberAvailability: Whether the base plan in the specified - // region is available for new subscribers. Existing subscribers will - // not have their subscription canceled if this value is set to false. - // If not specified, this will default to false. - NewSubscriberAvailability bool `json:"newSubscriberAvailability,omitempty"` +// ModuleTargeting: Targeting on the module level. +type ModuleTargeting struct { + // DeviceFeatureTargeting: Targeting for device features. + DeviceFeatureTargeting []*DeviceFeatureTargeting `json:"deviceFeatureTargeting,omitempty"` - // Price: The price of the base plan in the specified region. Must be - // set if the base plan is available to new subscribers. Must be set in - // the currency that is linked to the specified region. - Price *Money `json:"price,omitempty"` + // SdkVersionTargeting: The sdk version that the variant targets + SdkVersionTargeting *SdkVersionTargeting `json:"sdkVersionTargeting,omitempty"` - // RegionCode: Required. Region code this configuration applies to, as - // defined by ISO 3166-2, e.g. "US". - RegionCode string `json:"regionCode,omitempty"` + // UserCountriesTargeting: Countries-level targeting + UserCountriesTargeting *UserCountriesTargeting `json:"userCountriesTargeting,omitempty"` // ForceSendFields is a list of field names (e.g. - // "NewSubscriberAvailability") to unconditionally include in API - // requests. By default, fields with empty or default values are omitted - // from API requests. However, any non-pointer, non-interface field - // appearing in ForceSendFields will be sent to the server regardless of - // whether the field is empty or not. This may be used to include empty - // fields in Patch requests. + // "DeviceFeatureTargeting") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. - // "NewSubscriberAvailability") to include in API requests with the JSON - // null value. By default, fields with empty values are omitted from API - // requests. However, any field with an empty value appearing in - // NullFields will be sent to the server as null. It is an error if a - // field in this list has a non-empty value. This may be used to include - // null fields in Patch requests. + // NullFields is a list of field names (e.g. "DeviceFeatureTargeting") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *RegionalBasePlanConfig) MarshalJSON() ([]byte, error) { - type NoMethod RegionalBasePlanConfig +func (s *ModuleTargeting) MarshalJSON() ([]byte, error) { + type NoMethod ModuleTargeting raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// RegionalPriceMigrationConfig: Configuration for a price migration. -type RegionalPriceMigrationConfig struct { - // OldestAllowedPriceVersionTime: Required. The cutoff time for - // historical prices that subscribers can remain paying. Subscribers on - // prices which were available at this cutoff time or later will stay on - // their existing price. Subscribers on older prices will be migrated to - // the currently-offered price. The migrated subscribers will receive a - // notification that they will be paying a different price. Subscribers - // who do not agree to the new price will have their subscription ended - // at the next renewal. - OldestAllowedPriceVersionTime string `json:"oldestAllowedPriceVersionTime,omitempty"` +// Money: Represents an amount of money with its currency type. +type Money struct { + // CurrencyCode: The three-letter currency code defined in ISO 4217. + CurrencyCode string `json:"currencyCode,omitempty"` - // PriceIncreaseType: Optional. The behavior the caller wants users to - // see when there is a price increase during migration. If left unset, - // the behavior defaults to PRICE_INCREASE_TYPE_OPT_IN. Note that the - // first opt-out price increase migration for each app must be initiated - // in Play Console. - // - // Possible values: - // "PRICE_INCREASE_TYPE_UNSPECIFIED" - Unspecified state. - // "PRICE_INCREASE_TYPE_OPT_IN" - Price increase will be presented to - // users on an opt-in basis. - // "PRICE_INCREASE_TYPE_OPT_OUT" - Price increase will be presented to - // users on an opt-out basis. - PriceIncreaseType string `json:"priceIncreaseType,omitempty"` + // Nanos: Number of nano (10^-9) units of the amount. The value must be + // between -999,999,999 and +999,999,999 inclusive. If `units` is + // positive, `nanos` must be positive or zero. If `units` is zero, + // `nanos` can be positive, zero, or negative. If `units` is negative, + // `nanos` must be negative or zero. For example $-1.75 is represented + // as `units`=-1 and `nanos`=-750,000,000. + Nanos int64 `json:"nanos,omitempty"` - // RegionCode: Required. Region code this configuration applies to, as - // defined by ISO 3166-2, e.g. "US". - RegionCode string `json:"regionCode,omitempty"` + // Units: The whole units of the amount. For example if `currencyCode` + // is "USD", then 1 unit is one US dollar. + Units int64 `json:"units,omitempty,string"` - // ForceSendFields is a list of field names (e.g. - // "OldestAllowedPriceVersionTime") to unconditionally include in API - // requests. By default, fields with empty or default values are omitted - // from API requests. However, any non-pointer, non-interface field - // appearing in ForceSendFields will be sent to the server regardless of - // whether the field is empty or not. This may be used to include empty - // fields in Patch requests. + // ForceSendFields is a list of field names (e.g. "CurrencyCode") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. - // "OldestAllowedPriceVersionTime") to include in API requests with the - // JSON null value. By default, fields with empty values are omitted - // from API requests. However, any field with an empty value appearing - // in NullFields will be sent to the server as null. It is an error if a - // field in this list has a non-empty value. This may be used to include - // null fields in Patch requests. + // NullFields is a list of field names (e.g. "CurrencyCode") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *RegionalPriceMigrationConfig) MarshalJSON() ([]byte, error) { - type NoMethod RegionalPriceMigrationConfig +func (s *Money) MarshalJSON() ([]byte, error) { + type NoMethod Money raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// RegionalSubscriptionOfferConfig: Configuration for a subscription -// offer in a single region. -type RegionalSubscriptionOfferConfig struct { - // NewSubscriberAvailability: Whether the subscription offer in the - // specified region is available for new subscribers. Existing - // subscribers will not have their subscription cancelled if this value - // is set to false. If not specified, this will default to false. - NewSubscriberAvailability bool `json:"newSubscriberAvailability,omitempty"` - - // RegionCode: Required. Immutable. Region code this configuration - // applies to, as defined by ISO 3166-2, e.g. "US". - RegionCode string `json:"regionCode,omitempty"` +// MultiAbi: Represents a list of apis. +type MultiAbi struct { + // Abi: A list of targeted ABIs, as represented by the Android Platform + Abi []*Abi `json:"abi,omitempty"` - // ForceSendFields is a list of field names (e.g. - // "NewSubscriberAvailability") to unconditionally include in API - // requests. By default, fields with empty or default values are omitted - // from API requests. However, any non-pointer, non-interface field - // appearing in ForceSendFields will be sent to the server regardless of - // whether the field is empty or not. This may be used to include empty - // fields in Patch requests. + // ForceSendFields is a list of field names (e.g. "Abi") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. - // "NewSubscriberAvailability") to include in API requests with the JSON - // null value. By default, fields with empty values are omitted from API - // requests. However, any field with an empty value appearing in - // NullFields will be sent to the server as null. It is an error if a - // field in this list has a non-empty value. This may be used to include - // null fields in Patch requests. + // NullFields is a list of field names (e.g. "Abi") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *RegionalSubscriptionOfferConfig) MarshalJSON() ([]byte, error) { - type NoMethod RegionalSubscriptionOfferConfig +func (s *MultiAbi) MarshalJSON() ([]byte, error) { + type NoMethod MultiAbi raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// RegionalSubscriptionOfferPhaseConfig: Configuration for a single -// phase of a subscription offer in a single region. -type RegionalSubscriptionOfferPhaseConfig struct { - // AbsoluteDiscount: The absolute amount of money subtracted from the - // base plan price prorated over the phase duration that the user pays - // for this offer phase. For example, if the base plan price for this - // region is $12 for a period of 1 year, then a $1 absolute discount for - // a phase of a duration of 3 months would correspond to a price of $2. - // The resulting price may not be smaller than the minimum price allowed - // for this region. - AbsoluteDiscount *Money `json:"absoluteDiscount,omitempty"` - - // Price: The absolute price the user pays for this offer phase. The - // price must not be smaller than the minimum price allowed for this - // region. - Price *Money `json:"price,omitempty"` - - // RegionCode: Required. Immutable. The region to which this config - // applies. - RegionCode string `json:"regionCode,omitempty"` +// MultiAbiTargeting: Targeting based on multiple abis. +type MultiAbiTargeting struct { + // Alternatives: Targeting of other sibling directories that were in the + // Bundle. For main splits this is targeting of other main splits. + Alternatives []*MultiAbi `json:"alternatives,omitempty"` - // RelativeDiscount: The fraction of the base plan price prorated over - // the phase duration that the user pays for this offer phase. For - // example, if the base plan price for this region is $12 for a period - // of 1 year, then a 50% discount for a phase of a duration of 3 months - // would correspond to a price of $1.50. The discount must be specified - // as a fraction strictly larger than 0 and strictly smaller than 1. The - // resulting price will be rounded to the nearest billable unit (e.g. - // cents for USD). The relative discount is considered invalid if the - // discounted price ends up being smaller than the minimum price allowed - // in this region. - RelativeDiscount float64 `json:"relativeDiscount,omitempty"` + // Value: Value of a multi abi. + Value []*MultiAbi `json:"value,omitempty"` - // ForceSendFields is a list of field names (e.g. "AbsoluteDiscount") to + // ForceSendFields is a list of field names (e.g. "Alternatives") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4752,126 +4777,35 @@ type RegionalSubscriptionOfferPhaseConfig struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AbsoluteDiscount") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "Alternatives") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *RegionalSubscriptionOfferPhaseConfig) MarshalJSON() ([]byte, error) { - type NoMethod RegionalSubscriptionOfferPhaseConfig +func (s *MultiAbiTargeting) MarshalJSON() ([]byte, error) { + type NoMethod MultiAbiTargeting raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *RegionalSubscriptionOfferPhaseConfig) UnmarshalJSON(data []byte) error { - type NoMethod RegionalSubscriptionOfferPhaseConfig - var s1 struct { - RelativeDiscount gensupport.JSONFloat64 `json:"relativeDiscount"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.RelativeDiscount = float64(s1.RelativeDiscount) - return nil -} +// OfferDetails: Offer details information related to a purchase line +// item. +type OfferDetails struct { + // BasePlanId: The base plan ID. Present for all base plan and offers. + BasePlanId string `json:"basePlanId,omitempty"` -// RegionalTaxRateInfo: Specified details about taxation in a given -// geographical region. -type RegionalTaxRateInfo struct { - // EligibleForStreamingServiceTaxRate: You must tell us if your app - // contains streaming products to correctly charge US state and local - // sales tax. Field only supported in United States. - EligibleForStreamingServiceTaxRate bool `json:"eligibleForStreamingServiceTaxRate,omitempty"` + // OfferId: The offer ID. Only present for discounted offers. + OfferId string `json:"offerId,omitempty"` - // StreamingTaxType: To collect communications or amusement taxes in the - // United States, choose the appropriate tax category. Learn more - // (https://support.google.com/googleplay/android-developer/answer/10463498#streaming_tax). - // - // Possible values: - // "STREAMING_TAX_TYPE_UNSPECIFIED" - No telecommunications tax - // collected. - // "STREAMING_TAX_TYPE_TELCO_VIDEO_RENTAL" - US-specific - // telecommunications tax tier for video streaming, on demand, rentals / - // subscriptions / pay-per-view. - // "STREAMING_TAX_TYPE_TELCO_VIDEO_SALES" - US-specific - // telecommunications tax tier for video streaming of pre-recorded - // content like movies, tv shows. - // "STREAMING_TAX_TYPE_TELCO_VIDEO_MULTI_CHANNEL" - US-specific - // telecommunications tax tier for video streaming of multi-channel - // programming. - // "STREAMING_TAX_TYPE_TELCO_AUDIO_RENTAL" - US-specific - // telecommunications tax tier for audio streaming, rental / - // subscription. - // "STREAMING_TAX_TYPE_TELCO_AUDIO_SALES" - US-specific - // telecommunications tax tier for audio streaming, sale / permanent - // download. - // "STREAMING_TAX_TYPE_TELCO_AUDIO_MULTI_CHANNEL" - US-specific - // telecommunications tax tier for multi channel audio streaming like - // radio. - StreamingTaxType string `json:"streamingTaxType,omitempty"` - - // TaxTier: Tax tier to specify reduced tax rate. Developers who sell - // digital news, magazines, newspapers, books, or audiobooks in various - // regions may be eligible for reduced tax rates. Learn more - // (https://support.google.com/googleplay/android-developer/answer/10463498). - // - // Possible values: - // "TAX_TIER_UNSPECIFIED" - // "TAX_TIER_BOOKS_1" - // "TAX_TIER_NEWS_1" - // "TAX_TIER_NEWS_2" - // "TAX_TIER_MUSIC_OR_AUDIO_1" - // "TAX_TIER_LIVE_OR_BROADCAST_1" - TaxTier string `json:"taxTier,omitempty"` - - // ForceSendFields is a list of field names (e.g. - // "EligibleForStreamingServiceTaxRate") to unconditionally include in - // API requests. By default, fields with empty or default values are - // omitted from API requests. However, any non-pointer, non-interface - // field appearing in ForceSendFields will be sent to the server - // regardless of whether the field is empty or not. This may be used to - // include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. - // "EligibleForStreamingServiceTaxRate") to include in API requests with - // the JSON null value. By default, fields with empty values are omitted - // from API requests. However, any field with an empty value appearing - // in NullFields will be sent to the server as null. It is an error if a - // field in this list has a non-empty value. This may be used to include - // null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *RegionalTaxRateInfo) MarshalJSON() ([]byte, error) { - type NoMethod RegionalTaxRateInfo - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// RegionsVersion: The version of the available regions being used for -// the specified resource. -type RegionsVersion struct { - // Version: Required. A string representing the version of available - // regions being used for the specified resource. Regional prices for - // the resource have to be specified according to the information - // published in this article - // (https://support.google.com/googleplay/android-developer/answer/10532353). - // Each time the supported locations substantially change, the version - // will be incremented. Using this field will ensure that creating and - // updating the resource with an older region's version and set of - // regional prices and currencies will succeed even though a new version - // is available. The latest version is 2022/02. - Version string `json:"version,omitempty"` + // OfferTags: The latest offer tags associated with the offer. It + // includes tags inherited from the base plan. + OfferTags []string `json:"offerTags,omitempty"` - // ForceSendFields is a list of field names (e.g. "Version") to + // ForceSendFields is a list of field names (e.g. "BasePlanId") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4879,7 +4813,7 @@ type RegionsVersion struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Version") to include in + // NullFields is a list of field names (e.g. "BasePlanId") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -4888,33 +4822,21 @@ type RegionsVersion struct { NullFields []string `json:"-"` } -func (s *RegionsVersion) MarshalJSON() ([]byte, error) { - type NoMethod RegionsVersion +func (s *OfferDetails) MarshalJSON() ([]byte, error) { + type NoMethod OfferDetails raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ReplacementCancellation: Information specific to cancellations caused -// by subscription replacement. -type ReplacementCancellation struct { -} - -// Review: An Android app review. -type Review struct { - // AuthorName: The name of the user who wrote the review. - AuthorName string `json:"authorName,omitempty"` - - // Comments: A repeated field containing comments for the review. - Comments []*Comment `json:"comments,omitempty"` - - // ReviewId: Unique identifier for this review. - ReviewId string `json:"reviewId,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` +// OfferTag: Represents a custom tag specified for base plans and +// subscription offers. +type OfferTag struct { + // Tag: Must conform with RFC-1034. That is, this string can only + // contain lower-case letters (a-z), numbers (0-9), and hyphens (-), and + // be at most 20 characters. + Tag string `json:"tag,omitempty"` - // ForceSendFields is a list of field names (e.g. "AuthorName") to + // ForceSendFields is a list of field names (e.g. "Tag") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4922,8 +4844,8 @@ type Review struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AuthorName") to include in - // API requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Tag") to include in API + // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -4931,60 +4853,61 @@ type Review struct { NullFields []string `json:"-"` } -func (s *Review) MarshalJSON() ([]byte, error) { - type NoMethod Review +func (s *OfferTag) MarshalJSON() ([]byte, error) { + type NoMethod OfferTag raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ReviewReplyResult: The result of replying/updating a reply to review. -type ReviewReplyResult struct { - // LastEdited: The time at which the reply took effect. - LastEdited *Timestamp `json:"lastEdited,omitempty"` - - // ReplyText: The reply text that was applied. - ReplyText string `json:"replyText,omitempty"` +// OneTimeExternalTransaction: Represents a one-time transaction. +type OneTimeExternalTransaction struct { + // ExternalTransactionToken: Input only. Provided during the call to + // Create. Retrieved from the client when the alternative billing flow + // is launched. + ExternalTransactionToken string `json:"externalTransactionToken,omitempty"` - // ForceSendFields is a list of field names (e.g. "LastEdited") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. + // ForceSendFields is a list of field names (e.g. + // "ExternalTransactionToken") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "LastEdited") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "ExternalTransactionToken") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *ReviewReplyResult) MarshalJSON() ([]byte, error) { - type NoMethod ReviewReplyResult +func (s *OneTimeExternalTransaction) MarshalJSON() ([]byte, error) { + type NoMethod OneTimeExternalTransaction raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ReviewsListResponse: Response listing reviews. -type ReviewsListResponse struct { - // PageInfo: Information about the current page. - PageInfo *PageInfo `json:"pageInfo,omitempty"` - - // Reviews: List of reviews. - Reviews []*Review `json:"reviews,omitempty"` +// OtherRegionsBasePlanConfig: Pricing information for any new locations +// Play may launch in. +type OtherRegionsBasePlanConfig struct { + // EurPrice: Required. Price in EUR to use for any new locations Play + // may launch in. + EurPrice *Money `json:"eurPrice,omitempty"` - // TokenPagination: Pagination token, to handle a number of products - // that is over one page. - TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + // NewSubscriberAvailability: Whether the base plan is available for new + // subscribers in any new locations Play may launch in. If not + // specified, this will default to false. + NewSubscriberAvailability bool `json:"newSubscriberAvailability,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // UsdPrice: Required. Price in USD to use for any new locations Play + // may launch in. + UsdPrice *Money `json:"usdPrice,omitempty"` - // ForceSendFields is a list of field names (e.g. "PageInfo") to + // ForceSendFields is a list of field names (e.g. "EurPrice") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4992,7 +4915,7 @@ type ReviewsListResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "PageInfo") to include in + // NullFields is a list of field names (e.g. "EurPrice") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -5001,155 +4924,124 @@ type ReviewsListResponse struct { NullFields []string `json:"-"` } -func (s *ReviewsListResponse) MarshalJSON() ([]byte, error) { - type NoMethod ReviewsListResponse +func (s *OtherRegionsBasePlanConfig) MarshalJSON() ([]byte, error) { + type NoMethod OtherRegionsBasePlanConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ReviewsReplyRequest: Request to reply to review or update existing -// reply. -type ReviewsReplyRequest struct { - // ReplyText: The text to set as the reply. Replies of more than - // approximately 350 characters will be rejected. HTML tags will be - // stripped. - ReplyText string `json:"replyText,omitempty"` +// OtherRegionsSubscriptionOfferConfig: Configuration for any new +// locations Play may launch in specified on a subscription offer. +type OtherRegionsSubscriptionOfferConfig struct { + // OtherRegionsNewSubscriberAvailability: Whether the subscription offer + // in any new locations Play may launch in the future. If not specified, + // this will default to false. + OtherRegionsNewSubscriberAvailability bool `json:"otherRegionsNewSubscriberAvailability,omitempty"` - // ForceSendFields is a list of field names (e.g. "ReplyText") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. + // ForceSendFields is a list of field names (e.g. + // "OtherRegionsNewSubscriberAvailability") to unconditionally include + // in API requests. By default, fields with empty or default values are + // omitted from API requests. However, any non-pointer, non-interface + // field appearing in ForceSendFields will be sent to the server + // regardless of whether the field is empty or not. This may be used to + // include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ReplyText") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. + // "OtherRegionsNewSubscriberAvailability") to include in API requests + // with the JSON null value. By default, fields with empty values are + // omitted from API requests. However, any field with an empty value + // appearing in NullFields will be sent to the server as null. It is an + // error if a field in this list has a non-empty value. This may be used + // to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *ReviewsReplyRequest) MarshalJSON() ([]byte, error) { - type NoMethod ReviewsReplyRequest +func (s *OtherRegionsSubscriptionOfferConfig) MarshalJSON() ([]byte, error) { + type NoMethod OtherRegionsSubscriptionOfferConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ReviewsReplyResponse: Response on status of replying to a review. -type ReviewsReplyResponse struct { - // Result: The result of replying/updating a reply to review. - Result *ReviewReplyResult `json:"result,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Result") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Result") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *ReviewsReplyResponse) MarshalJSON() ([]byte, error) { - type NoMethod ReviewsReplyResponse - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} +// OtherRegionsSubscriptionOfferPhaseConfig: Configuration for any new +// locations Play may launch in for a single offer phase. +type OtherRegionsSubscriptionOfferPhaseConfig struct { + // AbsoluteDiscounts: The absolute amount of money subtracted from the + // base plan price prorated over the phase duration that the user pays + // for this offer phase. For example, if the base plan price for this + // region is $12 for a period of 1 year, then a $1 absolute discount for + // a phase of a duration of 3 months would correspond to a price of $2. + // The resulting price may not be smaller than the minimum price allowed + // for any new locations Play may launch in. + AbsoluteDiscounts *OtherRegionsSubscriptionOfferPhasePrices `json:"absoluteDiscounts,omitempty"` -// ScreenDensity: Represents a screen density. -type ScreenDensity struct { - // DensityAlias: Alias for a screen density. - // - // Possible values: - // "DENSITY_UNSPECIFIED" - Unspecified screen density. - // "NODPI" - NODPI screen density. - // "LDPI" - LDPI screen density. - // "MDPI" - MDPI screen density. - // "TVDPI" - TVDPI screen density. - // "HDPI" - HDPI screen density. - // "XHDPI" - XHDPI screen density. - // "XXHDPI" - XXHDPI screen density. - // "XXXHDPI" - XXXHDPI screen density. - DensityAlias string `json:"densityAlias,omitempty"` + // OtherRegionsPrices: The absolute price the user pays for this offer + // phase. The price must not be smaller than the minimum price allowed + // for any new locations Play may launch in. + OtherRegionsPrices *OtherRegionsSubscriptionOfferPhasePrices `json:"otherRegionsPrices,omitempty"` - // DensityDpi: Value for density dpi. - DensityDpi int64 `json:"densityDpi,omitempty"` + // RelativeDiscount: The fraction of the base plan price prorated over + // the phase duration that the user pays for this offer phase. For + // example, if the base plan price for this region is $12 for a period + // of 1 year, then a 50% discount for a phase of a duration of 3 months + // would correspond to a price of $1.50. The discount must be specified + // as a fraction strictly larger than 0 and strictly smaller than 1. The + // resulting price will be rounded to the nearest billable unit (e.g. + // cents for USD). The relative discount is considered invalid if the + // discounted price ends up being smaller than the minimum price allowed + // in any new locations Play may launch in. + RelativeDiscount float64 `json:"relativeDiscount,omitempty"` - // ForceSendFields is a list of field names (e.g. "DensityAlias") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "AbsoluteDiscounts") + // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DensityAlias") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "AbsoluteDiscounts") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *ScreenDensity) MarshalJSON() ([]byte, error) { - type NoMethod ScreenDensity +func (s *OtherRegionsSubscriptionOfferPhaseConfig) MarshalJSON() ([]byte, error) { + type NoMethod OtherRegionsSubscriptionOfferPhaseConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ScreenDensityTargeting: Targeting based on screen density. -type ScreenDensityTargeting struct { - // Alternatives: Targeting of other sibling directories that were in the - // Bundle. For main splits this is targeting of other main splits. - Alternatives []*ScreenDensity `json:"alternatives,omitempty"` - - // Value: Value of a screen density. - Value []*ScreenDensity `json:"value,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Alternatives") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Alternatives") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` +func (s *OtherRegionsSubscriptionOfferPhaseConfig) UnmarshalJSON(data []byte) error { + type NoMethod OtherRegionsSubscriptionOfferPhaseConfig + var s1 struct { + RelativeDiscount gensupport.JSONFloat64 `json:"relativeDiscount"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.RelativeDiscount = float64(s1.RelativeDiscount) + return nil } -func (s *ScreenDensityTargeting) MarshalJSON() ([]byte, error) { - type NoMethod ScreenDensityTargeting - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} +// OtherRegionsSubscriptionOfferPhasePrices: Pricing information for any +// new locations Play may launch in. +type OtherRegionsSubscriptionOfferPhasePrices struct { + // EurPrice: Required. Price in EUR to use for any new locations Play + // may launch in. + EurPrice *Money `json:"eurPrice,omitempty"` -// SdkVersion: Represents an sdk version. -type SdkVersion struct { - // Min: Inclusive minimum value of an sdk version. - Min int64 `json:"min,omitempty"` + // UsdPrice: Required. Price in USD to use for any new locations Play + // may launch in. + UsdPrice *Money `json:"usdPrice,omitempty"` - // ForceSendFields is a list of field names (e.g. "Min") to + // ForceSendFields is a list of field names (e.g. "EurPrice") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5157,8 +5049,8 @@ type SdkVersion struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Min") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "EurPrice") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -5166,54 +5058,28 @@ type SdkVersion struct { NullFields []string `json:"-"` } -func (s *SdkVersion) MarshalJSON() ([]byte, error) { - type NoMethod SdkVersion +func (s *OtherRegionsSubscriptionOfferPhasePrices) MarshalJSON() ([]byte, error) { + type NoMethod OtherRegionsSubscriptionOfferPhasePrices raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SdkVersionTargeting: Targeting based on sdk version. -type SdkVersionTargeting struct { - // Alternatives: Targeting of other sibling directories that were in the - // Bundle. For main splits this is targeting of other main splits. - Alternatives []*SdkVersion `json:"alternatives,omitempty"` - - // Value: Value of an sdk version. - Value []*SdkVersion `json:"value,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Alternatives") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Alternatives") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *SdkVersionTargeting) MarshalJSON() ([]byte, error) { - type NoMethod SdkVersionTargeting - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} +// PageInfo: Information about the current page. List operations that +// supports paging return only one "page" of results. This protocol +// buffer message describes the page that has been returned. +type PageInfo struct { + // ResultPerPage: Maximum number of results returned in one page. ! The + // number of results included in the API response. + ResultPerPage int64 `json:"resultPerPage,omitempty"` -// SplitApkMetadata: Holds data specific to Split APKs. -type SplitApkMetadata struct { - // IsMasterSplit: Indicates whether this APK is the main split of the - // module. - IsMasterSplit bool `json:"isMasterSplit,omitempty"` + // StartIndex: Index of the first result returned in the current page. + StartIndex int64 `json:"startIndex,omitempty"` - // SplitId: Id of the split. - SplitId string `json:"splitId,omitempty"` + // TotalResults: Total number of results available on the backend ! The + // total number of results in the result set. + TotalResults int64 `json:"totalResults,omitempty"` - // ForceSendFields is a list of field names (e.g. "IsMasterSplit") to + // ForceSendFields is a list of field names (e.g. "ResultPerPage") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5221,7 +5087,7 @@ type SplitApkMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "IsMasterSplit") to include + // NullFields is a list of field names (e.g. "ResultPerPage") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as @@ -5230,29 +5096,25 @@ type SplitApkMetadata struct { NullFields []string `json:"-"` } -func (s *SplitApkMetadata) MarshalJSON() ([]byte, error) { - type NoMethod SplitApkMetadata +func (s *PageInfo) MarshalJSON() ([]byte, error) { + type NoMethod PageInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SplitApkVariant: Variant is a group of APKs that covers a part of the -// device configuration space. APKs from multiple variants are never -// combined on one device. -type SplitApkVariant struct { - // ApkSet: Set of APKs, one set per module. - ApkSet []*ApkSet `json:"apkSet,omitempty"` - - // Targeting: Variant-level targeting. - Targeting *VariantTargeting `json:"targeting,omitempty"` +// PartialRefund: A partial refund of a transaction. +type PartialRefund struct { + // RefundId: Required. A unique id distinguishing this partial refund. + // If the refund is successful, subsequent refunds with the same id will + // fail. Must be unique across refunds for one individual transaction. + RefundId string `json:"refundId,omitempty"` - // VariantNumber: Number of the variant, starting at 0 (unless - // overridden). A device will receive APKs from the first variant that - // matches the device configuration, with higher variant numbers having - // priority over lower variant numbers. - VariantNumber int64 `json:"variantNumber,omitempty"` + // RefundPreTaxAmount: Required. The pre-tax amount of the partial + // refund. Should be less than the remaining pre-tax amount of the + // transaction. + RefundPreTaxAmount *Price `json:"refundPreTaxAmount,omitempty"` - // ForceSendFields is a list of field names (e.g. "ApkSet") to + // ForceSendFields is a list of field names (e.g. "RefundId") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5260,8 +5122,8 @@ type SplitApkVariant struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ApkSet") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "RefundId") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -5269,18 +5131,20 @@ type SplitApkVariant struct { NullFields []string `json:"-"` } -func (s *SplitApkVariant) MarshalJSON() ([]byte, error) { - type NoMethod SplitApkVariant +func (s *PartialRefund) MarshalJSON() ([]byte, error) { + type NoMethod PartialRefund raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// StandaloneApkMetadata: Holds data specific to Standalone APKs. -type StandaloneApkMetadata struct { - // FusedModuleName: Names of the modules fused in this standalone APK. - FusedModuleName []string `json:"fusedModuleName,omitempty"` +// PausedStateContext: Information specific to a subscription in paused +// state. +type PausedStateContext struct { + // AutoResumeTime: Time at which the subscription will be automatically + // resumed. + AutoResumeTime string `json:"autoResumeTime,omitempty"` - // ForceSendFields is a list of field names (e.g. "FusedModuleName") to + // ForceSendFields is a list of field names (e.g. "AutoResumeTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5288,7 +5152,7 @@ type StandaloneApkMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "FusedModuleName") to + // NullFields is a list of field names (e.g. "AutoResumeTime") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -5298,36 +5162,101 @@ type StandaloneApkMetadata struct { NullFields []string `json:"-"` } -func (s *StandaloneApkMetadata) MarshalJSON() ([]byte, error) { - type NoMethod StandaloneApkMetadata +func (s *PausedStateContext) MarshalJSON() ([]byte, error) { + type NoMethod PausedStateContext raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscribeWithGoogleInfo: Information associated with purchases made -// with 'Subscribe with Google'. -type SubscribeWithGoogleInfo struct { - // EmailAddress: The email address of the user when the subscription was - // purchased. - EmailAddress string `json:"emailAddress,omitempty"` +// PrepaidBasePlanType: Represents a base plan that does not +// automatically renew at the end of the base plan, and must be manually +// renewed by the user. +type PrepaidBasePlanType struct { + // BillingPeriodDuration: Required. Subscription period, specified in + // ISO 8601 format. For a list of acceptable billing periods, refer to + // the help center. + BillingPeriodDuration string `json:"billingPeriodDuration,omitempty"` - // FamilyName: The family name of the user when the subscription was - // purchased. - FamilyName string `json:"familyName,omitempty"` + // TimeExtension: Whether users should be able to extend this prepaid + // base plan in Google Play surfaces. Defaults to TIME_EXTENSION_ACTIVE + // if not specified. + // + // Possible values: + // "TIME_EXTENSION_UNSPECIFIED" - Unspecified state. + // "TIME_EXTENSION_ACTIVE" - Time extension is active. Users are + // allowed to top-up or extend their prepaid plan. + // "TIME_EXTENSION_INACTIVE" - Time extension is inactive. Users + // cannot top-up or extend their prepaid plan. + TimeExtension string `json:"timeExtension,omitempty"` - // GivenName: The given name of the user when the subscription was - // purchased. - GivenName string `json:"givenName,omitempty"` + // ForceSendFields is a list of field names (e.g. + // "BillingPeriodDuration") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` - // ProfileId: The Google profile id of the user when the subscription - // was purchased. - ProfileId string `json:"profileId,omitempty"` + // NullFields is a list of field names (e.g. "BillingPeriodDuration") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} - // ProfileName: The profile name of the user when the subscription was - // purchased. - ProfileName string `json:"profileName,omitempty"` +func (s *PrepaidBasePlanType) MarshalJSON() ([]byte, error) { + type NoMethod PrepaidBasePlanType + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // ForceSendFields is a list of field names (e.g. "EmailAddress") to +// PrepaidPlan: Information related to a prepaid plan. +type PrepaidPlan struct { + // AllowExtendAfterTime: If present, this is the time after which top up + // purchases are allowed for the prepaid plan. Will not be present for + // expired prepaid plans. + AllowExtendAfterTime string `json:"allowExtendAfterTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "AllowExtendAfterTime") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AllowExtendAfterTime") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *PrepaidPlan) MarshalJSON() ([]byte, error) { + type NoMethod PrepaidPlan + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Price: Definition of a price, i.e. currency and units. +type Price struct { + // Currency: 3 letter Currency code, as defined by ISO 4217. See + // java/com/google/common/money/CurrencyCode.java + Currency string `json:"currency,omitempty"` + + // PriceMicros: Price in 1/million of the currency base unit, + // represented as a string. + PriceMicros string `json:"priceMicros,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Currency") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5335,101 +5264,132 @@ type SubscribeWithGoogleInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "EmailAddress") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Currency") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *SubscribeWithGoogleInfo) MarshalJSON() ([]byte, error) { - type NoMethod SubscribeWithGoogleInfo +func (s *Price) MarshalJSON() ([]byte, error) { + type NoMethod Price raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Subscription: A single subscription for an app. -type Subscription struct { - // Archived: Output only. Whether this subscription is archived. - // Archived subscriptions are not available to any subscriber any - // longer, cannot be updated, and are not returned in list requests - // unless the show archived flag is passed in. - Archived bool `json:"archived,omitempty"` +// ProductPurchase: A ProductPurchase resource indicates the status of a +// user's inapp product purchase. +type ProductPurchase struct { + // AcknowledgementState: The acknowledgement state of the inapp product. + // Possible values are: 0. Yet to be acknowledged 1. Acknowledged + AcknowledgementState int64 `json:"acknowledgementState,omitempty"` - // BasePlans: The set of base plans for this subscription. Represents - // the prices and duration of the subscription if no other offers apply. - BasePlans []*BasePlan `json:"basePlans,omitempty"` + // ConsumptionState: The consumption state of the inapp product. + // Possible values are: 0. Yet to be consumed 1. Consumed + ConsumptionState int64 `json:"consumptionState,omitempty"` - // Listings: Required. List of localized listings for this subscription. - // Must contain at least an entry for the default language of the parent - // app. - Listings []*SubscriptionListing `json:"listings,omitempty"` + // DeveloperPayload: A developer-specified string that contains + // supplemental information about an order. + DeveloperPayload string `json:"developerPayload,omitempty"` - // PackageName: Immutable. Package name of the parent app. - PackageName string `json:"packageName,omitempty"` + // Kind: This kind represents an inappPurchase object in the + // androidpublisher service. + Kind string `json:"kind,omitempty"` - // ProductId: Immutable. Unique product ID of the product. Unique within - // the parent app. Product IDs must be composed of lower-case letters - // (a-z), numbers (0-9), underscores (_) and dots (.). It must start - // with a lower-case letter or number, and be between 1 and 40 - // (inclusive) characters in length. + // ObfuscatedExternalAccountId: An obfuscated version of the id that is + // uniquely associated with the user's account in your app. Only present + // if specified using + // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedaccountid + // when the purchase was made. + ObfuscatedExternalAccountId string `json:"obfuscatedExternalAccountId,omitempty"` + + // ObfuscatedExternalProfileId: An obfuscated version of the id that is + // uniquely associated with the user's profile in your app. Only present + // if specified using + // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedprofileid + // when the purchase was made. + ObfuscatedExternalProfileId string `json:"obfuscatedExternalProfileId,omitempty"` + + // OrderId: The order id associated with the purchase of the inapp + // product. + OrderId string `json:"orderId,omitempty"` + + // ProductId: The inapp product SKU. May not be present. ProductId string `json:"productId,omitempty"` - // TaxAndComplianceSettings: Details about taxes and legal compliance. - TaxAndComplianceSettings *SubscriptionTaxAndComplianceSettings `json:"taxAndComplianceSettings,omitempty"` + // PurchaseState: The purchase state of the order. Possible values are: + // 0. Purchased 1. Canceled 2. Pending + PurchaseState int64 `json:"purchaseState,omitempty"` + + // PurchaseTimeMillis: The time the product was purchased, in + // milliseconds since the epoch (Jan 1, 1970). + PurchaseTimeMillis int64 `json:"purchaseTimeMillis,omitempty,string"` + + // PurchaseToken: The purchase token generated to identify this + // purchase. May not be present. + PurchaseToken string `json:"purchaseToken,omitempty"` + + // PurchaseType: The type of purchase of the inapp product. This field + // is only set if this purchase was not made using the standard in-app + // billing flow. Possible values are: 0. Test (i.e. purchased from a + // license testing account) 1. Promo (i.e. purchased using a promo code) + // 2. Rewarded (i.e. from watching a video ad instead of paying) + PurchaseType *int64 `json:"purchaseType,omitempty"` + + // Quantity: The quantity associated with the purchase of the inapp + // product. If not present, the quantity is 1. + Quantity int64 `json:"quantity,omitempty"` + + // RegionCode: ISO 3166-1 alpha-2 billing region code of the user at the + // time the product was granted. + RegionCode string `json:"regionCode,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Archived") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. + // ForceSendFields is a list of field names (e.g. + // "AcknowledgementState") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Archived") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "AcknowledgementState") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *Subscription) MarshalJSON() ([]byte, error) { - type NoMethod Subscription +func (s *ProductPurchase) MarshalJSON() ([]byte, error) { + type NoMethod ProductPurchase raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscriptionCancelSurveyResult: Information provided by the user when -// they complete the subscription cancellation flow (cancellation reason -// survey). -type SubscriptionCancelSurveyResult struct { - // CancelSurveyReason: The cancellation reason the user chose in the - // survey. Possible values are: 0. Other 1. I don't use this service - // enough 2. Technical issues 3. Cost-related reasons 4. I found a - // better app - CancelSurveyReason int64 `json:"cancelSurveyReason,omitempty"` - - // UserInputCancelReason: The customized input cancel reason from the - // user. Only present when cancelReason is 0. - UserInputCancelReason string `json:"userInputCancelReason,omitempty"` +// ProductPurchasesAcknowledgeRequest: Request for the +// product.purchases.acknowledge API. +type ProductPurchasesAcknowledgeRequest struct { + // DeveloperPayload: Payload to attach to the purchase. + DeveloperPayload string `json:"developerPayload,omitempty"` - // ForceSendFields is a list of field names (e.g. "CancelSurveyReason") - // to unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "DeveloperPayload") to + // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CancelSurveyReason") to + // NullFields is a list of field names (e.g. "DeveloperPayload") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -5439,90 +5399,124 @@ type SubscriptionCancelSurveyResult struct { NullFields []string `json:"-"` } -func (s *SubscriptionCancelSurveyResult) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionCancelSurveyResult +func (s *ProductPurchasesAcknowledgeRequest) MarshalJSON() ([]byte, error) { + type NoMethod ProductPurchasesAcknowledgeRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscriptionDeferralInfo: A SubscriptionDeferralInfo contains the -// data needed to defer a subscription purchase to a future expiry time. -type SubscriptionDeferralInfo struct { - // DesiredExpiryTimeMillis: The desired next expiry time to assign to - // the subscription, in milliseconds since the Epoch. The given time - // must be later/greater than the current expiry time for the - // subscription. - DesiredExpiryTimeMillis int64 `json:"desiredExpiryTimeMillis,omitempty,string"` +// RecurringExternalTransaction: Represents a transaction that is part +// of a recurring series of payments. This can be a subscription or a +// one-time product with multiple payments (such as preorder). +type RecurringExternalTransaction struct { + // ExternalSubscription: Details of an external subscription. + ExternalSubscription *ExternalSubscription `json:"externalSubscription,omitempty"` - // ExpectedExpiryTimeMillis: The expected expiry time for the - // subscription. If the current expiry time for the subscription is not - // the value specified here, the deferral will not occur. - ExpectedExpiryTimeMillis int64 `json:"expectedExpiryTimeMillis,omitempty,string"` + // ExternalTransactionToken: Input only. Provided during the call to + // Create. Retrieved from the client when the alternative billing flow + // is launched. Required only for the initial purchase. + ExternalTransactionToken string `json:"externalTransactionToken,omitempty"` + + // InitialExternalTransactionId: The external transaction id of the + // first transaction of this recurring series of transactions. For + // example, for a subscription this would be the transaction id of the + // first payment. Required when creating recurring external + // transactions. + InitialExternalTransactionId string `json:"initialExternalTransactionId,omitempty"` + + // MigratedTransactionProgram: Input only. Provided during the call to + // Create. Must only be used when migrating a subscription from manual + // monthly reporting to automated reporting. + // + // Possible values: + // "EXTERNAL_TRANSACTION_PROGRAM_UNSPECIFIED" - Unspecified + // transaction program. Not used. + // "USER_CHOICE_BILLING" - User choice billing, where a user may + // choose between Google Play Billing developer-managed billing. + // "ALTERTNATIVE_BILLING_ONLY" - Alternatively billing only, where + // users may only use developer-manager billing. + MigratedTransactionProgram string `json:"migratedTransactionProgram,omitempty"` // ForceSendFields is a list of field names (e.g. - // "DesiredExpiryTimeMillis") to unconditionally include in API - // requests. By default, fields with empty or default values are omitted - // from API requests. However, any non-pointer, non-interface field - // appearing in ForceSendFields will be sent to the server regardless of - // whether the field is empty or not. This may be used to include empty - // fields in Patch requests. + // "ExternalSubscription") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DesiredExpiryTimeMillis") - // to include in API requests with the JSON null value. By default, - // fields with empty values are omitted from API requests. However, any - // field with an empty value appearing in NullFields will be sent to the + // NullFields is a list of field names (e.g. "ExternalSubscription") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } -func (s *SubscriptionDeferralInfo) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionDeferralInfo +func (s *RecurringExternalTransaction) MarshalJSON() ([]byte, error) { + type NoMethod RecurringExternalTransaction raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscriptionItemPriceChangeDetails: Price change related information -// of a subscription item. -type SubscriptionItemPriceChangeDetails struct { - // ExpectedNewPriceChargeTime: The renewal time at which the price - // change will become effective for the user. This is subject to - // change(to a future time) due to cases where the renewal time shifts - // like pause. This field is only populated if the price change has not - // taken effect. - ExpectedNewPriceChargeTime string `json:"expectedNewPriceChargeTime,omitempty"` +// RefundExternalTransactionRequest: A request to refund an existing +// external transaction. +type RefundExternalTransactionRequest struct { + // FullRefund: A full-amount refund. + FullRefund *FullRefund `json:"fullRefund,omitempty"` - // NewPrice: New recurring price for the subscription item. - NewPrice *Money `json:"newPrice,omitempty"` + // PartialRefund: A partial refund. + PartialRefund *PartialRefund `json:"partialRefund,omitempty"` - // PriceChangeMode: Price change mode specifies how the subscription - // item price is changing. - // - // Possible values: - // "PRICE_CHANGE_MODE_UNSPECIFIED" - Price change mode unspecified. - // This value should never be set. - // "PRICE_DECREASE" - If the subscription price is decreasing. - // "PRICE_INCREASE" - If the subscription price is increasing and the - // user needs to accept it. - // "OPT_OUT_PRICE_INCREASE" - If the subscription price is increasing - // with opt out mode. - PriceChangeMode string `json:"priceChangeMode,omitempty"` + // RefundTime: Required. The time that the transaction was refunded. + RefundTime string `json:"refundTime,omitempty"` - // PriceChangeState: State the price change is currently in. - // - // Possible values: - // "PRICE_CHANGE_STATE_UNSPECIFIED" - Price change state unspecified. - // This value should not be used. - // "OUTSTANDING" - Waiting for the user to agree for the price change. - // "CONFIRMED" - The price change is confirmed to happen for the user. - // "APPLIED" - The price change is applied, i.e. the user has started - // being charged the new price. - PriceChangeState string `json:"priceChangeState,omitempty"` + // ForceSendFields is a list of field names (e.g. "FullRefund") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "FullRefund") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *RefundExternalTransactionRequest) MarshalJSON() ([]byte, error) { + type NoMethod RefundExternalTransactionRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// RegionalBasePlanConfig: Configuration for a base plan specific to a +// region. +type RegionalBasePlanConfig struct { + // NewSubscriberAvailability: Whether the base plan in the specified + // region is available for new subscribers. Existing subscribers will + // not have their subscription canceled if this value is set to false. + // If not specified, this will default to false. + NewSubscriberAvailability bool `json:"newSubscriberAvailability,omitempty"` + + // Price: The price of the base plan in the specified region. Must be + // set if the base plan is available to new subscribers. Must be set in + // the currency that is linked to the specified region. + Price *Money `json:"price,omitempty"` + + // RegionCode: Required. Region code this configuration applies to, as + // defined by ISO 3166-2, e.g. "US". + RegionCode string `json:"regionCode,omitempty"` // ForceSendFields is a list of field names (e.g. - // "ExpectedNewPriceChargeTime") to unconditionally include in API + // "NewSubscriberAvailability") to unconditionally include in API // requests. By default, fields with empty or default values are omitted // from API requests. However, any non-pointer, non-interface field // appearing in ForceSendFields will be sent to the server regardless of @@ -5531,125 +5525,275 @@ type SubscriptionItemPriceChangeDetails struct { ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. - // "ExpectedNewPriceChargeTime") to include in API requests with the - // JSON null value. By default, fields with empty values are omitted - // from API requests. However, any field with an empty value appearing - // in NullFields will be sent to the server as null. It is an error if a + // "NewSubscriberAvailability") to include in API requests with the JSON + // null value. By default, fields with empty values are omitted from API + // requests. However, any field with an empty value appearing in + // NullFields will be sent to the server as null. It is an error if a // field in this list has a non-empty value. This may be used to include // null fields in Patch requests. NullFields []string `json:"-"` } -func (s *SubscriptionItemPriceChangeDetails) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionItemPriceChangeDetails +func (s *RegionalBasePlanConfig) MarshalJSON() ([]byte, error) { + type NoMethod RegionalBasePlanConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscriptionListing: The consumer-visible metadata of a subscription. -type SubscriptionListing struct { - // Benefits: A list of benefits shown to the user on platforms such as - // the Play Store and in restoration flows in the language of this - // listing. Plain text. Ordered list of at most four benefits. - Benefits []string `json:"benefits,omitempty"` - - // Description: The description of this subscription in the language of - // this listing. Maximum length - 80 characters. Plain text. - Description string `json:"description,omitempty"` +// RegionalPriceMigrationConfig: Configuration for a price migration. +type RegionalPriceMigrationConfig struct { + // OldestAllowedPriceVersionTime: Required. The cutoff time for + // historical prices that subscribers can remain paying. Subscribers on + // prices which were available at this cutoff time or later will stay on + // their existing price. Subscribers on older prices will be migrated to + // the currently-offered price. The migrated subscribers will receive a + // notification that they will be paying a different price. Subscribers + // who do not agree to the new price will have their subscription ended + // at the next renewal. + OldestAllowedPriceVersionTime string `json:"oldestAllowedPriceVersionTime,omitempty"` - // LanguageCode: Required. The language of this listing, as defined by - // BCP-47, e.g. "en-US". - LanguageCode string `json:"languageCode,omitempty"` + // PriceIncreaseType: Optional. The behavior the caller wants users to + // see when there is a price increase during migration. If left unset, + // the behavior defaults to PRICE_INCREASE_TYPE_OPT_IN. Note that the + // first opt-out price increase migration for each app must be initiated + // in Play Console. + // + // Possible values: + // "PRICE_INCREASE_TYPE_UNSPECIFIED" - Unspecified state. + // "PRICE_INCREASE_TYPE_OPT_IN" - Price increase will be presented to + // users on an opt-in basis. + // "PRICE_INCREASE_TYPE_OPT_OUT" - Price increase will be presented to + // users on an opt-out basis. + PriceIncreaseType string `json:"priceIncreaseType,omitempty"` - // Title: Required. The title of this subscription in the language of - // this listing. Plain text. - Title string `json:"title,omitempty"` + // RegionCode: Required. Region code this configuration applies to, as + // defined by ISO 3166-2, e.g. "US". + RegionCode string `json:"regionCode,omitempty"` - // ForceSendFields is a list of field names (e.g. "Benefits") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. + // ForceSendFields is a list of field names (e.g. + // "OldestAllowedPriceVersionTime") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Benefits") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. + // "OldestAllowedPriceVersionTime") to include in API requests with the + // JSON null value. By default, fields with empty values are omitted + // from API requests. However, any field with an empty value appearing + // in NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. NullFields []string `json:"-"` } -func (s *SubscriptionListing) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionListing +func (s *RegionalPriceMigrationConfig) MarshalJSON() ([]byte, error) { + type NoMethod RegionalPriceMigrationConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscriptionOffer: A single, temporary offer -type SubscriptionOffer struct { - // BasePlanId: Required. Immutable. The ID of the base plan to which - // this offer is an extension. - BasePlanId string `json:"basePlanId,omitempty"` +// RegionalSubscriptionOfferConfig: Configuration for a subscription +// offer in a single region. +type RegionalSubscriptionOfferConfig struct { + // NewSubscriberAvailability: Whether the subscription offer in the + // specified region is available for new subscribers. Existing + // subscribers will not have their subscription cancelled if this value + // is set to false. If not specified, this will default to false. + NewSubscriberAvailability bool `json:"newSubscriberAvailability,omitempty"` - // OfferId: Required. Immutable. Unique ID of this subscription offer. - // Must be unique within the base plan. - OfferId string `json:"offerId,omitempty"` + // RegionCode: Required. Immutable. Region code this configuration + // applies to, as defined by ISO 3166-2, e.g. "US". + RegionCode string `json:"regionCode,omitempty"` - // OfferTags: List of up to 20 custom tags specified for this offer, and - // returned to the app through the billing library. - OfferTags []*OfferTag `json:"offerTags,omitempty"` + // ForceSendFields is a list of field names (e.g. + // "NewSubscriberAvailability") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` - // OtherRegionsConfig: The configuration for any new locations Play may - // launch in the future. - OtherRegionsConfig *OtherRegionsSubscriptionOfferConfig `json:"otherRegionsConfig,omitempty"` + // NullFields is a list of field names (e.g. + // "NewSubscriberAvailability") to include in API requests with the JSON + // null value. By default, fields with empty values are omitted from API + // requests. However, any field with an empty value appearing in + // NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. + NullFields []string `json:"-"` +} - // PackageName: Required. Immutable. The package name of the app the - // parent subscription belongs to. - PackageName string `json:"packageName,omitempty"` +func (s *RegionalSubscriptionOfferConfig) MarshalJSON() ([]byte, error) { + type NoMethod RegionalSubscriptionOfferConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // Phases: Required. The phases of this subscription offer. Must contain - // at least one entry, and may contain at most five. Users will always - // receive all these phases in the specified order. Phases may not be - // added, removed, or reordered after initial creation. - Phases []*SubscriptionOfferPhase `json:"phases,omitempty"` +// RegionalSubscriptionOfferPhaseConfig: Configuration for a single +// phase of a subscription offer in a single region. +type RegionalSubscriptionOfferPhaseConfig struct { + // AbsoluteDiscount: The absolute amount of money subtracted from the + // base plan price prorated over the phase duration that the user pays + // for this offer phase. For example, if the base plan price for this + // region is $12 for a period of 1 year, then a $1 absolute discount for + // a phase of a duration of 3 months would correspond to a price of $2. + // The resulting price may not be smaller than the minimum price allowed + // for this region. + AbsoluteDiscount *Money `json:"absoluteDiscount,omitempty"` - // ProductId: Required. Immutable. The ID of the parent subscription - // this offer belongs to. - ProductId string `json:"productId,omitempty"` + // Price: The absolute price the user pays for this offer phase. The + // price must not be smaller than the minimum price allowed for this + // region. + Price *Money `json:"price,omitempty"` - // RegionalConfigs: Required. The region-specific configuration of this - // offer. Must contain at least one entry. - RegionalConfigs []*RegionalSubscriptionOfferConfig `json:"regionalConfigs,omitempty"` + // RegionCode: Required. Immutable. The region to which this config + // applies. + RegionCode string `json:"regionCode,omitempty"` - // State: Output only. The current state of this offer. Can be changed - // using Activate and Deactivate actions. NB: the base plan state - // supersedes this state, so an active offer may not be available if the - // base plan is not active. + // RelativeDiscount: The fraction of the base plan price prorated over + // the phase duration that the user pays for this offer phase. For + // example, if the base plan price for this region is $12 for a period + // of 1 year, then a 50% discount for a phase of a duration of 3 months + // would correspond to a price of $1.50. The discount must be specified + // as a fraction strictly larger than 0 and strictly smaller than 1. The + // resulting price will be rounded to the nearest billable unit (e.g. + // cents for USD). The relative discount is considered invalid if the + // discounted price ends up being smaller than the minimum price allowed + // in this region. + RelativeDiscount float64 `json:"relativeDiscount,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AbsoluteDiscount") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AbsoluteDiscount") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *RegionalSubscriptionOfferPhaseConfig) MarshalJSON() ([]byte, error) { + type NoMethod RegionalSubscriptionOfferPhaseConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *RegionalSubscriptionOfferPhaseConfig) UnmarshalJSON(data []byte) error { + type NoMethod RegionalSubscriptionOfferPhaseConfig + var s1 struct { + RelativeDiscount gensupport.JSONFloat64 `json:"relativeDiscount"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.RelativeDiscount = float64(s1.RelativeDiscount) + return nil +} + +// RegionalTaxRateInfo: Specified details about taxation in a given +// geographical region. +type RegionalTaxRateInfo struct { + // EligibleForStreamingServiceTaxRate: You must tell us if your app + // contains streaming products to correctly charge US state and local + // sales tax. Field only supported in United States. + EligibleForStreamingServiceTaxRate bool `json:"eligibleForStreamingServiceTaxRate,omitempty"` + + // StreamingTaxType: To collect communications or amusement taxes in the + // United States, choose the appropriate tax category. Learn more + // (https://support.google.com/googleplay/android-developer/answer/10463498#streaming_tax). // // Possible values: - // "STATE_UNSPECIFIED" - Default value, should never be used. - // "DRAFT" - The subscription offer is not and has never been - // available to users. - // "ACTIVE" - The subscription offer is available to new and existing - // users. - // "INACTIVE" - The subscription offer is not available to new users. - // Existing users retain access. - State string `json:"state,omitempty"` + // "STREAMING_TAX_TYPE_UNSPECIFIED" - No telecommunications tax + // collected. + // "STREAMING_TAX_TYPE_TELCO_VIDEO_RENTAL" - US-specific + // telecommunications tax tier for video streaming, on demand, rentals / + // subscriptions / pay-per-view. + // "STREAMING_TAX_TYPE_TELCO_VIDEO_SALES" - US-specific + // telecommunications tax tier for video streaming of pre-recorded + // content like movies, tv shows. + // "STREAMING_TAX_TYPE_TELCO_VIDEO_MULTI_CHANNEL" - US-specific + // telecommunications tax tier for video streaming of multi-channel + // programming. + // "STREAMING_TAX_TYPE_TELCO_AUDIO_RENTAL" - US-specific + // telecommunications tax tier for audio streaming, rental / + // subscription. + // "STREAMING_TAX_TYPE_TELCO_AUDIO_SALES" - US-specific + // telecommunications tax tier for audio streaming, sale / permanent + // download. + // "STREAMING_TAX_TYPE_TELCO_AUDIO_MULTI_CHANNEL" - US-specific + // telecommunications tax tier for multi channel audio streaming like + // radio. + StreamingTaxType string `json:"streamingTaxType,omitempty"` - // Targeting: The requirements that users need to fulfil to be eligible - // for this offer. Represents the requirements that Play will evaluate - // to decide whether an offer should be returned. Developers may further - // filter these offers themselves. - Targeting *SubscriptionOfferTargeting `json:"targeting,omitempty"` + // TaxTier: Tax tier to specify reduced tax rate. Developers who sell + // digital news, magazines, newspapers, books, or audiobooks in various + // regions may be eligible for reduced tax rates. Learn more + // (https://support.google.com/googleplay/android-developer/answer/10463498). + // + // Possible values: + // "TAX_TIER_UNSPECIFIED" + // "TAX_TIER_BOOKS_1" + // "TAX_TIER_NEWS_1" + // "TAX_TIER_NEWS_2" + // "TAX_TIER_MUSIC_OR_AUDIO_1" + // "TAX_TIER_LIVE_OR_BROADCAST_1" + TaxTier string `json:"taxTier,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. + // "EligibleForStreamingServiceTaxRate") to unconditionally include in + // API requests. By default, fields with empty or default values are + // omitted from API requests. However, any non-pointer, non-interface + // field appearing in ForceSendFields will be sent to the server + // regardless of whether the field is empty or not. This may be used to + // include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // ForceSendFields is a list of field names (e.g. "BasePlanId") to + // NullFields is a list of field names (e.g. + // "EligibleForStreamingServiceTaxRate") to include in API requests with + // the JSON null value. By default, fields with empty values are omitted + // from API requests. However, any field with an empty value appearing + // in NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *RegionalTaxRateInfo) MarshalJSON() ([]byte, error) { + type NoMethod RegionalTaxRateInfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// RegionsVersion: The version of the available regions being used for +// the specified resource. +type RegionsVersion struct { + // Version: Required. A string representing the version of available + // regions being used for the specified resource. Regional prices for + // the resource have to be specified according to the information + // published in this article + // (https://support.google.com/googleplay/android-developer/answer/10532353). + // Each time the supported locations substantially change, the version + // will be incremented. Using this field will ensure that creating and + // updating the resource with an older region's version and set of + // regional prices and currencies will succeed even though a new version + // is available. The latest version is 2022/02. + Version string `json:"version,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Version") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5657,7 +5801,7 @@ type SubscriptionOffer struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "BasePlanId") to include in + // NullFields is a list of field names (e.g. "Version") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -5666,33 +5810,33 @@ type SubscriptionOffer struct { NullFields []string `json:"-"` } -func (s *SubscriptionOffer) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionOffer +func (s *RegionsVersion) MarshalJSON() ([]byte, error) { + type NoMethod RegionsVersion raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscriptionOfferPhase: A single phase of a subscription offer. -type SubscriptionOfferPhase struct { - // Duration: Required. The duration of a single recurrence of this - // phase. Specified in ISO 8601 format. - Duration string `json:"duration,omitempty"` +// ReplacementCancellation: Information specific to cancellations caused +// by subscription replacement. +type ReplacementCancellation struct { +} - // OtherRegionsConfig: Pricing information for any new locations Play - // may launch in. - OtherRegionsConfig *OtherRegionsSubscriptionOfferPhaseConfig `json:"otherRegionsConfig,omitempty"` +// Review: An Android app review. +type Review struct { + // AuthorName: The name of the user who wrote the review. + AuthorName string `json:"authorName,omitempty"` - // RecurrenceCount: Required. The number of times this phase repeats. If - // this offer phase is not free, each recurrence charges the user the - // price of this offer phase. - RecurrenceCount int64 `json:"recurrenceCount,omitempty"` + // Comments: A repeated field containing comments for the review. + Comments []*Comment `json:"comments,omitempty"` - // RegionalConfigs: Required. The region-specific configuration of this - // offer phase. This list must contain exactly one entry for each region - // for which the subscription offer has a regional config. - RegionalConfigs []*RegionalSubscriptionOfferPhaseConfig `json:"regionalConfigs,omitempty"` + // ReviewId: Unique identifier for this review. + ReviewId string `json:"reviewId,omitempty"` - // ForceSendFields is a list of field names (e.g. "Duration") to + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AuthorName") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5700,7 +5844,7 @@ type SubscriptionOfferPhase struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Duration") to include in + // NullFields is a list of field names (e.g. "AuthorName") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -5709,23 +5853,21 @@ type SubscriptionOfferPhase struct { NullFields []string `json:"-"` } -func (s *SubscriptionOfferPhase) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionOfferPhase +func (s *Review) MarshalJSON() ([]byte, error) { + type NoMethod Review raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscriptionOfferTargeting: Defines the rule a user needs to satisfy -// to receive this offer. -type SubscriptionOfferTargeting struct { - // AcquisitionRule: Offer targeting rule for new user acquisition. - AcquisitionRule *AcquisitionTargetingRule `json:"acquisitionRule,omitempty"` +// ReviewReplyResult: The result of replying/updating a reply to review. +type ReviewReplyResult struct { + // LastEdited: The time at which the reply took effect. + LastEdited *Timestamp `json:"lastEdited,omitempty"` - // UpgradeRule: Offer targeting rule for upgrading users' existing - // plans. - UpgradeRule *UpgradeTargetingRule `json:"upgradeRule,omitempty"` + // ReplyText: The reply text that was applied. + ReplyText string `json:"replyText,omitempty"` - // ForceSendFields is a list of field names (e.g. "AcquisitionRule") to + // ForceSendFields is a list of field names (e.g. "LastEdited") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5733,43 +5875,38 @@ type SubscriptionOfferTargeting struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AcquisitionRule") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "LastEdited") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *SubscriptionOfferTargeting) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionOfferTargeting +func (s *ReviewReplyResult) MarshalJSON() ([]byte, error) { + type NoMethod ReviewReplyResult raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscriptionPriceChange: Contains the price change information for a -// subscription that can be used to control the user journey for the -// price change in the app. This can be in the form of seeking -// confirmation from the user or tailoring the experience for a -// successful conversion. -type SubscriptionPriceChange struct { - // NewPrice: The new price the subscription will renew with if the price - // change is accepted by the user. - NewPrice *Price `json:"newPrice,omitempty"` +// ReviewsListResponse: Response listing reviews. +type ReviewsListResponse struct { + // PageInfo: Information about the current page. + PageInfo *PageInfo `json:"pageInfo,omitempty"` - // State: The current state of the price change. Possible values are: 0. - // Outstanding: State for a pending price change waiting for the user to - // agree. In this state, you can optionally seek confirmation from the - // user using the In-App API. 1. Accepted: State for an accepted price - // change that the subscription will renew with unless it's canceled. - // The price change takes effect on a future date when the subscription - // renews. Note that the change might not occur when the subscription is - // renewed next. - State int64 `json:"state,omitempty"` + // Reviews: List of reviews. + Reviews []*Review `json:"reviews,omitempty"` - // ForceSendFields is a list of field names (e.g. "NewPrice") to + // TokenPagination: Pagination token, to handle a number of products + // that is over one page. + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "PageInfo") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5777,7 +5914,7 @@ type SubscriptionPriceChange struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "NewPrice") to include in + // NullFields is a list of field names (e.g. "PageInfo") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -5786,230 +5923,286 @@ type SubscriptionPriceChange struct { NullFields []string `json:"-"` } -func (s *SubscriptionPriceChange) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionPriceChange +func (s *ReviewsListResponse) MarshalJSON() ([]byte, error) { + type NoMethod ReviewsListResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscriptionPurchase: A SubscriptionPurchase resource indicates the -// status of a user's subscription purchase. -type SubscriptionPurchase struct { - // AcknowledgementState: The acknowledgement state of the subscription - // product. Possible values are: 0. Yet to be acknowledged 1. - // Acknowledged - AcknowledgementState int64 `json:"acknowledgementState,omitempty"` +// ReviewsReplyRequest: Request to reply to review or update existing +// reply. +type ReviewsReplyRequest struct { + // ReplyText: The text to set as the reply. Replies of more than + // approximately 350 characters will be rejected. HTML tags will be + // stripped. + ReplyText string `json:"replyText,omitempty"` - // AutoRenewing: Whether the subscription will automatically be renewed - // when it reaches its current expiry time. - AutoRenewing bool `json:"autoRenewing,omitempty"` + // ForceSendFields is a list of field names (e.g. "ReplyText") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // AutoResumeTimeMillis: Time at which the subscription will be - // automatically resumed, in milliseconds since the Epoch. Only present - // if the user has requested to pause the subscription. - AutoResumeTimeMillis int64 `json:"autoResumeTimeMillis,omitempty,string"` + // NullFields is a list of field names (e.g. "ReplyText") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} - // CancelReason: The reason why a subscription was canceled or is not - // auto-renewing. Possible values are: 0. User canceled the subscription - // 1. Subscription was canceled by the system, for example because of a - // billing problem 2. Subscription was replaced with a new subscription - // 3. Subscription was canceled by the developer - CancelReason int64 `json:"cancelReason,omitempty"` +func (s *ReviewsReplyRequest) MarshalJSON() ([]byte, error) { + type NoMethod ReviewsReplyRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // CancelSurveyResult: Information provided by the user when they - // complete the subscription cancellation flow (cancellation reason - // survey). - CancelSurveyResult *SubscriptionCancelSurveyResult `json:"cancelSurveyResult,omitempty"` +// ReviewsReplyResponse: Response on status of replying to a review. +type ReviewsReplyResponse struct { + // Result: The result of replying/updating a reply to review. + Result *ReviewReplyResult `json:"result,omitempty"` - // CountryCode: ISO 3166-1 alpha-2 billing country/region code of the - // user at the time the subscription was granted. - CountryCode string `json:"countryCode,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // DeveloperPayload: A developer-specified string that contains - // supplemental information about an order. - DeveloperPayload string `json:"developerPayload,omitempty"` + // ForceSendFields is a list of field names (e.g. "Result") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // EmailAddress: The email address of the user when the subscription was - // purchased. Only present for purchases made with 'Subscribe with - // Google'. - EmailAddress string `json:"emailAddress,omitempty"` + // NullFields is a list of field names (e.g. "Result") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} - // ExpiryTimeMillis: Time at which the subscription will expire, in - // milliseconds since the Epoch. - ExpiryTimeMillis int64 `json:"expiryTimeMillis,omitempty,string"` +func (s *ReviewsReplyResponse) MarshalJSON() ([]byte, error) { + type NoMethod ReviewsReplyResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // ExternalAccountId: User account identifier in the third-party - // service. Only present if account linking happened as part of the - // subscription purchase flow. - ExternalAccountId string `json:"externalAccountId,omitempty"` +// ScreenDensity: Represents a screen density. +type ScreenDensity struct { + // DensityAlias: Alias for a screen density. + // + // Possible values: + // "DENSITY_UNSPECIFIED" - Unspecified screen density. + // "NODPI" - NODPI screen density. + // "LDPI" - LDPI screen density. + // "MDPI" - MDPI screen density. + // "TVDPI" - TVDPI screen density. + // "HDPI" - HDPI screen density. + // "XHDPI" - XHDPI screen density. + // "XXHDPI" - XXHDPI screen density. + // "XXXHDPI" - XXXHDPI screen density. + DensityAlias string `json:"densityAlias,omitempty"` - // FamilyName: The family name of the user when the subscription was - // purchased. Only present for purchases made with 'Subscribe with - // Google'. - FamilyName string `json:"familyName,omitempty"` + // DensityDpi: Value for density dpi. + DensityDpi int64 `json:"densityDpi,omitempty"` - // GivenName: The given name of the user when the subscription was - // purchased. Only present for purchases made with 'Subscribe with - // Google'. - GivenName string `json:"givenName,omitempty"` + // ForceSendFields is a list of field names (e.g. "DensityAlias") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // IntroductoryPriceInfo: Introductory price information of the - // subscription. This is only present when the subscription was - // purchased with an introductory price. This field does not indicate - // the subscription is currently in introductory price period. - IntroductoryPriceInfo *IntroductoryPriceInfo `json:"introductoryPriceInfo,omitempty"` + // NullFields is a list of field names (e.g. "DensityAlias") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} - // Kind: This kind represents a subscriptionPurchase object in the - // androidpublisher service. - Kind string `json:"kind,omitempty"` +func (s *ScreenDensity) MarshalJSON() ([]byte, error) { + type NoMethod ScreenDensity + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // LinkedPurchaseToken: The purchase token of the originating purchase - // if this subscription is one of the following: 0. Re-signup of a - // canceled but non-lapsed subscription 1. Upgrade/downgrade from a - // previous subscription For example, suppose a user originally signs up - // and you receive purchase token X, then the user cancels and goes - // through the resignup flow (before their subscription lapses) and you - // receive purchase token Y, and finally the user upgrades their - // subscription and you receive purchase token Z. If you call this API - // with purchase token Z, this field will be set to Y. If you call this - // API with purchase token Y, this field will be set to X. If you call - // this API with purchase token X, this field will not be set. - LinkedPurchaseToken string `json:"linkedPurchaseToken,omitempty"` +// ScreenDensityTargeting: Targeting based on screen density. +type ScreenDensityTargeting struct { + // Alternatives: Targeting of other sibling directories that were in the + // Bundle. For main splits this is targeting of other main splits. + Alternatives []*ScreenDensity `json:"alternatives,omitempty"` - // ObfuscatedExternalAccountId: An obfuscated version of the id that is - // uniquely associated with the user's account in your app. Present for - // the following purchases: * If account linking happened as part of the - // subscription purchase flow. * It was specified using - // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedaccountid - // when the purchase was made. - ObfuscatedExternalAccountId string `json:"obfuscatedExternalAccountId,omitempty"` + // Value: Value of a screen density. + Value []*ScreenDensity `json:"value,omitempty"` - // ObfuscatedExternalProfileId: An obfuscated version of the id that is - // uniquely associated with the user's profile in your app. Only present - // if specified using - // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedprofileid - // when the purchase was made. - ObfuscatedExternalProfileId string `json:"obfuscatedExternalProfileId,omitempty"` + // ForceSendFields is a list of field names (e.g. "Alternatives") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // OrderId: The order id of the latest recurring order associated with - // the purchase of the subscription. If the subscription was canceled - // because payment was declined, this will be the order id from the - // payment declined order. - OrderId string `json:"orderId,omitempty"` + // NullFields is a list of field names (e.g. "Alternatives") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} - // PaymentState: The payment state of the subscription. Possible values - // are: 0. Payment pending 1. Payment received 2. Free trial 3. Pending - // deferred upgrade/downgrade Not present for canceled, expired - // subscriptions. - PaymentState *int64 `json:"paymentState,omitempty"` +func (s *ScreenDensityTargeting) MarshalJSON() ([]byte, error) { + type NoMethod ScreenDensityTargeting + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // PriceAmountMicros: Price of the subscription, For tax exclusive - // countries, the price doesn't include tax. For tax inclusive - // countries, the price includes tax. Price is expressed in micro-units, - // where 1,000,000 micro-units represents one unit of the currency. For - // example, if the subscription price is €1.99, price_amount_micros is - // 1990000. - PriceAmountMicros int64 `json:"priceAmountMicros,omitempty,string"` +// SdkVersion: Represents an sdk version. +type SdkVersion struct { + // Min: Inclusive minimum value of an sdk version. + Min int64 `json:"min,omitempty"` - // PriceChange: The latest price change information available. This is - // present only when there is an upcoming price change for the - // subscription yet to be applied. Once the subscription renews with the - // new price or the subscription is canceled, no price change - // information will be returned. - PriceChange *SubscriptionPriceChange `json:"priceChange,omitempty"` + // ForceSendFields is a list of field names (e.g. "Min") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // PriceCurrencyCode: ISO 4217 currency code for the subscription price. - // For example, if the price is specified in British pounds sterling, - // price_currency_code is "GBP". - PriceCurrencyCode string `json:"priceCurrencyCode,omitempty"` + // NullFields is a list of field names (e.g. "Min") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} - // ProfileId: The Google profile id of the user when the subscription - // was purchased. Only present for purchases made with 'Subscribe with - // Google'. - ProfileId string `json:"profileId,omitempty"` +func (s *SdkVersion) MarshalJSON() ([]byte, error) { + type NoMethod SdkVersion + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // ProfileName: The profile name of the user when the subscription was - // purchased. Only present for purchases made with 'Subscribe with - // Google'. - ProfileName string `json:"profileName,omitempty"` +// SdkVersionTargeting: Targeting based on sdk version. +type SdkVersionTargeting struct { + // Alternatives: Targeting of other sibling directories that were in the + // Bundle. For main splits this is targeting of other main splits. + Alternatives []*SdkVersion `json:"alternatives,omitempty"` - // PromotionCode: The promotion code applied on this purchase. This - // field is only set if a vanity code promotion is applied when the - // subscription was purchased. - PromotionCode string `json:"promotionCode,omitempty"` + // Value: Value of an sdk version. + Value []*SdkVersion `json:"value,omitempty"` - // PromotionType: The type of promotion applied on this purchase. This - // field is only set if a promotion is applied when the subscription was - // purchased. Possible values are: 0. One time code 1. Vanity code - PromotionType int64 `json:"promotionType,omitempty"` + // ForceSendFields is a list of field names (e.g. "Alternatives") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // PurchaseType: The type of purchase of the subscription. This field is - // only set if this purchase was not made using the standard in-app - // billing flow. Possible values are: 0. Test (i.e. purchased from a - // license testing account) 1. Promo (i.e. purchased using a promo code) - PurchaseType *int64 `json:"purchaseType,omitempty"` + // NullFields is a list of field names (e.g. "Alternatives") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} - // StartTimeMillis: Time at which the subscription was granted, in - // milliseconds since the Epoch. - StartTimeMillis int64 `json:"startTimeMillis,omitempty,string"` +func (s *SdkVersionTargeting) MarshalJSON() ([]byte, error) { + type NoMethod SdkVersionTargeting + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // UserCancellationTimeMillis: The time at which the subscription was - // canceled by the user, in milliseconds since the epoch. Only present - // if cancelReason is 0. - UserCancellationTimeMillis int64 `json:"userCancellationTimeMillis,omitempty,string"` +// SplitApkMetadata: Holds data specific to Split APKs. +type SplitApkMetadata struct { + // IsMasterSplit: Indicates whether this APK is the main split of the + // module. + IsMasterSplit bool `json:"isMasterSplit,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // SplitId: Id of the split. + SplitId string `json:"splitId,omitempty"` - // ForceSendFields is a list of field names (e.g. - // "AcknowledgementState") to unconditionally include in API requests. - // By default, fields with empty or default values are omitted from API - // requests. However, any non-pointer, non-interface field appearing in - // ForceSendFields will be sent to the server regardless of whether the - // field is empty or not. This may be used to include empty fields in - // Patch requests. + // ForceSendFields is a list of field names (e.g. "IsMasterSplit") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AcknowledgementState") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "IsMasterSplit") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *SubscriptionPurchase) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionPurchase +func (s *SplitApkMetadata) MarshalJSON() ([]byte, error) { + type NoMethod SplitApkMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscriptionPurchaseLineItem: Item-level info for a subscription -// purchase. -type SubscriptionPurchaseLineItem struct { - // AutoRenewingPlan: The item is auto renewing. - AutoRenewingPlan *AutoRenewingPlan `json:"autoRenewingPlan,omitempty"` +// SplitApkVariant: Variant is a group of APKs that covers a part of the +// device configuration space. APKs from multiple variants are never +// combined on one device. +type SplitApkVariant struct { + // ApkSet: Set of APKs, one set per module. + ApkSet []*ApkSet `json:"apkSet,omitempty"` - // DeferredItemReplacement: Information for deferred item replacement. - DeferredItemReplacement *DeferredItemReplacement `json:"deferredItemReplacement,omitempty"` + // Targeting: Variant-level targeting. + Targeting *VariantTargeting `json:"targeting,omitempty"` - // ExpiryTime: Time at which the subscription expired or will expire - // unless the access is extended (ex. renews). - ExpiryTime string `json:"expiryTime,omitempty"` + // VariantNumber: Number of the variant, starting at 0 (unless + // overridden). A device will receive APKs from the first variant that + // matches the device configuration, with higher variant numbers having + // priority over lower variant numbers. + VariantNumber int64 `json:"variantNumber,omitempty"` - // OfferDetails: The offer details for this item. - OfferDetails *OfferDetails `json:"offerDetails,omitempty"` + // ForceSendFields is a list of field names (e.g. "ApkSet") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // PrepaidPlan: The item is prepaid. - PrepaidPlan *PrepaidPlan `json:"prepaidPlan,omitempty"` + // NullFields is a list of field names (e.g. "ApkSet") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} - // ProductId: The purchased product ID (for example, 'monthly001'). - ProductId string `json:"productId,omitempty"` +func (s *SplitApkVariant) MarshalJSON() ([]byte, error) { + type NoMethod SplitApkVariant + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // ForceSendFields is a list of field names (e.g. "AutoRenewingPlan") to +// StandaloneApkMetadata: Holds data specific to Standalone APKs. +type StandaloneApkMetadata struct { + // FusedModuleName: Names of the modules fused in this standalone APK. + FusedModuleName []string `json:"fusedModuleName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FusedModuleName") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6017,7 +6210,7 @@ type SubscriptionPurchaseLineItem struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AutoRenewingPlan") to + // NullFields is a list of field names (e.g. "FusedModuleName") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -6027,145 +6220,36 @@ type SubscriptionPurchaseLineItem struct { NullFields []string `json:"-"` } -func (s *SubscriptionPurchaseLineItem) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionPurchaseLineItem +func (s *StandaloneApkMetadata) MarshalJSON() ([]byte, error) { + type NoMethod StandaloneApkMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscriptionPurchaseV2: Indicates the status of a user's subscription -// purchase. -type SubscriptionPurchaseV2 struct { - // AcknowledgementState: The acknowledgement state of the subscription. - // - // Possible values: - // "ACKNOWLEDGEMENT_STATE_UNSPECIFIED" - Unspecified acknowledgement - // state. - // "ACKNOWLEDGEMENT_STATE_PENDING" - The subscription is not - // acknowledged yet. - // "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED" - The subscription is - // acknowledged. - AcknowledgementState string `json:"acknowledgementState,omitempty"` +// SubscribeWithGoogleInfo: Information associated with purchases made +// with 'Subscribe with Google'. +type SubscribeWithGoogleInfo struct { + // EmailAddress: The email address of the user when the subscription was + // purchased. + EmailAddress string `json:"emailAddress,omitempty"` - // CanceledStateContext: Additional context around canceled - // subscriptions. Only present if the subscription currently has - // subscription_state SUBSCRIPTION_STATE_CANCELED. - CanceledStateContext *CanceledStateContext `json:"canceledStateContext,omitempty"` + // FamilyName: The family name of the user when the subscription was + // purchased. + FamilyName string `json:"familyName,omitempty"` - // ExternalAccountIdentifiers: User account identifier in the - // third-party service. - ExternalAccountIdentifiers *ExternalAccountIdentifiers `json:"externalAccountIdentifiers,omitempty"` - - // Kind: This kind represents a SubscriptionPurchaseV2 object in the - // androidpublisher service. - Kind string `json:"kind,omitempty"` - - // LatestOrderId: The order id of the latest order associated with the - // purchase of the subscription. For autoRenewing subscription, this is - // the order id of signup order if it is not renewed yet, or the last - // recurring order id (success, pending, or declined order). For prepaid - // subscription, this is the order id associated with the queried - // purchase token. - LatestOrderId string `json:"latestOrderId,omitempty"` - - // LineItems: Item-level info for a subscription purchase. The items in - // the same purchase should be either all with AutoRenewingPlan or all - // with PrepaidPlan. - LineItems []*SubscriptionPurchaseLineItem `json:"lineItems,omitempty"` - - // LinkedPurchaseToken: The purchase token of the old subscription if - // this subscription is one of the following: * Re-signup of a canceled - // but non-lapsed subscription * Upgrade/downgrade from a previous - // subscription. * Convert from prepaid to auto renewing subscription. * - // Convert from an auto renewing subscription to prepaid. * Topup a - // prepaid subscription. - LinkedPurchaseToken string `json:"linkedPurchaseToken,omitempty"` - - // PausedStateContext: Additional context around paused subscriptions. - // Only present if the subscription currently has subscription_state - // SUBSCRIPTION_STATE_PAUSED. - PausedStateContext *PausedStateContext `json:"pausedStateContext,omitempty"` - - // RegionCode: ISO 3166-1 alpha-2 billing country/region code of the - // user at the time the subscription was granted. - RegionCode string `json:"regionCode,omitempty"` - - // StartTime: Time at which the subscription was granted. Not set for - // pending subscriptions (subscription was created but awaiting payment - // during signup). - StartTime string `json:"startTime,omitempty"` - - // SubscribeWithGoogleInfo: User profile associated with purchases made - // with 'Subscribe with Google'. - SubscribeWithGoogleInfo *SubscribeWithGoogleInfo `json:"subscribeWithGoogleInfo,omitempty"` - - // SubscriptionState: The current state of the subscription. - // - // Possible values: - // "SUBSCRIPTION_STATE_UNSPECIFIED" - Unspecified subscription state. - // "SUBSCRIPTION_STATE_PENDING" - Subscription was created but - // awaiting payment during signup. In this state, all items are awaiting - // payment. - // "SUBSCRIPTION_STATE_ACTIVE" - Subscription is active. - (1) If the - // subscription is an auto renewing plan, at least one item is - // auto_renew_enabled and not expired. - (2) If the subscription is a - // prepaid plan, at least one item is not expired. - // "SUBSCRIPTION_STATE_PAUSED" - Subscription is paused. The state is - // only available when the subscription is an auto renewing plan. In - // this state, all items are in paused state. - // "SUBSCRIPTION_STATE_IN_GRACE_PERIOD" - Subscription is in grace - // period. The state is only available when the subscription is an auto - // renewing plan. In this state, all items are in grace period. - // "SUBSCRIPTION_STATE_ON_HOLD" - Subscription is on hold (suspended). - // The state is only available when the subscription is an auto renewing - // plan. In this state, all items are on hold. - // "SUBSCRIPTION_STATE_CANCELED" - Subscription is canceled but not - // expired yet. The state is only available when the subscription is an - // auto renewing plan. All items have auto_renew_enabled set to false. - // "SUBSCRIPTION_STATE_EXPIRED" - Subscription is expired. All items - // have expiry_time in the past. - SubscriptionState string `json:"subscriptionState,omitempty"` - - // TestPurchase: Only present if this subscription purchase is a test - // purchase. - TestPurchase *TestPurchase `json:"testPurchase,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. - // "AcknowledgementState") to unconditionally include in API requests. - // By default, fields with empty or default values are omitted from API - // requests. However, any non-pointer, non-interface field appearing in - // ForceSendFields will be sent to the server regardless of whether the - // field is empty or not. This may be used to include empty fields in - // Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "AcknowledgementState") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} + // GivenName: The given name of the user when the subscription was + // purchased. + GivenName string `json:"givenName,omitempty"` -func (s *SubscriptionPurchaseV2) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionPurchaseV2 - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} + // ProfileId: The Google profile id of the user when the subscription + // was purchased. + ProfileId string `json:"profileId,omitempty"` -// SubscriptionPurchasesAcknowledgeRequest: Request for the -// purchases.subscriptions.acknowledge API. -type SubscriptionPurchasesAcknowledgeRequest struct { - // DeveloperPayload: Payload to attach to the purchase. - DeveloperPayload string `json:"developerPayload,omitempty"` + // ProfileName: The profile name of the user when the subscription was + // purchased. + ProfileName string `json:"profileName,omitempty"` - // ForceSendFields is a list of field names (e.g. "DeveloperPayload") to + // ForceSendFields is a list of field names (e.g. "EmailAddress") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6173,30 +6257,56 @@ type SubscriptionPurchasesAcknowledgeRequest struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DeveloperPayload") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "EmailAddress") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *SubscriptionPurchasesAcknowledgeRequest) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionPurchasesAcknowledgeRequest +func (s *SubscribeWithGoogleInfo) MarshalJSON() ([]byte, error) { + type NoMethod SubscribeWithGoogleInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscriptionPurchasesDeferRequest: Request for the -// purchases.subscriptions.defer API. -type SubscriptionPurchasesDeferRequest struct { - // DeferralInfo: The information about the new desired expiry time for - // the subscription. - DeferralInfo *SubscriptionDeferralInfo `json:"deferralInfo,omitempty"` +// Subscription: A single subscription for an app. +type Subscription struct { + // Archived: Output only. Whether this subscription is archived. + // Archived subscriptions are not available to any subscriber any + // longer, cannot be updated, and are not returned in list requests + // unless the show archived flag is passed in. + Archived bool `json:"archived,omitempty"` - // ForceSendFields is a list of field names (e.g. "DeferralInfo") to + // BasePlans: The set of base plans for this subscription. Represents + // the prices and duration of the subscription if no other offers apply. + BasePlans []*BasePlan `json:"basePlans,omitempty"` + + // Listings: Required. List of localized listings for this subscription. + // Must contain at least an entry for the default language of the parent + // app. + Listings []*SubscriptionListing `json:"listings,omitempty"` + + // PackageName: Immutable. Package name of the parent app. + PackageName string `json:"packageName,omitempty"` + + // ProductId: Immutable. Unique product ID of the product. Unique within + // the parent app. Product IDs must be composed of lower-case letters + // (a-z), numbers (0-9), underscores (_) and dots (.). It must start + // with a lower-case letter or number, and be between 1 and 40 + // (inclusive) characters in length. + ProductId string `json:"productId,omitempty"` + + // TaxAndComplianceSettings: Details about taxes and legal compliance. + TaxAndComplianceSettings *SubscriptionTaxAndComplianceSettings `json:"taxAndComplianceSettings,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Archived") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6204,33 +6314,36 @@ type SubscriptionPurchasesDeferRequest struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DeferralInfo") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Archived") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *SubscriptionPurchasesDeferRequest) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionPurchasesDeferRequest +func (s *Subscription) MarshalJSON() ([]byte, error) { + type NoMethod Subscription raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscriptionPurchasesDeferResponse: Response for the -// purchases.subscriptions.defer API. -type SubscriptionPurchasesDeferResponse struct { - // NewExpiryTimeMillis: The new expiry time for the subscription in - // milliseconds since the Epoch. - NewExpiryTimeMillis int64 `json:"newExpiryTimeMillis,omitempty,string"` +// SubscriptionCancelSurveyResult: Information provided by the user when +// they complete the subscription cancellation flow (cancellation reason +// survey). +type SubscriptionCancelSurveyResult struct { + // CancelSurveyReason: The cancellation reason the user chose in the + // survey. Possible values are: 0. Other 1. I don't use this service + // enough 2. Technical issues 3. Cost-related reasons 4. I found a + // better app + CancelSurveyReason int64 `json:"cancelSurveyReason,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // UserInputCancelReason: The customized input cancel reason from the + // user. Only present when cancelReason is 0. + UserInputCancelReason string `json:"userInputCancelReason,omitempty"` - // ForceSendFields is a list of field names (e.g. "NewExpiryTimeMillis") + // ForceSendFields is a list of field names (e.g. "CancelSurveyReason") // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6238,7 +6351,7 @@ type SubscriptionPurchasesDeferResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "NewExpiryTimeMillis") to + // NullFields is a list of field names (e.g. "CancelSurveyReason") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -6248,46 +6361,36 @@ type SubscriptionPurchasesDeferResponse struct { NullFields []string `json:"-"` } -func (s *SubscriptionPurchasesDeferResponse) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionPurchasesDeferResponse +func (s *SubscriptionCancelSurveyResult) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionCancelSurveyResult raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscriptionTaxAndComplianceSettings: Details about taxation, Google -// Play policy and legal compliance for subscription products. -type SubscriptionTaxAndComplianceSettings struct { - // EeaWithdrawalRightType: Digital content or service classification for - // products distributed to users in the European Economic Area (EEA). - // The withdrawal regime under EEA consumer laws depends on this - // classification. Refer to the Help Center article - // (https://support.google.com/googleplay/android-developer/answer/10463498) - // for more information. - // - // Possible values: - // "WITHDRAWAL_RIGHT_TYPE_UNSPECIFIED" - // "WITHDRAWAL_RIGHT_DIGITAL_CONTENT" - // "WITHDRAWAL_RIGHT_SERVICE" - EeaWithdrawalRightType string `json:"eeaWithdrawalRightType,omitempty"` - - // IsTokenizedDigitalAsset: Whether this subscription is declared as a - // product representing a tokenized digital asset. - IsTokenizedDigitalAsset bool `json:"isTokenizedDigitalAsset,omitempty"` +// SubscriptionDeferralInfo: A SubscriptionDeferralInfo contains the +// data needed to defer a subscription purchase to a future expiry time. +type SubscriptionDeferralInfo struct { + // DesiredExpiryTimeMillis: The desired next expiry time to assign to + // the subscription, in milliseconds since the Epoch. The given time + // must be later/greater than the current expiry time for the + // subscription. + DesiredExpiryTimeMillis int64 `json:"desiredExpiryTimeMillis,omitempty,string"` - // TaxRateInfoByRegionCode: A mapping from region code to tax rate - // details. The keys are region codes as defined by Unicode's "CLDR". - TaxRateInfoByRegionCode map[string]RegionalTaxRateInfo `json:"taxRateInfoByRegionCode,omitempty"` + // ExpectedExpiryTimeMillis: The expected expiry time for the + // subscription. If the current expiry time for the subscription is not + // the value specified here, the deferral will not occur. + ExpectedExpiryTimeMillis int64 `json:"expectedExpiryTimeMillis,omitempty,string"` // ForceSendFields is a list of field names (e.g. - // "EeaWithdrawalRightType") to unconditionally include in API requests. - // By default, fields with empty or default values are omitted from API - // requests. However, any non-pointer, non-interface field appearing in - // ForceSendFields will be sent to the server regardless of whether the - // field is empty or not. This may be used to include empty fields in - // Patch requests. + // "DesiredExpiryTimeMillis") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "EeaWithdrawalRightType") + // NullFields is a list of field names (e.g. "DesiredExpiryTimeMillis") // to include in API requests with the JSON null value. By default, // fields with empty values are omitted from API requests. However, any // field with an empty value appearing in NullFields will be sent to the @@ -6297,26 +6400,94 @@ type SubscriptionTaxAndComplianceSettings struct { NullFields []string `json:"-"` } -func (s *SubscriptionTaxAndComplianceSettings) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionTaxAndComplianceSettings +func (s *SubscriptionDeferralInfo) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionDeferralInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SystemApkOptions: Options for system APKs. -type SystemApkOptions struct { - // Rotated: Whether to use the rotated key for signing the system APK. - Rotated bool `json:"rotated,omitempty"` +// SubscriptionItemPriceChangeDetails: Price change related information +// of a subscription item. +type SubscriptionItemPriceChangeDetails struct { + // ExpectedNewPriceChargeTime: The renewal time at which the price + // change will become effective for the user. This is subject to + // change(to a future time) due to cases where the renewal time shifts + // like pause. This field is only populated if the price change has not + // taken effect. + ExpectedNewPriceChargeTime string `json:"expectedNewPriceChargeTime,omitempty"` - // UncompressedDexFiles: Whether system APK was generated with - // uncompressed dex files. - UncompressedDexFiles bool `json:"uncompressedDexFiles,omitempty"` + // NewPrice: New recurring price for the subscription item. + NewPrice *Money `json:"newPrice,omitempty"` - // UncompressedNativeLibraries: Whether system APK was generated with - // uncompressed native libraries. - UncompressedNativeLibraries bool `json:"uncompressedNativeLibraries,omitempty"` + // PriceChangeMode: Price change mode specifies how the subscription + // item price is changing. + // + // Possible values: + // "PRICE_CHANGE_MODE_UNSPECIFIED" - Price change mode unspecified. + // This value should never be set. + // "PRICE_DECREASE" - If the subscription price is decreasing. + // "PRICE_INCREASE" - If the subscription price is increasing and the + // user needs to accept it. + // "OPT_OUT_PRICE_INCREASE" - If the subscription price is increasing + // with opt out mode. + PriceChangeMode string `json:"priceChangeMode,omitempty"` - // ForceSendFields is a list of field names (e.g. "Rotated") to + // PriceChangeState: State the price change is currently in. + // + // Possible values: + // "PRICE_CHANGE_STATE_UNSPECIFIED" - Price change state unspecified. + // This value should not be used. + // "OUTSTANDING" - Waiting for the user to agree for the price change. + // "CONFIRMED" - The price change is confirmed to happen for the user. + // "APPLIED" - The price change is applied, i.e. the user has started + // being charged the new price. + PriceChangeState string `json:"priceChangeState,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "ExpectedNewPriceChargeTime") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. + // "ExpectedNewPriceChargeTime") to include in API requests with the + // JSON null value. By default, fields with empty values are omitted + // from API requests. However, any field with an empty value appearing + // in NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *SubscriptionItemPriceChangeDetails) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionItemPriceChangeDetails + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SubscriptionListing: The consumer-visible metadata of a subscription. +type SubscriptionListing struct { + // Benefits: A list of benefits shown to the user on platforms such as + // the Play Store and in restoration flows in the language of this + // listing. Plain text. Ordered list of at most four benefits. + Benefits []string `json:"benefits,omitempty"` + + // Description: The description of this subscription in the language of + // this listing. Maximum length - 80 characters. Plain text. + Description string `json:"description,omitempty"` + + // LanguageCode: Required. The language of this listing, as defined by + // BCP-47, e.g. "en-US". + LanguageCode string `json:"languageCode,omitempty"` + + // Title: Required. The title of this subscription in the language of + // this listing. Plain text. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Benefits") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6324,7 +6495,7 @@ type SystemApkOptions struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Rotated") to include in + // NullFields is a list of field names (e.g. "Benefits") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -6333,23 +6504,74 @@ type SystemApkOptions struct { NullFields []string `json:"-"` } -func (s *SystemApkOptions) MarshalJSON() ([]byte, error) { - type NoMethod SystemApkOptions +func (s *SubscriptionListing) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionListing raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SystemApksListResponse: Response to list previously created system -// APK variants. -type SystemApksListResponse struct { - // Variants: All system APK variants created. - Variants []*Variant `json:"variants,omitempty"` +// SubscriptionOffer: A single, temporary offer +type SubscriptionOffer struct { + // BasePlanId: Required. Immutable. The ID of the base plan to which + // this offer is an extension. + BasePlanId string `json:"basePlanId,omitempty"` + + // OfferId: Required. Immutable. Unique ID of this subscription offer. + // Must be unique within the base plan. + OfferId string `json:"offerId,omitempty"` + + // OfferTags: List of up to 20 custom tags specified for this offer, and + // returned to the app through the billing library. + OfferTags []*OfferTag `json:"offerTags,omitempty"` + + // OtherRegionsConfig: The configuration for any new locations Play may + // launch in the future. + OtherRegionsConfig *OtherRegionsSubscriptionOfferConfig `json:"otherRegionsConfig,omitempty"` + + // PackageName: Required. Immutable. The package name of the app the + // parent subscription belongs to. + PackageName string `json:"packageName,omitempty"` + + // Phases: Required. The phases of this subscription offer. Must contain + // at least one entry, and may contain at most five. Users will always + // receive all these phases in the specified order. Phases may not be + // added, removed, or reordered after initial creation. + Phases []*SubscriptionOfferPhase `json:"phases,omitempty"` + + // ProductId: Required. Immutable. The ID of the parent subscription + // this offer belongs to. + ProductId string `json:"productId,omitempty"` + + // RegionalConfigs: Required. The region-specific configuration of this + // offer. Must contain at least one entry. + RegionalConfigs []*RegionalSubscriptionOfferConfig `json:"regionalConfigs,omitempty"` + + // State: Output only. The current state of this offer. Can be changed + // using Activate and Deactivate actions. NB: the base plan state + // supersedes this state, so an active offer may not be available if the + // base plan is not active. + // + // Possible values: + // "STATE_UNSPECIFIED" - Default value, should never be used. + // "DRAFT" - The subscription offer is not and has never been + // available to users. + // "ACTIVE" - The subscription offer is available to new and existing + // users. + // "INACTIVE" - The subscription offer is not available to new users. + // Existing users retain access. + State string `json:"state,omitempty"` + + // Targeting: The requirements that users need to fulfil to be eligible + // for this offer. Represents the requirements that Play will evaluate + // to decide whether an offer should be returned. Developers may further + // filter these offers themselves. + Targeting *SubscriptionOfferTargeting `json:"targeting,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Variants") to + // ForceSendFields is a list of field names (e.g. "BasePlanId") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6357,7 +6579,7 @@ type SystemApksListResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Variants") to include in + // NullFields is a list of field names (e.g. "BasePlanId") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -6366,18 +6588,33 @@ type SystemApksListResponse struct { NullFields []string `json:"-"` } -func (s *SystemApksListResponse) MarshalJSON() ([]byte, error) { - type NoMethod SystemApksListResponse +func (s *SubscriptionOffer) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionOffer raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SystemFeature: Representation of a system feature. -type SystemFeature struct { - // Name: The name of the feature. - Name string `json:"name,omitempty"` +// SubscriptionOfferPhase: A single phase of a subscription offer. +type SubscriptionOfferPhase struct { + // Duration: Required. The duration of a single recurrence of this + // phase. Specified in ISO 8601 format. + Duration string `json:"duration,omitempty"` - // ForceSendFields is a list of field names (e.g. "Name") to + // OtherRegionsConfig: Pricing information for any new locations Play + // may launch in. + OtherRegionsConfig *OtherRegionsSubscriptionOfferPhaseConfig `json:"otherRegionsConfig,omitempty"` + + // RecurrenceCount: Required. The number of times this phase repeats. If + // this offer phase is not free, each recurrence charges the user the + // price of this offer phase. + RecurrenceCount int64 `json:"recurrenceCount,omitempty"` + + // RegionalConfigs: Required. The region-specific configuration of this + // offer phase. This list must contain exactly one entry for each region + // for which the subscription offer has a regional config. + RegionalConfigs []*RegionalSubscriptionOfferPhaseConfig `json:"regionalConfigs,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Duration") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6385,8 +6622,8 @@ type SystemFeature struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Name") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Duration") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -6394,29 +6631,23 @@ type SystemFeature struct { NullFields []string `json:"-"` } -func (s *SystemFeature) MarshalJSON() ([]byte, error) { - type NoMethod SystemFeature +func (s *SubscriptionOfferPhase) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionOfferPhase raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SystemInitiatedCancellation: Information specific to cancellations -// initiated by Google system. -type SystemInitiatedCancellation struct { -} - -// TargetingInfo: Targeting information about the generated apks. -type TargetingInfo struct { - // AssetSliceSet: List of created asset slices. - AssetSliceSet []*AssetSliceSet `json:"assetSliceSet,omitempty"` - - // PackageName: The package name of this app. - PackageName string `json:"packageName,omitempty"` +// SubscriptionOfferTargeting: Defines the rule a user needs to satisfy +// to receive this offer. +type SubscriptionOfferTargeting struct { + // AcquisitionRule: Offer targeting rule for new user acquisition. + AcquisitionRule *AcquisitionTargetingRule `json:"acquisitionRule,omitempty"` - // Variant: List of the created variants. - Variant []*SplitApkVariant `json:"variant,omitempty"` + // UpgradeRule: Offer targeting rule for upgrading users' existing + // plans. + UpgradeRule *UpgradeTargetingRule `json:"upgradeRule,omitempty"` - // ForceSendFields is a list of field names (e.g. "AssetSliceSet") to + // ForceSendFields is a list of field names (e.g. "AcquisitionRule") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6424,112 +6655,43 @@ type TargetingInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AssetSliceSet") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "AcquisitionRule") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *TargetingInfo) MarshalJSON() ([]byte, error) { - type NoMethod TargetingInfo +func (s *SubscriptionOfferTargeting) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionOfferTargeting raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// TargetingRuleScope: Defines the scope of subscriptions which a -// targeting rule can match to target offers to users based on past or -// current entitlement. -type TargetingRuleScope struct { - // SpecificSubscriptionInApp: The scope of the current targeting rule is - // the subscription with the specified subscription ID. Must be a - // subscription within the same parent app. - SpecificSubscriptionInApp string `json:"specificSubscriptionInApp,omitempty"` - - // ForceSendFields is a list of field names (e.g. - // "SpecificSubscriptionInApp") to unconditionally include in API - // requests. By default, fields with empty or default values are omitted - // from API requests. However, any non-pointer, non-interface field - // appearing in ForceSendFields will be sent to the server regardless of - // whether the field is empty or not. This may be used to include empty - // fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. - // "SpecificSubscriptionInApp") to include in API requests with the JSON - // null value. By default, fields with empty values are omitted from API - // requests. However, any field with an empty value appearing in - // NullFields will be sent to the server as null. It is an error if a - // field in this list has a non-empty value. This may be used to include - // null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *TargetingRuleScope) MarshalJSON() ([]byte, error) { - type NoMethod TargetingRuleScope - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// TestPurchase: Whether this subscription purchase is a test purchase. -type TestPurchase struct { -} - -// Testers: The testers of an app. The resource for TestersService. -// Note: while it is possible in the Play Console UI to add testers via -// email lists, email lists are not supported by this resource. -type Testers struct { - // GoogleGroups: All testing Google Groups, as email addresses. - GoogleGroups []string `json:"googleGroups,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "GoogleGroups") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "GoogleGroups") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *Testers) MarshalJSON() ([]byte, error) { - type NoMethod Testers - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} +// SubscriptionPriceChange: Contains the price change information for a +// subscription that can be used to control the user journey for the +// price change in the app. This can be in the form of seeking +// confirmation from the user or tailoring the experience for a +// successful conversion. +type SubscriptionPriceChange struct { + // NewPrice: The new price the subscription will renew with if the price + // change is accepted by the user. + NewPrice *Price `json:"newPrice,omitempty"` -// TextureCompressionFormat: Represents texture compression format. -type TextureCompressionFormat struct { - // Alias: Alias for texture compression format. - // - // Possible values: - // "UNSPECIFIED_TEXTURE_COMPRESSION_FORMAT" - Unspecified format. - // "ETC1_RGB8" - ETC1_RGB8 format. - // "PALETTED" - PALETTED format. - // "THREE_DC" - THREE_DC format. - // "ATC" - ATC format. - // "LATC" - LATC format. - // "DXT1" - DXT1 format. - // "S3TC" - S3TC format. - // "PVRTC" - PVRTC format. - // "ASTC" - ASTC format. - // "ETC2" - ETC2 format. - Alias string `json:"alias,omitempty"` + // State: The current state of the price change. Possible values are: 0. + // Outstanding: State for a pending price change waiting for the user to + // agree. In this state, you can optionally seek confirmation from the + // user using the In-App API. 1. Accepted: State for an accepted price + // change that the subscription will renew with unless it's canceled. + // The price change takes effect on a future date when the subscription + // renews. Note that the change might not occur when the subscription is + // renewed next. + State int64 `json:"state,omitempty"` - // ForceSendFields is a list of field names (e.g. "Alias") to + // ForceSendFields is a list of field names (e.g. "NewPrice") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6537,8 +6699,8 @@ type TextureCompressionFormat struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Alias") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "NewPrice") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -6546,237 +6708,230 @@ type TextureCompressionFormat struct { NullFields []string `json:"-"` } -func (s *TextureCompressionFormat) MarshalJSON() ([]byte, error) { - type NoMethod TextureCompressionFormat +func (s *SubscriptionPriceChange) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionPriceChange raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// TextureCompressionFormatTargeting: Targeting by a texture compression -// format. -type TextureCompressionFormatTargeting struct { - // Alternatives: List of alternative TCFs (TCFs targeted by the sibling - // splits). - Alternatives []*TextureCompressionFormat `json:"alternatives,omitempty"` - - // Value: The list of targeted TCFs. Should not be empty. - Value []*TextureCompressionFormat `json:"value,omitempty"` +// SubscriptionPurchase: A SubscriptionPurchase resource indicates the +// status of a user's subscription purchase. +type SubscriptionPurchase struct { + // AcknowledgementState: The acknowledgement state of the subscription + // product. Possible values are: 0. Yet to be acknowledged 1. + // Acknowledged + AcknowledgementState int64 `json:"acknowledgementState,omitempty"` - // ForceSendFields is a list of field names (e.g. "Alternatives") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` + // AutoRenewing: Whether the subscription will automatically be renewed + // when it reaches its current expiry time. + AutoRenewing bool `json:"autoRenewing,omitempty"` - // NullFields is a list of field names (e.g. "Alternatives") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} + // AutoResumeTimeMillis: Time at which the subscription will be + // automatically resumed, in milliseconds since the Epoch. Only present + // if the user has requested to pause the subscription. + AutoResumeTimeMillis int64 `json:"autoResumeTimeMillis,omitempty,string"` -func (s *TextureCompressionFormatTargeting) MarshalJSON() ([]byte, error) { - type NoMethod TextureCompressionFormatTargeting - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} + // CancelReason: The reason why a subscription was canceled or is not + // auto-renewing. Possible values are: 0. User canceled the subscription + // 1. Subscription was canceled by the system, for example because of a + // billing problem 2. Subscription was replaced with a new subscription + // 3. Subscription was canceled by the developer + CancelReason int64 `json:"cancelReason,omitempty"` -// Timestamp: A Timestamp represents a point in time independent of any -// time zone or local calendar, encoded as a count of seconds and -// fractions of seconds at nanosecond resolution. The count is relative -// to an epoch at UTC midnight on January 1, 1970. -type Timestamp struct { - // Nanos: Non-negative fractions of a second at nanosecond resolution. - // Must be from 0 to 999,999,999 inclusive. - Nanos int64 `json:"nanos,omitempty"` + // CancelSurveyResult: Information provided by the user when they + // complete the subscription cancellation flow (cancellation reason + // survey). + CancelSurveyResult *SubscriptionCancelSurveyResult `json:"cancelSurveyResult,omitempty"` - // Seconds: Represents seconds of UTC time since Unix epoch. - Seconds int64 `json:"seconds,omitempty,string"` + // CountryCode: ISO 3166-1 alpha-2 billing country/region code of the + // user at the time the subscription was granted. + CountryCode string `json:"countryCode,omitempty"` - // ForceSendFields is a list of field names (e.g. "Nanos") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` + // DeveloperPayload: A developer-specified string that contains + // supplemental information about an order. + DeveloperPayload string `json:"developerPayload,omitempty"` - // NullFields is a list of field names (e.g. "Nanos") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} + // EmailAddress: The email address of the user when the subscription was + // purchased. Only present for purchases made with 'Subscribe with + // Google'. + EmailAddress string `json:"emailAddress,omitempty"` -func (s *Timestamp) MarshalJSON() ([]byte, error) { - type NoMethod Timestamp - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} + // ExpiryTimeMillis: Time at which the subscription will expire, in + // milliseconds since the Epoch. + ExpiryTimeMillis int64 `json:"expiryTimeMillis,omitempty,string"` -// TokenPagination: Pagination information returned by a List operation -// when token pagination is enabled. List operations that supports -// paging return only one "page" of results. This protocol buffer -// message describes the page that has been returned. When using token -// pagination, clients should use the next/previous token to get another -// page of the result. The presence or absence of next/previous token -// indicates whether a next/previous page is available and provides a -// mean of accessing this page. ListRequest.page_token should be set to -// either next_page_token or previous_page_token to access another page. -type TokenPagination struct { - // NextPageToken: Tokens to pass to the standard list field - // 'page_token'. Whenever available, tokens are preferred over - // manipulating start_index. - NextPageToken string `json:"nextPageToken,omitempty"` + // ExternalAccountId: User account identifier in the third-party + // service. Only present if account linking happened as part of the + // subscription purchase flow. + ExternalAccountId string `json:"externalAccountId,omitempty"` - PreviousPageToken string `json:"previousPageToken,omitempty"` + // FamilyName: The family name of the user when the subscription was + // purchased. Only present for purchases made with 'Subscribe with + // Google'. + FamilyName string `json:"familyName,omitempty"` - // ForceSendFields is a list of field names (e.g. "NextPageToken") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` + // GivenName: The given name of the user when the subscription was + // purchased. Only present for purchases made with 'Subscribe with + // Google'. + GivenName string `json:"givenName,omitempty"` - // NullFields is a list of field names (e.g. "NextPageToken") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} + // IntroductoryPriceInfo: Introductory price information of the + // subscription. This is only present when the subscription was + // purchased with an introductory price. This field does not indicate + // the subscription is currently in introductory price period. + IntroductoryPriceInfo *IntroductoryPriceInfo `json:"introductoryPriceInfo,omitempty"` -func (s *TokenPagination) MarshalJSON() ([]byte, error) { - type NoMethod TokenPagination - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} + // Kind: This kind represents a subscriptionPurchase object in the + // androidpublisher service. + Kind string `json:"kind,omitempty"` -// Track: A track configuration. The resource for TracksService. -type Track struct { - // Releases: In a read request, represents all active releases in the - // track. In an update request, represents desired changes. - Releases []*TrackRelease `json:"releases,omitempty"` + // LinkedPurchaseToken: The purchase token of the originating purchase + // if this subscription is one of the following: 0. Re-signup of a + // canceled but non-lapsed subscription 1. Upgrade/downgrade from a + // previous subscription For example, suppose a user originally signs up + // and you receive purchase token X, then the user cancels and goes + // through the resignup flow (before their subscription lapses) and you + // receive purchase token Y, and finally the user upgrades their + // subscription and you receive purchase token Z. If you call this API + // with purchase token Z, this field will be set to Y. If you call this + // API with purchase token Y, this field will be set to X. If you call + // this API with purchase token X, this field will not be set. + LinkedPurchaseToken string `json:"linkedPurchaseToken,omitempty"` - // Track: Identifier of the track. Form factor tracks have a special - // prefix as an identifier, for example `wear:production`, - // `automotive:production`. More on track name - // (https://developers.google.com/android-publisher/tracks#ff-track-name) - Track string `json:"track,omitempty"` + // ObfuscatedExternalAccountId: An obfuscated version of the id that is + // uniquely associated with the user's account in your app. Present for + // the following purchases: * If account linking happened as part of the + // subscription purchase flow. * It was specified using + // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedaccountid + // when the purchase was made. + ObfuscatedExternalAccountId string `json:"obfuscatedExternalAccountId,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // ObfuscatedExternalProfileId: An obfuscated version of the id that is + // uniquely associated with the user's profile in your app. Only present + // if specified using + // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedprofileid + // when the purchase was made. + ObfuscatedExternalProfileId string `json:"obfuscatedExternalProfileId,omitempty"` - // ForceSendFields is a list of field names (e.g. "Releases") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` + // OrderId: The order id of the latest recurring order associated with + // the purchase of the subscription. If the subscription was canceled + // because payment was declined, this will be the order id from the + // payment declined order. + OrderId string `json:"orderId,omitempty"` - // NullFields is a list of field names (e.g. "Releases") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} + // PaymentState: The payment state of the subscription. Possible values + // are: 0. Payment pending 1. Payment received 2. Free trial 3. Pending + // deferred upgrade/downgrade Not present for canceled, expired + // subscriptions. + PaymentState *int64 `json:"paymentState,omitempty"` -func (s *Track) MarshalJSON() ([]byte, error) { - type NoMethod Track - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} + // PriceAmountMicros: Price of the subscription, For tax exclusive + // countries, the price doesn't include tax. For tax inclusive + // countries, the price includes tax. Price is expressed in micro-units, + // where 1,000,000 micro-units represents one unit of the currency. For + // example, if the subscription price is €1.99, price_amount_micros is + // 1990000. + PriceAmountMicros int64 `json:"priceAmountMicros,omitempty,string"` -// TrackConfig: Configurations of the new track. -type TrackConfig struct { - // FormFactor: Required. Form factor of the new track. Defaults to the - // default track. - // - // Possible values: - // "FORM_FACTOR_UNSPECIFIED" - Fallback value, do not use. - // "DEFAULT" - Default track. - // "WEAR" - Wear form factor track. - // "AUTOMOTIVE" - Automotive form factor track. - FormFactor string `json:"formFactor,omitempty"` + // PriceChange: The latest price change information available. This is + // present only when there is an upcoming price change for the + // subscription yet to be applied. Once the subscription renews with the + // new price or the subscription is canceled, no price change + // information will be returned. + PriceChange *SubscriptionPriceChange `json:"priceChange,omitempty"` - // Track: Required. Identifier of the new track. For default tracks, - // this field consists of the track alias only. Form factor tracks have - // a special prefix as an identifier, for example `wear:production`, - // `automotive:production`. This prefix must match the value of the - // `form_factor` field, if it is not a default track. More on track name - // (https://developers.google.com/android-publisher/tracks#ff-track-name) - Track string `json:"track,omitempty"` + // PriceCurrencyCode: ISO 4217 currency code for the subscription price. + // For example, if the price is specified in British pounds sterling, + // price_currency_code is "GBP". + PriceCurrencyCode string `json:"priceCurrencyCode,omitempty"` - // Type: Required. Type of the new track. Currently, the only supported - // value is closedTesting. - // - // Possible values: - // "TRACK_TYPE_UNSPECIFIED" - Fallback value, do not use. - // "CLOSED_TESTING" - Closed testing track. - Type string `json:"type,omitempty"` + // ProfileId: The Google profile id of the user when the subscription + // was purchased. Only present for purchases made with 'Subscribe with + // Google'. + ProfileId string `json:"profileId,omitempty"` - // ForceSendFields is a list of field names (e.g. "FormFactor") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. + // ProfileName: The profile name of the user when the subscription was + // purchased. Only present for purchases made with 'Subscribe with + // Google'. + ProfileName string `json:"profileName,omitempty"` + + // PromotionCode: The promotion code applied on this purchase. This + // field is only set if a vanity code promotion is applied when the + // subscription was purchased. + PromotionCode string `json:"promotionCode,omitempty"` + + // PromotionType: The type of promotion applied on this purchase. This + // field is only set if a promotion is applied when the subscription was + // purchased. Possible values are: 0. One time code 1. Vanity code + PromotionType int64 `json:"promotionType,omitempty"` + + // PurchaseType: The type of purchase of the subscription. This field is + // only set if this purchase was not made using the standard in-app + // billing flow. Possible values are: 0. Test (i.e. purchased from a + // license testing account) 1. Promo (i.e. purchased using a promo code) + PurchaseType *int64 `json:"purchaseType,omitempty"` + + // StartTimeMillis: Time at which the subscription was granted, in + // milliseconds since the Epoch. + StartTimeMillis int64 `json:"startTimeMillis,omitempty,string"` + + // UserCancellationTimeMillis: The time at which the subscription was + // canceled by the user, in milliseconds since the epoch. Only present + // if cancelReason is 0. + UserCancellationTimeMillis int64 `json:"userCancellationTimeMillis,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "AcknowledgementState") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "FormFactor") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "AcknowledgementState") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *TrackConfig) MarshalJSON() ([]byte, error) { - type NoMethod TrackConfig +func (s *SubscriptionPurchase) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionPurchase raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// TrackCountryAvailability: Resource for per-track country availability -// information. -type TrackCountryAvailability struct { - // Countries: A list of one or more countries where artifacts in this - // track are available. This list includes all countries that are - // targeted by the track, even if only specific carriers are targeted in - // that country. - Countries []*TrackTargetedCountry `json:"countries,omitempty"` +// SubscriptionPurchaseLineItem: Item-level info for a subscription +// purchase. +type SubscriptionPurchaseLineItem struct { + // AutoRenewingPlan: The item is auto renewing. + AutoRenewingPlan *AutoRenewingPlan `json:"autoRenewingPlan,omitempty"` - // RestOfWorld: Whether artifacts in this track are available to "rest - // of the world" countries. - RestOfWorld bool `json:"restOfWorld,omitempty"` + // DeferredItemReplacement: Information for deferred item replacement. + DeferredItemReplacement *DeferredItemReplacement `json:"deferredItemReplacement,omitempty"` - // SyncWithProduction: Whether this track's availability is synced with - // the default production track. See - // https://support.google.com/googleplay/android-developer/answer/7550024 - // for more information on syncing country availability with production. - // Note that if this is true, the returned "countries" and - // "rest_of_world" fields will reflect the values for the default - // production track. - SyncWithProduction bool `json:"syncWithProduction,omitempty"` + // ExpiryTime: Time at which the subscription expired or will expire + // unless the access is extended (ex. renews). + ExpiryTime string `json:"expiryTime,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // OfferDetails: The offer details for this item. + OfferDetails *OfferDetails `json:"offerDetails,omitempty"` - // ForceSendFields is a list of field names (e.g. "Countries") to + // PrepaidPlan: The item is prepaid. + PrepaidPlan *PrepaidPlan `json:"prepaidPlan,omitempty"` + + // ProductId: The purchased product ID (for example, 'monthly001'). + ProductId string `json:"productId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AutoRenewingPlan") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6784,74 +6939,133 @@ type TrackCountryAvailability struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Countries") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "AutoRenewingPlan") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *TrackCountryAvailability) MarshalJSON() ([]byte, error) { - type NoMethod TrackCountryAvailability +func (s *SubscriptionPurchaseLineItem) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionPurchaseLineItem raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// TrackRelease: A release within a track. -type TrackRelease struct { - // CountryTargeting: Restricts a release to a specific set of countries. - CountryTargeting *CountryTargeting `json:"countryTargeting,omitempty"` - - // InAppUpdatePriority: In-app update priority of the release. All newly - // added APKs in the release will be considered at this priority. Can - // take values in the range [0, 5], with 5 the highest priority. - // Defaults to 0. in_app_update_priority can not be updated once the - // release is rolled out. See - // https://developer.android.com/guide/playcore/in-app-updates. - InAppUpdatePriority int64 `json:"inAppUpdatePriority,omitempty"` +// SubscriptionPurchaseV2: Indicates the status of a user's subscription +// purchase. +type SubscriptionPurchaseV2 struct { + // AcknowledgementState: The acknowledgement state of the subscription. + // + // Possible values: + // "ACKNOWLEDGEMENT_STATE_UNSPECIFIED" - Unspecified acknowledgement + // state. + // "ACKNOWLEDGEMENT_STATE_PENDING" - The subscription is not + // acknowledged yet. + // "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED" - The subscription is + // acknowledged. + AcknowledgementState string `json:"acknowledgementState,omitempty"` - // Name: The release name. Not required to be unique. If not set, the - // name is generated from the APK's version_name. If the release - // contains multiple APKs, the name is generated from the date. - Name string `json:"name,omitempty"` + // CanceledStateContext: Additional context around canceled + // subscriptions. Only present if the subscription currently has + // subscription_state SUBSCRIPTION_STATE_CANCELED. + CanceledStateContext *CanceledStateContext `json:"canceledStateContext,omitempty"` - // ReleaseNotes: A description of what is new in this release. - ReleaseNotes []*LocalizedText `json:"releaseNotes,omitempty"` + // ExternalAccountIdentifiers: User account identifier in the + // third-party service. + ExternalAccountIdentifiers *ExternalAccountIdentifiers `json:"externalAccountIdentifiers,omitempty"` - // Status: The status of the release. + // Kind: This kind represents a SubscriptionPurchaseV2 object in the + // androidpublisher service. + Kind string `json:"kind,omitempty"` + + // LatestOrderId: The order id of the latest order associated with the + // purchase of the subscription. For autoRenewing subscription, this is + // the order id of signup order if it is not renewed yet, or the last + // recurring order id (success, pending, or declined order). For prepaid + // subscription, this is the order id associated with the queried + // purchase token. + LatestOrderId string `json:"latestOrderId,omitempty"` + + // LineItems: Item-level info for a subscription purchase. The items in + // the same purchase should be either all with AutoRenewingPlan or all + // with PrepaidPlan. + LineItems []*SubscriptionPurchaseLineItem `json:"lineItems,omitempty"` + + // LinkedPurchaseToken: The purchase token of the old subscription if + // this subscription is one of the following: * Re-signup of a canceled + // but non-lapsed subscription * Upgrade/downgrade from a previous + // subscription. * Convert from prepaid to auto renewing subscription. * + // Convert from an auto renewing subscription to prepaid. * Topup a + // prepaid subscription. + LinkedPurchaseToken string `json:"linkedPurchaseToken,omitempty"` + + // PausedStateContext: Additional context around paused subscriptions. + // Only present if the subscription currently has subscription_state + // SUBSCRIPTION_STATE_PAUSED. + PausedStateContext *PausedStateContext `json:"pausedStateContext,omitempty"` + + // RegionCode: ISO 3166-1 alpha-2 billing country/region code of the + // user at the time the subscription was granted. + RegionCode string `json:"regionCode,omitempty"` + + // StartTime: Time at which the subscription was granted. Not set for + // pending subscriptions (subscription was created but awaiting payment + // during signup). + StartTime string `json:"startTime,omitempty"` + + // SubscribeWithGoogleInfo: User profile associated with purchases made + // with 'Subscribe with Google'. + SubscribeWithGoogleInfo *SubscribeWithGoogleInfo `json:"subscribeWithGoogleInfo,omitempty"` + + // SubscriptionState: The current state of the subscription. // // Possible values: - // "statusUnspecified" - Unspecified status. - // "draft" - The release's APKs are not being served to users. - // "inProgress" - The release's APKs are being served to a fraction of - // users, determined by 'user_fraction'. - // "halted" - The release's APKs will no longer be served to users. - // Users who already have these APKs are unaffected. - // "completed" - The release will have no further changes. Its APKs - // are being served to all users, unless they are eligible to APKs of a - // more recent release. - Status string `json:"status,omitempty"` + // "SUBSCRIPTION_STATE_UNSPECIFIED" - Unspecified subscription state. + // "SUBSCRIPTION_STATE_PENDING" - Subscription was created but + // awaiting payment during signup. In this state, all items are awaiting + // payment. + // "SUBSCRIPTION_STATE_ACTIVE" - Subscription is active. - (1) If the + // subscription is an auto renewing plan, at least one item is + // auto_renew_enabled and not expired. - (2) If the subscription is a + // prepaid plan, at least one item is not expired. + // "SUBSCRIPTION_STATE_PAUSED" - Subscription is paused. The state is + // only available when the subscription is an auto renewing plan. In + // this state, all items are in paused state. + // "SUBSCRIPTION_STATE_IN_GRACE_PERIOD" - Subscription is in grace + // period. The state is only available when the subscription is an auto + // renewing plan. In this state, all items are in grace period. + // "SUBSCRIPTION_STATE_ON_HOLD" - Subscription is on hold (suspended). + // The state is only available when the subscription is an auto renewing + // plan. In this state, all items are on hold. + // "SUBSCRIPTION_STATE_CANCELED" - Subscription is canceled but not + // expired yet. The state is only available when the subscription is an + // auto renewing plan. All items have auto_renew_enabled set to false. + // "SUBSCRIPTION_STATE_EXPIRED" - Subscription is expired. All items + // have expiry_time in the past. + SubscriptionState string `json:"subscriptionState,omitempty"` - // UserFraction: Fraction of users who are eligible for a staged - // release. 0 < fraction < 1. Can only be set when status is - // "inProgress" or "halted". - UserFraction float64 `json:"userFraction,omitempty"` + // TestPurchase: Only present if this subscription purchase is a test + // purchase. + TestPurchase *TestPurchase `json:"testPurchase,omitempty"` - // VersionCodes: Version codes of all APKs in the release. Must include - // version codes to retain from previous releases. - VersionCodes googleapi.Int64s `json:"versionCodes,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "CountryTargeting") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. + // ForceSendFields is a list of field names (e.g. + // "AcknowledgementState") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CountryTargeting") to + // NullFields is a list of field names (e.g. "AcknowledgementState") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -6861,33 +7075,19 @@ type TrackRelease struct { NullFields []string `json:"-"` } -func (s *TrackRelease) MarshalJSON() ([]byte, error) { - type NoMethod TrackRelease +func (s *SubscriptionPurchaseV2) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionPurchaseV2 raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *TrackRelease) UnmarshalJSON(data []byte) error { - type NoMethod TrackRelease - var s1 struct { - UserFraction gensupport.JSONFloat64 `json:"userFraction"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.UserFraction = float64(s1.UserFraction) - return nil -} - -// TrackTargetedCountry: Representation of a single country where the -// contents of a track are available. -type TrackTargetedCountry struct { - // CountryCode: The country to target, as a two-letter CLDR code. - CountryCode string `json:"countryCode,omitempty"` +// SubscriptionPurchasesAcknowledgeRequest: Request for the +// purchases.subscriptions.acknowledge API. +type SubscriptionPurchasesAcknowledgeRequest struct { + // DeveloperPayload: Payload to attach to the purchase. + DeveloperPayload string `json:"developerPayload,omitempty"` - // ForceSendFields is a list of field names (e.g. "CountryCode") to + // ForceSendFields is a list of field names (e.g. "DeveloperPayload") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6895,35 +7095,30 @@ type TrackTargetedCountry struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CountryCode") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "DeveloperPayload") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *TrackTargetedCountry) MarshalJSON() ([]byte, error) { - type NoMethod TrackTargetedCountry +func (s *SubscriptionPurchasesAcknowledgeRequest) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionPurchasesAcknowledgeRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// TracksListResponse: Response listing all tracks. -type TracksListResponse struct { - // Kind: The kind of this response - // ("androidpublisher#tracksListResponse"). - Kind string `json:"kind,omitempty"` - - // Tracks: All tracks (including tracks with no releases). - Tracks []*Track `json:"tracks,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` +// SubscriptionPurchasesDeferRequest: Request for the +// purchases.subscriptions.defer API. +type SubscriptionPurchasesDeferRequest struct { + // DeferralInfo: The information about the new desired expiry time for + // the subscription. + DeferralInfo *SubscriptionDeferralInfo `json:"deferralInfo,omitempty"` - // ForceSendFields is a list of field names (e.g. "Kind") to + // ForceSendFields is a list of field names (e.g. "DeferralInfo") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6931,49 +7126,41 @@ type TracksListResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Kind") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "DeferralInfo") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *TracksListResponse) MarshalJSON() ([]byte, error) { - type NoMethod TracksListResponse +func (s *SubscriptionPurchasesDeferRequest) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionPurchasesDeferRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// UpgradeTargetingRule: Represents a targeting rule of the form: User -// currently has {scope} [with billing period {billing_period}]. -type UpgradeTargetingRule struct { - // BillingPeriodDuration: The specific billing period duration, - // specified in ISO 8601 format, that a user must be currently - // subscribed to to be eligible for this rule. If not specified, users - // subscribed to any billing period are matched. - BillingPeriodDuration string `json:"billingPeriodDuration,omitempty"` - - // OncePerUser: Limit this offer to only once per user. If set to true, - // a user can never be eligible for this offer again if they ever - // subscribed to this offer. - OncePerUser bool `json:"oncePerUser,omitempty"` +// SubscriptionPurchasesDeferResponse: Response for the +// purchases.subscriptions.defer API. +type SubscriptionPurchasesDeferResponse struct { + // NewExpiryTimeMillis: The new expiry time for the subscription in + // milliseconds since the Epoch. + NewExpiryTimeMillis int64 `json:"newExpiryTimeMillis,omitempty,string"` - // Scope: Required. The scope of subscriptions this rule considers. Only - // allows "this subscription" and "specific subscription in app". - Scope *TargetingRuleScope `json:"scope,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. - // "BillingPeriodDuration") to unconditionally include in API requests. - // By default, fields with empty or default values are omitted from API - // requests. However, any non-pointer, non-interface field appearing in - // ForceSendFields will be sent to the server regardless of whether the - // field is empty or not. This may be used to include empty fields in - // Patch requests. + // ForceSendFields is a list of field names (e.g. "NewExpiryTimeMillis") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "BillingPeriodDuration") to + // NullFields is a list of field names (e.g. "NewExpiryTimeMillis") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -6983,166 +7170,75 @@ type UpgradeTargetingRule struct { NullFields []string `json:"-"` } -func (s *UpgradeTargetingRule) MarshalJSON() ([]byte, error) { - type NoMethod UpgradeTargetingRule +func (s *SubscriptionPurchasesDeferResponse) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionPurchasesDeferResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// User: A user resource. -type User struct { - // AccessState: Output only. The state of the user's access to the Play - // Console. - // - // Possible values: - // "ACCESS_STATE_UNSPECIFIED" - Unknown or unspecified access state. - // "INVITED" - User is invited but has not yet accepted the - // invitation. - // "INVITATION_EXPIRED" - Invitation has expired. - // "ACCESS_GRANTED" - User has accepted an invitation and has access - // to the Play Console. - // "ACCESS_EXPIRED" - Account access has expired. - AccessState string `json:"accessState,omitempty"` - - // DeveloperAccountPermissions: Permissions for the user which apply - // across the developer account. +// SubscriptionTaxAndComplianceSettings: Details about taxation, Google +// Play policy and legal compliance for subscription products. +type SubscriptionTaxAndComplianceSettings struct { + // EeaWithdrawalRightType: Digital content or service classification for + // products distributed to users in the European Economic Area (EEA). + // The withdrawal regime under EEA consumer laws depends on this + // classification. Refer to the Help Center article + // (https://support.google.com/googleplay/android-developer/answer/10463498) + // for more information. // // Possible values: - // "DEVELOPER_LEVEL_PERMISSION_UNSPECIFIED" - Unknown or unspecified - // permission. - // "CAN_SEE_ALL_APPS" - View app information and download bulk reports - // (read-only). Deprecated: Check CAN_VIEW_NON_FINANCIAL_DATA_GLOBAL. - // "CAN_VIEW_FINANCIAL_DATA_GLOBAL" - View financial data, orders, and - // cancellation survey responses. - // "CAN_MANAGE_PERMISSIONS_GLOBAL" - Admin (all permissions). - // "CAN_EDIT_GAMES_GLOBAL" - Edit Play Games Services projects. - // "CAN_PUBLISH_GAMES_GLOBAL" - Publish Play Games Services projects. - // "CAN_REPLY_TO_REVIEWS_GLOBAL" - Reply to reviews. - // "CAN_MANAGE_PUBLIC_APKS_GLOBAL" - Release to production, exclude - // devices, and use app signing by Google Play. - // "CAN_MANAGE_TRACK_APKS_GLOBAL" - Release to testing tracks. - // "CAN_MANAGE_TRACK_USERS_GLOBAL" - Manage testing tracks and edit - // tester lists. - // "CAN_MANAGE_PUBLIC_LISTING_GLOBAL" - Manage store presence. - // "CAN_MANAGE_DRAFT_APPS_GLOBAL" - Create, edit, and delete draft - // apps. - // "CAN_CREATE_MANAGED_PLAY_APPS_GLOBAL" - Create and publish private - // apps to your organization. - // "CAN_CHANGE_MANAGED_PLAY_SETTING_GLOBAL" - Choose whether apps are - // public, or only available to your organization. - // "CAN_MANAGE_ORDERS_GLOBAL" - Manage orders and subscriptions. - // "CAN_MANAGE_APP_CONTENT_GLOBAL" - Manage policy related pages on - // all apps for the developer. - // "CAN_VIEW_NON_FINANCIAL_DATA_GLOBAL" - View app information and - // download bulk reports (read-only). - // "CAN_VIEW_APP_QUALITY_GLOBAL" - View app quality information for - // all apps for the developer. - DeveloperAccountPermissions []string `json:"developerAccountPermissions,omitempty"` - - // Email: Immutable. The user's email address. - Email string `json:"email,omitempty"` - - // ExpirationTime: The time at which the user's access expires, if set. - // When setting this value, it must always be in the future. - ExpirationTime string `json:"expirationTime,omitempty"` - - // Grants: Output only. Per-app permissions for the user. - Grants []*Grant `json:"grants,omitempty"` - - // Name: Required. Resource name for this user, following the pattern - // "developers/{developer}/users/{email}". - Name string `json:"name,omitempty"` + // "WITHDRAWAL_RIGHT_TYPE_UNSPECIFIED" + // "WITHDRAWAL_RIGHT_DIGITAL_CONTENT" + // "WITHDRAWAL_RIGHT_SERVICE" + EeaWithdrawalRightType string `json:"eeaWithdrawalRightType,omitempty"` - // Partial: Output only. Whether there are more permissions for the user - // that are not represented here. This can happen if the caller does not - // have permission to manage all apps in the account. This is also - // `true` if this user is the account owner. If this field is `true`, it - // should be taken as a signal that this user cannot be fully managed - // via the API. That is, the API caller is not be able to manage all of - // the permissions this user holds, either because it doesn't know about - // them or because the user is the account owner. - Partial bool `json:"partial,omitempty"` + // IsTokenizedDigitalAsset: Whether this subscription is declared as a + // product representing a tokenized digital asset. + IsTokenizedDigitalAsset bool `json:"isTokenizedDigitalAsset,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // TaxRateInfoByRegionCode: A mapping from region code to tax rate + // details. The keys are region codes as defined by Unicode's "CLDR". + TaxRateInfoByRegionCode map[string]RegionalTaxRateInfo `json:"taxRateInfoByRegionCode,omitempty"` - // ForceSendFields is a list of field names (e.g. "AccessState") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. + // ForceSendFields is a list of field names (e.g. + // "EeaWithdrawalRightType") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AccessState") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "EeaWithdrawalRightType") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *User) MarshalJSON() ([]byte, error) { - type NoMethod User +func (s *SubscriptionTaxAndComplianceSettings) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionTaxAndComplianceSettings raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// UserComment: User entry from conversation between user and developer. -type UserComment struct { - // AndroidOsVersion: Integer Android SDK version of the user's device at - // the time the review was written, e.g. 23 is Marshmallow. May be - // absent. - AndroidOsVersion int64 `json:"androidOsVersion,omitempty"` - - // AppVersionCode: Integer version code of the app as installed at the - // time the review was written. May be absent. - AppVersionCode int64 `json:"appVersionCode,omitempty"` - - // AppVersionName: String version name of the app as installed at the - // time the review was written. May be absent. - AppVersionName string `json:"appVersionName,omitempty"` - - // Device: Codename for the reviewer's device, e.g. klte, flounder. May - // be absent. - Device string `json:"device,omitempty"` - - // DeviceMetadata: Information about the characteristics of the user's - // device. - DeviceMetadata *DeviceMetadata `json:"deviceMetadata,omitempty"` - - // LastModified: The last time at which this comment was updated. - LastModified *Timestamp `json:"lastModified,omitempty"` - - // OriginalText: Untranslated text of the review, where the review was - // translated. If the review was not translated this is left blank. - OriginalText string `json:"originalText,omitempty"` - - // ReviewerLanguage: Language code for the reviewer. This is taken from - // the device settings so is not guaranteed to match the language the - // review is written in. May be absent. - ReviewerLanguage string `json:"reviewerLanguage,omitempty"` - - // StarRating: The star rating associated with the review, from 1 to 5. - StarRating int64 `json:"starRating,omitempty"` - - // Text: The content of the comment, i.e. review body. In some cases - // users have been able to write a review with separate title and body; - // in those cases the title and body are concatenated and separated by a - // tab character. - Text string `json:"text,omitempty"` +// SystemApkOptions: Options for system APKs. +type SystemApkOptions struct { + // Rotated: Whether to use the rotated key for signing the system APK. + Rotated bool `json:"rotated,omitempty"` - // ThumbsDownCount: Number of users who have given this review a thumbs - // down. - ThumbsDownCount int64 `json:"thumbsDownCount,omitempty"` + // UncompressedDexFiles: Whether system APK was generated with + // uncompressed dex files. + UncompressedDexFiles bool `json:"uncompressedDexFiles,omitempty"` - // ThumbsUpCount: Number of users who have given this review a thumbs - // up. - ThumbsUpCount int64 `json:"thumbsUpCount,omitempty"` + // UncompressedNativeLibraries: Whether system APK was generated with + // uncompressed native libraries. + UncompressedNativeLibraries bool `json:"uncompressedNativeLibraries,omitempty"` - // ForceSendFields is a list of field names (e.g. "AndroidOsVersion") to + // ForceSendFields is a list of field names (e.g. "Rotated") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7150,33 +7246,32 @@ type UserComment struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AndroidOsVersion") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "Rotated") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *UserComment) MarshalJSON() ([]byte, error) { - type NoMethod UserComment +func (s *SystemApkOptions) MarshalJSON() ([]byte, error) { + type NoMethod SystemApkOptions raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// UserCountriesTargeting: Describes an inclusive/exclusive list of -// country codes that module targets. -type UserCountriesTargeting struct { - // CountryCodes: List of country codes in the two-letter CLDR territory - // format. - CountryCodes []string `json:"countryCodes,omitempty"` +// SystemApksListResponse: Response to list previously created system +// APK variants. +type SystemApksListResponse struct { + // Variants: All system APK variants created. + Variants []*Variant `json:"variants,omitempty"` - // Exclude: Indicates if the list above is exclusive. - Exclude bool `json:"exclude,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "CountryCodes") to + // ForceSendFields is a list of field names (e.g. "Variants") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7184,33 +7279,27 @@ type UserCountriesTargeting struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CountryCodes") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Variants") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *UserCountriesTargeting) MarshalJSON() ([]byte, error) { - type NoMethod UserCountriesTargeting +func (s *SystemApksListResponse) MarshalJSON() ([]byte, error) { + type NoMethod SystemApksListResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// UserCountrySet: A set of user countries. A country set determines -// what variation of app content gets served to a specific location. -type UserCountrySet struct { - // CountryCodes: List of country codes representing countries. A Country - // code is represented in ISO 3166 alpha-2 format. For Example:- "IT" - // for Italy, "GE" for Georgia. - CountryCodes []string `json:"countryCodes,omitempty"` - - // Name: Country set name. +// SystemFeature: Representation of a system feature. +type SystemFeature struct { + // Name: The name of the feature. Name string `json:"name,omitempty"` - // ForceSendFields is a list of field names (e.g. "CountryCodes") to + // ForceSendFields is a list of field names (e.g. "Name") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7218,69 +7307,110 @@ type UserCountrySet struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CountryCodes") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Name") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *UserCountrySet) MarshalJSON() ([]byte, error) { - type NoMethod UserCountrySet +func (s *SystemFeature) MarshalJSON() ([]byte, error) { + type NoMethod SystemFeature raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// UserInitiatedCancellation: Information specific to cancellations -// initiated by users. -type UserInitiatedCancellation struct { - // CancelSurveyResult: Information provided by the user when they - // complete the subscription cancellation flow (cancellation reason - // survey). - CancelSurveyResult *CancelSurveyResult `json:"cancelSurveyResult,omitempty"` +// SystemInitiatedCancellation: Information specific to cancellations +// initiated by Google system. +type SystemInitiatedCancellation struct { +} - // CancelTime: The time at which the subscription was canceled by the - // user. The user might still have access to the subscription after this - // time. Use line_items.expiry_time to determine if a user still has - // access. - CancelTime string `json:"cancelTime,omitempty"` +// TargetingInfo: Targeting information about the generated apks. +type TargetingInfo struct { + // AssetSliceSet: List of created asset slices. + AssetSliceSet []*AssetSliceSet `json:"assetSliceSet,omitempty"` - // ForceSendFields is a list of field names (e.g. "CancelSurveyResult") - // to unconditionally include in API requests. By default, fields with + // PackageName: The package name of this app. + PackageName string `json:"packageName,omitempty"` + + // Variant: List of the created variants. + Variant []*SplitApkVariant `json:"variant,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AssetSliceSet") to + // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CancelSurveyResult") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "AssetSliceSet") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *UserInitiatedCancellation) MarshalJSON() ([]byte, error) { - type NoMethod UserInitiatedCancellation +func (s *TargetingInfo) MarshalJSON() ([]byte, error) { + type NoMethod TargetingInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// UsesPermission: A permission used by this APK. -type UsesPermission struct { - // MaxSdkVersion: Optionally, the maximum SDK version for which the - // permission is required. - MaxSdkVersion int64 `json:"maxSdkVersion,omitempty"` +// TargetingRuleScope: Defines the scope of subscriptions which a +// targeting rule can match to target offers to users based on past or +// current entitlement. +type TargetingRuleScope struct { + // SpecificSubscriptionInApp: The scope of the current targeting rule is + // the subscription with the specified subscription ID. Must be a + // subscription within the same parent app. + SpecificSubscriptionInApp string `json:"specificSubscriptionInApp,omitempty"` - // Name: The name of the permission requested. - Name string `json:"name,omitempty"` + // ForceSendFields is a list of field names (e.g. + // "SpecificSubscriptionInApp") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` - // ForceSendFields is a list of field names (e.g. "MaxSdkVersion") to + // NullFields is a list of field names (e.g. + // "SpecificSubscriptionInApp") to include in API requests with the JSON + // null value. By default, fields with empty values are omitted from API + // requests. However, any field with an empty value appearing in + // NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *TargetingRuleScope) MarshalJSON() ([]byte, error) { + type NoMethod TargetingRuleScope + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// TestPurchase: Whether this subscription purchase is a test purchase. +type TestPurchase struct { +} + +// Testers: The testers of an app. The resource for TestersService. +// Note: while it is possible in the Play Console UI to add testers via +// email lists, email lists are not supported by this resource. +type Testers struct { + // GoogleGroups: All testing Google Groups, as email addresses. + GoogleGroups []string `json:"googleGroups,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "GoogleGroups") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7288,7 +7418,7 @@ type UsesPermission struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "MaxSdkVersion") to include + // NullFields is a list of field names (e.g. "GoogleGroups") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as @@ -7297,30 +7427,31 @@ type UsesPermission struct { NullFields []string `json:"-"` } -func (s *UsesPermission) MarshalJSON() ([]byte, error) { - type NoMethod UsesPermission +func (s *Testers) MarshalJSON() ([]byte, error) { + type NoMethod Testers raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Variant: APK that is suitable for inclusion in a system image. The -// resource of SystemApksService. -type Variant struct { - // DeviceSpec: The device spec used to generate the APK. - DeviceSpec *DeviceSpec `json:"deviceSpec,omitempty"` - - // Options: Optional. Options applied to the generated APK. - Options *SystemApkOptions `json:"options,omitempty"` - - // VariantId: Output only. The ID of a previously created system APK - // variant. - VariantId int64 `json:"variantId,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` +// TextureCompressionFormat: Represents texture compression format. +type TextureCompressionFormat struct { + // Alias: Alias for texture compression format. + // + // Possible values: + // "UNSPECIFIED_TEXTURE_COMPRESSION_FORMAT" - Unspecified format. + // "ETC1_RGB8" - ETC1_RGB8 format. + // "PALETTED" - PALETTED format. + // "THREE_DC" - THREE_DC format. + // "ATC" - ATC format. + // "LATC" - LATC format. + // "DXT1" - DXT1 format. + // "S3TC" - S3TC format. + // "PVRTC" - PVRTC format. + // "ASTC" - ASTC format. + // "ETC2" - ETC2 format. + Alias string `json:"alias,omitempty"` - // ForceSendFields is a list of field names (e.g. "DeviceSpec") to + // ForceSendFields is a list of field names (e.g. "Alias") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7328,8 +7459,8 @@ type Variant struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DeviceSpec") to include in - // API requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Alias") to include in API + // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -7337,32 +7468,23 @@ type Variant struct { NullFields []string `json:"-"` } -func (s *Variant) MarshalJSON() ([]byte, error) { - type NoMethod Variant +func (s *TextureCompressionFormat) MarshalJSON() ([]byte, error) { + type NoMethod TextureCompressionFormat raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// VariantTargeting: Targeting on the level of variants. -type VariantTargeting struct { - // AbiTargeting: The abi that the variant targets - AbiTargeting *AbiTargeting `json:"abiTargeting,omitempty"` - - // MultiAbiTargeting: Multi-api-level targeting - MultiAbiTargeting *MultiAbiTargeting `json:"multiAbiTargeting,omitempty"` - - // ScreenDensityTargeting: The screen densities that this variant - // supports - ScreenDensityTargeting *ScreenDensityTargeting `json:"screenDensityTargeting,omitempty"` - - // SdkVersionTargeting: The sdk version that the variant targets - SdkVersionTargeting *SdkVersionTargeting `json:"sdkVersionTargeting,omitempty"` +// TextureCompressionFormatTargeting: Targeting by a texture compression +// format. +type TextureCompressionFormatTargeting struct { + // Alternatives: List of alternative TCFs (TCFs targeted by the sibling + // splits). + Alternatives []*TextureCompressionFormat `json:"alternatives,omitempty"` - // TextureCompressionFormatTargeting: Texture-compression-format-level - // targeting - TextureCompressionFormatTargeting *TextureCompressionFormatTargeting `json:"textureCompressionFormatTargeting,omitempty"` + // Value: The list of targeted TCFs. Should not be empty. + Value []*TextureCompressionFormat `json:"value,omitempty"` - // ForceSendFields is a list of field names (e.g. "AbiTargeting") to + // ForceSendFields is a list of field names (e.g. "Alternatives") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7370,7 +7492,7 @@ type VariantTargeting struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AbiTargeting") to include + // NullFields is a list of field names (e.g. "Alternatives") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as @@ -7379,47 +7501,25 @@ type VariantTargeting struct { NullFields []string `json:"-"` } -func (s *VariantTargeting) MarshalJSON() ([]byte, error) { - type NoMethod VariantTargeting +func (s *TextureCompressionFormatTargeting) MarshalJSON() ([]byte, error) { + type NoMethod TextureCompressionFormatTargeting raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// VoidedPurchase: A VoidedPurchase resource indicates a purchase that -// was either canceled/refunded/charged-back. -type VoidedPurchase struct { - // Kind: This kind represents a voided purchase object in the - // androidpublisher service. - Kind string `json:"kind,omitempty"` - - // OrderId: The order id which uniquely identifies a one-time purchase, - // subscription purchase, or subscription renewal. - OrderId string `json:"orderId,omitempty"` - - // PurchaseTimeMillis: The time at which the purchase was made, in - // milliseconds since the epoch (Jan 1, 1970). - PurchaseTimeMillis int64 `json:"purchaseTimeMillis,omitempty,string"` - - // PurchaseToken: The token which uniquely identifies a one-time - // purchase or subscription. To uniquely identify subscription renewals - // use order_id (available starting from version 3 of the API). - PurchaseToken string `json:"purchaseToken,omitempty"` - - // VoidedReason: The reason why the purchase was voided, possible values - // are: 0. Other 1. Remorse 2. Not_received 3. Defective 4. - // Accidental_purchase 5. Fraud 6. Friendly_fraud 7. Chargeback - VoidedReason int64 `json:"voidedReason,omitempty"` - - // VoidedSource: The initiator of voided purchase, possible values are: - // 0. User 1. Developer 2. Google - VoidedSource int64 `json:"voidedSource,omitempty"` +// Timestamp: A Timestamp represents a point in time independent of any +// time zone or local calendar, encoded as a count of seconds and +// fractions of seconds at nanosecond resolution. The count is relative +// to an epoch at UTC midnight on January 1, 1970. +type Timestamp struct { + // Nanos: Non-negative fractions of a second at nanosecond resolution. + // Must be from 0 to 999,999,999 inclusive. + Nanos int64 `json:"nanos,omitempty"` - // VoidedTimeMillis: The time at which the purchase was - // canceled/refunded/charged-back, in milliseconds since the epoch (Jan - // 1, 1970). - VoidedTimeMillis int64 `json:"voidedTimeMillis,omitempty,string"` + // Seconds: Represents seconds of UTC time since Unix epoch. + Seconds int64 `json:"seconds,omitempty,string"` - // ForceSendFields is a list of field names (e.g. "Kind") to + // ForceSendFields is a list of field names (e.g. "Nanos") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7427,7 +7527,7 @@ type VoidedPurchase struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Kind") to include in API + // NullFields is a list of field names (e.g. "Nanos") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -7436,28 +7536,69 @@ type VoidedPurchase struct { NullFields []string `json:"-"` } -func (s *VoidedPurchase) MarshalJSON() ([]byte, error) { - type NoMethod VoidedPurchase +func (s *Timestamp) MarshalJSON() ([]byte, error) { + type NoMethod Timestamp raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// VoidedPurchasesListResponse: Response for the voidedpurchases.list -// API. -type VoidedPurchasesListResponse struct { - // PageInfo: General pagination information. - PageInfo *PageInfo `json:"pageInfo,omitempty"` +// TokenPagination: Pagination information returned by a List operation +// when token pagination is enabled. List operations that supports +// paging return only one "page" of results. This protocol buffer +// message describes the page that has been returned. When using token +// pagination, clients should use the next/previous token to get another +// page of the result. The presence or absence of next/previous token +// indicates whether a next/previous page is available and provides a +// mean of accessing this page. ListRequest.page_token should be set to +// either next_page_token or previous_page_token to access another page. +type TokenPagination struct { + // NextPageToken: Tokens to pass to the standard list field + // 'page_token'. Whenever available, tokens are preferred over + // manipulating start_index. + NextPageToken string `json:"nextPageToken,omitempty"` - // TokenPagination: Pagination information for token pagination. - TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + PreviousPageToken string `json:"previousPageToken,omitempty"` - VoidedPurchases []*VoidedPurchase `json:"voidedPurchases,omitempty"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *TokenPagination) MarshalJSON() ([]byte, error) { + type NoMethod TokenPagination + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Track: A track configuration. The resource for TracksService. +type Track struct { + // Releases: In a read request, represents all active releases in the + // track. In an update request, represents desired changes. + Releases []*TrackRelease `json:"releases,omitempty"` + + // Track: Identifier of the track. Form factor tracks have a special + // prefix as an identifier, for example `wear:production`, + // `automotive:production`. More on track name + // (https://developers.google.com/android-publisher/tracks#ff-track-name) + Track string `json:"track,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "PageInfo") to + // ForceSendFields is a list of field names (e.g. "Releases") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -7465,7 +7606,107 @@ type VoidedPurchasesListResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "PageInfo") to include in + // NullFields is a list of field names (e.g. "Releases") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Track) MarshalJSON() ([]byte, error) { + type NoMethod Track + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// TrackConfig: Configurations of the new track. +type TrackConfig struct { + // FormFactor: Required. Form factor of the new track. Defaults to the + // default track. + // + // Possible values: + // "FORM_FACTOR_UNSPECIFIED" - Fallback value, do not use. + // "DEFAULT" - Default track. + // "WEAR" - Wear form factor track. + // "AUTOMOTIVE" - Automotive form factor track. + FormFactor string `json:"formFactor,omitempty"` + + // Track: Required. Identifier of the new track. For default tracks, + // this field consists of the track alias only. Form factor tracks have + // a special prefix as an identifier, for example `wear:production`, + // `automotive:production`. This prefix must match the value of the + // `form_factor` field, if it is not a default track. More on track name + // (https://developers.google.com/android-publisher/tracks#ff-track-name) + Track string `json:"track,omitempty"` + + // Type: Required. Type of the new track. Currently, the only supported + // value is closedTesting. + // + // Possible values: + // "TRACK_TYPE_UNSPECIFIED" - Fallback value, do not use. + // "CLOSED_TESTING" - Closed testing track. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FormFactor") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "FormFactor") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *TrackConfig) MarshalJSON() ([]byte, error) { + type NoMethod TrackConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// TrackCountryAvailability: Resource for per-track country availability +// information. +type TrackCountryAvailability struct { + // Countries: A list of one or more countries where artifacts in this + // track are available. This list includes all countries that are + // targeted by the track, even if only specific carriers are targeted in + // that country. + Countries []*TrackTargetedCountry `json:"countries,omitempty"` + + // RestOfWorld: Whether artifacts in this track are available to "rest + // of the world" countries. + RestOfWorld bool `json:"restOfWorld,omitempty"` + + // SyncWithProduction: Whether this track's availability is synced with + // the default production track. See + // https://support.google.com/googleplay/android-developer/answer/7550024 + // for more information on syncing country availability with production. + // Note that if this is true, the returned "countries" and + // "rest_of_world" fields will reflect the values for the default + // production track. + SyncWithProduction bool `json:"syncWithProduction,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Countries") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Countries") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -7474,102 +7715,2733 @@ type VoidedPurchasesListResponse struct { NullFields []string `json:"-"` } -func (s *VoidedPurchasesListResponse) MarshalJSON() ([]byte, error) { - type NoMethod VoidedPurchasesListResponse - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +func (s *TrackCountryAvailability) MarshalJSON() ([]byte, error) { + type NoMethod TrackCountryAvailability + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// TrackRelease: A release within a track. +type TrackRelease struct { + // CountryTargeting: Restricts a release to a specific set of countries. + CountryTargeting *CountryTargeting `json:"countryTargeting,omitempty"` + + // InAppUpdatePriority: In-app update priority of the release. All newly + // added APKs in the release will be considered at this priority. Can + // take values in the range [0, 5], with 5 the highest priority. + // Defaults to 0. in_app_update_priority can not be updated once the + // release is rolled out. See + // https://developer.android.com/guide/playcore/in-app-updates. + InAppUpdatePriority int64 `json:"inAppUpdatePriority,omitempty"` + + // Name: The release name. Not required to be unique. If not set, the + // name is generated from the APK's version_name. If the release + // contains multiple APKs, the name is generated from the date. + Name string `json:"name,omitempty"` + + // ReleaseNotes: A description of what is new in this release. + ReleaseNotes []*LocalizedText `json:"releaseNotes,omitempty"` + + // Status: The status of the release. + // + // Possible values: + // "statusUnspecified" - Unspecified status. + // "draft" - The release's APKs are not being served to users. + // "inProgress" - The release's APKs are being served to a fraction of + // users, determined by 'user_fraction'. + // "halted" - The release's APKs will no longer be served to users. + // Users who already have these APKs are unaffected. + // "completed" - The release will have no further changes. Its APKs + // are being served to all users, unless they are eligible to APKs of a + // more recent release. + Status string `json:"status,omitempty"` + + // UserFraction: Fraction of users who are eligible for a staged + // release. 0 < fraction < 1. Can only be set when status is + // "inProgress" or "halted". + UserFraction float64 `json:"userFraction,omitempty"` + + // VersionCodes: Version codes of all APKs in the release. Must include + // version codes to retain from previous releases. + VersionCodes googleapi.Int64s `json:"versionCodes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CountryTargeting") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CountryTargeting") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *TrackRelease) MarshalJSON() ([]byte, error) { + type NoMethod TrackRelease + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *TrackRelease) UnmarshalJSON(data []byte) error { + type NoMethod TrackRelease + var s1 struct { + UserFraction gensupport.JSONFloat64 `json:"userFraction"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.UserFraction = float64(s1.UserFraction) + return nil +} + +// TrackTargetedCountry: Representation of a single country where the +// contents of a track are available. +type TrackTargetedCountry struct { + // CountryCode: The country to target, as a two-letter CLDR code. + CountryCode string `json:"countryCode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CountryCode") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CountryCode") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *TrackTargetedCountry) MarshalJSON() ([]byte, error) { + type NoMethod TrackTargetedCountry + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// TracksListResponse: Response listing all tracks. +type TracksListResponse struct { + // Kind: The kind of this response + // ("androidpublisher#tracksListResponse"). + Kind string `json:"kind,omitempty"` + + // Tracks: All tracks (including tracks with no releases). + Tracks []*Track `json:"tracks,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Kind") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *TracksListResponse) MarshalJSON() ([]byte, error) { + type NoMethod TracksListResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// UpdateBasePlanStateRequest: Request message to update the state of a +// subscription base plan. +type UpdateBasePlanStateRequest struct { + // ActivateBasePlanRequest: Activates a base plan. Once activated, base + // plans will be available to new subscribers. + ActivateBasePlanRequest *ActivateBasePlanRequest `json:"activateBasePlanRequest,omitempty"` + + // DeactivateBasePlanRequest: Deactivates a base plan. Once deactivated, + // the base plan will become unavailable to new subscribers, but + // existing subscribers will maintain their subscription + DeactivateBasePlanRequest *DeactivateBasePlanRequest `json:"deactivateBasePlanRequest,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "ActivateBasePlanRequest") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ActivateBasePlanRequest") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *UpdateBasePlanStateRequest) MarshalJSON() ([]byte, error) { + type NoMethod UpdateBasePlanStateRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// UpdateSubscriptionOfferRequest: Request message for +// UpdateSubscriptionOffer. +type UpdateSubscriptionOfferRequest struct { + // AllowMissing: Optional. If set to true, and the subscription offer + // with the given package_name, product_id, base_plan_id and offer_id + // doesn't exist, an offer will be created. If a new offer is created, + // update_mask is ignored. + AllowMissing bool `json:"allowMissing,omitempty"` + + // LatencyTolerance: Optional. The latency tolerance for the propagation + // of this product update. Defaults to latency-sensitive. + // + // Possible values: + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" - Defaults to + // PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE. + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" - The update + // will propagate to clients within several minutes on average and up to + // a few hours in rare cases. Throughput is limited to 7,200 updates per + // app per hour. + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" - The update + // will propagate to clients within 24 hours. Supports high throughput + // of up to 720,000 updates per app per hour using batch modification + // methods. + LatencyTolerance string `json:"latencyTolerance,omitempty"` + + // RegionsVersion: Required. The version of the available regions being + // used for the subscription_offer. + RegionsVersion *RegionsVersion `json:"regionsVersion,omitempty"` + + // SubscriptionOffer: Required. The subscription offer to update. + SubscriptionOffer *SubscriptionOffer `json:"subscriptionOffer,omitempty"` + + // UpdateMask: Required. The list of fields to be updated. + UpdateMask string `json:"updateMask,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AllowMissing") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AllowMissing") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *UpdateSubscriptionOfferRequest) MarshalJSON() ([]byte, error) { + type NoMethod UpdateSubscriptionOfferRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// UpdateSubscriptionOfferStateRequest: Request message to update the +// state of a subscription offer. +type UpdateSubscriptionOfferStateRequest struct { + // ActivateSubscriptionOfferRequest: Activates an offer. Once activated, + // the offer will be available to new subscribers. + ActivateSubscriptionOfferRequest *ActivateSubscriptionOfferRequest `json:"activateSubscriptionOfferRequest,omitempty"` + + // DeactivateSubscriptionOfferRequest: Deactivates an offer. Once + // deactivated, the offer will become unavailable to new subscribers, + // but existing subscribers will maintain their subscription + DeactivateSubscriptionOfferRequest *DeactivateSubscriptionOfferRequest `json:"deactivateSubscriptionOfferRequest,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "ActivateSubscriptionOfferRequest") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. + // "ActivateSubscriptionOfferRequest") to include in API requests with + // the JSON null value. By default, fields with empty values are omitted + // from API requests. However, any field with an empty value appearing + // in NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *UpdateSubscriptionOfferStateRequest) MarshalJSON() ([]byte, error) { + type NoMethod UpdateSubscriptionOfferStateRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// UpdateSubscriptionRequest: Request message for UpdateSubscription. +type UpdateSubscriptionRequest struct { + // AllowMissing: Optional. If set to true, and the subscription with the + // given package_name and product_id doesn't exist, the subscription + // will be created. If a new subscription is created, update_mask is + // ignored. + AllowMissing bool `json:"allowMissing,omitempty"` + + // LatencyTolerance: Optional. The latency tolerance for the propagation + // of this product update. Defaults to latency-sensitive. + // + // Possible values: + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" - Defaults to + // PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE. + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" - The update + // will propagate to clients within several minutes on average and up to + // a few hours in rare cases. Throughput is limited to 7,200 updates per + // app per hour. + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" - The update + // will propagate to clients within 24 hours. Supports high throughput + // of up to 720,000 updates per app per hour using batch modification + // methods. + LatencyTolerance string `json:"latencyTolerance,omitempty"` + + // RegionsVersion: Required. The version of the available regions being + // used for the subscription. + RegionsVersion *RegionsVersion `json:"regionsVersion,omitempty"` + + // Subscription: Required. The subscription to update. + Subscription *Subscription `json:"subscription,omitempty"` + + // UpdateMask: Required. The list of fields to be updated. + UpdateMask string `json:"updateMask,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AllowMissing") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AllowMissing") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *UpdateSubscriptionRequest) MarshalJSON() ([]byte, error) { + type NoMethod UpdateSubscriptionRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// UpgradeTargetingRule: Represents a targeting rule of the form: User +// currently has {scope} [with billing period {billing_period}]. +type UpgradeTargetingRule struct { + // BillingPeriodDuration: The specific billing period duration, + // specified in ISO 8601 format, that a user must be currently + // subscribed to to be eligible for this rule. If not specified, users + // subscribed to any billing period are matched. + BillingPeriodDuration string `json:"billingPeriodDuration,omitempty"` + + // OncePerUser: Limit this offer to only once per user. If set to true, + // a user can never be eligible for this offer again if they ever + // subscribed to this offer. + OncePerUser bool `json:"oncePerUser,omitempty"` + + // Scope: Required. The scope of subscriptions this rule considers. Only + // allows "this subscription" and "specific subscription in app". + Scope *TargetingRuleScope `json:"scope,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "BillingPeriodDuration") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "BillingPeriodDuration") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *UpgradeTargetingRule) MarshalJSON() ([]byte, error) { + type NoMethod UpgradeTargetingRule + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// User: A user resource. +type User struct { + // AccessState: Output only. The state of the user's access to the Play + // Console. + // + // Possible values: + // "ACCESS_STATE_UNSPECIFIED" - Unknown or unspecified access state. + // "INVITED" - User is invited but has not yet accepted the + // invitation. + // "INVITATION_EXPIRED" - Invitation has expired. + // "ACCESS_GRANTED" - User has accepted an invitation and has access + // to the Play Console. + // "ACCESS_EXPIRED" - Account access has expired. + AccessState string `json:"accessState,omitempty"` + + // DeveloperAccountPermissions: Permissions for the user which apply + // across the developer account. + // + // Possible values: + // "DEVELOPER_LEVEL_PERMISSION_UNSPECIFIED" - Unknown or unspecified + // permission. + // "CAN_SEE_ALL_APPS" - View app information and download bulk reports + // (read-only). Deprecated: Check CAN_VIEW_NON_FINANCIAL_DATA_GLOBAL. + // "CAN_VIEW_FINANCIAL_DATA_GLOBAL" - View financial data, orders, and + // cancellation survey responses. + // "CAN_MANAGE_PERMISSIONS_GLOBAL" - Admin (all permissions). + // "CAN_EDIT_GAMES_GLOBAL" - Edit Play Games Services projects. + // "CAN_PUBLISH_GAMES_GLOBAL" - Publish Play Games Services projects. + // "CAN_REPLY_TO_REVIEWS_GLOBAL" - Reply to reviews. + // "CAN_MANAGE_PUBLIC_APKS_GLOBAL" - Release to production, exclude + // devices, and use app signing by Google Play. + // "CAN_MANAGE_TRACK_APKS_GLOBAL" - Release to testing tracks. + // "CAN_MANAGE_TRACK_USERS_GLOBAL" - Manage testing tracks and edit + // tester lists. + // "CAN_MANAGE_PUBLIC_LISTING_GLOBAL" - Manage store presence. + // "CAN_MANAGE_DRAFT_APPS_GLOBAL" - Create, edit, and delete draft + // apps. + // "CAN_CREATE_MANAGED_PLAY_APPS_GLOBAL" - Create and publish private + // apps to your organization. + // "CAN_CHANGE_MANAGED_PLAY_SETTING_GLOBAL" - Choose whether apps are + // public, or only available to your organization. + // "CAN_MANAGE_ORDERS_GLOBAL" - Manage orders and subscriptions. + // "CAN_MANAGE_APP_CONTENT_GLOBAL" - Manage policy related pages on + // all apps for the developer. + // "CAN_VIEW_NON_FINANCIAL_DATA_GLOBAL" - View app information and + // download bulk reports (read-only). + // "CAN_VIEW_APP_QUALITY_GLOBAL" - View app quality information for + // all apps for the developer. + DeveloperAccountPermissions []string `json:"developerAccountPermissions,omitempty"` + + // Email: Immutable. The user's email address. + Email string `json:"email,omitempty"` + + // ExpirationTime: The time at which the user's access expires, if set. + // When setting this value, it must always be in the future. + ExpirationTime string `json:"expirationTime,omitempty"` + + // Grants: Output only. Per-app permissions for the user. + Grants []*Grant `json:"grants,omitempty"` + + // Name: Required. Resource name for this user, following the pattern + // "developers/{developer}/users/{email}". + Name string `json:"name,omitempty"` + + // Partial: Output only. Whether there are more permissions for the user + // that are not represented here. This can happen if the caller does not + // have permission to manage all apps in the account. This is also + // `true` if this user is the account owner. If this field is `true`, it + // should be taken as a signal that this user cannot be fully managed + // via the API. That is, the API caller is not be able to manage all of + // the permissions this user holds, either because it doesn't know about + // them or because the user is the account owner. + Partial bool `json:"partial,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccessState") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AccessState") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *User) MarshalJSON() ([]byte, error) { + type NoMethod User + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// UserComment: User entry from conversation between user and developer. +type UserComment struct { + // AndroidOsVersion: Integer Android SDK version of the user's device at + // the time the review was written, e.g. 23 is Marshmallow. May be + // absent. + AndroidOsVersion int64 `json:"androidOsVersion,omitempty"` + + // AppVersionCode: Integer version code of the app as installed at the + // time the review was written. May be absent. + AppVersionCode int64 `json:"appVersionCode,omitempty"` + + // AppVersionName: String version name of the app as installed at the + // time the review was written. May be absent. + AppVersionName string `json:"appVersionName,omitempty"` + + // Device: Codename for the reviewer's device, e.g. klte, flounder. May + // be absent. + Device string `json:"device,omitempty"` + + // DeviceMetadata: Information about the characteristics of the user's + // device. + DeviceMetadata *DeviceMetadata `json:"deviceMetadata,omitempty"` + + // LastModified: The last time at which this comment was updated. + LastModified *Timestamp `json:"lastModified,omitempty"` + + // OriginalText: Untranslated text of the review, where the review was + // translated. If the review was not translated this is left blank. + OriginalText string `json:"originalText,omitempty"` + + // ReviewerLanguage: Language code for the reviewer. This is taken from + // the device settings so is not guaranteed to match the language the + // review is written in. May be absent. + ReviewerLanguage string `json:"reviewerLanguage,omitempty"` + + // StarRating: The star rating associated with the review, from 1 to 5. + StarRating int64 `json:"starRating,omitempty"` + + // Text: The content of the comment, i.e. review body. In some cases + // users have been able to write a review with separate title and body; + // in those cases the title and body are concatenated and separated by a + // tab character. + Text string `json:"text,omitempty"` + + // ThumbsDownCount: Number of users who have given this review a thumbs + // down. + ThumbsDownCount int64 `json:"thumbsDownCount,omitempty"` + + // ThumbsUpCount: Number of users who have given this review a thumbs + // up. + ThumbsUpCount int64 `json:"thumbsUpCount,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AndroidOsVersion") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AndroidOsVersion") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *UserComment) MarshalJSON() ([]byte, error) { + type NoMethod UserComment + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// UserCountriesTargeting: Describes an inclusive/exclusive list of +// country codes that module targets. +type UserCountriesTargeting struct { + // CountryCodes: List of country codes in the two-letter CLDR territory + // format. + CountryCodes []string `json:"countryCodes,omitempty"` + + // Exclude: Indicates if the list above is exclusive. + Exclude bool `json:"exclude,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CountryCodes") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CountryCodes") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *UserCountriesTargeting) MarshalJSON() ([]byte, error) { + type NoMethod UserCountriesTargeting + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// UserCountrySet: A set of user countries. A country set determines +// what variation of app content gets served to a specific location. +type UserCountrySet struct { + // CountryCodes: List of country codes representing countries. A Country + // code is represented in ISO 3166 alpha-2 format. For Example:- "IT" + // for Italy, "GE" for Georgia. + CountryCodes []string `json:"countryCodes,omitempty"` + + // Name: Country set name. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CountryCodes") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CountryCodes") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *UserCountrySet) MarshalJSON() ([]byte, error) { + type NoMethod UserCountrySet + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// UserInitiatedCancellation: Information specific to cancellations +// initiated by users. +type UserInitiatedCancellation struct { + // CancelSurveyResult: Information provided by the user when they + // complete the subscription cancellation flow (cancellation reason + // survey). + CancelSurveyResult *CancelSurveyResult `json:"cancelSurveyResult,omitempty"` + + // CancelTime: The time at which the subscription was canceled by the + // user. The user might still have access to the subscription after this + // time. Use line_items.expiry_time to determine if a user still has + // access. + CancelTime string `json:"cancelTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CancelSurveyResult") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CancelSurveyResult") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *UserInitiatedCancellation) MarshalJSON() ([]byte, error) { + type NoMethod UserInitiatedCancellation + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// UsesPermission: A permission used by this APK. +type UsesPermission struct { + // MaxSdkVersion: Optionally, the maximum SDK version for which the + // permission is required. + MaxSdkVersion int64 `json:"maxSdkVersion,omitempty"` + + // Name: The name of the permission requested. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MaxSdkVersion") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "MaxSdkVersion") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *UsesPermission) MarshalJSON() ([]byte, error) { + type NoMethod UsesPermission + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Variant: APK that is suitable for inclusion in a system image. The +// resource of SystemApksService. +type Variant struct { + // DeviceSpec: The device spec used to generate the APK. + DeviceSpec *DeviceSpec `json:"deviceSpec,omitempty"` + + // Options: Optional. Options applied to the generated APK. + Options *SystemApkOptions `json:"options,omitempty"` + + // VariantId: Output only. The ID of a previously created system APK + // variant. + VariantId int64 `json:"variantId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DeviceSpec") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "DeviceSpec") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Variant) MarshalJSON() ([]byte, error) { + type NoMethod Variant + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// VariantTargeting: Targeting on the level of variants. +type VariantTargeting struct { + // AbiTargeting: The abi that the variant targets + AbiTargeting *AbiTargeting `json:"abiTargeting,omitempty"` + + // MultiAbiTargeting: Multi-api-level targeting + MultiAbiTargeting *MultiAbiTargeting `json:"multiAbiTargeting,omitempty"` + + // ScreenDensityTargeting: The screen densities that this variant + // supports + ScreenDensityTargeting *ScreenDensityTargeting `json:"screenDensityTargeting,omitempty"` + + // SdkVersionTargeting: The sdk version that the variant targets + SdkVersionTargeting *SdkVersionTargeting `json:"sdkVersionTargeting,omitempty"` + + // TextureCompressionFormatTargeting: Texture-compression-format-level + // targeting + TextureCompressionFormatTargeting *TextureCompressionFormatTargeting `json:"textureCompressionFormatTargeting,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AbiTargeting") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AbiTargeting") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *VariantTargeting) MarshalJSON() ([]byte, error) { + type NoMethod VariantTargeting + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// VoidedPurchase: A VoidedPurchase resource indicates a purchase that +// was either canceled/refunded/charged-back. +type VoidedPurchase struct { + // Kind: This kind represents a voided purchase object in the + // androidpublisher service. + Kind string `json:"kind,omitempty"` + + // OrderId: The order id which uniquely identifies a one-time purchase, + // subscription purchase, or subscription renewal. + OrderId string `json:"orderId,omitempty"` + + // PurchaseTimeMillis: The time at which the purchase was made, in + // milliseconds since the epoch (Jan 1, 1970). + PurchaseTimeMillis int64 `json:"purchaseTimeMillis,omitempty,string"` + + // PurchaseToken: The token which uniquely identifies a one-time + // purchase or subscription. To uniquely identify subscription renewals + // use order_id (available starting from version 3 of the API). + PurchaseToken string `json:"purchaseToken,omitempty"` + + // VoidedReason: The reason why the purchase was voided, possible values + // are: 0. Other 1. Remorse 2. Not_received 3. Defective 4. + // Accidental_purchase 5. Fraud 6. Friendly_fraud 7. Chargeback + VoidedReason int64 `json:"voidedReason,omitempty"` + + // VoidedSource: The initiator of voided purchase, possible values are: + // 0. User 1. Developer 2. Google + VoidedSource int64 `json:"voidedSource,omitempty"` + + // VoidedTimeMillis: The time at which the purchase was + // canceled/refunded/charged-back, in milliseconds since the epoch (Jan + // 1, 1970). + VoidedTimeMillis int64 `json:"voidedTimeMillis,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Kind") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *VoidedPurchase) MarshalJSON() ([]byte, error) { + type NoMethod VoidedPurchase + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// VoidedPurchasesListResponse: Response for the voidedpurchases.list +// API. +type VoidedPurchasesListResponse struct { + // PageInfo: General pagination information. + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + // TokenPagination: Pagination information for token pagination. + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + VoidedPurchases []*VoidedPurchase `json:"voidedPurchases,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "PageInfo") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "PageInfo") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *VoidedPurchasesListResponse) MarshalJSON() ([]byte, error) { + type NoMethod VoidedPurchasesListResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// method id "androidpublisher.applications.deviceTierConfigs.create": + +type ApplicationsDeviceTierConfigsCreateCall struct { + s *Service + packageName string + devicetierconfig *DeviceTierConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a new device tier config for an app. +// +// - packageName: Package name of the app. +func (r *ApplicationsDeviceTierConfigsService) Create(packageName string, devicetierconfig *DeviceTierConfig) *ApplicationsDeviceTierConfigsCreateCall { + c := &ApplicationsDeviceTierConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.devicetierconfig = devicetierconfig + return c +} + +// AllowUnknownDevices sets the optional parameter +// "allowUnknownDevices": Whether the service should accept device IDs +// that are unknown to Play's device catalog. +func (c *ApplicationsDeviceTierConfigsCreateCall) AllowUnknownDevices(allowUnknownDevices bool) *ApplicationsDeviceTierConfigsCreateCall { + c.urlParams_.Set("allowUnknownDevices", fmt.Sprint(allowUnknownDevices)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ApplicationsDeviceTierConfigsCreateCall) Fields(s ...googleapi.Field) *ApplicationsDeviceTierConfigsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ApplicationsDeviceTierConfigsCreateCall) Context(ctx context.Context) *ApplicationsDeviceTierConfigsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ApplicationsDeviceTierConfigsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ApplicationsDeviceTierConfigsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.devicetierconfig) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/deviceTierConfigs") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.applications.deviceTierConfigs.create" call. +// Exactly one of *DeviceTierConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DeviceTierConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ApplicationsDeviceTierConfigsCreateCall) Do(opts ...googleapi.CallOption) (*DeviceTierConfig, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &DeviceTierConfig{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new device tier config for an app.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs", + // "httpMethod": "POST", + // "id": "androidpublisher.applications.deviceTierConfigs.create", + // "parameterOrder": [ + // "packageName" + // ], + // "parameters": { + // "allowUnknownDevices": { + // "description": "Whether the service should accept device IDs that are unknown to Play's device catalog.", + // "location": "query", + // "type": "boolean" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs", + // "request": { + // "$ref": "DeviceTierConfig" + // }, + // "response": { + // "$ref": "DeviceTierConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.applications.deviceTierConfigs.get": + +type ApplicationsDeviceTierConfigsGetCall struct { + s *Service + packageName string + deviceTierConfigId int64 + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Returns a particular device tier config. +// +// - deviceTierConfigId: Id of an existing device tier config. +// - packageName: Package name of the app. +func (r *ApplicationsDeviceTierConfigsService) Get(packageName string, deviceTierConfigId int64) *ApplicationsDeviceTierConfigsGetCall { + c := &ApplicationsDeviceTierConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.deviceTierConfigId = deviceTierConfigId + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ApplicationsDeviceTierConfigsGetCall) Fields(s ...googleapi.Field) *ApplicationsDeviceTierConfigsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ApplicationsDeviceTierConfigsGetCall) IfNoneMatch(entityTag string) *ApplicationsDeviceTierConfigsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ApplicationsDeviceTierConfigsGetCall) Context(ctx context.Context) *ApplicationsDeviceTierConfigsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ApplicationsDeviceTierConfigsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ApplicationsDeviceTierConfigsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/deviceTierConfigs/{deviceTierConfigId}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "deviceTierConfigId": strconv.FormatInt(c.deviceTierConfigId, 10), + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.applications.deviceTierConfigs.get" call. +// Exactly one of *DeviceTierConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DeviceTierConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ApplicationsDeviceTierConfigsGetCall) Do(opts ...googleapi.CallOption) (*DeviceTierConfig, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &DeviceTierConfig{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a particular device tier config.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs/{deviceTierConfigId}", + // "httpMethod": "GET", + // "id": "androidpublisher.applications.deviceTierConfigs.get", + // "parameterOrder": [ + // "packageName", + // "deviceTierConfigId" + // ], + // "parameters": { + // "deviceTierConfigId": { + // "description": "Required. Id of an existing device tier config.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs/{deviceTierConfigId}", + // "response": { + // "$ref": "DeviceTierConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.applications.deviceTierConfigs.list": + +type ApplicationsDeviceTierConfigsListCall struct { + s *Service + packageName string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Returns created device tier configs, ordered by descending +// creation time. +// +// - packageName: Package name of the app. +func (r *ApplicationsDeviceTierConfigsService) List(packageName string) *ApplicationsDeviceTierConfigsListCall { + c := &ApplicationsDeviceTierConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of device tier configs to return. The service may return fewer than +// this value. If unspecified, at most 10 device tier configs will be +// returned. The maximum value for this field is 100; values above 100 +// will be coerced to 100. Device tier configs will be ordered by +// descending creation time. +func (c *ApplicationsDeviceTierConfigsListCall) PageSize(pageSize int64) *ApplicationsDeviceTierConfigsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListDeviceTierConfigs` call. Provide this +// to retrieve the subsequent page. +func (c *ApplicationsDeviceTierConfigsListCall) PageToken(pageToken string) *ApplicationsDeviceTierConfigsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ApplicationsDeviceTierConfigsListCall) Fields(s ...googleapi.Field) *ApplicationsDeviceTierConfigsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ApplicationsDeviceTierConfigsListCall) IfNoneMatch(entityTag string) *ApplicationsDeviceTierConfigsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ApplicationsDeviceTierConfigsListCall) Context(ctx context.Context) *ApplicationsDeviceTierConfigsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ApplicationsDeviceTierConfigsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ApplicationsDeviceTierConfigsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/deviceTierConfigs") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.applications.deviceTierConfigs.list" call. +// Exactly one of *ListDeviceTierConfigsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListDeviceTierConfigsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ApplicationsDeviceTierConfigsListCall) Do(opts ...googleapi.CallOption) (*ListDeviceTierConfigsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListDeviceTierConfigsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns created device tier configs, ordered by descending creation time.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs", + // "httpMethod": "GET", + // "id": "androidpublisher.applications.deviceTierConfigs.list", + // "parameterOrder": [ + // "packageName" + // ], + // "parameters": { + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of device tier configs to return. The service may return fewer than this value. If unspecified, at most 10 device tier configs will be returned. The maximum value for this field is 100; values above 100 will be coerced to 100. Device tier configs will be ordered by descending creation time.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token, received from a previous `ListDeviceTierConfigs` call. Provide this to retrieve the subsequent page.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs", + // "response": { + // "$ref": "ListDeviceTierConfigsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ApplicationsDeviceTierConfigsListCall) Pages(ctx context.Context, f func(*ListDeviceTierConfigsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "androidpublisher.edits.commit": + +type EditsCommitCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Commit: Commits an app edit. +// +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsService) Commit(packageName string, editId string) *EditsCommitCall { + c := &EditsCommitCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.editId = editId + return c +} + +// ChangesNotSentForReview sets the optional parameter +// "changesNotSentForReview": Indicates that the changes in this edit +// will not be reviewed until they are explicitly sent for review from +// the Google Play Console UI. These changes will be added to any other +// changes that are not yet sent for review. +func (c *EditsCommitCall) ChangesNotSentForReview(changesNotSentForReview bool) *EditsCommitCall { + c.urlParams_.Set("changesNotSentForReview", fmt.Sprint(changesNotSentForReview)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsCommitCall) Fields(s ...googleapi.Field) *EditsCommitCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EditsCommitCall) Context(ctx context.Context) *EditsCommitCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsCommitCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsCommitCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}:commit") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "editId": c.editId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.commit" call. +// Exactly one of *AppEdit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AppEdit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsCommitCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &AppEdit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Commits an app edit.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}:commit", + // "httpMethod": "POST", + // "id": "androidpublisher.edits.commit", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "changesNotSentForReview": { + // "description": "Indicates that the changes in this edit will not be reviewed until they are explicitly sent for review from the Google Play Console UI. These changes will be added to any other changes that are not yet sent for review.", + // "location": "query", + // "type": "boolean" + // }, + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}:commit", + // "response": { + // "$ref": "AppEdit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.delete": + +type EditsDeleteCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes an app edit. +// +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsService) Delete(packageName string, editId string) *EditsDeleteCall { + c := &EditsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.editId = editId + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsDeleteCall) Fields(s ...googleapi.Field) *EditsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EditsDeleteCall) Context(ctx context.Context) *EditsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "editId": c.editId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.delete" call. +func (c *EditsDeleteCall) Do(opts ...googleapi.CallOption) error { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return gensupport.WrapError(err) + } + return nil + // { + // "description": "Deletes an app edit.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}", + // "httpMethod": "DELETE", + // "id": "androidpublisher.edits.delete", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}", + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.get": + +type EditsGetCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets an app edit. +// +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsService) Get(packageName string, editId string) *EditsGetCall { + c := &EditsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.editId = editId + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsGetCall) Fields(s ...googleapi.Field) *EditsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsGetCall) IfNoneMatch(entityTag string) *EditsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EditsGetCall) Context(ctx context.Context) *EditsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "editId": c.editId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.get" call. +// Exactly one of *AppEdit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AppEdit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsGetCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &AppEdit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets an app edit.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.get", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}", + // "response": { + // "$ref": "AppEdit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.insert": + +type EditsInsertCall struct { + s *Service + packageName string + appedit *AppEdit + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Insert: Creates a new edit for an app. +// +// - packageName: Package name of the app. +func (r *EditsService) Insert(packageName string, appedit *AppEdit) *EditsInsertCall { + c := &EditsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.appedit = appedit + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsInsertCall) Fields(s ...googleapi.Field) *EditsInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EditsInsertCall) Context(ctx context.Context) *EditsInsertCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsInsertCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.appedit) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.insert" call. +// Exactly one of *AppEdit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AppEdit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsInsertCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &AppEdit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new edit for an app.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits", + // "httpMethod": "POST", + // "id": "androidpublisher.edits.insert", + // "parameterOrder": [ + // "packageName" + // ], + // "parameters": { + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits", + // "request": { + // "$ref": "AppEdit" + // }, + // "response": { + // "$ref": "AppEdit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.validate": + +type EditsValidateCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Validate: Validates an app edit. +// +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsService) Validate(packageName string, editId string) *EditsValidateCall { + c := &EditsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.editId = editId + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsValidateCall) Fields(s ...googleapi.Field) *EditsValidateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EditsValidateCall) Context(ctx context.Context) *EditsValidateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsValidateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsValidateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}:validate") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "editId": c.editId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.validate" call. +// Exactly one of *AppEdit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AppEdit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsValidateCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &AppEdit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Validates an app edit.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}:validate", + // "httpMethod": "POST", + // "id": "androidpublisher.edits.validate", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}:validate", + // "response": { + // "$ref": "AppEdit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.apks.addexternallyhosted": + +type EditsApksAddexternallyhostedCall struct { + s *Service + packageName string + editId string + apksaddexternallyhostedrequest *ApksAddExternallyHostedRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Addexternallyhosted: Creates a new APK without uploading the APK +// itself to Google Play, instead hosting the APK at a specified URL. +// This function is only available to organizations using Managed Play +// whose application is configured to restrict distribution to the +// organizations. +// +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsApksService) Addexternallyhosted(packageName string, editId string, apksaddexternallyhostedrequest *ApksAddExternallyHostedRequest) *EditsApksAddexternallyhostedCall { + c := &EditsApksAddexternallyhostedCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.editId = editId + c.apksaddexternallyhostedrequest = apksaddexternallyhostedrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsApksAddexternallyhostedCall) Fields(s ...googleapi.Field) *EditsApksAddexternallyhostedCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EditsApksAddexternallyhostedCall) Context(ctx context.Context) *EditsApksAddexternallyhostedCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsApksAddexternallyhostedCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsApksAddexternallyhostedCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.apksaddexternallyhostedrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/externallyHosted") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "editId": c.editId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.apks.addexternallyhosted" call. +// Exactly one of *ApksAddExternallyHostedResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ApksAddExternallyHostedResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsApksAddexternallyhostedCall) Do(opts ...googleapi.CallOption) (*ApksAddExternallyHostedResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ApksAddExternallyHostedResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new APK without uploading the APK itself to Google Play, instead hosting the APK at a specified URL. This function is only available to organizations using Managed Play whose application is configured to restrict distribution to the organizations.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/externallyHosted", + // "httpMethod": "POST", + // "id": "androidpublisher.edits.apks.addexternallyhosted", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/externallyHosted", + // "request": { + // "$ref": "ApksAddExternallyHostedRequest" + // }, + // "response": { + // "$ref": "ApksAddExternallyHostedResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.apks.list": + +type EditsApksListCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists all current APKs of the app and edit. +// +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsApksService) List(packageName string, editId string) *EditsApksListCall { + c := &EditsApksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.editId = editId + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsApksListCall) Fields(s ...googleapi.Field) *EditsApksListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsApksListCall) IfNoneMatch(entityTag string) *EditsApksListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EditsApksListCall) Context(ctx context.Context) *EditsApksListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsApksListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsApksListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "editId": c.editId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.apks.list" call. +// Exactly one of *ApksListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ApksListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsApksListCall) Do(opts ...googleapi.CallOption) (*ApksListResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ApksListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all current APKs of the app and edit.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.apks.list", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks", + // "response": { + // "$ref": "ApksListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.apks.upload": + +type EditsApksUploadCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + mediaInfo_ *gensupport.MediaInfo + ctx_ context.Context + header_ http.Header +} + +// Upload: Uploads an APK and adds to the current edit. +// +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsApksService) Upload(packageName string, editId string) *EditsApksUploadCall { + c := &EditsApksUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.editId = editId + return c +} + +// Media specifies the media to upload in one or more chunks. The chunk +// size may be controlled by supplying a MediaOption generated by +// googleapi.ChunkSize. The chunk size defaults to +// googleapi.DefaultUploadChunkSize.The Content-Type header used in the +// upload request will be determined by sniffing the contents of r, +// unless a MediaOption generated by googleapi.ContentType is +// supplied. +// At most one of Media and ResumableMedia may be set. +func (c *EditsApksUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsApksUploadCall { + c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be +// canceled with ctx. +// +// Deprecated: use Media instead. +// +// At most one of Media and ResumableMedia may be set. mediaType +// identifies the MIME media type of the upload, such as "image/png". If +// mediaType is "", it will be auto-detected. The provided ctx will +// supersede any context previously provided to the Context method. +func (c *EditsApksUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsApksUploadCall { + c.ctx_ = ctx + c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) + return c +} + +// ProgressUpdater provides a callback function that will be called +// after every chunk. It should be a low-latency function in order to +// not slow down the upload operation. This should only be called when +// using ResumableMedia (as opposed to Media). +func (c *EditsApksUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsApksUploadCall { + c.mediaInfo_.SetProgressUpdater(pu) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsApksUploadCall) Fields(s ...googleapi.Field) *EditsApksUploadCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +// This context will supersede any context previously provided to the +// ResumableMedia method. +func (c *EditsApksUploadCall) Context(ctx context.Context) *EditsApksUploadCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsApksUploadCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsApksUploadCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks") + if c.mediaInfo_ != nil { + urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks") + c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) + } + if body == nil { + body = new(bytes.Buffer) + reqHeaders.Set("Content-Type", "application/json") + } + body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + defer cleanup() + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + req.GetBody = getBody + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "editId": c.editId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.apks.upload" call. +// Exactly one of *Apk or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Apk.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *EditsApksUploadCall) Do(opts ...googleapi.CallOption) (*Apk, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) + if rx != nil { + rx.Client = c.s.client + rx.UserAgent = c.s.userAgent() + ctx := c.ctx_ + if ctx == nil { + ctx = context.TODO() + } + res, err = rx.Upload(ctx) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + } + ret := &Apk{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Uploads an APK and adds to the current edit.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks", + // "httpMethod": "POST", + // "id": "androidpublisher.edits.apks.upload", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream", + // "application/vnd.android.package-archive" + // ], + // "maxSize": "10737418240", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks" + // } + // } + // }, + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks", + // "response": { + // "$ref": "Apk" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ], + // "supportsMediaUpload": true + // } + } -// method id "androidpublisher.applications.deviceTierConfigs.create": +// method id "androidpublisher.edits.bundles.list": -type ApplicationsDeviceTierConfigsCreateCall struct { - s *Service - packageName string - devicetierconfig *DeviceTierConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type EditsBundlesListCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a new device tier config for an app. +// List: Lists all current Android App Bundles of the app and edit. // +// - editId: Identifier of the edit. // - packageName: Package name of the app. -func (r *ApplicationsDeviceTierConfigsService) Create(packageName string, devicetierconfig *DeviceTierConfig) *ApplicationsDeviceTierConfigsCreateCall { - c := &ApplicationsDeviceTierConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsBundlesService) List(packageName string, editId string) *EditsBundlesListCall { + c := &EditsBundlesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.devicetierconfig = devicetierconfig - return c -} - -// AllowUnknownDevices sets the optional parameter -// "allowUnknownDevices": Whether the service should accept device IDs -// that are unknown to Play's device catalog. -func (c *ApplicationsDeviceTierConfigsCreateCall) AllowUnknownDevices(allowUnknownDevices bool) *ApplicationsDeviceTierConfigsCreateCall { - c.urlParams_.Set("allowUnknownDevices", fmt.Sprint(allowUnknownDevices)) + c.editId = editId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ApplicationsDeviceTierConfigsCreateCall) Fields(s ...googleapi.Field) *ApplicationsDeviceTierConfigsCreateCall { +func (c *EditsBundlesListCall) Fields(s ...googleapi.Field) *EditsBundlesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsBundlesListCall) IfNoneMatch(entityTag string) *EditsBundlesListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ApplicationsDeviceTierConfigsCreateCall) Context(ctx context.Context) *ApplicationsDeviceTierConfigsCreateCall { +func (c *EditsBundlesListCall) Context(ctx context.Context) *EditsBundlesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ApplicationsDeviceTierConfigsCreateCall) Header() http.Header { +func (c *EditsBundlesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ApplicationsDeviceTierConfigsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsBundlesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.devicetierconfig) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/deviceTierConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, + "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.applications.deviceTierConfigs.create" call. -// Exactly one of *DeviceTierConfig or error will be non-nil. Any +// Do executes the "androidpublisher.edits.bundles.list" call. +// Exactly one of *BundlesListResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *DeviceTierConfig.ServerResponse.Header or (if a response was +// *BundlesListResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ApplicationsDeviceTierConfigsCreateCall) Do(opts ...googleapi.CallOption) (*DeviceTierConfig, error) { +func (c *EditsBundlesListCall) Do(opts ...googleapi.CallOption) (*BundlesListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7588,7 +10460,7 @@ func (c *ApplicationsDeviceTierConfigsCreateCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &DeviceTierConfig{ + ret := &BundlesListResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7600,18 +10472,20 @@ func (c *ApplicationsDeviceTierConfigsCreateCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Creates a new device tier config for an app.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs", - // "httpMethod": "POST", - // "id": "androidpublisher.applications.deviceTierConfigs.create", + // "description": "Lists all current Android App Bundles of the app and edit.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.bundles.list", // "parameterOrder": [ - // "packageName" + // "packageName", + // "editId" // ], // "parameters": { - // "allowUnknownDevices": { - // "description": "Whether the service should accept device IDs that are unknown to Play's device catalog.", - // "location": "query", - // "type": "boolean" + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", @@ -7620,12 +10494,9 @@ func (c *ApplicationsDeviceTierConfigsCreateCall) Do(opts ...googleapi.CallOptio // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs", - // "request": { - // "$ref": "DeviceTierConfig" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles", // "response": { - // "$ref": "DeviceTierConfig" + // "$ref": "BundlesListResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -7634,99 +10505,158 @@ func (c *ApplicationsDeviceTierConfigsCreateCall) Do(opts ...googleapi.CallOptio } -// method id "androidpublisher.applications.deviceTierConfigs.get": - -type ApplicationsDeviceTierConfigsGetCall struct { - s *Service - packageName string - deviceTierConfigId int64 - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "androidpublisher.edits.bundles.upload": + +type EditsBundlesUploadCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + mediaInfo_ *gensupport.MediaInfo + ctx_ context.Context + header_ http.Header +} + +// Upload: Uploads a new Android App Bundle to this edit. If you are +// using the Google API client libraries, please increase the timeout of +// the http request before calling this endpoint (a timeout of 2 minutes +// is recommended). See Timeouts and Errors +// (https://developers.google.com/api-client-library/java/google-api-java-client/errors) +// for an example in java. +// +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsBundlesService) Upload(packageName string, editId string) *EditsBundlesUploadCall { + c := &EditsBundlesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.editId = editId + return c +} + +// AckBundleInstallationWarning sets the optional parameter +// "ackBundleInstallationWarning": Must be set to true if the app bundle +// installation may trigger a warning on user devices (for example, if +// installation size may be over a threshold, typically 100 MB). +func (c *EditsBundlesUploadCall) AckBundleInstallationWarning(ackBundleInstallationWarning bool) *EditsBundlesUploadCall { + c.urlParams_.Set("ackBundleInstallationWarning", fmt.Sprint(ackBundleInstallationWarning)) + return c +} + +// DeviceTierConfigId sets the optional parameter "deviceTierConfigId": +// Device tier config (DTC) to be used for generating deliverables +// (APKs). Contains id of the DTC or "LATEST" for last uploaded DTC. +func (c *EditsBundlesUploadCall) DeviceTierConfigId(deviceTierConfigId string) *EditsBundlesUploadCall { + c.urlParams_.Set("deviceTierConfigId", deviceTierConfigId) + return c +} + +// Media specifies the media to upload in one or more chunks. The chunk +// size may be controlled by supplying a MediaOption generated by +// googleapi.ChunkSize. The chunk size defaults to +// googleapi.DefaultUploadChunkSize.The Content-Type header used in the +// upload request will be determined by sniffing the contents of r, +// unless a MediaOption generated by googleapi.ContentType is +// supplied. +// At most one of Media and ResumableMedia may be set. +func (c *EditsBundlesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsBundlesUploadCall { + c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) + return c } -// Get: Returns a particular device tier config. +// ResumableMedia specifies the media to upload in chunks and can be +// canceled with ctx. // -// - deviceTierConfigId: Id of an existing device tier config. -// - packageName: Package name of the app. -func (r *ApplicationsDeviceTierConfigsService) Get(packageName string, deviceTierConfigId int64) *ApplicationsDeviceTierConfigsGetCall { - c := &ApplicationsDeviceTierConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.packageName = packageName - c.deviceTierConfigId = deviceTierConfigId +// Deprecated: use Media instead. +// +// At most one of Media and ResumableMedia may be set. mediaType +// identifies the MIME media type of the upload, such as "image/png". If +// mediaType is "", it will be auto-detected. The provided ctx will +// supersede any context previously provided to the Context method. +func (c *EditsBundlesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsBundlesUploadCall { + c.ctx_ = ctx + c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) + return c +} + +// ProgressUpdater provides a callback function that will be called +// after every chunk. It should be a low-latency function in order to +// not slow down the upload operation. This should only be called when +// using ResumableMedia (as opposed to Media). +func (c *EditsBundlesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsBundlesUploadCall { + c.mediaInfo_.SetProgressUpdater(pu) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ApplicationsDeviceTierConfigsGetCall) Fields(s ...googleapi.Field) *ApplicationsDeviceTierConfigsGetCall { +func (c *EditsBundlesUploadCall) Fields(s ...googleapi.Field) *EditsBundlesUploadCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ApplicationsDeviceTierConfigsGetCall) IfNoneMatch(entityTag string) *ApplicationsDeviceTierConfigsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ApplicationsDeviceTierConfigsGetCall) Context(ctx context.Context) *ApplicationsDeviceTierConfigsGetCall { +// This context will supersede any context previously provided to the +// ResumableMedia method. +func (c *EditsBundlesUploadCall) Context(ctx context.Context) *EditsBundlesUploadCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ApplicationsDeviceTierConfigsGetCall) Header() http.Header { +func (c *EditsBundlesUploadCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ApplicationsDeviceTierConfigsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsBundlesUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/deviceTierConfigs/{deviceTierConfigId}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles") + if c.mediaInfo_ != nil { + urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles") + c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) + } + if body == nil { + body = new(bytes.Buffer) + reqHeaders.Set("Content-Type", "application/json") + } + body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders + req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "deviceTierConfigId": strconv.FormatInt(c.deviceTierConfigId, 10), + "packageName": c.packageName, + "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.applications.deviceTierConfigs.get" call. -// Exactly one of *DeviceTierConfig or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *DeviceTierConfig.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ApplicationsDeviceTierConfigsGetCall) Do(opts ...googleapi.CallOption) (*DeviceTierConfig, error) { +// Do executes the "androidpublisher.edits.bundles.upload" call. +// Exactly one of *Bundle or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Bundle.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsBundlesUploadCall) Do(opts ...googleapi.CallOption) (*Bundle, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7745,7 +10675,24 @@ func (c *ApplicationsDeviceTierConfigsGetCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &DeviceTierConfig{ + rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) + if rx != nil { + rx.Client = c.s.client + rx.UserAgent = c.s.userAgent() + ctx := c.ctx_ + if ctx == nil { + ctx = context.TODO() + } + res, err = rx.Upload(ctx) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + } + ret := &Bundle{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7757,18 +10704,43 @@ func (c *ApplicationsDeviceTierConfigsGetCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Returns a particular device tier config.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs/{deviceTierConfigId}", - // "httpMethod": "GET", - // "id": "androidpublisher.applications.deviceTierConfigs.get", + // "description": "Uploads a new Android App Bundle to this edit. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See [Timeouts and Errors](https://developers.google.com/api-client-library/java/google-api-java-client/errors) for an example in java.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles", + // "httpMethod": "POST", + // "id": "androidpublisher.edits.bundles.upload", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream" + // ], + // "maxSize": "10737418240", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles" + // } + // } + // }, // "parameterOrder": [ // "packageName", - // "deviceTierConfigId" + // "editId" // ], // "parameters": { + // "ackBundleInstallationWarning": { + // "description": "Must be set to true if the app bundle installation may trigger a warning on user devices (for example, if installation size may be over a threshold, typically 100 MB).", + // "location": "query", + // "type": "boolean" + // }, // "deviceTierConfigId": { - // "description": "Required. Id of an existing device tier config.", - // "format": "int64", + // "description": "Device tier config (DTC) to be used for generating deliverables (APKs). Contains id of the DTC or \"LATEST\" for last uploaded DTC.", + // "location": "query", + // "type": "string" + // }, + // "editId": { + // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" @@ -7780,61 +10752,48 @@ func (c *ApplicationsDeviceTierConfigsGetCall) Do(opts ...googleapi.CallOption) // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs/{deviceTierConfigId}", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles", // "response": { - // "$ref": "DeviceTierConfig" + // "$ref": "Bundle" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ] + // ], + // "supportsMediaUpload": true // } } -// method id "androidpublisher.applications.deviceTierConfigs.list": +// method id "androidpublisher.edits.countryavailability.get": -type ApplicationsDeviceTierConfigsListCall struct { +type EditsCountryavailabilityGetCall struct { s *Service packageName string + editId string + track string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Returns created device tier configs, ordered by descending -// creation time. +// Get: Gets country availability. // +// - editId: Identifier of the edit. // - packageName: Package name of the app. -func (r *ApplicationsDeviceTierConfigsService) List(packageName string) *ApplicationsDeviceTierConfigsListCall { - c := &ApplicationsDeviceTierConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - track: The track to read from. +func (r *EditsCountryavailabilityService) Get(packageName string, editId string, track string) *EditsCountryavailabilityGetCall { + c := &EditsCountryavailabilityGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of device tier configs to return. The service may return fewer than -// this value. If unspecified, at most 10 device tier configs will be -// returned. The maximum value for this field is 100; values above 100 -// will be coerced to 100. Device tier configs will be ordered by -// descending creation time. -func (c *ApplicationsDeviceTierConfigsListCall) PageSize(pageSize int64) *ApplicationsDeviceTierConfigsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": A page token, -// received from a previous `ListDeviceTierConfigs` call. Provide this -// to retrieve the subsequent page. -func (c *ApplicationsDeviceTierConfigsListCall) PageToken(pageToken string) *ApplicationsDeviceTierConfigsListCall { - c.urlParams_.Set("pageToken", pageToken) + c.editId = editId + c.track = track return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ApplicationsDeviceTierConfigsListCall) Fields(s ...googleapi.Field) *ApplicationsDeviceTierConfigsListCall { +func (c *EditsCountryavailabilityGetCall) Fields(s ...googleapi.Field) *EditsCountryavailabilityGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7844,7 +10803,7 @@ func (c *ApplicationsDeviceTierConfigsListCall) Fields(s ...googleapi.Field) *Ap // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ApplicationsDeviceTierConfigsListCall) IfNoneMatch(entityTag string) *ApplicationsDeviceTierConfigsListCall { +func (c *EditsCountryavailabilityGetCall) IfNoneMatch(entityTag string) *EditsCountryavailabilityGetCall { c.ifNoneMatch_ = entityTag return c } @@ -7852,21 +10811,21 @@ func (c *ApplicationsDeviceTierConfigsListCall) IfNoneMatch(entityTag string) *A // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ApplicationsDeviceTierConfigsListCall) Context(ctx context.Context) *ApplicationsDeviceTierConfigsListCall { +func (c *EditsCountryavailabilityGetCall) Context(ctx context.Context) *EditsCountryavailabilityGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ApplicationsDeviceTierConfigsListCall) Header() http.Header { +func (c *EditsCountryavailabilityGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ApplicationsDeviceTierConfigsListCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsCountryavailabilityGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -7879,7 +10838,7 @@ func (c *ApplicationsDeviceTierConfigsListCall) doRequest(alt string) (*http.Res var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/deviceTierConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/countryAvailability/{track}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -7888,18 +10847,20 @@ func (c *ApplicationsDeviceTierConfigsListCall) doRequest(alt string) (*http.Res req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, + "editId": c.editId, + "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.applications.deviceTierConfigs.list" call. -// Exactly one of *ListDeviceTierConfigsResponse or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *ListDeviceTierConfigsResponse.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "androidpublisher.edits.countryavailability.get" call. +// Exactly one of *TrackCountryAvailability or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TrackCountryAvailability.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ApplicationsDeviceTierConfigsListCall) Do(opts ...googleapi.CallOption) (*ListDeviceTierConfigsResponse, error) { +func (c *EditsCountryavailabilityGetCall) Do(opts ...googleapi.CallOption) (*TrackCountryAvailability, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7918,7 +10879,7 @@ func (c *ApplicationsDeviceTierConfigsListCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListDeviceTierConfigsResponse{ + ret := &TrackCountryAvailability{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7930,35 +10891,38 @@ func (c *ApplicationsDeviceTierConfigsListCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Returns created device tier configs, ordered by descending creation time.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs", + // "description": "Gets country availability.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/countryAvailability/{track}", // "httpMethod": "GET", - // "id": "androidpublisher.applications.deviceTierConfigs.list", + // "id": "androidpublisher.edits.countryavailability.get", // "parameterOrder": [ - // "packageName" + // "packageName", + // "editId", + // "track" // ], // "parameters": { - // "packageName": { - // "description": "Package name of the app.", + // "editId": { + // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, - // "pageSize": { - // "description": "The maximum number of device tier configs to return. The service may return fewer than this value. If unspecified, at most 10 device tier configs will be returned. The maximum value for this field is 100; values above 100 will be coerced to 100. Device tier configs will be ordered by descending creation time.", - // "format": "int32", - // "location": "query", - // "type": "integer" + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" // }, - // "pageToken": { - // "description": "A page token, received from a previous `ListDeviceTierConfigs` call. Provide this to retrieve the subsequent page.", - // "location": "query", + // "track": { + // "description": "The track to read from.", + // "location": "path", + // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/countryAvailability/{track}", // "response": { - // "$ref": "ListDeviceTierConfigsResponse" + // "$ref": "TrackCountryAvailability" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -7967,63 +10931,78 @@ func (c *ApplicationsDeviceTierConfigsListCall) Do(opts ...googleapi.CallOption) } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ApplicationsDeviceTierConfigsListCall) Pages(ctx context.Context, f func(*ListDeviceTierConfigsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } +// method id "androidpublisher.edits.deobfuscationfiles.upload": + +type EditsDeobfuscationfilesUploadCall struct { + s *Service + packageNameid string + editId string + apkVersionCode int64 + deobfuscationFileType string + urlParams_ gensupport.URLParams + mediaInfo_ *gensupport.MediaInfo + ctx_ context.Context + header_ http.Header } -// method id "androidpublisher.edits.commit": +// Upload: Uploads a new deobfuscation file and attaches to the +// specified APK. +// +// - apkVersionCode: The version code of the APK whose Deobfuscation +// File is being uploaded. +// - deobfuscationFileType: The type of the deobfuscation file. +// - editId: Unique identifier for this edit. +// - packageName: Unique identifier for the Android app. +func (r *EditsDeobfuscationfilesService) Upload(packageNameid string, editId string, apkVersionCode int64, deobfuscationFileType string) *EditsDeobfuscationfilesUploadCall { + c := &EditsDeobfuscationfilesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageNameid = packageNameid + c.editId = editId + c.apkVersionCode = apkVersionCode + c.deobfuscationFileType = deobfuscationFileType + return c +} -type EditsCommitCall struct { - s *Service - packageName string - editId string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Media specifies the media to upload in one or more chunks. The chunk +// size may be controlled by supplying a MediaOption generated by +// googleapi.ChunkSize. The chunk size defaults to +// googleapi.DefaultUploadChunkSize.The Content-Type header used in the +// upload request will be determined by sniffing the contents of r, +// unless a MediaOption generated by googleapi.ContentType is +// supplied. +// At most one of Media and ResumableMedia may be set. +func (c *EditsDeobfuscationfilesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsDeobfuscationfilesUploadCall { + c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) + return c } -// Commit: Commits an app edit. +// ResumableMedia specifies the media to upload in chunks and can be +// canceled with ctx. // -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -func (r *EditsService) Commit(packageName string, editId string) *EditsCommitCall { - c := &EditsCommitCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.packageName = packageName - c.editId = editId +// Deprecated: use Media instead. +// +// At most one of Media and ResumableMedia may be set. mediaType +// identifies the MIME media type of the upload, such as "image/png". If +// mediaType is "", it will be auto-detected. The provided ctx will +// supersede any context previously provided to the Context method. +func (c *EditsDeobfuscationfilesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsDeobfuscationfilesUploadCall { + c.ctx_ = ctx + c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) return c } -// ChangesNotSentForReview sets the optional parameter -// "changesNotSentForReview": Indicates that the changes in this edit -// will not be reviewed until they are explicitly sent for review from -// the Google Play Console UI. These changes will be added to any other -// changes that are not yet sent for review. -func (c *EditsCommitCall) ChangesNotSentForReview(changesNotSentForReview bool) *EditsCommitCall { - c.urlParams_.Set("changesNotSentForReview", fmt.Sprint(changesNotSentForReview)) +// ProgressUpdater provides a callback function that will be called +// after every chunk. It should be a low-latency function in order to +// not slow down the upload operation. This should only be called when +// using ResumableMedia (as opposed to Media). +func (c *EditsDeobfuscationfilesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsDeobfuscationfilesUploadCall { + c.mediaInfo_.SetProgressUpdater(pu) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsCommitCall) Fields(s ...googleapi.Field) *EditsCommitCall { +func (c *EditsDeobfuscationfilesUploadCall) Fields(s ...googleapi.Field) *EditsDeobfuscationfilesUploadCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8031,21 +11010,23 @@ func (c *EditsCommitCall) Fields(s ...googleapi.Field) *EditsCommitCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsCommitCall) Context(ctx context.Context) *EditsCommitCall { +// This context will supersede any context previously provided to the +// ResumableMedia method. +func (c *EditsDeobfuscationfilesUploadCall) Context(ctx context.Context) *EditsDeobfuscationfilesUploadCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsCommitCall) Header() http.Header { +func (c *EditsDeobfuscationfilesUploadCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsCommitCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsDeobfuscationfilesUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -8055,28 +11036,41 @@ func (c *EditsCommitCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}:commit") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}") + if c.mediaInfo_ != nil { + urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}") + c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) + } + if body == nil { + body = new(bytes.Buffer) + reqHeaders.Set("Content-Type", "application/json") + } + body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + defer cleanup() urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders + req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, + "packageName": c.packageNameid, + "editId": c.editId, + "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), + "deobfuscationFileType": c.deobfuscationFileType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.commit" call. -// Exactly one of *AppEdit or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *AppEdit.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsCommitCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { +// Do executes the "androidpublisher.edits.deobfuscationfiles.upload" call. +// Exactly one of *DeobfuscationFilesUploadResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *DeobfuscationFilesUploadResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsDeobfuscationfilesUploadCall) Do(opts ...googleapi.CallOption) (*DeobfuscationFilesUploadResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8095,7 +11089,24 @@ func (c *EditsCommitCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &AppEdit{ + rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) + if rx != nil { + rx.Client = c.s.client + rx.UserAgent = c.s.userAgent() + ctx := c.ctx_ + if ctx == nil { + ctx = context.TODO() + } + res, err = rx.Upload(ctx) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + } + ret := &DeobfuscationFilesUploadResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8107,61 +11118,99 @@ func (c *EditsCommitCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { } return ret, nil // { - // "description": "Commits an app edit.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}:commit", + // "description": "Uploads a new deobfuscation file and attaches to the specified APK.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}", // "httpMethod": "POST", - // "id": "androidpublisher.edits.commit", + // "id": "androidpublisher.edits.deobfuscationfiles.upload", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream" + // ], + // "maxSize": "1677721600", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}" + // } + // } + // }, // "parameterOrder": [ // "packageName", - // "editId" + // "editId", + // "apkVersionCode", + // "deobfuscationFileType" // ], // "parameters": { - // "changesNotSentForReview": { - // "description": "Indicates that the changes in this edit will not be reviewed until they are explicitly sent for review from the Google Play Console UI. These changes will be added to any other changes that are not yet sent for review.", - // "location": "query", - // "type": "boolean" + // "apkVersionCode": { + // "description": "The version code of the APK whose Deobfuscation File is being uploaded.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "deobfuscationFileType": { + // "description": "The type of the deobfuscation file.", + // "enum": [ + // "deobfuscationFileTypeUnspecified", + // "proguard", + // "nativeCode" + // ], + // "enumDescriptions": [ + // "Unspecified deobfuscation file type.", + // "Proguard deobfuscation file type.", + // "Native debugging symbols file type." + // ], + // "location": "path", + // "required": true, + // "type": "string" // }, // "editId": { - // "description": "Identifier of the edit.", + // "description": "Unique identifier for this edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { - // "description": "Package name of the app.", + // "description": "Unique identifier for the Android app.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}:commit", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}", // "response": { - // "$ref": "AppEdit" + // "$ref": "DeobfuscationFilesUploadResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ] + // ], + // "supportsMediaUpload": true // } } -// method id "androidpublisher.edits.delete": +// method id "androidpublisher.edits.details.get": -type EditsDeleteCall struct { - s *Service - packageName string - editId string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type EditsDetailsGetCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an app edit. +// Get: Gets details of an app. // // - editId: Identifier of the edit. // - packageName: Package name of the app. -func (r *EditsService) Delete(packageName string, editId string) *EditsDeleteCall { - c := &EditsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsDetailsService) Get(packageName string, editId string) *EditsDetailsGetCall { + c := &EditsDetailsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId return c @@ -8170,41 +11219,54 @@ func (r *EditsService) Delete(packageName string, editId string) *EditsDeleteCal // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsDeleteCall) Fields(s ...googleapi.Field) *EditsDeleteCall { +func (c *EditsDetailsGetCall) Fields(s ...googleapi.Field) *EditsDetailsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsDetailsGetCall) IfNoneMatch(entityTag string) *EditsDetailsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsDeleteCall) Context(ctx context.Context) *EditsDeleteCall { +func (c *EditsDetailsGetCall) Context(ctx context.Context) *EditsDetailsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsDeleteCall) Header() http.Header { +func (c *EditsDetailsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsDetailsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/details") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -8216,23 +11278,48 @@ func (c *EditsDeleteCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.delete" call. -func (c *EditsDeleteCall) Do(opts ...googleapi.CallOption) error { +// Do executes the "androidpublisher.edits.details.get" call. +// Exactly one of *AppDetails or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AppDetails.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EditsDetailsGetCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } if err != nil { - return err + return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return gensupport.WrapError(err) + return nil, gensupport.WrapError(err) } - return nil + ret := &AppDetails{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil // { - // "description": "Deletes an app edit.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}", - // "httpMethod": "DELETE", - // "id": "androidpublisher.edits.delete", + // "description": "Gets details of an app.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.details.get", // "parameterOrder": [ // "packageName", // "editId" @@ -8251,7 +11338,10 @@ func (c *EditsDeleteCall) Do(opts ...googleapi.CallOption) error { // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", + // "response": { + // "$ref": "AppDetails" + // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -8259,80 +11349,73 @@ func (c *EditsDeleteCall) Do(opts ...googleapi.CallOption) error { } -// method id "androidpublisher.edits.get": +// method id "androidpublisher.edits.details.patch": -type EditsGetCall struct { - s *Service - packageName string - editId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type EditsDetailsPatchCall struct { + s *Service + packageName string + editId string + appdetails *AppDetails + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets an app edit. +// Patch: Patches details of an app. // // - editId: Identifier of the edit. // - packageName: Package name of the app. -func (r *EditsService) Get(packageName string, editId string) *EditsGetCall { - c := &EditsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsDetailsService) Patch(packageName string, editId string, appdetails *AppDetails) *EditsDetailsPatchCall { + c := &EditsDetailsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId + c.appdetails = appdetails return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsGetCall) Fields(s ...googleapi.Field) *EditsGetCall { +func (c *EditsDetailsPatchCall) Fields(s ...googleapi.Field) *EditsDetailsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *EditsGetCall) IfNoneMatch(entityTag string) *EditsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsGetCall) Context(ctx context.Context) *EditsGetCall { +func (c *EditsDetailsPatchCall) Context(ctx context.Context) *EditsDetailsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsGetCall) Header() http.Header { +func (c *EditsDetailsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsDetailsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/details") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -8344,14 +11427,14 @@ func (c *EditsGetCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.get" call. -// Exactly one of *AppEdit or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *AppEdit.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsGetCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { +// Do executes the "androidpublisher.edits.details.patch" call. +// Exactly one of *AppDetails or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AppDetails.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EditsDetailsPatchCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8370,7 +11453,7 @@ func (c *EditsGetCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &AppEdit{ + ret := &AppDetails{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8382,10 +11465,10 @@ func (c *EditsGetCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { } return ret, nil // { - // "description": "Gets an app edit.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}", - // "httpMethod": "GET", - // "id": "androidpublisher.edits.get", + // "description": "Patches details of an app.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", + // "httpMethod": "PATCH", + // "id": "androidpublisher.edits.details.patch", // "parameterOrder": [ // "packageName", // "editId" @@ -8404,9 +11487,12 @@ func (c *EditsGetCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", + // "request": { + // "$ref": "AppDetails" + // }, // "response": { - // "$ref": "AppEdit" + // "$ref": "AppDetails" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -8415,31 +11501,34 @@ func (c *EditsGetCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { } -// method id "androidpublisher.edits.insert": +// method id "androidpublisher.edits.details.update": -type EditsInsertCall struct { +type EditsDetailsUpdateCall struct { s *Service packageName string - appedit *AppEdit + editId string + appdetails *AppDetails urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Insert: Creates a new edit for an app. +// Update: Updates details of an app. // +// - editId: Identifier of the edit. // - packageName: Package name of the app. -func (r *EditsService) Insert(packageName string, appedit *AppEdit) *EditsInsertCall { - c := &EditsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsDetailsService) Update(packageName string, editId string, appdetails *AppDetails) *EditsDetailsUpdateCall { + c := &EditsDetailsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.appedit = appedit + c.editId = editId + c.appdetails = appdetails return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsInsertCall) Fields(s ...googleapi.Field) *EditsInsertCall { +func (c *EditsDetailsUpdateCall) Fields(s ...googleapi.Field) *EditsDetailsUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8447,21 +11536,21 @@ func (c *EditsInsertCall) Fields(s ...googleapi.Field) *EditsInsertCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsInsertCall) Context(ctx context.Context) *EditsInsertCall { +func (c *EditsDetailsUpdateCall) Context(ctx context.Context) *EditsDetailsUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsInsertCall) Header() http.Header { +func (c *EditsDetailsUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsDetailsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -8469,34 +11558,35 @@ func (c *EditsInsertCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.appedit) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/details") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, + "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.insert" call. -// Exactly one of *AppEdit or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *AppEdit.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsInsertCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { +// Do executes the "androidpublisher.edits.details.update" call. +// Exactly one of *AppDetails or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AppDetails.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EditsDetailsUpdateCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8515,7 +11605,7 @@ func (c *EditsInsertCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &AppEdit{ + ret := &AppDetails{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8527,14 +11617,21 @@ func (c *EditsInsertCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { } return ret, nil // { - // "description": "Creates a new edit for an app.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits", - // "httpMethod": "POST", - // "id": "androidpublisher.edits.insert", + // "description": "Updates details of an app.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", + // "httpMethod": "PUT", + // "id": "androidpublisher.edits.details.update", // "parameterOrder": [ - // "packageName" + // "packageName", + // "editId" // ], // "parameters": { + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", @@ -8542,12 +11639,12 @@ func (c *EditsInsertCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", // "request": { - // "$ref": "AppEdit" + // "$ref": "AppDetails" // }, // "response": { - // "$ref": "AppEdit" + // "$ref": "AppDetails" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -8556,85 +11653,109 @@ func (c *EditsInsertCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { } -// method id "androidpublisher.edits.validate": +// method id "androidpublisher.edits.expansionfiles.get": -type EditsValidateCall struct { - s *Service - packageName string - editId string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type EditsExpansionfilesGetCall struct { + s *Service + packageName string + editId string + apkVersionCode int64 + expansionFileType string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Validate: Validates an app edit. +// Get: Fetches the expansion file configuration for the specified APK. // -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -func (r *EditsService) Validate(packageName string, editId string) *EditsValidateCall { - c := &EditsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - apkVersionCode: The version code of the APK whose expansion file +// configuration is being read or modified. +// - editId: Identifier of the edit. +// - expansionFileType: The file type of the file configuration which is +// being read or modified. +// - packageName: Package name of the app. +func (r *EditsExpansionfilesService) Get(packageName string, editId string, apkVersionCode int64, expansionFileType string) *EditsExpansionfilesGetCall { + c := &EditsExpansionfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId + c.apkVersionCode = apkVersionCode + c.expansionFileType = expansionFileType return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsValidateCall) Fields(s ...googleapi.Field) *EditsValidateCall { +func (c *EditsExpansionfilesGetCall) Fields(s ...googleapi.Field) *EditsExpansionfilesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsExpansionfilesGetCall) IfNoneMatch(entityTag string) *EditsExpansionfilesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsValidateCall) Context(ctx context.Context) *EditsValidateCall { +func (c *EditsExpansionfilesGetCall) Context(ctx context.Context) *EditsExpansionfilesGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsValidateCall) Header() http.Header { +func (c *EditsExpansionfilesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsValidateCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsExpansionfilesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}:validate") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, + "packageName": c.packageName, + "editId": c.editId, + "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), + "expansionFileType": c.expansionFileType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.validate" call. -// Exactly one of *AppEdit or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *AppEdit.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsValidateCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { +// Do executes the "androidpublisher.edits.expansionfiles.get" call. +// Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ExpansionFile.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsExpansionfilesGetCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8653,7 +11774,7 @@ func (c *EditsValidateCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &AppEdit{ + ret := &ExpansionFile{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8665,21 +11786,46 @@ func (c *EditsValidateCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { } return ret, nil // { - // "description": "Validates an app edit.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}:validate", - // "httpMethod": "POST", - // "id": "androidpublisher.edits.validate", + // "description": "Fetches the expansion file configuration for the specified APK.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.expansionfiles.get", // "parameterOrder": [ // "packageName", - // "editId" + // "editId", + // "apkVersionCode", + // "expansionFileType" // ], // "parameters": { + // "apkVersionCode": { + // "description": "The version code of the APK whose expansion file configuration is being read or modified.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, + // "expansionFileType": { + // "description": "The file type of the file configuration which is being read or modified.", + // "enum": [ + // "expansionFileTypeUnspecified", + // "main", + // "patch" + // ], + // "enumDescriptions": [ + // "Unspecified expansion file type.", + // "Main expansion file.", + // "Patch expansion file." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", @@ -8687,9 +11833,9 @@ func (c *EditsValidateCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}:validate", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", // "response": { - // "$ref": "AppEdit" + // "$ref": "ExpansionFile" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -8698,38 +11844,44 @@ func (c *EditsValidateCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { } -// method id "androidpublisher.edits.apks.addexternallyhosted": +// method id "androidpublisher.edits.expansionfiles.patch": -type EditsApksAddexternallyhostedCall struct { - s *Service - packageName string - editId string - apksaddexternallyhostedrequest *ApksAddExternallyHostedRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type EditsExpansionfilesPatchCall struct { + s *Service + packageName string + editId string + apkVersionCode int64 + expansionFileType string + expansionfile *ExpansionFile + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Addexternallyhosted: Creates a new APK without uploading the APK -// itself to Google Play, instead hosting the APK at a specified URL. -// This function is only available to organizations using Managed Play -// whose application is configured to restrict distribution to the -// organizations. +// Patch: Patches the APK's expansion file configuration to reference +// another APK's expansion file. To add a new expansion file use the +// Upload method. // -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -func (r *EditsApksService) Addexternallyhosted(packageName string, editId string, apksaddexternallyhostedrequest *ApksAddExternallyHostedRequest) *EditsApksAddexternallyhostedCall { - c := &EditsApksAddexternallyhostedCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - apkVersionCode: The version code of the APK whose expansion file +// configuration is being read or modified. +// - editId: Identifier of the edit. +// - expansionFileType: The file type of the expansion file +// configuration which is being updated. +// - packageName: Package name of the app. +func (r *EditsExpansionfilesService) Patch(packageName string, editId string, apkVersionCode int64, expansionFileType string, expansionfile *ExpansionFile) *EditsExpansionfilesPatchCall { + c := &EditsExpansionfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.apksaddexternallyhostedrequest = apksaddexternallyhostedrequest + c.apkVersionCode = apkVersionCode + c.expansionFileType = expansionFileType + c.expansionfile = expansionfile return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsApksAddexternallyhostedCall) Fields(s ...googleapi.Field) *EditsApksAddexternallyhostedCall { +func (c *EditsExpansionfilesPatchCall) Fields(s ...googleapi.Field) *EditsExpansionfilesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8737,21 +11889,21 @@ func (c *EditsApksAddexternallyhostedCall) Fields(s ...googleapi.Field) *EditsAp // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsApksAddexternallyhostedCall) Context(ctx context.Context) *EditsApksAddexternallyhostedCall { +func (c *EditsExpansionfilesPatchCall) Context(ctx context.Context) *EditsExpansionfilesPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsApksAddexternallyhostedCall) Header() http.Header { +func (c *EditsExpansionfilesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsApksAddexternallyhostedCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsExpansionfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -8759,35 +11911,37 @@ func (c *EditsApksAddexternallyhostedCall) doRequest(alt string) (*http.Response } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apksaddexternallyhostedrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/externallyHosted") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, + "packageName": c.packageName, + "editId": c.editId, + "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), + "expansionFileType": c.expansionFileType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.apks.addexternallyhosted" call. -// Exactly one of *ApksAddExternallyHostedResponse or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *ApksAddExternallyHostedResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was +// Do executes the "androidpublisher.edits.expansionfiles.patch" call. +// Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ExpansionFile.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *EditsApksAddexternallyhostedCall) Do(opts ...googleapi.CallOption) (*ApksAddExternallyHostedResponse, error) { +func (c *EditsExpansionfilesPatchCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8806,7 +11960,7 @@ func (c *EditsApksAddexternallyhostedCall) Do(opts ...googleapi.CallOption) (*Ap if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ApksAddExternallyHostedResponse{ + ret := &ExpansionFile{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8818,21 +11972,46 @@ func (c *EditsApksAddexternallyhostedCall) Do(opts ...googleapi.CallOption) (*Ap } return ret, nil // { - // "description": "Creates a new APK without uploading the APK itself to Google Play, instead hosting the APK at a specified URL. This function is only available to organizations using Managed Play whose application is configured to restrict distribution to the organizations.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/externallyHosted", - // "httpMethod": "POST", - // "id": "androidpublisher.edits.apks.addexternallyhosted", + // "description": "Patches the APK's expansion file configuration to reference another APK's expansion file. To add a new expansion file use the Upload method.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "httpMethod": "PATCH", + // "id": "androidpublisher.edits.expansionfiles.patch", // "parameterOrder": [ // "packageName", - // "editId" + // "editId", + // "apkVersionCode", + // "expansionFileType" // ], // "parameters": { + // "apkVersionCode": { + // "description": "The version code of the APK whose expansion file configuration is being read or modified.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, + // "expansionFileType": { + // "description": "The file type of the expansion file configuration which is being updated.", + // "enum": [ + // "expansionFileTypeUnspecified", + // "main", + // "patch" + // ], + // "enumDescriptions": [ + // "Unspecified expansion file type.", + // "Main expansion file.", + // "Patch expansion file." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", @@ -8840,12 +12019,12 @@ func (c *EditsApksAddexternallyhostedCall) Do(opts ...googleapi.CallOption) (*Ap // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/externallyHosted", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", // "request": { - // "$ref": "ApksAddExternallyHostedRequest" + // "$ref": "ExpansionFile" // }, // "response": { - // "$ref": "ApksAddExternallyHostedResponse" + // "$ref": "ExpansionFile" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -8854,99 +12033,104 @@ func (c *EditsApksAddexternallyhostedCall) Do(opts ...googleapi.CallOption) (*Ap } -// method id "androidpublisher.edits.apks.list": +// method id "androidpublisher.edits.expansionfiles.update": -type EditsApksListCall struct { - s *Service - packageName string - editId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type EditsExpansionfilesUpdateCall struct { + s *Service + packageName string + editId string + apkVersionCode int64 + expansionFileType string + expansionfile *ExpansionFile + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all current APKs of the app and edit. -// -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -func (r *EditsApksService) List(packageName string, editId string) *EditsApksListCall { - c := &EditsApksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// Update: Updates the APK's expansion file configuration to reference +// another APK's expansion file. To add a new expansion file use the +// Upload method. +// +// - apkVersionCode: The version code of the APK whose expansion file +// configuration is being read or modified. +// - editId: Identifier of the edit. +// - expansionFileType: The file type of the file configuration which is +// being read or modified. +// - packageName: Package name of the app. +func (r *EditsExpansionfilesService) Update(packageName string, editId string, apkVersionCode int64, expansionFileType string, expansionfile *ExpansionFile) *EditsExpansionfilesUpdateCall { + c := &EditsExpansionfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId + c.apkVersionCode = apkVersionCode + c.expansionFileType = expansionFileType + c.expansionfile = expansionfile return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsApksListCall) Fields(s ...googleapi.Field) *EditsApksListCall { +func (c *EditsExpansionfilesUpdateCall) Fields(s ...googleapi.Field) *EditsExpansionfilesUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *EditsApksListCall) IfNoneMatch(entityTag string) *EditsApksListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsApksListCall) Context(ctx context.Context) *EditsApksListCall { +func (c *EditsExpansionfilesUpdateCall) Context(ctx context.Context) *EditsExpansionfilesUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsApksListCall) Header() http.Header { +func (c *EditsExpansionfilesUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsApksListCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsExpansionfilesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, + "packageName": c.packageName, + "editId": c.editId, + "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), + "expansionFileType": c.expansionFileType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.apks.list" call. -// Exactly one of *ApksListResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ApksListResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "androidpublisher.edits.expansionfiles.update" call. +// Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ExpansionFile.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *EditsApksListCall) Do(opts ...googleapi.CallOption) (*ApksListResponse, error) { +func (c *EditsExpansionfilesUpdateCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8965,7 +12149,7 @@ func (c *EditsApksListCall) Do(opts ...googleapi.CallOption) (*ApksListResponse, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ApksListResponse{ + ret := &ExpansionFile{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8977,21 +12161,46 @@ func (c *EditsApksListCall) Do(opts ...googleapi.CallOption) (*ApksListResponse, } return ret, nil // { - // "description": "Lists all current APKs of the app and edit.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks", - // "httpMethod": "GET", - // "id": "androidpublisher.edits.apks.list", + // "description": "Updates the APK's expansion file configuration to reference another APK's expansion file. To add a new expansion file use the Upload method.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "httpMethod": "PUT", + // "id": "androidpublisher.edits.expansionfiles.update", // "parameterOrder": [ // "packageName", - // "editId" + // "editId", + // "apkVersionCode", + // "expansionFileType" // ], // "parameters": { + // "apkVersionCode": { + // "description": "The version code of the APK whose expansion file configuration is being read or modified.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, + // "expansionFileType": { + // "description": "The file type of the file configuration which is being read or modified.", + // "enum": [ + // "expansionFileTypeUnspecified", + // "main", + // "patch" + // ], + // "enumDescriptions": [ + // "Unspecified expansion file type.", + // "Main expansion file.", + // "Patch expansion file." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", @@ -8999,9 +12208,12 @@ func (c *EditsApksListCall) Do(opts ...googleapi.CallOption) (*ApksListResponse, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "request": { + // "$ref": "ExpansionFile" + // }, // "response": { - // "$ref": "ApksListResponse" + // "$ref": "ExpansionFile" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -9010,26 +12222,35 @@ func (c *EditsApksListCall) Do(opts ...googleapi.CallOption) (*ApksListResponse, } -// method id "androidpublisher.edits.apks.upload": +// method id "androidpublisher.edits.expansionfiles.upload": -type EditsApksUploadCall struct { - s *Service - packageName string - editId string - urlParams_ gensupport.URLParams - mediaInfo_ *gensupport.MediaInfo - ctx_ context.Context - header_ http.Header +type EditsExpansionfilesUploadCall struct { + s *Service + packageName string + editId string + apkVersionCode int64 + expansionFileType string + urlParams_ gensupport.URLParams + mediaInfo_ *gensupport.MediaInfo + ctx_ context.Context + header_ http.Header } -// Upload: Uploads an APK and adds to the current edit. +// Upload: Uploads a new expansion file and attaches to the specified +// APK. // -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -func (r *EditsApksService) Upload(packageName string, editId string) *EditsApksUploadCall { - c := &EditsApksUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - apkVersionCode: The version code of the APK whose expansion file +// configuration is being read or modified. +// - editId: Identifier of the edit. +// - expansionFileType: The file type of the expansion file +// configuration which is being updated. +// - packageName: Package name of the app. +func (r *EditsExpansionfilesService) Upload(packageName string, editId string, apkVersionCode int64, expansionFileType string) *EditsExpansionfilesUploadCall { + c := &EditsExpansionfilesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId + c.apkVersionCode = apkVersionCode + c.expansionFileType = expansionFileType return c } @@ -9041,7 +12262,7 @@ func (r *EditsApksService) Upload(packageName string, editId string) *EditsApksU // unless a MediaOption generated by googleapi.ContentType is // supplied. // At most one of Media and ResumableMedia may be set. -func (c *EditsApksUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsApksUploadCall { +func (c *EditsExpansionfilesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsExpansionfilesUploadCall { c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) return c } @@ -9055,7 +12276,7 @@ func (c *EditsApksUploadCall) Media(r io.Reader, options ...googleapi.MediaOptio // identifies the MIME media type of the upload, such as "image/png". If // mediaType is "", it will be auto-detected. The provided ctx will // supersede any context previously provided to the Context method. -func (c *EditsApksUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsApksUploadCall { +func (c *EditsExpansionfilesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsExpansionfilesUploadCall { c.ctx_ = ctx c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) return c @@ -9065,7 +12286,7 @@ func (c *EditsApksUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, // after every chunk. It should be a low-latency function in order to // not slow down the upload operation. This should only be called when // using ResumableMedia (as opposed to Media). -func (c *EditsApksUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsApksUploadCall { +func (c *EditsExpansionfilesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsExpansionfilesUploadCall { c.mediaInfo_.SetProgressUpdater(pu) return c } @@ -9073,7 +12294,7 @@ func (c *EditsApksUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *Edi // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsApksUploadCall) Fields(s ...googleapi.Field) *EditsApksUploadCall { +func (c *EditsExpansionfilesUploadCall) Fields(s ...googleapi.Field) *EditsExpansionfilesUploadCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9083,21 +12304,21 @@ func (c *EditsApksUploadCall) Fields(s ...googleapi.Field) *EditsApksUploadCall // canceled. // This context will supersede any context previously provided to the // ResumableMedia method. -func (c *EditsApksUploadCall) Context(ctx context.Context) *EditsApksUploadCall { +func (c *EditsExpansionfilesUploadCall) Context(ctx context.Context) *EditsExpansionfilesUploadCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsApksUploadCall) Header() http.Header { +func (c *EditsExpansionfilesUploadCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsApksUploadCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsExpansionfilesUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -9107,9 +12328,9 @@ func (c *EditsApksUploadCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") if c.mediaInfo_ != nil { - urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks") + urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } if body == nil { @@ -9126,20 +12347,22 @@ func (c *EditsApksUploadCall) doRequest(alt string) (*http.Response, error) { req.Header = reqHeaders req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, + "packageName": c.packageName, + "editId": c.editId, + "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), + "expansionFileType": c.expansionFileType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.apks.upload" call. -// Exactly one of *Apk or error will be non-nil. Any non-2xx status code -// is an error. Response headers are in either -// *Apk.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *EditsApksUploadCall) Do(opts ...googleapi.CallOption) (*Apk, error) { +// Do executes the "androidpublisher.edits.expansionfiles.upload" call. +// Exactly one of *ExpansionFilesUploadResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ExpansionFilesUploadResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsExpansionfilesUploadCall) Do(opts ...googleapi.CallOption) (*ExpansionFilesUploadResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9175,7 +12398,7 @@ func (c *EditsApksUploadCall) Do(opts ...googleapi.CallOption) (*Apk, error) { return nil, gensupport.WrapError(err) } } - ret := &Apk{ + ret := &ExpansionFilesUploadResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9187,38 +12410,62 @@ func (c *EditsApksUploadCall) Do(opts ...googleapi.CallOption) (*Apk, error) { } return ret, nil // { - // "description": "Uploads an APK and adds to the current edit.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks", + // "description": "Uploads a new expansion file and attaches to the specified APK.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", // "httpMethod": "POST", - // "id": "androidpublisher.edits.apks.upload", + // "id": "androidpublisher.edits.expansionfiles.upload", // "mediaUpload": { // "accept": [ - // "application/octet-stream", - // "application/vnd.android.package-archive" + // "application/octet-stream" // ], - // "maxSize": "10737418240", + // "maxSize": "2147483648", // "protocols": { // "resumable": { // "multipart": true, - // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks" + // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}" // }, // "simple": { // "multipart": true, - // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks" + // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}" // } // } // }, // "parameterOrder": [ // "packageName", - // "editId" + // "editId", + // "apkVersionCode", + // "expansionFileType" // ], // "parameters": { + // "apkVersionCode": { + // "description": "The version code of the APK whose expansion file configuration is being read or modified.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, + // "expansionFileType": { + // "description": "The file type of the expansion file configuration which is being updated.", + // "enum": [ + // "expansionFileTypeUnspecified", + // "main", + // "patch" + // ], + // "enumDescriptions": [ + // "Unspecified expansion file type.", + // "Main expansion file.", + // "Patch expansion file." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", @@ -9226,9 +12473,9 @@ func (c *EditsApksUploadCall) Do(opts ...googleapi.CallOption) (*Apk, error) { // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", // "response": { - // "$ref": "Apk" + // "$ref": "ExpansionFilesUploadResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -9238,80 +12485,77 @@ func (c *EditsApksUploadCall) Do(opts ...googleapi.CallOption) (*Apk, error) { } -// method id "androidpublisher.edits.bundles.list": +// method id "androidpublisher.edits.images.delete": -type EditsBundlesListCall struct { - s *Service - packageName string - editId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type EditsImagesDeleteCall struct { + s *Service + packageName string + editId string + language string + imageType string + imageId string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all current Android App Bundles of the app and edit. -// -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -func (r *EditsBundlesService) List(packageName string, editId string) *EditsBundlesListCall { - c := &EditsBundlesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// Delete: Deletes the image (specified by id) from the edit. +// +// - editId: Identifier of the edit. +// - imageId: Unique identifier an image within the set of images +// attached to this edit. +// - imageType: Type of the Image. +// - language: Language localization code (a BCP-47 language tag; for +// example, "de-AT" for Austrian German). +// - packageName: Package name of the app. +func (r *EditsImagesService) Delete(packageName string, editId string, language string, imageType string, imageId string) *EditsImagesDeleteCall { + c := &EditsImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId + c.language = language + c.imageType = imageType + c.imageId = imageId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsBundlesListCall) Fields(s ...googleapi.Field) *EditsBundlesListCall { +func (c *EditsImagesDeleteCall) Fields(s ...googleapi.Field) *EditsImagesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *EditsBundlesListCall) IfNoneMatch(entityTag string) *EditsBundlesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsBundlesListCall) Context(ctx context.Context) *EditsBundlesListCall { +func (c *EditsImagesDeleteCall) Context(ctx context.Context) *EditsImagesDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsBundlesListCall) Header() http.Header { +func (c *EditsImagesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsBundlesListCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsImagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -9319,55 +12563,36 @@ func (c *EditsBundlesListCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, + "language": c.language, + "imageType": c.imageType, + "imageId": c.imageId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.bundles.list" call. -// Exactly one of *BundlesListResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *BundlesListResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EditsBundlesListCall) Do(opts ...googleapi.CallOption) (*BundlesListResponse, error) { +// Do executes the "androidpublisher.edits.images.delete" call. +func (c *EditsImagesDeleteCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } if err != nil { - return nil, err + return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &BundlesListResponse{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err + return gensupport.WrapError(err) } - return ret, nil + return nil // { - // "description": "Lists all current Android App Bundles of the app and edit.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles", - // "httpMethod": "GET", - // "id": "androidpublisher.edits.bundles.list", + // "description": "Deletes the image (specified by id) from the edit.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}", + // "httpMethod": "DELETE", + // "id": "androidpublisher.edits.images.delete", // "parameterOrder": [ // "packageName", - // "editId" + // "editId", + // "language", + // "imageType", + // "imageId" // ], // "parameters": { // "editId": { @@ -9376,6 +12601,46 @@ func (c *EditsBundlesListCall) Do(opts ...googleapi.CallOption) (*BundlesListRes // "required": true, // "type": "string" // }, + // "imageId": { + // "description": "Unique identifier an image within the set of images attached to this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "imageType": { + // "description": "Type of the Image.", + // "enum": [ + // "appImageTypeUnspecified", + // "phoneScreenshots", + // "sevenInchScreenshots", + // "tenInchScreenshots", + // "tvScreenshots", + // "wearScreenshots", + // "icon", + // "featureGraphic", + // "tvBanner" + // ], + // "enumDescriptions": [ + // "Unspecified type. Do not use.", + // "Phone screenshot.", + // "Seven inch screenshot.", + // "Ten inch screenshot.", + // "TV screenshot.", + // "Wear screenshot.", + // "Icon.", + // "Feature graphic.", + // "TV banner." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", + // "location": "path", + // "required": true, + // "type": "string" + // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", @@ -9383,10 +12648,7 @@ func (c *EditsBundlesListCall) Do(opts ...googleapi.CallOption) (*BundlesListRes // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles", - // "response": { - // "$ref": "BundlesListResponse" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -9394,92 +12656,42 @@ func (c *EditsBundlesListCall) Do(opts ...googleapi.CallOption) (*BundlesListRes } -// method id "androidpublisher.edits.bundles.upload": +// method id "androidpublisher.edits.images.deleteall": -type EditsBundlesUploadCall struct { +type EditsImagesDeleteallCall struct { s *Service packageName string editId string + language string + imageType string urlParams_ gensupport.URLParams - mediaInfo_ *gensupport.MediaInfo ctx_ context.Context header_ http.Header } -// Upload: Uploads a new Android App Bundle to this edit. If you are -// using the Google API client libraries, please increase the timeout of -// the http request before calling this endpoint (a timeout of 2 minutes -// is recommended). See Timeouts and Errors -// (https://developers.google.com/api-client-library/java/google-api-java-client/errors) -// for an example in java. +// Deleteall: Deletes all images for the specified language and image +// type. Returns an empty response if no images are found. // -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -func (r *EditsBundlesService) Upload(packageName string, editId string) *EditsBundlesUploadCall { - c := &EditsBundlesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - editId: Identifier of the edit. +// - imageType: Type of the Image. Providing an image type that refers +// to no images is a no-op. +// - language: Language localization code (a BCP-47 language tag; for +// example, "de-AT" for Austrian German). Providing a language that is +// not supported by the App is a no-op. +// - packageName: Package name of the app. +func (r *EditsImagesService) Deleteall(packageName string, editId string, language string, imageType string) *EditsImagesDeleteallCall { + c := &EditsImagesDeleteallCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - return c -} - -// AckBundleInstallationWarning sets the optional parameter -// "ackBundleInstallationWarning": Must be set to true if the app bundle -// installation may trigger a warning on user devices (for example, if -// installation size may be over a threshold, typically 100 MB). -func (c *EditsBundlesUploadCall) AckBundleInstallationWarning(ackBundleInstallationWarning bool) *EditsBundlesUploadCall { - c.urlParams_.Set("ackBundleInstallationWarning", fmt.Sprint(ackBundleInstallationWarning)) - return c -} - -// DeviceTierConfigId sets the optional parameter "deviceTierConfigId": -// Device tier config (DTC) to be used for generating deliverables -// (APKs). Contains id of the DTC or "LATEST" for last uploaded DTC. -func (c *EditsBundlesUploadCall) DeviceTierConfigId(deviceTierConfigId string) *EditsBundlesUploadCall { - c.urlParams_.Set("deviceTierConfigId", deviceTierConfigId) - return c -} - -// Media specifies the media to upload in one or more chunks. The chunk -// size may be controlled by supplying a MediaOption generated by -// googleapi.ChunkSize. The chunk size defaults to -// googleapi.DefaultUploadChunkSize.The Content-Type header used in the -// upload request will be determined by sniffing the contents of r, -// unless a MediaOption generated by googleapi.ContentType is -// supplied. -// At most one of Media and ResumableMedia may be set. -func (c *EditsBundlesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsBundlesUploadCall { - c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) - return c -} - -// ResumableMedia specifies the media to upload in chunks and can be -// canceled with ctx. -// -// Deprecated: use Media instead. -// -// At most one of Media and ResumableMedia may be set. mediaType -// identifies the MIME media type of the upload, such as "image/png". If -// mediaType is "", it will be auto-detected. The provided ctx will -// supersede any context previously provided to the Context method. -func (c *EditsBundlesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsBundlesUploadCall { - c.ctx_ = ctx - c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) - return c -} - -// ProgressUpdater provides a callback function that will be called -// after every chunk. It should be a low-latency function in order to -// not slow down the upload operation. This should only be called when -// using ResumableMedia (as opposed to Media). -func (c *EditsBundlesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsBundlesUploadCall { - c.mediaInfo_.SetProgressUpdater(pu) + c.language = language + c.imageType = imageType return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsBundlesUploadCall) Fields(s ...googleapi.Field) *EditsBundlesUploadCall { +func (c *EditsImagesDeleteallCall) Fields(s ...googleapi.Field) *EditsImagesDeleteallCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9487,23 +12699,21 @@ func (c *EditsBundlesUploadCall) Fields(s ...googleapi.Field) *EditsBundlesUploa // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -// This context will supersede any context previously provided to the -// ResumableMedia method. -func (c *EditsBundlesUploadCall) Context(ctx context.Context) *EditsBundlesUploadCall { +func (c *EditsImagesDeleteallCall) Context(ctx context.Context) *EditsImagesDeleteallCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsBundlesUploadCall) Header() http.Header { +func (c *EditsImagesDeleteallCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsBundlesUploadCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsImagesDeleteallCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -9513,39 +12723,30 @@ func (c *EditsBundlesUploadCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles") - if c.mediaInfo_ != nil { - urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles") - c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) - } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) - defer cleanup() + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders - req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, + "language": c.language, + "imageType": c.imageType, }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "androidpublisher.edits.bundles.upload" call. -// Exactly one of *Bundle or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Bundle.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsBundlesUploadCall) Do(opts ...googleapi.CallOption) (*Bundle, error) { + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.images.deleteall" call. +// Exactly one of *ImagesDeleteAllResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ImagesDeleteAllResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsImagesDeleteallCall) Do(opts ...googleapi.CallOption) (*ImagesDeleteAllResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9564,24 +12765,7 @@ func (c *EditsBundlesUploadCall) Do(opts ...googleapi.CallOption) (*Bundle, erro if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) - if rx != nil { - rx.Client = c.s.client - rx.UserAgent = c.s.userAgent() - ctx := c.ctx_ - if ctx == nil { - ctx = context.TODO() - } - res, err = rx.Upload(ctx) - if err != nil { - return nil, err - } - defer res.Body.Close() - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - } - ret := &Bundle{ + ret := &ImagesDeleteAllResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9593,43 +12777,53 @@ func (c *EditsBundlesUploadCall) Do(opts ...googleapi.CallOption) (*Bundle, erro } return ret, nil // { - // "description": "Uploads a new Android App Bundle to this edit. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See [Timeouts and Errors](https://developers.google.com/api-client-library/java/google-api-java-client/errors) for an example in java.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles", - // "httpMethod": "POST", - // "id": "androidpublisher.edits.bundles.upload", - // "mediaUpload": { - // "accept": [ - // "application/octet-stream" - // ], - // "maxSize": "10737418240", - // "protocols": { - // "resumable": { - // "multipart": true, - // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles" - // }, - // "simple": { - // "multipart": true, - // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles" - // } - // } - // }, + // "description": "Deletes all images for the specified language and image type. Returns an empty response if no images are found.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", + // "httpMethod": "DELETE", + // "id": "androidpublisher.edits.images.deleteall", // "parameterOrder": [ // "packageName", - // "editId" + // "editId", + // "language", + // "imageType" // ], // "parameters": { - // "ackBundleInstallationWarning": { - // "description": "Must be set to true if the app bundle installation may trigger a warning on user devices (for example, if installation size may be over a threshold, typically 100 MB).", - // "location": "query", - // "type": "boolean" + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" // }, - // "deviceTierConfigId": { - // "description": "Device tier config (DTC) to be used for generating deliverables (APKs). Contains id of the DTC or \"LATEST\" for last uploaded DTC.", - // "location": "query", + // "imageType": { + // "description": "Type of the Image. Providing an image type that refers to no images is a no-op.", + // "enum": [ + // "appImageTypeUnspecified", + // "phoneScreenshots", + // "sevenInchScreenshots", + // "tenInchScreenshots", + // "tvScreenshots", + // "wearScreenshots", + // "icon", + // "featureGraphic", + // "tvBanner" + // ], + // "enumDescriptions": [ + // "Unspecified type. Do not use.", + // "Phone screenshot.", + // "Seven inch screenshot.", + // "Ten inch screenshot.", + // "TV screenshot.", + // "Wear screenshot.", + // "Icon.", + // "Feature graphic.", + // "TV banner." + // ], + // "location": "path", + // "required": true, // "type": "string" // }, - // "editId": { - // "description": "Identifier of the edit.", + // "language": { + // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German). Providing a language that is not supported by the App is a no-op.", // "location": "path", // "required": true, // "type": "string" @@ -9641,48 +12835,53 @@ func (c *EditsBundlesUploadCall) Do(opts ...googleapi.CallOption) (*Bundle, erro // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", // "response": { - // "$ref": "Bundle" + // "$ref": "ImagesDeleteAllResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ], - // "supportsMediaUpload": true + // ] // } } -// method id "androidpublisher.edits.countryavailability.get": +// method id "androidpublisher.edits.images.list": -type EditsCountryavailabilityGetCall struct { +type EditsImagesListCall struct { s *Service packageName string editId string - track string + language string + imageType string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets country availability. +// List: Lists all images. The response may be empty. // -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -// - track: The track to read from. -func (r *EditsCountryavailabilityService) Get(packageName string, editId string, track string) *EditsCountryavailabilityGetCall { - c := &EditsCountryavailabilityGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - editId: Identifier of the edit. +// - imageType: Type of the Image. Providing an image type that refers +// to no images will return an empty response. +// - language: Language localization code (a BCP-47 language tag; for +// example, "de-AT" for Austrian German). There must be a store +// listing for the specified language. +// - packageName: Package name of the app. +func (r *EditsImagesService) List(packageName string, editId string, language string, imageType string) *EditsImagesListCall { + c := &EditsImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.track = track + c.language = language + c.imageType = imageType return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsCountryavailabilityGetCall) Fields(s ...googleapi.Field) *EditsCountryavailabilityGetCall { +func (c *EditsImagesListCall) Fields(s ...googleapi.Field) *EditsImagesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9692,7 +12891,7 @@ func (c *EditsCountryavailabilityGetCall) Fields(s ...googleapi.Field) *EditsCou // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *EditsCountryavailabilityGetCall) IfNoneMatch(entityTag string) *EditsCountryavailabilityGetCall { +func (c *EditsImagesListCall) IfNoneMatch(entityTag string) *EditsImagesListCall { c.ifNoneMatch_ = entityTag return c } @@ -9700,21 +12899,21 @@ func (c *EditsCountryavailabilityGetCall) IfNoneMatch(entityTag string) *EditsCo // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsCountryavailabilityGetCall) Context(ctx context.Context) *EditsCountryavailabilityGetCall { +func (c *EditsImagesListCall) Context(ctx context.Context) *EditsImagesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsCountryavailabilityGetCall) Header() http.Header { +func (c *EditsImagesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsCountryavailabilityGetCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsImagesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -9727,7 +12926,7 @@ func (c *EditsCountryavailabilityGetCall) doRequest(alt string) (*http.Response, var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/countryAvailability/{track}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -9737,19 +12936,20 @@ func (c *EditsCountryavailabilityGetCall) doRequest(alt string) (*http.Response, googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, - "track": c.track, + "language": c.language, + "imageType": c.imageType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.countryavailability.get" call. -// Exactly one of *TrackCountryAvailability or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *TrackCountryAvailability.ServerResponse.Header or (if a response was +// Do executes the "androidpublisher.edits.images.list" call. +// Exactly one of *ImagesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ImagesListResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *EditsCountryavailabilityGetCall) Do(opts ...googleapi.CallOption) (*TrackCountryAvailability, error) { +func (c *EditsImagesListCall) Do(opts ...googleapi.CallOption) (*ImagesListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9768,7 +12968,7 @@ func (c *EditsCountryavailabilityGetCall) Do(opts ...googleapi.CallOption) (*Tra if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &TrackCountryAvailability{ + ret := &ImagesListResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9780,14 +12980,15 @@ func (c *EditsCountryavailabilityGetCall) Do(opts ...googleapi.CallOption) (*Tra } return ret, nil // { - // "description": "Gets country availability.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/countryAvailability/{track}", + // "description": "Lists all images. The response may be empty.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", // "httpMethod": "GET", - // "id": "androidpublisher.edits.countryavailability.get", + // "id": "androidpublisher.edits.images.list", // "parameterOrder": [ // "packageName", // "editId", - // "track" + // "language", + // "imageType" // ], // "parameters": { // "editId": { @@ -9796,22 +12997,50 @@ func (c *EditsCountryavailabilityGetCall) Do(opts ...googleapi.CallOption) (*Tra // "required": true, // "type": "string" // }, - // "packageName": { - // "description": "Package name of the app.", + // "imageType": { + // "description": "Type of the Image. Providing an image type that refers to no images will return an empty response.", + // "enum": [ + // "appImageTypeUnspecified", + // "phoneScreenshots", + // "sevenInchScreenshots", + // "tenInchScreenshots", + // "tvScreenshots", + // "wearScreenshots", + // "icon", + // "featureGraphic", + // "tvBanner" + // ], + // "enumDescriptions": [ + // "Unspecified type. Do not use.", + // "Phone screenshot.", + // "Seven inch screenshot.", + // "Ten inch screenshot.", + // "TV screenshot.", + // "Wear screenshot.", + // "Icon.", + // "Feature graphic.", + // "TV banner." + // ], // "location": "path", // "required": true, // "type": "string" // }, - // "track": { - // "description": "The track to read from.", + // "language": { + // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German). There must be a store listing for the specified language.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/countryAvailability/{track}", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", // "response": { - // "$ref": "TrackCountryAvailability" + // "$ref": "ImagesListResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -9820,34 +13049,35 @@ func (c *EditsCountryavailabilityGetCall) Do(opts ...googleapi.CallOption) (*Tra } -// method id "androidpublisher.edits.deobfuscationfiles.upload": +// method id "androidpublisher.edits.images.upload": -type EditsDeobfuscationfilesUploadCall struct { - s *Service - packageNameid string - editId string - apkVersionCode int64 - deobfuscationFileType string - urlParams_ gensupport.URLParams - mediaInfo_ *gensupport.MediaInfo - ctx_ context.Context - header_ http.Header +type EditsImagesUploadCall struct { + s *Service + packageName string + editId string + language string + imageType string + urlParams_ gensupport.URLParams + mediaInfo_ *gensupport.MediaInfo + ctx_ context.Context + header_ http.Header } -// Upload: Uploads a new deobfuscation file and attaches to the -// specified APK. +// Upload: Uploads an image of the specified language and image type, +// and adds to the edit. // -// - apkVersionCode: The version code of the APK whose Deobfuscation -// File is being uploaded. -// - deobfuscationFileType: The type of the deobfuscation file. -// - editId: Unique identifier for this edit. -// - packageName: Unique identifier for the Android app. -func (r *EditsDeobfuscationfilesService) Upload(packageNameid string, editId string, apkVersionCode int64, deobfuscationFileType string) *EditsDeobfuscationfilesUploadCall { - c := &EditsDeobfuscationfilesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.packageNameid = packageNameid +// - editId: Identifier of the edit. +// - imageType: Type of the Image. +// - language: Language localization code (a BCP-47 language tag; for +// example, "de-AT" for Austrian German). Providing a language that is +// not supported by the App is a no-op. +// - packageName: Package name of the app. +func (r *EditsImagesService) Upload(packageName string, editId string, language string, imageType string) *EditsImagesUploadCall { + c := &EditsImagesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName c.editId = editId - c.apkVersionCode = apkVersionCode - c.deobfuscationFileType = deobfuscationFileType + c.language = language + c.imageType = imageType return c } @@ -9859,7 +13089,7 @@ func (r *EditsDeobfuscationfilesService) Upload(packageNameid string, editId str // unless a MediaOption generated by googleapi.ContentType is // supplied. // At most one of Media and ResumableMedia may be set. -func (c *EditsDeobfuscationfilesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsDeobfuscationfilesUploadCall { +func (c *EditsImagesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsImagesUploadCall { c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) return c } @@ -9873,7 +13103,7 @@ func (c *EditsDeobfuscationfilesUploadCall) Media(r io.Reader, options ...google // identifies the MIME media type of the upload, such as "image/png". If // mediaType is "", it will be auto-detected. The provided ctx will // supersede any context previously provided to the Context method. -func (c *EditsDeobfuscationfilesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsDeobfuscationfilesUploadCall { +func (c *EditsImagesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsImagesUploadCall { c.ctx_ = ctx c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) return c @@ -9883,7 +13113,7 @@ func (c *EditsDeobfuscationfilesUploadCall) ResumableMedia(ctx context.Context, // after every chunk. It should be a low-latency function in order to // not slow down the upload operation. This should only be called when // using ResumableMedia (as opposed to Media). -func (c *EditsDeobfuscationfilesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsDeobfuscationfilesUploadCall { +func (c *EditsImagesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsImagesUploadCall { c.mediaInfo_.SetProgressUpdater(pu) return c } @@ -9891,7 +13121,7 @@ func (c *EditsDeobfuscationfilesUploadCall) ProgressUpdater(pu googleapi.Progres // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsDeobfuscationfilesUploadCall) Fields(s ...googleapi.Field) *EditsDeobfuscationfilesUploadCall { +func (c *EditsImagesUploadCall) Fields(s ...googleapi.Field) *EditsImagesUploadCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9901,21 +13131,21 @@ func (c *EditsDeobfuscationfilesUploadCall) Fields(s ...googleapi.Field) *EditsD // canceled. // This context will supersede any context previously provided to the // ResumableMedia method. -func (c *EditsDeobfuscationfilesUploadCall) Context(ctx context.Context) *EditsDeobfuscationfilesUploadCall { +func (c *EditsImagesUploadCall) Context(ctx context.Context) *EditsImagesUploadCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsDeobfuscationfilesUploadCall) Header() http.Header { +func (c *EditsImagesUploadCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsDeobfuscationfilesUploadCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsImagesUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -9925,9 +13155,9 @@ func (c *EditsDeobfuscationfilesUploadCall) doRequest(alt string) (*http.Respons var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") if c.mediaInfo_ != nil { - urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}") + urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } if body == nil { @@ -9944,22 +13174,22 @@ func (c *EditsDeobfuscationfilesUploadCall) doRequest(alt string) (*http.Respons req.Header = reqHeaders req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageNameid, - "editId": c.editId, - "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), - "deobfuscationFileType": c.deobfuscationFileType, + "packageName": c.packageName, + "editId": c.editId, + "language": c.language, + "imageType": c.imageType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.deobfuscationfiles.upload" call. -// Exactly one of *DeobfuscationFilesUploadResponse or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *DeobfuscationFilesUploadResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was +// Do executes the "androidpublisher.edits.images.upload" call. +// Exactly one of *ImagesUploadResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ImagesUploadResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *EditsDeobfuscationfilesUploadCall) Do(opts ...googleapi.CallOption) (*DeobfuscationFilesUploadResponse, error) { +func (c *EditsImagesUploadCall) Do(opts ...googleapi.CallOption) (*ImagesUploadResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9995,7 +13225,7 @@ func (c *EditsDeobfuscationfilesUploadCall) Do(opts ...googleapi.CallOption) (*D return nil, gensupport.WrapError(err) } } - ret := &DeobfuscationFilesUploadResponse{ + ret := &ImagesUploadResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10007,215 +13237,69 @@ func (c *EditsDeobfuscationfilesUploadCall) Do(opts ...googleapi.CallOption) (*D } return ret, nil // { - // "description": "Uploads a new deobfuscation file and attaches to the specified APK.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}", + // "description": "Uploads an image of the specified language and image type, and adds to the edit.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", // "httpMethod": "POST", - // "id": "androidpublisher.edits.deobfuscationfiles.upload", + // "id": "androidpublisher.edits.images.upload", // "mediaUpload": { // "accept": [ - // "application/octet-stream" + // "image/*" // ], - // "maxSize": "1677721600", + // "maxSize": "15728640", // "protocols": { // "resumable": { // "multipart": true, - // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}" + // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}" // }, // "simple": { // "multipart": true, - // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}" + // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}" // } // } // }, // "parameterOrder": [ // "packageName", // "editId", - // "apkVersionCode", - // "deobfuscationFileType" + // "language", + // "imageType" // ], // "parameters": { - // "apkVersionCode": { - // "description": "The version code of the APK whose Deobfuscation File is being uploaded.", - // "format": "int32", + // "editId": { + // "description": "Identifier of the edit.", // "location": "path", // "required": true, - // "type": "integer" + // "type": "string" // }, - // "deobfuscationFileType": { - // "description": "The type of the deobfuscation file.", + // "imageType": { + // "description": "Type of the Image.", // "enum": [ - // "deobfuscationFileTypeUnspecified", - // "proguard", - // "nativeCode" + // "appImageTypeUnspecified", + // "phoneScreenshots", + // "sevenInchScreenshots", + // "tenInchScreenshots", + // "tvScreenshots", + // "wearScreenshots", + // "icon", + // "featureGraphic", + // "tvBanner" // ], // "enumDescriptions": [ - // "Unspecified deobfuscation file type.", - // "Proguard deobfuscation file type.", - // "Native debugging symbols file type." + // "Unspecified type. Do not use.", + // "Phone screenshot.", + // "Seven inch screenshot.", + // "Ten inch screenshot.", + // "TV screenshot.", + // "Wear screenshot.", + // "Icon.", + // "Feature graphic.", + // "TV banner." // ], // "location": "path", // "required": true, - // "type": "string" - // }, - // "editId": { - // "description": "Unique identifier for this edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "packageName": { - // "description": "Unique identifier for the Android app.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}", - // "response": { - // "$ref": "DeobfuscationFilesUploadResponse" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/androidpublisher" - // ], - // "supportsMediaUpload": true - // } - -} - -// method id "androidpublisher.edits.details.get": - -type EditsDetailsGetCall struct { - s *Service - packageName string - editId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// Get: Gets details of an app. -// -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -func (r *EditsDetailsService) Get(packageName string, editId string) *EditsDetailsGetCall { - c := &EditsDetailsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.packageName = packageName - c.editId = editId - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *EditsDetailsGetCall) Fields(s ...googleapi.Field) *EditsDetailsGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *EditsDetailsGetCall) IfNoneMatch(entityTag string) *EditsDetailsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *EditsDetailsGetCall) Context(ctx context.Context) *EditsDetailsGetCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *EditsDetailsGetCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *EditsDetailsGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/details") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "androidpublisher.edits.details.get" call. -// Exactly one of *AppDetails or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *AppDetails.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *EditsDetailsGetCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &AppDetails{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Gets details of an app.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", - // "httpMethod": "GET", - // "id": "androidpublisher.edits.details.get", - // "parameterOrder": [ - // "packageName", - // "editId" - // ], - // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", + // "type": "string" + // }, + // "language": { + // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German). Providing a language that is not supported by the App is a no-op.", // "location": "path", // "required": true, // "type": "string" @@ -10227,45 +13311,48 @@ func (c *EditsDetailsGetCall) Do(opts ...googleapi.CallOption) (*AppDetails, err // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", // "response": { - // "$ref": "AppDetails" + // "$ref": "ImagesUploadResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ] + // ], + // "supportsMediaUpload": true // } } -// method id "androidpublisher.edits.details.patch": +// method id "androidpublisher.edits.listings.delete": -type EditsDetailsPatchCall struct { +type EditsListingsDeleteCall struct { s *Service packageName string editId string - appdetails *AppDetails + language string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Patches details of an app. +// Delete: Deletes a localized store listing. // -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -func (r *EditsDetailsService) Patch(packageName string, editId string, appdetails *AppDetails) *EditsDetailsPatchCall { - c := &EditsDetailsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - editId: Identifier of the edit. +// - language: Language localization code (a BCP-47 language tag; for +// example, "de-AT" for Austrian German). +// - packageName: Package name of the app. +func (r *EditsListingsService) Delete(packageName string, editId string, language string) *EditsListingsDeleteCall { + c := &EditsListingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.appdetails = appdetails + c.language = language return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsDetailsPatchCall) Fields(s ...googleapi.Field) *EditsDetailsPatchCall { +func (c *EditsListingsDeleteCall) Fields(s ...googleapi.Field) *EditsListingsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10273,21 +13360,21 @@ func (c *EditsDetailsPatchCall) Fields(s ...googleapi.Field) *EditsDetailsPatchC // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsDetailsPatchCall) Context(ctx context.Context) *EditsDetailsPatchCall { +func (c *EditsListingsDeleteCall) Context(ctx context.Context) *EditsListingsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsDetailsPatchCall) Header() http.Header { +func (c *EditsListingsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsDetailsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsListingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10295,16 +13382,11 @@ func (c *EditsDetailsPatchCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/details") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -10312,55 +13394,32 @@ func (c *EditsDetailsPatchCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, + "language": c.language, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.details.patch" call. -// Exactly one of *AppDetails or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *AppDetails.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *EditsDetailsPatchCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) { +// Do executes the "androidpublisher.edits.listings.delete" call. +func (c *EditsListingsDeleteCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } if err != nil { - return nil, err + return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &AppDetails{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err + return gensupport.WrapError(err) } - return ret, nil + return nil // { - // "description": "Patches details of an app.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", - // "httpMethod": "PATCH", - // "id": "androidpublisher.edits.details.patch", + // "description": "Deletes a localized store listing.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", + // "httpMethod": "DELETE", + // "id": "androidpublisher.edits.listings.delete", // "parameterOrder": [ // "packageName", - // "editId" + // "editId", + // "language" // ], // "parameters": { // "editId": { @@ -10369,6 +13428,12 @@ func (c *EditsDetailsPatchCall) Do(opts ...googleapi.CallOption) (*AppDetails, e // "required": true, // "type": "string" // }, + // "language": { + // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", + // "location": "path", + // "required": true, + // "type": "string" + // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", @@ -10376,13 +13441,7 @@ func (c *EditsDetailsPatchCall) Do(opts ...googleapi.CallOption) (*AppDetails, e // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", - // "request": { - // "$ref": "AppDetails" - // }, - // "response": { - // "$ref": "AppDetails" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -10390,34 +13449,32 @@ func (c *EditsDetailsPatchCall) Do(opts ...googleapi.CallOption) (*AppDetails, e } -// method id "androidpublisher.edits.details.update": +// method id "androidpublisher.edits.listings.deleteall": -type EditsDetailsUpdateCall struct { +type EditsListingsDeleteallCall struct { s *Service packageName string editId string - appdetails *AppDetails urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Update: Updates details of an app. +// Deleteall: Deletes all store listings. // // - editId: Identifier of the edit. // - packageName: Package name of the app. -func (r *EditsDetailsService) Update(packageName string, editId string, appdetails *AppDetails) *EditsDetailsUpdateCall { - c := &EditsDetailsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsListingsService) Deleteall(packageName string, editId string) *EditsListingsDeleteallCall { + c := &EditsListingsDeleteallCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.appdetails = appdetails return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsDetailsUpdateCall) Fields(s ...googleapi.Field) *EditsDetailsUpdateCall { +func (c *EditsListingsDeleteallCall) Fields(s ...googleapi.Field) *EditsListingsDeleteallCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10425,21 +13482,21 @@ func (c *EditsDetailsUpdateCall) Fields(s ...googleapi.Field) *EditsDetailsUpdat // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsDetailsUpdateCall) Context(ctx context.Context) *EditsDetailsUpdateCall { +func (c *EditsListingsDeleteallCall) Context(ctx context.Context) *EditsListingsDeleteallCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsDetailsUpdateCall) Header() http.Header { +func (c *EditsListingsDeleteallCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsDetailsUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsListingsDeleteallCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10447,16 +13504,11 @@ func (c *EditsDetailsUpdateCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/details") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -10468,48 +13520,23 @@ func (c *EditsDetailsUpdateCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.details.update" call. -// Exactly one of *AppDetails or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *AppDetails.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *EditsDetailsUpdateCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) { +// Do executes the "androidpublisher.edits.listings.deleteall" call. +func (c *EditsListingsDeleteallCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } if err != nil { - return nil, err + return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &AppDetails{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err + return gensupport.WrapError(err) } - return ret, nil + return nil // { - // "description": "Updates details of an app.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", - // "httpMethod": "PUT", - // "id": "androidpublisher.edits.details.update", + // "description": "Deletes all store listings.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings", + // "httpMethod": "DELETE", + // "id": "androidpublisher.edits.listings.deleteall", // "parameterOrder": [ // "packageName", // "editId" @@ -10528,13 +13555,7 @@ func (c *EditsDetailsUpdateCall) Do(opts ...googleapi.CallOption) (*AppDetails, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", - // "request": { - // "$ref": "AppDetails" - // }, - // "response": { - // "$ref": "AppDetails" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -10542,41 +13563,37 @@ func (c *EditsDetailsUpdateCall) Do(opts ...googleapi.CallOption) (*AppDetails, } -// method id "androidpublisher.edits.expansionfiles.get": +// method id "androidpublisher.edits.listings.get": -type EditsExpansionfilesGetCall struct { - s *Service - packageName string - editId string - apkVersionCode int64 - expansionFileType string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type EditsListingsGetCall struct { + s *Service + packageName string + editId string + language string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Get: Fetches the expansion file configuration for the specified APK. +// Get: Gets a localized store listing. // -// - apkVersionCode: The version code of the APK whose expansion file -// configuration is being read or modified. // - editId: Identifier of the edit. -// - expansionFileType: The file type of the file configuration which is -// being read or modified. +// - language: Language localization code (a BCP-47 language tag; for +// example, "de-AT" for Austrian German). // - packageName: Package name of the app. -func (r *EditsExpansionfilesService) Get(packageName string, editId string, apkVersionCode int64, expansionFileType string) *EditsExpansionfilesGetCall { - c := &EditsExpansionfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsListingsService) Get(packageName string, editId string, language string) *EditsListingsGetCall { + c := &EditsListingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.apkVersionCode = apkVersionCode - c.expansionFileType = expansionFileType + c.language = language return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsExpansionfilesGetCall) Fields(s ...googleapi.Field) *EditsExpansionfilesGetCall { +func (c *EditsListingsGetCall) Fields(s ...googleapi.Field) *EditsListingsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10586,7 +13603,7 @@ func (c *EditsExpansionfilesGetCall) Fields(s ...googleapi.Field) *EditsExpansio // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *EditsExpansionfilesGetCall) IfNoneMatch(entityTag string) *EditsExpansionfilesGetCall { +func (c *EditsListingsGetCall) IfNoneMatch(entityTag string) *EditsListingsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -10594,21 +13611,21 @@ func (c *EditsExpansionfilesGetCall) IfNoneMatch(entityTag string) *EditsExpansi // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsExpansionfilesGetCall) Context(ctx context.Context) *EditsExpansionfilesGetCall { +func (c *EditsListingsGetCall) Context(ctx context.Context) *EditsListingsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsExpansionfilesGetCall) Header() http.Header { +func (c *EditsListingsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsExpansionfilesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsListingsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10621,7 +13638,7 @@ func (c *EditsExpansionfilesGetCall) doRequest(alt string) (*http.Response, erro var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -10629,22 +13646,21 @@ func (c *EditsExpansionfilesGetCall) doRequest(alt string) (*http.Response, erro } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, - "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), - "expansionFileType": c.expansionFileType, + "packageName": c.packageName, + "editId": c.editId, + "language": c.language, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.expansionfiles.get" call. -// Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *ExpansionFile.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EditsExpansionfilesGetCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) { +// Do executes the "androidpublisher.edits.listings.get" call. +// Exactly one of *Listing or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Listing.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsListingsGetCall) Do(opts ...googleapi.CallOption) (*Listing, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10663,7 +13679,7 @@ func (c *EditsExpansionfilesGetCall) Do(opts ...googleapi.CallOption) (*Expansio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ExpansionFile{ + ret := &Listing{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10675,42 +13691,24 @@ func (c *EditsExpansionfilesGetCall) Do(opts ...googleapi.CallOption) (*Expansio } return ret, nil // { - // "description": "Fetches the expansion file configuration for the specified APK.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "description": "Gets a localized store listing.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", // "httpMethod": "GET", - // "id": "androidpublisher.edits.expansionfiles.get", + // "id": "androidpublisher.edits.listings.get", // "parameterOrder": [ // "packageName", // "editId", - // "apkVersionCode", - // "expansionFileType" + // "language" // ], // "parameters": { - // "apkVersionCode": { - // "description": "The version code of the APK whose expansion file configuration is being read or modified.", - // "format": "int32", - // "location": "path", - // "required": true, - // "type": "integer" - // }, // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, - // "expansionFileType": { - // "description": "The file type of the file configuration which is being read or modified.", - // "enum": [ - // "expansionFileTypeUnspecified", - // "main", - // "patch" - // ], - // "enumDescriptions": [ - // "Unspecified expansion file type.", - // "Main expansion file.", - // "Patch expansion file." - // ], + // "language": { + // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", // "location": "path", // "required": true, // "type": "string" @@ -10722,9 +13720,9 @@ func (c *EditsExpansionfilesGetCall) Do(opts ...googleapi.CallOption) (*Expansio // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", // "response": { - // "$ref": "ExpansionFile" + // "$ref": "Listing" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -10733,104 +13731,99 @@ func (c *EditsExpansionfilesGetCall) Do(opts ...googleapi.CallOption) (*Expansio } -// method id "androidpublisher.edits.expansionfiles.patch": +// method id "androidpublisher.edits.listings.list": -type EditsExpansionfilesPatchCall struct { - s *Service - packageName string - editId string - apkVersionCode int64 - expansionFileType string - expansionfile *ExpansionFile - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type EditsListingsListCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Patches the APK's expansion file configuration to reference -// another APK's expansion file. To add a new expansion file use the -// Upload method. +// List: Lists all localized store listings. // -// - apkVersionCode: The version code of the APK whose expansion file -// configuration is being read or modified. -// - editId: Identifier of the edit. -// - expansionFileType: The file type of the expansion file -// configuration which is being updated. -// - packageName: Package name of the app. -func (r *EditsExpansionfilesService) Patch(packageName string, editId string, apkVersionCode int64, expansionFileType string, expansionfile *ExpansionFile) *EditsExpansionfilesPatchCall { - c := &EditsExpansionfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsListingsService) List(packageName string, editId string) *EditsListingsListCall { + c := &EditsListingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.apkVersionCode = apkVersionCode - c.expansionFileType = expansionFileType - c.expansionfile = expansionfile return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsExpansionfilesPatchCall) Fields(s ...googleapi.Field) *EditsExpansionfilesPatchCall { +func (c *EditsListingsListCall) Fields(s ...googleapi.Field) *EditsListingsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsListingsListCall) IfNoneMatch(entityTag string) *EditsListingsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsExpansionfilesPatchCall) Context(ctx context.Context) *EditsExpansionfilesPatchCall { +func (c *EditsListingsListCall) Context(ctx context.Context) *EditsListingsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsExpansionfilesPatchCall) Header() http.Header { +func (c *EditsListingsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsExpansionfilesPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsListingsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, - "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), - "expansionFileType": c.expansionFileType, + "packageName": c.packageName, + "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.expansionfiles.patch" call. -// Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *ExpansionFile.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use +// Do executes the "androidpublisher.edits.listings.list" call. +// Exactly one of *ListingsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListingsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *EditsExpansionfilesPatchCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) { +func (c *EditsListingsListCall) Do(opts ...googleapi.CallOption) (*ListingsListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10849,7 +13842,7 @@ func (c *EditsExpansionfilesPatchCall) Do(opts ...googleapi.CallOption) (*Expans if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ExpansionFile{ + ret := &ListingsListResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10861,46 +13854,21 @@ func (c *EditsExpansionfilesPatchCall) Do(opts ...googleapi.CallOption) (*Expans } return ret, nil // { - // "description": "Patches the APK's expansion file configuration to reference another APK's expansion file. To add a new expansion file use the Upload method.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", - // "httpMethod": "PATCH", - // "id": "androidpublisher.edits.expansionfiles.patch", + // "description": "Lists all localized store listings.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.listings.list", // "parameterOrder": [ // "packageName", - // "editId", - // "apkVersionCode", - // "expansionFileType" + // "editId" // ], // "parameters": { - // "apkVersionCode": { - // "description": "The version code of the APK whose expansion file configuration is being read or modified.", - // "format": "int32", - // "location": "path", - // "required": true, - // "type": "integer" - // }, // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, - // "expansionFileType": { - // "description": "The file type of the expansion file configuration which is being updated.", - // "enum": [ - // "expansionFileTypeUnspecified", - // "main", - // "patch" - // ], - // "enumDescriptions": [ - // "Unspecified expansion file type.", - // "Main expansion file.", - // "Patch expansion file." - // ], - // "location": "path", - // "required": true, - // "type": "string" - // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", @@ -10908,12 +13876,9 @@ func (c *EditsExpansionfilesPatchCall) Do(opts ...googleapi.CallOption) (*Expans // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", - // "request": { - // "$ref": "ExpansionFile" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings", // "response": { - // "$ref": "ExpansionFile" + // "$ref": "ListingsListResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -10922,44 +13887,38 @@ func (c *EditsExpansionfilesPatchCall) Do(opts ...googleapi.CallOption) (*Expans } -// method id "androidpublisher.edits.expansionfiles.update": +// method id "androidpublisher.edits.listings.patch": -type EditsExpansionfilesUpdateCall struct { - s *Service - packageName string - editId string - apkVersionCode int64 - expansionFileType string - expansionfile *ExpansionFile - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type EditsListingsPatchCall struct { + s *Service + packageName string + editId string + language string + listing *Listing + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Update: Updates the APK's expansion file configuration to reference -// another APK's expansion file. To add a new expansion file use the -// Upload method. +// Patch: Patches a localized store listing. // -// - apkVersionCode: The version code of the APK whose expansion file -// configuration is being read or modified. // - editId: Identifier of the edit. -// - expansionFileType: The file type of the file configuration which is -// being read or modified. +// - language: Language localization code (a BCP-47 language tag; for +// example, "de-AT" for Austrian German). // - packageName: Package name of the app. -func (r *EditsExpansionfilesService) Update(packageName string, editId string, apkVersionCode int64, expansionFileType string, expansionfile *ExpansionFile) *EditsExpansionfilesUpdateCall { - c := &EditsExpansionfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsListingsService) Patch(packageName string, editId string, language string, listing *Listing) *EditsListingsPatchCall { + c := &EditsListingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.apkVersionCode = apkVersionCode - c.expansionFileType = expansionFileType - c.expansionfile = expansionfile + c.language = language + c.listing = listing return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsExpansionfilesUpdateCall) Fields(s ...googleapi.Field) *EditsExpansionfilesUpdateCall { +func (c *EditsListingsPatchCall) Fields(s ...googleapi.Field) *EditsListingsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10967,21 +13926,21 @@ func (c *EditsExpansionfilesUpdateCall) Fields(s ...googleapi.Field) *EditsExpan // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsExpansionfilesUpdateCall) Context(ctx context.Context) *EditsExpansionfilesUpdateCall { +func (c *EditsListingsPatchCall) Context(ctx context.Context) *EditsListingsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsExpansionfilesUpdateCall) Header() http.Header { +func (c *EditsListingsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsExpansionfilesUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsListingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10989,37 +13948,36 @@ func (c *EditsExpansionfilesUpdateCall) doRequest(alt string) (*http.Response, e } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, - "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), - "expansionFileType": c.expansionFileType, + "packageName": c.packageName, + "editId": c.editId, + "language": c.language, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.expansionfiles.update" call. -// Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *ExpansionFile.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EditsExpansionfilesUpdateCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) { +// Do executes the "androidpublisher.edits.listings.patch" call. +// Exactly one of *Listing or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Listing.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsListingsPatchCall) Do(opts ...googleapi.CallOption) (*Listing, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11038,7 +13996,7 @@ func (c *EditsExpansionfilesUpdateCall) Do(opts ...googleapi.CallOption) (*Expan if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ExpansionFile{ + ret := &Listing{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11050,42 +14008,24 @@ func (c *EditsExpansionfilesUpdateCall) Do(opts ...googleapi.CallOption) (*Expan } return ret, nil // { - // "description": "Updates the APK's expansion file configuration to reference another APK's expansion file. To add a new expansion file use the Upload method.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", - // "httpMethod": "PUT", - // "id": "androidpublisher.edits.expansionfiles.update", + // "description": "Patches a localized store listing.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", + // "httpMethod": "PATCH", + // "id": "androidpublisher.edits.listings.patch", // "parameterOrder": [ // "packageName", // "editId", - // "apkVersionCode", - // "expansionFileType" + // "language" // ], // "parameters": { - // "apkVersionCode": { - // "description": "The version code of the APK whose expansion file configuration is being read or modified.", - // "format": "int32", - // "location": "path", - // "required": true, - // "type": "integer" - // }, // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, - // "expansionFileType": { - // "description": "The file type of the file configuration which is being read or modified.", - // "enum": [ - // "expansionFileTypeUnspecified", - // "main", - // "patch" - // ], - // "enumDescriptions": [ - // "Unspecified expansion file type.", - // "Main expansion file.", - // "Patch expansion file." - // ], + // "language": { + // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", // "location": "path", // "required": true, // "type": "string" @@ -11097,12 +14037,12 @@ func (c *EditsExpansionfilesUpdateCall) Do(opts ...googleapi.CallOption) (*Expan // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", // "request": { - // "$ref": "ExpansionFile" + // "$ref": "Listing" // }, // "response": { - // "$ref": "ExpansionFile" + // "$ref": "Listing" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -11111,79 +14051,38 @@ func (c *EditsExpansionfilesUpdateCall) Do(opts ...googleapi.CallOption) (*Expan } -// method id "androidpublisher.edits.expansionfiles.upload": +// method id "androidpublisher.edits.listings.update": -type EditsExpansionfilesUploadCall struct { - s *Service - packageName string - editId string - apkVersionCode int64 - expansionFileType string - urlParams_ gensupport.URLParams - mediaInfo_ *gensupport.MediaInfo - ctx_ context.Context - header_ http.Header +type EditsListingsUpdateCall struct { + s *Service + packageName string + editId string + language string + listing *Listing + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Upload: Uploads a new expansion file and attaches to the specified -// APK. +// Update: Creates or updates a localized store listing. // -// - apkVersionCode: The version code of the APK whose expansion file -// configuration is being read or modified. // - editId: Identifier of the edit. -// - expansionFileType: The file type of the expansion file -// configuration which is being updated. +// - language: Language localization code (a BCP-47 language tag; for +// example, "de-AT" for Austrian German). // - packageName: Package name of the app. -func (r *EditsExpansionfilesService) Upload(packageName string, editId string, apkVersionCode int64, expansionFileType string) *EditsExpansionfilesUploadCall { - c := &EditsExpansionfilesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsListingsService) Update(packageName string, editId string, language string, listing *Listing) *EditsListingsUpdateCall { + c := &EditsListingsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.apkVersionCode = apkVersionCode - c.expansionFileType = expansionFileType - return c -} - -// Media specifies the media to upload in one or more chunks. The chunk -// size may be controlled by supplying a MediaOption generated by -// googleapi.ChunkSize. The chunk size defaults to -// googleapi.DefaultUploadChunkSize.The Content-Type header used in the -// upload request will be determined by sniffing the contents of r, -// unless a MediaOption generated by googleapi.ContentType is -// supplied. -// At most one of Media and ResumableMedia may be set. -func (c *EditsExpansionfilesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsExpansionfilesUploadCall { - c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) - return c -} - -// ResumableMedia specifies the media to upload in chunks and can be -// canceled with ctx. -// -// Deprecated: use Media instead. -// -// At most one of Media and ResumableMedia may be set. mediaType -// identifies the MIME media type of the upload, such as "image/png". If -// mediaType is "", it will be auto-detected. The provided ctx will -// supersede any context previously provided to the Context method. -func (c *EditsExpansionfilesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsExpansionfilesUploadCall { - c.ctx_ = ctx - c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) - return c -} - -// ProgressUpdater provides a callback function that will be called -// after every chunk. It should be a low-latency function in order to -// not slow down the upload operation. This should only be called when -// using ResumableMedia (as opposed to Media). -func (c *EditsExpansionfilesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsExpansionfilesUploadCall { - c.mediaInfo_.SetProgressUpdater(pu) + c.language = language + c.listing = listing return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsExpansionfilesUploadCall) Fields(s ...googleapi.Field) *EditsExpansionfilesUploadCall { +func (c *EditsListingsUpdateCall) Fields(s ...googleapi.Field) *EditsListingsUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11191,23 +14090,21 @@ func (c *EditsExpansionfilesUploadCall) Fields(s ...googleapi.Field) *EditsExpan // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -// This context will supersede any context previously provided to the -// ResumableMedia method. -func (c *EditsExpansionfilesUploadCall) Context(ctx context.Context) *EditsExpansionfilesUploadCall { +func (c *EditsListingsUpdateCall) Context(ctx context.Context) *EditsListingsUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsExpansionfilesUploadCall) Header() http.Header { +func (c *EditsListingsUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsExpansionfilesUploadCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsListingsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -11215,43 +14112,36 @@ func (c *EditsExpansionfilesUploadCall) doRequest(alt string) (*http.Response, e } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") - if c.mediaInfo_ != nil { - urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") - c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) - } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) - defer cleanup() + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } req.Header = reqHeaders - req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, - "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), - "expansionFileType": c.expansionFileType, + "packageName": c.packageName, + "editId": c.editId, + "language": c.language, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.expansionfiles.upload" call. -// Exactly one of *ExpansionFilesUploadResponse or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *ExpansionFilesUploadResponse.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EditsExpansionfilesUploadCall) Do(opts ...googleapi.CallOption) (*ExpansionFilesUploadResponse, error) { +// Do executes the "androidpublisher.edits.listings.update" call. +// Exactly one of *Listing or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Listing.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsListingsUpdateCall) Do(opts ...googleapi.CallOption) (*Listing, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11270,24 +14160,7 @@ func (c *EditsExpansionfilesUploadCall) Do(opts ...googleapi.CallOption) (*Expan if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) - if rx != nil { - rx.Client = c.s.client - rx.UserAgent = c.s.userAgent() - ctx := c.ctx_ - if ctx == nil { - ctx = context.TODO() - } - res, err = rx.Upload(ctx) - if err != nil { - return nil, err - } - defer res.Body.Close() - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - } - ret := &ExpansionFilesUploadResponse{ + ret := &Listing{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11299,58 +14172,24 @@ func (c *EditsExpansionfilesUploadCall) Do(opts ...googleapi.CallOption) (*Expan } return ret, nil // { - // "description": "Uploads a new expansion file and attaches to the specified APK.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", - // "httpMethod": "POST", - // "id": "androidpublisher.edits.expansionfiles.upload", - // "mediaUpload": { - // "accept": [ - // "application/octet-stream" - // ], - // "maxSize": "2147483648", - // "protocols": { - // "resumable": { - // "multipart": true, - // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}" - // }, - // "simple": { - // "multipart": true, - // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}" - // } - // } - // }, + // "description": "Creates or updates a localized store listing.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", + // "httpMethod": "PUT", + // "id": "androidpublisher.edits.listings.update", // "parameterOrder": [ // "packageName", // "editId", - // "apkVersionCode", - // "expansionFileType" + // "language" // ], // "parameters": { - // "apkVersionCode": { - // "description": "The version code of the APK whose expansion file configuration is being read or modified.", - // "format": "int32", - // "location": "path", - // "required": true, - // "type": "integer" - // }, // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, - // "expansionFileType": { - // "description": "The file type of the expansion file configuration which is being updated.", - // "enum": [ - // "expansionFileTypeUnspecified", - // "main", - // "patch" - // ], - // "enumDescriptions": [ - // "Unspecified expansion file type.", - // "Main expansion file.", - // "Patch expansion file." - // ], + // "language": { + // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", // "location": "path", // "required": true, // "type": "string" @@ -11362,89 +14201,98 @@ func (c *EditsExpansionfilesUploadCall) Do(opts ...googleapi.CallOption) (*Expan // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", + // "request": { + // "$ref": "Listing" + // }, // "response": { - // "$ref": "ExpansionFilesUploadResponse" + // "$ref": "Listing" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ], - // "supportsMediaUpload": true + // ] // } } -// method id "androidpublisher.edits.images.delete": +// method id "androidpublisher.edits.testers.get": -type EditsImagesDeleteCall struct { - s *Service - packageName string - editId string - language string - imageType string - imageId string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type EditsTestersGetCall struct { + s *Service + packageName string + editId string + track string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the image (specified by id) from the edit. +// Get: Gets testers. Note: Testers resource does not support email +// lists. // -// - editId: Identifier of the edit. -// - imageId: Unique identifier an image within the set of images -// attached to this edit. -// - imageType: Type of the Image. -// - language: Language localization code (a BCP-47 language tag; for -// example, "de-AT" for Austrian German). -// - packageName: Package name of the app. -func (r *EditsImagesService) Delete(packageName string, editId string, language string, imageType string, imageId string) *EditsImagesDeleteCall { - c := &EditsImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +// - track: The track to read from. +func (r *EditsTestersService) Get(packageName string, editId string, track string) *EditsTestersGetCall { + c := &EditsTestersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.language = language - c.imageType = imageType - c.imageId = imageId + c.track = track return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsImagesDeleteCall) Fields(s ...googleapi.Field) *EditsImagesDeleteCall { +func (c *EditsTestersGetCall) Fields(s ...googleapi.Field) *EditsTestersGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsTestersGetCall) IfNoneMatch(entityTag string) *EditsTestersGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsImagesDeleteCall) Context(ctx context.Context) *EditsImagesDeleteCall { +func (c *EditsTestersGetCall) Context(ctx context.Context) *EditsTestersGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsImagesDeleteCall) Header() http.Header { +func (c *EditsTestersGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsImagesDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsTestersGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -11452,36 +14300,57 @@ func (c *EditsImagesDeleteCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, - "language": c.language, - "imageType": c.imageType, - "imageId": c.imageId, + "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.images.delete" call. -func (c *EditsImagesDeleteCall) Do(opts ...googleapi.CallOption) error { +// Do executes the "androidpublisher.edits.testers.get" call. +// Exactly one of *Testers or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Testers.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsTestersGetCall) Do(opts ...googleapi.CallOption) (*Testers, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } if err != nil { - return err + return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return gensupport.WrapError(err) + return nil, gensupport.WrapError(err) } - return nil + ret := &Testers{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil // { - // "description": "Deletes the image (specified by id) from the edit.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}", - // "httpMethod": "DELETE", - // "id": "androidpublisher.edits.images.delete", + // "description": "Gets testers. Note: Testers resource does not support email lists.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.testers.get", // "parameterOrder": [ // "packageName", // "editId", - // "language", - // "imageType", - // "imageId" + // "track" // ], // "parameters": { // "editId": { @@ -11490,54 +14359,23 @@ func (c *EditsImagesDeleteCall) Do(opts ...googleapi.CallOption) error { // "required": true, // "type": "string" // }, - // "imageId": { - // "description": "Unique identifier an image within the set of images attached to this edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "imageType": { - // "description": "Type of the Image.", - // "enum": [ - // "appImageTypeUnspecified", - // "phoneScreenshots", - // "sevenInchScreenshots", - // "tenInchScreenshots", - // "tvScreenshots", - // "wearScreenshots", - // "icon", - // "featureGraphic", - // "tvBanner" - // ], - // "enumDescriptions": [ - // "Unspecified type. Do not use.", - // "Phone screenshot.", - // "Seven inch screenshot.", - // "Ten inch screenshot.", - // "TV screenshot.", - // "Wear screenshot.", - // "Icon.", - // "Feature graphic.", - // "TV banner." - // ], - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "language": { - // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", + // "packageName": { + // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, - // "packageName": { - // "description": "Package name of the app.", + // "track": { + // "description": "The track to read from.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", + // "response": { + // "$ref": "Testers" + // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -11545,42 +14383,38 @@ func (c *EditsImagesDeleteCall) Do(opts ...googleapi.CallOption) error { } -// method id "androidpublisher.edits.images.deleteall": +// method id "androidpublisher.edits.testers.patch": -type EditsImagesDeleteallCall struct { +type EditsTestersPatchCall struct { s *Service packageName string editId string - language string - imageType string + track string + testers *Testers urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Deleteall: Deletes all images for the specified language and image -// type. Returns an empty response if no images are found. +// Patch: Patches testers. Note: Testers resource does not support email +// lists. // -// - editId: Identifier of the edit. -// - imageType: Type of the Image. Providing an image type that refers -// to no images is a no-op. -// - language: Language localization code (a BCP-47 language tag; for -// example, "de-AT" for Austrian German). Providing a language that is -// not supported by the App is a no-op. -// - packageName: Package name of the app. -func (r *EditsImagesService) Deleteall(packageName string, editId string, language string, imageType string) *EditsImagesDeleteallCall { - c := &EditsImagesDeleteallCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +// - track: The track to update. +func (r *EditsTestersService) Patch(packageName string, editId string, track string, testers *Testers) *EditsTestersPatchCall { + c := &EditsTestersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.language = language - c.imageType = imageType + c.track = track + c.testers = testers return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsImagesDeleteallCall) Fields(s ...googleapi.Field) *EditsImagesDeleteallCall { +func (c *EditsTestersPatchCall) Fields(s ...googleapi.Field) *EditsTestersPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11588,21 +14422,21 @@ func (c *EditsImagesDeleteallCall) Fields(s ...googleapi.Field) *EditsImagesDele // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsImagesDeleteallCall) Context(ctx context.Context) *EditsImagesDeleteallCall { +func (c *EditsTestersPatchCall) Context(ctx context.Context) *EditsTestersPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsImagesDeleteallCall) Header() http.Header { +func (c *EditsTestersPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsImagesDeleteallCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsTestersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -11610,11 +14444,16 @@ func (c *EditsImagesDeleteallCall) doRequest(alt string) (*http.Response, error) } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -11622,20 +14461,19 @@ func (c *EditsImagesDeleteallCall) doRequest(alt string) (*http.Response, error) googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, - "language": c.language, - "imageType": c.imageType, + "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.images.deleteall" call. -// Exactly one of *ImagesDeleteAllResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ImagesDeleteAllResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EditsImagesDeleteallCall) Do(opts ...googleapi.CallOption) (*ImagesDeleteAllResponse, error) { +// Do executes the "androidpublisher.edits.testers.patch" call. +// Exactly one of *Testers or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Testers.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsTestersPatchCall) Do(opts ...googleapi.CallOption) (*Testers, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11654,7 +14492,7 @@ func (c *EditsImagesDeleteallCall) Do(opts ...googleapi.CallOption) (*ImagesDele if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ImagesDeleteAllResponse{ + ret := &Testers{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11666,67 +14504,41 @@ func (c *EditsImagesDeleteallCall) Do(opts ...googleapi.CallOption) (*ImagesDele } return ret, nil // { - // "description": "Deletes all images for the specified language and image type. Returns an empty response if no images are found.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", - // "httpMethod": "DELETE", - // "id": "androidpublisher.edits.images.deleteall", + // "description": "Patches testers. Note: Testers resource does not support email lists.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", + // "httpMethod": "PATCH", + // "id": "androidpublisher.edits.testers.patch", // "parameterOrder": [ // "packageName", // "editId", - // "language", - // "imageType" - // ], - // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "imageType": { - // "description": "Type of the Image. Providing an image type that refers to no images is a no-op.", - // "enum": [ - // "appImageTypeUnspecified", - // "phoneScreenshots", - // "sevenInchScreenshots", - // "tenInchScreenshots", - // "tvScreenshots", - // "wearScreenshots", - // "icon", - // "featureGraphic", - // "tvBanner" - // ], - // "enumDescriptions": [ - // "Unspecified type. Do not use.", - // "Phone screenshot.", - // "Seven inch screenshot.", - // "Ten inch screenshot.", - // "TV screenshot.", - // "Wear screenshot.", - // "Icon.", - // "Feature graphic.", - // "TV banner." - // ], + // "track" + // ], + // "parameters": { + // "editId": { + // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, - // "language": { - // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German). Providing a language that is not supported by the App is a no-op.", + // "packageName": { + // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, - // "packageName": { - // "description": "Package name of the app.", + // "track": { + // "description": "The track to update.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", + // "request": { + // "$ref": "Testers" + // }, // "response": { - // "$ref": "ImagesDeleteAllResponse" + // "$ref": "Testers" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -11735,89 +14547,77 @@ func (c *EditsImagesDeleteallCall) Do(opts ...googleapi.CallOption) (*ImagesDele } -// method id "androidpublisher.edits.images.list": +// method id "androidpublisher.edits.testers.update": -type EditsImagesListCall struct { - s *Service - packageName string - editId string - language string - imageType string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type EditsTestersUpdateCall struct { + s *Service + packageName string + editId string + track string + testers *Testers + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all images. The response may be empty. +// Update: Updates testers. Note: Testers resource does not support +// email lists. // -// - editId: Identifier of the edit. -// - imageType: Type of the Image. Providing an image type that refers -// to no images will return an empty response. -// - language: Language localization code (a BCP-47 language tag; for -// example, "de-AT" for Austrian German). There must be a store -// listing for the specified language. -// - packageName: Package name of the app. -func (r *EditsImagesService) List(packageName string, editId string, language string, imageType string) *EditsImagesListCall { - c := &EditsImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +// - track: The track to update. +func (r *EditsTestersService) Update(packageName string, editId string, track string, testers *Testers) *EditsTestersUpdateCall { + c := &EditsTestersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.language = language - c.imageType = imageType + c.track = track + c.testers = testers return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsImagesListCall) Fields(s ...googleapi.Field) *EditsImagesListCall { +func (c *EditsTestersUpdateCall) Fields(s ...googleapi.Field) *EditsTestersUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *EditsImagesListCall) IfNoneMatch(entityTag string) *EditsImagesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsImagesListCall) Context(ctx context.Context) *EditsImagesListCall { +func (c *EditsTestersUpdateCall) Context(ctx context.Context) *EditsTestersUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsImagesListCall) Header() http.Header { +func (c *EditsTestersUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsImagesListCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsTestersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } @@ -11825,20 +14625,19 @@ func (c *EditsImagesListCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, - "language": c.language, - "imageType": c.imageType, + "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.images.list" call. -// Exactly one of *ImagesListResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ImagesListResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EditsImagesListCall) Do(opts ...googleapi.CallOption) (*ImagesListResponse, error) { +// Do executes the "androidpublisher.edits.testers.update" call. +// Exactly one of *Testers or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Testers.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsTestersUpdateCall) Do(opts ...googleapi.CallOption) (*Testers, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11857,7 +14656,7 @@ func (c *EditsImagesListCall) Do(opts ...googleapi.CallOption) (*ImagesListRespo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ImagesListResponse{ + ret := &Testers{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11869,15 +14668,14 @@ func (c *EditsImagesListCall) Do(opts ...googleapi.CallOption) (*ImagesListRespo } return ret, nil // { - // "description": "Lists all images. The response may be empty.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", - // "httpMethod": "GET", - // "id": "androidpublisher.edits.images.list", + // "description": "Updates testers. Note: Testers resource does not support email lists.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", + // "httpMethod": "PUT", + // "id": "androidpublisher.edits.testers.update", // "parameterOrder": [ // "packageName", // "editId", - // "language", - // "imageType" + // "track" // ], // "parameters": { // "editId": { @@ -11886,50 +14684,25 @@ func (c *EditsImagesListCall) Do(opts ...googleapi.CallOption) (*ImagesListRespo // "required": true, // "type": "string" // }, - // "imageType": { - // "description": "Type of the Image. Providing an image type that refers to no images will return an empty response.", - // "enum": [ - // "appImageTypeUnspecified", - // "phoneScreenshots", - // "sevenInchScreenshots", - // "tenInchScreenshots", - // "tvScreenshots", - // "wearScreenshots", - // "icon", - // "featureGraphic", - // "tvBanner" - // ], - // "enumDescriptions": [ - // "Unspecified type. Do not use.", - // "Phone screenshot.", - // "Seven inch screenshot.", - // "Ten inch screenshot.", - // "TV screenshot.", - // "Wear screenshot.", - // "Icon.", - // "Feature graphic.", - // "TV banner." - // ], - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "language": { - // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German). There must be a store listing for the specified language.", + // "packageName": { + // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, - // "packageName": { - // "description": "Package name of the app.", + // "track": { + // "description": "The track to update.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", + // "request": { + // "$ref": "Testers" + // }, // "response": { - // "$ref": "ImagesListResponse" + // "$ref": "Testers" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -11938,79 +14711,34 @@ func (c *EditsImagesListCall) Do(opts ...googleapi.CallOption) (*ImagesListRespo } -// method id "androidpublisher.edits.images.upload": +// method id "androidpublisher.edits.tracks.create": -type EditsImagesUploadCall struct { +type EditsTracksCreateCall struct { s *Service packageName string editId string - language string - imageType string + trackconfig *TrackConfig urlParams_ gensupport.URLParams - mediaInfo_ *gensupport.MediaInfo ctx_ context.Context header_ http.Header } -// Upload: Uploads an image of the specified language and image type, -// and adds to the edit. +// Create: Creates a new track. // -// - editId: Identifier of the edit. -// - imageType: Type of the Image. -// - language: Language localization code (a BCP-47 language tag; for -// example, "de-AT" for Austrian German). Providing a language that is -// not supported by the App is a no-op. -// - packageName: Package name of the app. -func (r *EditsImagesService) Upload(packageName string, editId string, language string, imageType string) *EditsImagesUploadCall { - c := &EditsImagesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsTracksService) Create(packageName string, editId string, trackconfig *TrackConfig) *EditsTracksCreateCall { + c := &EditsTracksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.language = language - c.imageType = imageType - return c -} - -// Media specifies the media to upload in one or more chunks. The chunk -// size may be controlled by supplying a MediaOption generated by -// googleapi.ChunkSize. The chunk size defaults to -// googleapi.DefaultUploadChunkSize.The Content-Type header used in the -// upload request will be determined by sniffing the contents of r, -// unless a MediaOption generated by googleapi.ContentType is -// supplied. -// At most one of Media and ResumableMedia may be set. -func (c *EditsImagesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsImagesUploadCall { - c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) - return c -} - -// ResumableMedia specifies the media to upload in chunks and can be -// canceled with ctx. -// -// Deprecated: use Media instead. -// -// At most one of Media and ResumableMedia may be set. mediaType -// identifies the MIME media type of the upload, such as "image/png". If -// mediaType is "", it will be auto-detected. The provided ctx will -// supersede any context previously provided to the Context method. -func (c *EditsImagesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsImagesUploadCall { - c.ctx_ = ctx - c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) - return c -} - -// ProgressUpdater provides a callback function that will be called -// after every chunk. It should be a low-latency function in order to -// not slow down the upload operation. This should only be called when -// using ResumableMedia (as opposed to Media). -func (c *EditsImagesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsImagesUploadCall { - c.mediaInfo_.SetProgressUpdater(pu) + c.trackconfig = trackconfig return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsImagesUploadCall) Fields(s ...googleapi.Field) *EditsImagesUploadCall { +func (c *EditsTracksCreateCall) Fields(s ...googleapi.Field) *EditsTracksCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12018,23 +14746,21 @@ func (c *EditsImagesUploadCall) Fields(s ...googleapi.Field) *EditsImagesUploadC // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -// This context will supersede any context previously provided to the -// ResumableMedia method. -func (c *EditsImagesUploadCall) Context(ctx context.Context) *EditsImagesUploadCall { +func (c *EditsTracksCreateCall) Context(ctx context.Context) *EditsTracksCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsImagesUploadCall) Header() http.Header { +func (c *EditsTracksCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsImagesUploadCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsTracksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -12042,43 +14768,35 @@ func (c *EditsImagesUploadCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.trackconfig) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") - if c.mediaInfo_ != nil { - urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") - c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) - } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) - defer cleanup() + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders - req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, - "language": c.language, - "imageType": c.imageType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.images.upload" call. -// Exactly one of *ImagesUploadResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ImagesUploadResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EditsImagesUploadCall) Do(opts ...googleapi.CallOption) (*ImagesUploadResponse, error) { +// Do executes the "androidpublisher.edits.tracks.create" call. +// Exactly one of *Track or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Track.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsTracksCreateCall) Do(opts ...googleapi.CallOption) (*Track, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12097,24 +14815,7 @@ func (c *EditsImagesUploadCall) Do(opts ...googleapi.CallOption) (*ImagesUploadR if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) - if rx != nil { - rx.Client = c.s.client - rx.UserAgent = c.s.userAgent() - ctx := c.ctx_ - if ctx == nil { - ctx = context.TODO() - } - res, err = rx.Upload(ctx) - if err != nil { - return nil, err - } - defer res.Body.Close() - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - } - ret := &ImagesUploadResponse{ + ret := &Track{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12126,156 +14827,120 @@ func (c *EditsImagesUploadCall) Do(opts ...googleapi.CallOption) (*ImagesUploadR } return ret, nil // { - // "description": "Uploads an image of the specified language and image type, and adds to the edit.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", + // "description": "Creates a new track.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks", // "httpMethod": "POST", - // "id": "androidpublisher.edits.images.upload", - // "mediaUpload": { - // "accept": [ - // "image/*" - // ], - // "maxSize": "15728640", - // "protocols": { - // "resumable": { - // "multipart": true, - // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}" - // }, - // "simple": { - // "multipart": true, - // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}" - // } - // } - // }, + // "id": "androidpublisher.edits.tracks.create", // "parameterOrder": [ // "packageName", - // "editId", - // "language", - // "imageType" + // "editId" // ], // "parameters": { // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "imageType": { - // "description": "Type of the Image.", - // "enum": [ - // "appImageTypeUnspecified", - // "phoneScreenshots", - // "sevenInchScreenshots", - // "tenInchScreenshots", - // "tvScreenshots", - // "wearScreenshots", - // "icon", - // "featureGraphic", - // "tvBanner" - // ], - // "enumDescriptions": [ - // "Unspecified type. Do not use.", - // "Phone screenshot.", - // "Seven inch screenshot.", - // "Ten inch screenshot.", - // "TV screenshot.", - // "Wear screenshot.", - // "Icon.", - // "Feature graphic.", - // "TV banner." - // ], - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "language": { - // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German). Providing a language that is not supported by the App is a no-op.", + // "description": "Required. Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { - // "description": "Package name of the app.", + // "description": "Required. Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks", + // "request": { + // "$ref": "TrackConfig" + // }, // "response": { - // "$ref": "ImagesUploadResponse" + // "$ref": "Track" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ], - // "supportsMediaUpload": true + // ] // } } -// method id "androidpublisher.edits.listings.delete": +// method id "androidpublisher.edits.tracks.get": -type EditsListingsDeleteCall struct { - s *Service - packageName string - editId string - language string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type EditsTracksGetCall struct { + s *Service + packageName string + editId string + track string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a localized store listing. +// Get: Gets a track. // // - editId: Identifier of the edit. -// - language: Language localization code (a BCP-47 language tag; for -// example, "de-AT" for Austrian German). // - packageName: Package name of the app. -func (r *EditsListingsService) Delete(packageName string, editId string, language string) *EditsListingsDeleteCall { - c := &EditsListingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - track: Identifier of the track. More on track name +// (https://developers.google.com/android-publisher/tracks#ff-track-name). +func (r *EditsTracksService) Get(packageName string, editId string, track string) *EditsTracksGetCall { + c := &EditsTracksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.language = language + c.track = track return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsListingsDeleteCall) Fields(s ...googleapi.Field) *EditsListingsDeleteCall { +func (c *EditsTracksGetCall) Fields(s ...googleapi.Field) *EditsTracksGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsTracksGetCall) IfNoneMatch(entityTag string) *EditsTracksGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsListingsDeleteCall) Context(ctx context.Context) *EditsListingsDeleteCall { +func (c *EditsTracksGetCall) Context(ctx context.Context) *EditsTracksGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsListingsDeleteCall) Header() http.Header { +func (c *EditsTracksGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsListingsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsTracksGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -12283,32 +14948,57 @@ func (c *EditsListingsDeleteCall) doRequest(alt string) (*http.Response, error) googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, - "language": c.language, + "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.listings.delete" call. -func (c *EditsListingsDeleteCall) Do(opts ...googleapi.CallOption) error { +// Do executes the "androidpublisher.edits.tracks.get" call. +// Exactly one of *Track or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Track.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsTracksGetCall) Do(opts ...googleapi.CallOption) (*Track, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } if err != nil { - return err + return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return gensupport.WrapError(err) + return nil, gensupport.WrapError(err) } - return nil + ret := &Track{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil // { - // "description": "Deletes a localized store listing.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", - // "httpMethod": "DELETE", - // "id": "androidpublisher.edits.listings.delete", + // "description": "Gets a track.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.tracks.get", // "parameterOrder": [ // "packageName", // "editId", - // "language" + // "track" // ], // "parameters": { // "editId": { @@ -12317,20 +15007,23 @@ func (c *EditsListingsDeleteCall) Do(opts ...googleapi.CallOption) error { // "required": true, // "type": "string" // }, - // "language": { - // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", + // "packageName": { + // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, - // "packageName": { - // "description": "Package name of the app.", + // "track": { + // "description": "Identifier of the track. [More on track name](https://developers.google.com/android-publisher/tracks#ff-track-name)", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", + // "response": { + // "$ref": "Track" + // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -12338,23 +15031,24 @@ func (c *EditsListingsDeleteCall) Do(opts ...googleapi.CallOption) error { } -// method id "androidpublisher.edits.listings.deleteall": +// method id "androidpublisher.edits.tracks.list": -type EditsListingsDeleteallCall struct { - s *Service - packageName string - editId string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type EditsTracksListCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Deleteall: Deletes all store listings. +// List: Lists all tracks. // // - editId: Identifier of the edit. // - packageName: Package name of the app. -func (r *EditsListingsService) Deleteall(packageName string, editId string) *EditsListingsDeleteallCall { - c := &EditsListingsDeleteallCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsTracksService) List(packageName string, editId string) *EditsTracksListCall { + c := &EditsTracksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId return c @@ -12363,41 +15057,54 @@ func (r *EditsListingsService) Deleteall(packageName string, editId string) *Edi // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsListingsDeleteallCall) Fields(s ...googleapi.Field) *EditsListingsDeleteallCall { +func (c *EditsTracksListCall) Fields(s ...googleapi.Field) *EditsTracksListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsTracksListCall) IfNoneMatch(entityTag string) *EditsTracksListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsListingsDeleteallCall) Context(ctx context.Context) *EditsListingsDeleteallCall { +func (c *EditsTracksListCall) Context(ctx context.Context) *EditsTracksListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsListingsDeleteallCall) Header() http.Header { +func (c *EditsTracksListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsListingsDeleteallCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsTracksListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -12409,23 +15116,48 @@ func (c *EditsListingsDeleteallCall) doRequest(alt string) (*http.Response, erro return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.listings.deleteall" call. -func (c *EditsListingsDeleteallCall) Do(opts ...googleapi.CallOption) error { +// Do executes the "androidpublisher.edits.tracks.list" call. +// Exactly one of *TracksListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TracksListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsTracksListCall) Do(opts ...googleapi.CallOption) (*TracksListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } if err != nil { - return err + return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return gensupport.WrapError(err) + return nil, gensupport.WrapError(err) } - return nil + ret := &TracksListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil // { - // "description": "Deletes all store listings.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings", - // "httpMethod": "DELETE", - // "id": "androidpublisher.edits.listings.deleteall", + // "description": "Lists all tracks.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.tracks.list", // "parameterOrder": [ // "packageName", // "editId" @@ -12444,7 +15176,10 @@ func (c *EditsListingsDeleteallCall) Do(opts ...googleapi.CallOption) error { // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks", + // "response": { + // "$ref": "TracksListResponse" + // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -12452,84 +15187,77 @@ func (c *EditsListingsDeleteallCall) Do(opts ...googleapi.CallOption) error { } -// method id "androidpublisher.edits.listings.get": +// method id "androidpublisher.edits.tracks.patch": -type EditsListingsGetCall struct { - s *Service - packageName string - editId string - language string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type EditsTracksPatchCall struct { + s *Service + packageName string + editId string + track string + track2 *Track + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a localized store listing. +// Patch: Patches a track. // // - editId: Identifier of the edit. -// - language: Language localization code (a BCP-47 language tag; for -// example, "de-AT" for Austrian German). // - packageName: Package name of the app. -func (r *EditsListingsService) Get(packageName string, editId string, language string) *EditsListingsGetCall { - c := &EditsListingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - track: Identifier of the track. More on track name +// (https://developers.google.com/android-publisher/tracks#ff-track-name). +func (r *EditsTracksService) Patch(packageName string, editId string, track string, track2 *Track) *EditsTracksPatchCall { + c := &EditsTracksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.language = language + c.track = track + c.track2 = track2 return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsListingsGetCall) Fields(s ...googleapi.Field) *EditsListingsGetCall { +func (c *EditsTracksPatchCall) Fields(s ...googleapi.Field) *EditsTracksPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *EditsListingsGetCall) IfNoneMatch(entityTag string) *EditsListingsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsListingsGetCall) Context(ctx context.Context) *EditsListingsGetCall { +func (c *EditsTracksPatchCall) Context(ctx context.Context) *EditsTracksPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsListingsGetCall) Header() http.Header { +func (c *EditsTracksPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsListingsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsTracksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -12537,19 +15265,19 @@ func (c *EditsListingsGetCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, - "language": c.language, + "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.listings.get" call. -// Exactly one of *Listing or error will be non-nil. Any non-2xx status +// Do executes the "androidpublisher.edits.tracks.patch" call. +// Exactly one of *Track or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Listing.ServerResponse.Header or (if a response was returned at all) +// *Track.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *EditsListingsGetCall) Do(opts ...googleapi.CallOption) (*Listing, error) { +func (c *EditsTracksPatchCall) Do(opts ...googleapi.CallOption) (*Track, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12568,7 +15296,7 @@ func (c *EditsListingsGetCall) Do(opts ...googleapi.CallOption) (*Listing, error if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Listing{ + ret := &Track{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12580,14 +15308,14 @@ func (c *EditsListingsGetCall) Do(opts ...googleapi.CallOption) (*Listing, error } return ret, nil // { - // "description": "Gets a localized store listing.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", - // "httpMethod": "GET", - // "id": "androidpublisher.edits.listings.get", + // "description": "Patches a track.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", + // "httpMethod": "PATCH", + // "id": "androidpublisher.edits.tracks.patch", // "parameterOrder": [ // "packageName", // "editId", - // "language" + // "track" // ], // "parameters": { // "editId": { @@ -12596,22 +15324,25 @@ func (c *EditsListingsGetCall) Do(opts ...googleapi.CallOption) (*Listing, error // "required": true, // "type": "string" // }, - // "language": { - // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", + // "packageName": { + // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, - // "packageName": { - // "description": "Package name of the app.", + // "track": { + // "description": "Identifier of the track. [More on track name](https://developers.google.com/android-publisher/tracks#ff-track-name)", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", + // "request": { + // "$ref": "Track" + // }, // "response": { - // "$ref": "Listing" + // "$ref": "Track" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -12620,80 +15351,77 @@ func (c *EditsListingsGetCall) Do(opts ...googleapi.CallOption) (*Listing, error } -// method id "androidpublisher.edits.listings.list": +// method id "androidpublisher.edits.tracks.update": -type EditsListingsListCall struct { - s *Service - packageName string - editId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type EditsTracksUpdateCall struct { + s *Service + packageName string + editId string + track string + track2 *Track + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all localized store listings. +// Update: Updates a track. // -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -func (r *EditsListingsService) List(packageName string, editId string) *EditsListingsListCall { - c := &EditsListingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +// - track: Identifier of the track. More on track name +// (https://developers.google.com/android-publisher/tracks#ff-track-name). +func (r *EditsTracksService) Update(packageName string, editId string, track string, track2 *Track) *EditsTracksUpdateCall { + c := &EditsTracksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId + c.track = track + c.track2 = track2 return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsListingsListCall) Fields(s ...googleapi.Field) *EditsListingsListCall { +func (c *EditsTracksUpdateCall) Fields(s ...googleapi.Field) *EditsTracksUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *EditsListingsListCall) IfNoneMatch(entityTag string) *EditsListingsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsListingsListCall) Context(ctx context.Context) *EditsListingsListCall { +func (c *EditsTracksUpdateCall) Context(ctx context.Context) *EditsTracksUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsListingsListCall) Header() http.Header { +func (c *EditsTracksUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsListingsListCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsTracksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } @@ -12701,18 +15429,19 @@ func (c *EditsListingsListCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, + "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.listings.list" call. -// Exactly one of *ListingsListResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListingsListResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EditsListingsListCall) Do(opts ...googleapi.CallOption) (*ListingsListResponse, error) { +// Do executes the "androidpublisher.edits.tracks.update" call. +// Exactly one of *Track or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Track.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsTracksUpdateCall) Do(opts ...googleapi.CallOption) (*Track, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12731,7 +15460,7 @@ func (c *EditsListingsListCall) Do(opts ...googleapi.CallOption) (*ListingsListR if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListingsListResponse{ + ret := &Track{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12742,14 +15471,15 @@ func (c *EditsListingsListCall) Do(opts ...googleapi.CallOption) (*ListingsListR return nil, err } return ret, nil - // { - // "description": "Lists all localized store listings.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings", - // "httpMethod": "GET", - // "id": "androidpublisher.edits.listings.list", + // { + // "description": "Updates a track.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", + // "httpMethod": "PUT", + // "id": "androidpublisher.edits.tracks.update", // "parameterOrder": [ // "packageName", - // "editId" + // "editId", + // "track" // ], // "parameters": { // "editId": { @@ -12763,11 +15493,20 @@ func (c *EditsListingsListCall) Do(opts ...googleapi.CallOption) (*ListingsListR // "location": "path", // "required": true, // "type": "string" + // }, + // "track": { + // "description": "Identifier of the track. [More on track name](https://developers.google.com/android-publisher/tracks#ff-track-name)", + // "location": "path", + // "required": true, + // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", + // "request": { + // "$ref": "Track" + // }, // "response": { - // "$ref": "ListingsListResponse" + // "$ref": "Track" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -12776,38 +15515,44 @@ func (c *EditsListingsListCall) Do(opts ...googleapi.CallOption) (*ListingsListR } -// method id "androidpublisher.edits.listings.patch": +// method id "androidpublisher.externaltransactions.createexternaltransaction": -type EditsListingsPatchCall struct { - s *Service - packageName string - editId string - language string - listing *Listing - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ExternaltransactionsCreateexternaltransactionCall struct { + s *Service + parent string + externaltransaction *ExternalTransaction + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Patches a localized store listing. +// Createexternaltransaction: Creates a new external transaction. // -// - editId: Identifier of the edit. -// - language: Language localization code (a BCP-47 language tag; for -// example, "de-AT" for Austrian German). -// - packageName: Package name of the app. -func (r *EditsListingsService) Patch(packageName string, editId string, language string, listing *Listing) *EditsListingsPatchCall { - c := &EditsListingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.packageName = packageName - c.editId = editId - c.language = language - c.listing = listing +// - parent: The parent resource where this external transaction will be +// created. Format: applications/{package_name}. +func (r *ExternaltransactionsService) Createexternaltransaction(parent string, externaltransaction *ExternalTransaction) *ExternaltransactionsCreateexternaltransactionCall { + c := &ExternaltransactionsCreateexternaltransactionCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.externaltransaction = externaltransaction + return c +} + +// ExternalTransactionId sets the optional parameter +// "externalTransactionId": Required. The id to use for the external +// transaction. Must be unique across all other transactions for the +// app. This value should be 1-63 characters and valid characters are +// /a-z0-9_-/. Do not use this field to store any Personally +// Identifiable Information (PII) such as emails. Attempting to store +// PII in this field may result in requests being blocked. +func (c *ExternaltransactionsCreateexternaltransactionCall) ExternalTransactionId(externalTransactionId string) *ExternaltransactionsCreateexternaltransactionCall { + c.urlParams_.Set("externalTransactionId", externalTransactionId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsListingsPatchCall) Fields(s ...googleapi.Field) *EditsListingsPatchCall { +func (c *ExternaltransactionsCreateexternaltransactionCall) Fields(s ...googleapi.Field) *ExternaltransactionsCreateexternaltransactionCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12815,21 +15560,21 @@ func (c *EditsListingsPatchCall) Fields(s ...googleapi.Field) *EditsListingsPatc // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsListingsPatchCall) Context(ctx context.Context) *EditsListingsPatchCall { +func (c *ExternaltransactionsCreateexternaltransactionCall) Context(ctx context.Context) *ExternaltransactionsCreateexternaltransactionCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsListingsPatchCall) Header() http.Header { +func (c *ExternaltransactionsCreateexternaltransactionCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsListingsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ExternaltransactionsCreateexternaltransactionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -12837,36 +15582,34 @@ func (c *EditsListingsPatchCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.externaltransaction) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+parent}/externalTransactions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, - "language": c.language, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.listings.patch" call. -// Exactly one of *Listing or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Listing.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsListingsPatchCall) Do(opts ...googleapi.CallOption) (*Listing, error) { +// Do executes the "androidpublisher.externaltransactions.createexternaltransaction" call. +// Exactly one of *ExternalTransaction or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ExternalTransaction.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ExternaltransactionsCreateexternaltransactionCall) Do(opts ...googleapi.CallOption) (*ExternalTransaction, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12885,7 +15628,7 @@ func (c *EditsListingsPatchCall) Do(opts ...googleapi.CallOption) (*Listing, err if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Listing{ + ret := &ExternalTransaction{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12897,41 +15640,33 @@ func (c *EditsListingsPatchCall) Do(opts ...googleapi.CallOption) (*Listing, err } return ret, nil // { - // "description": "Patches a localized store listing.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", - // "httpMethod": "PATCH", - // "id": "androidpublisher.edits.listings.patch", + // "description": "Creates a new external transaction.", + // "flatPath": "androidpublisher/v3/applications/{applicationsId}/externalTransactions", + // "httpMethod": "POST", + // "id": "androidpublisher.externaltransactions.createexternaltransaction", // "parameterOrder": [ - // "packageName", - // "editId", - // "language" + // "parent" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "language": { - // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", - // "location": "path", - // "required": true, + // "externalTransactionId": { + // "description": "Required. The id to use for the external transaction. Must be unique across all other transactions for the app. This value should be 1-63 characters and valid characters are /a-z0-9_-/. Do not use this field to store any Personally Identifiable Information (PII) such as emails. Attempting to store PII in this field may result in requests being blocked.", + // "location": "query", // "type": "string" // }, - // "packageName": { - // "description": "Package name of the app.", + // "parent": { + // "description": "Required. The parent resource where this external transaction will be created. Format: applications/{package_name}", // "location": "path", + // "pattern": "^applications/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", + // "path": "androidpublisher/v3/{+parent}/externalTransactions", // "request": { - // "$ref": "Listing" + // "$ref": "ExternalTransaction" // }, // "response": { - // "$ref": "Listing" + // "$ref": "ExternalTransaction" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -12940,97 +15675,97 @@ func (c *EditsListingsPatchCall) Do(opts ...googleapi.CallOption) (*Listing, err } -// method id "androidpublisher.edits.listings.update": +// method id "androidpublisher.externaltransactions.getexternaltransaction": -type EditsListingsUpdateCall struct { - s *Service - packageName string - editId string - language string - listing *Listing - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ExternaltransactionsGetexternaltransactionCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Update: Creates or updates a localized store listing. +// Getexternaltransaction: Gets an existing external transaction. // -// - editId: Identifier of the edit. -// - language: Language localization code (a BCP-47 language tag; for -// example, "de-AT" for Austrian German). -// - packageName: Package name of the app. -func (r *EditsListingsService) Update(packageName string, editId string, language string, listing *Listing) *EditsListingsUpdateCall { - c := &EditsListingsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.packageName = packageName - c.editId = editId - c.language = language - c.listing = listing +// - name: The name of the external transaction to retrieve. Format: +// applications/{package_name}/externalTransactions/{external_transacti +// on}. +func (r *ExternaltransactionsService) Getexternaltransaction(name string) *ExternaltransactionsGetexternaltransactionCall { + c := &ExternaltransactionsGetexternaltransactionCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsListingsUpdateCall) Fields(s ...googleapi.Field) *EditsListingsUpdateCall { +func (c *ExternaltransactionsGetexternaltransactionCall) Fields(s ...googleapi.Field) *ExternaltransactionsGetexternaltransactionCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ExternaltransactionsGetexternaltransactionCall) IfNoneMatch(entityTag string) *ExternaltransactionsGetexternaltransactionCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsListingsUpdateCall) Context(ctx context.Context) *EditsListingsUpdateCall { +func (c *ExternaltransactionsGetexternaltransactionCall) Context(ctx context.Context) *ExternaltransactionsGetexternaltransactionCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsListingsUpdateCall) Header() http.Header { +func (c *ExternaltransactionsGetexternaltransactionCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsListingsUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *ExternaltransactionsGetexternaltransactionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, - "language": c.language, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.listings.update" call. -// Exactly one of *Listing or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Listing.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsListingsUpdateCall) Do(opts ...googleapi.CallOption) (*Listing, error) { +// Do executes the "androidpublisher.externaltransactions.getexternaltransaction" call. +// Exactly one of *ExternalTransaction or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ExternalTransaction.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ExternaltransactionsGetexternaltransactionCall) Do(opts ...googleapi.CallOption) (*ExternalTransaction, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13049,7 +15784,7 @@ func (c *EditsListingsUpdateCall) Do(opts ...googleapi.CallOption) (*Listing, er if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Listing{ + ret := &ExternalTransaction{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13061,41 +15796,25 @@ func (c *EditsListingsUpdateCall) Do(opts ...googleapi.CallOption) (*Listing, er } return ret, nil // { - // "description": "Creates or updates a localized store listing.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", - // "httpMethod": "PUT", - // "id": "androidpublisher.edits.listings.update", + // "description": "Gets an existing external transaction.", + // "flatPath": "androidpublisher/v3/applications/{applicationsId}/externalTransactions/{externalTransactionsId}", + // "httpMethod": "GET", + // "id": "androidpublisher.externaltransactions.getexternaltransaction", // "parameterOrder": [ - // "packageName", - // "editId", - // "language" - // ], - // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "language": { - // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "packageName": { - // "description": "Package name of the app.", + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The name of the external transaction to retrieve. Format: applications/{package_name}/externalTransactions/{external_transaction}", // "location": "path", + // "pattern": "^applications/[^/]+/externalTransactions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", - // "request": { - // "$ref": "Listing" - // }, + // "path": "androidpublisher/v3/{+name}", // "response": { - // "$ref": "Listing" + // "$ref": "ExternalTransaction" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -13104,104 +15823,92 @@ func (c *EditsListingsUpdateCall) Do(opts ...googleapi.CallOption) (*Listing, er } -// method id "androidpublisher.edits.testers.get": +// method id "androidpublisher.externaltransactions.refundexternaltransaction": -type EditsTestersGetCall struct { - s *Service - packageName string - editId string - track string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ExternaltransactionsRefundexternaltransactionCall struct { + s *Service + name string + refundexternaltransactionrequest *RefundExternalTransactionRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets testers. Note: Testers resource does not support email -// lists. +// Refundexternaltransaction: Refunds or partially refunds an existing +// external transaction. // -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -// - track: The track to read from. -func (r *EditsTestersService) Get(packageName string, editId string, track string) *EditsTestersGetCall { - c := &EditsTestersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.packageName = packageName - c.editId = editId - c.track = track +// - name: The name of the external transaction that will be refunded. +// Format: +// applications/{package_name}/externalTransactions/{external_transacti +// on}. +func (r *ExternaltransactionsService) Refundexternaltransaction(name string, refundexternaltransactionrequest *RefundExternalTransactionRequest) *ExternaltransactionsRefundexternaltransactionCall { + c := &ExternaltransactionsRefundexternaltransactionCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.refundexternaltransactionrequest = refundexternaltransactionrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsTestersGetCall) Fields(s ...googleapi.Field) *EditsTestersGetCall { +func (c *ExternaltransactionsRefundexternaltransactionCall) Fields(s ...googleapi.Field) *ExternaltransactionsRefundexternaltransactionCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *EditsTestersGetCall) IfNoneMatch(entityTag string) *EditsTestersGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsTestersGetCall) Context(ctx context.Context) *EditsTestersGetCall { +func (c *ExternaltransactionsRefundexternaltransactionCall) Context(ctx context.Context) *ExternaltransactionsRefundexternaltransactionCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsTestersGetCall) Header() http.Header { +func (c *ExternaltransactionsRefundexternaltransactionCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsTestersGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ExternaltransactionsRefundexternaltransactionCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.refundexternaltransactionrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+name}:refund") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, - "track": c.track, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.testers.get" call. -// Exactly one of *Testers or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Testers.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsTestersGetCall) Do(opts ...googleapi.CallOption) (*Testers, error) { +// Do executes the "androidpublisher.externaltransactions.refundexternaltransaction" call. +// Exactly one of *ExternalTransaction or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ExternalTransaction.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ExternaltransactionsRefundexternaltransactionCall) Do(opts ...googleapi.CallOption) (*ExternalTransaction, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13220,7 +15927,7 @@ func (c *EditsTestersGetCall) Do(opts ...googleapi.CallOption) (*Testers, error) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Testers{ + ret := &ExternalTransaction{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13232,38 +15939,28 @@ func (c *EditsTestersGetCall) Do(opts ...googleapi.CallOption) (*Testers, error) } return ret, nil // { - // "description": "Gets testers. Note: Testers resource does not support email lists.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", - // "httpMethod": "GET", - // "id": "androidpublisher.edits.testers.get", + // "description": "Refunds or partially refunds an existing external transaction.", + // "flatPath": "androidpublisher/v3/applications/{applicationsId}/externalTransactions/{externalTransactionsId}:refund", + // "httpMethod": "POST", + // "id": "androidpublisher.externaltransactions.refundexternaltransaction", // "parameterOrder": [ - // "packageName", - // "editId", - // "track" + // "name" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "packageName": { - // "description": "Package name of the app.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "track": { - // "description": "The track to read from.", + // "name": { + // "description": "Required. The name of the external transaction that will be refunded. Format: applications/{package_name}/externalTransactions/{external_transaction}", // "location": "path", + // "pattern": "^applications/[^/]+/externalTransactions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", + // "path": "androidpublisher/v3/{+name}:refund", + // "request": { + // "$ref": "RefundExternalTransactionRequest" + // }, // "response": { - // "$ref": "Testers" + // "$ref": "ExternalTransaction" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -13272,139 +15969,138 @@ func (c *EditsTestersGetCall) Do(opts ...googleapi.CallOption) (*Testers, error) } -// method id "androidpublisher.edits.testers.patch": +// method id "androidpublisher.generatedapks.download": -type EditsTestersPatchCall struct { - s *Service - packageName string - editId string - track string - testers *Testers - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type GeneratedapksDownloadCall struct { + s *Service + packageName string + versionCode int64 + downloadId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Patches testers. Note: Testers resource does not support email -// lists. +// Download: Downloads a single signed APK generated from an app bundle. // -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -// - track: The track to update. -func (r *EditsTestersService) Patch(packageName string, editId string, track string, testers *Testers) *EditsTestersPatchCall { - c := &EditsTestersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - downloadId: Download ID, which uniquely identifies the APK to +// download. Can be obtained from the response of `generatedapks.list` +// method. +// - packageName: Package name of the app. +// - versionCode: Version code of the app bundle. +func (r *GeneratedapksService) Download(packageName string, versionCode int64, downloadId string) *GeneratedapksDownloadCall { + c := &GeneratedapksDownloadCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.editId = editId - c.track = track - c.testers = testers + c.versionCode = versionCode + c.downloadId = downloadId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsTestersPatchCall) Fields(s ...googleapi.Field) *EditsTestersPatchCall { +func (c *GeneratedapksDownloadCall) Fields(s ...googleapi.Field) *GeneratedapksDownloadCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *EditsTestersPatchCall) Context(ctx context.Context) *EditsTestersPatchCall { +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GeneratedapksDownloadCall) IfNoneMatch(entityTag string) *GeneratedapksDownloadCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download +// methods. Any pending HTTP request will be aborted if the provided +// context is canceled. +func (c *GeneratedapksDownloadCall) Context(ctx context.Context) *GeneratedapksDownloadCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsTestersPatchCall) Header() http.Header { +func (c *GeneratedapksDownloadCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsTestersPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *GeneratedapksDownloadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}/downloads/{downloadId}:download") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "editId": c.editId, - "track": c.track, + "versionCode": strconv.FormatInt(c.versionCode, 10), + "downloadId": c.downloadId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.testers.patch" call. -// Exactly one of *Testers or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Testers.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsTestersPatchCall) Do(opts ...googleapi.CallOption) (*Testers, error) { +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *GeneratedapksDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } + res, err := c.doRequest("media") if err != nil { return nil, err } - defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { + res.Body.Close() return nil, gensupport.WrapError(err) } - ret := &Testers{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, + return res, nil +} + +// Do executes the "androidpublisher.generatedapks.download" call. +func (c *GeneratedapksDownloadCall) Do(opts ...googleapi.CallOption) error { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if err != nil { + return err } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return gensupport.WrapError(err) } - return ret, nil + return nil // { - // "description": "Patches testers. Note: Testers resource does not support email lists.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", - // "httpMethod": "PATCH", - // "id": "androidpublisher.edits.testers.patch", + // "description": "Downloads a single signed APK generated from an app bundle.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}/downloads/{downloadId}:download", + // "httpMethod": "GET", + // "id": "androidpublisher.generatedapks.download", // "parameterOrder": [ // "packageName", - // "editId", - // "track" + // "versionCode", + // "downloadId" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", + // "downloadId": { + // "description": "Download ID, which uniquely identifies the APK to download. Can be obtained from the response of `generatedapks.list` method.", // "location": "path", // "required": true, // "type": "string" @@ -13415,118 +16111,118 @@ func (c *EditsTestersPatchCall) Do(opts ...googleapi.CallOption) (*Testers, erro // "required": true, // "type": "string" // }, - // "track": { - // "description": "The track to update.", + // "versionCode": { + // "description": "Version code of the app bundle.", + // "format": "int32", // "location": "path", // "required": true, - // "type": "string" + // "type": "integer" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", - // "request": { - // "$ref": "Testers" - // }, - // "response": { - // "$ref": "Testers" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}/downloads/{downloadId}:download", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ] + // ], + // "supportsMediaDownload": true, + // "useMediaDownloadService": true // } } -// method id "androidpublisher.edits.testers.update": +// method id "androidpublisher.generatedapks.list": -type EditsTestersUpdateCall struct { - s *Service - packageName string - editId string - track string - testers *Testers - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type GeneratedapksListCall struct { + s *Service + packageName string + versionCode int64 + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Update: Updates testers. Note: Testers resource does not support -// email lists. +// List: Returns download metadata for all APKs that were generated from +// a given app bundle. // -// - editId: Identifier of the edit. // - packageName: Package name of the app. -// - track: The track to update. -func (r *EditsTestersService) Update(packageName string, editId string, track string, testers *Testers) *EditsTestersUpdateCall { - c := &EditsTestersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - versionCode: Version code of the app bundle. +func (r *GeneratedapksService) List(packageName string, versionCode int64) *GeneratedapksListCall { + c := &GeneratedapksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.editId = editId - c.track = track - c.testers = testers + c.versionCode = versionCode return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsTestersUpdateCall) Fields(s ...googleapi.Field) *EditsTestersUpdateCall { +func (c *GeneratedapksListCall) Fields(s ...googleapi.Field) *GeneratedapksListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GeneratedapksListCall) IfNoneMatch(entityTag string) *GeneratedapksListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsTestersUpdateCall) Context(ctx context.Context) *EditsTestersUpdateCall { +func (c *GeneratedapksListCall) Context(ctx context.Context) *GeneratedapksListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsTestersUpdateCall) Header() http.Header { +func (c *GeneratedapksListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsTestersUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *GeneratedapksListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "editId": c.editId, - "track": c.track, + "versionCode": strconv.FormatInt(c.versionCode, 10), }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.testers.update" call. -// Exactly one of *Testers or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Testers.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsTestersUpdateCall) Do(opts ...googleapi.CallOption) (*Testers, error) { +// Do executes the "androidpublisher.generatedapks.list" call. +// Exactly one of *GeneratedApksListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GeneratedApksListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GeneratedapksListCall) Do(opts ...googleapi.CallOption) (*GeneratedApksListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13545,7 +16241,7 @@ func (c *EditsTestersUpdateCall) Do(opts ...googleapi.CallOption) (*Testers, err if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Testers{ + ret := &GeneratedApksListResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13557,41 +16253,32 @@ func (c *EditsTestersUpdateCall) Do(opts ...googleapi.CallOption) (*Testers, err } return ret, nil // { - // "description": "Updates testers. Note: Testers resource does not support email lists.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", - // "httpMethod": "PUT", - // "id": "androidpublisher.edits.testers.update", + // "description": "Returns download metadata for all APKs that were generated from a given app bundle.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}", + // "httpMethod": "GET", + // "id": "androidpublisher.generatedapks.list", // "parameterOrder": [ // "packageName", - // "editId", - // "track" + // "versionCode" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, - // "track": { - // "description": "The track to update.", + // "versionCode": { + // "description": "Version code of the app bundle.", + // "format": "int32", // "location": "path", // "required": true, - // "type": "string" + // "type": "integer" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", - // "request": { - // "$ref": "Testers" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}", // "response": { - // "$ref": "Testers" + // "$ref": "GeneratedApksListResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -13600,34 +16287,32 @@ func (c *EditsTestersUpdateCall) Do(opts ...googleapi.CallOption) (*Testers, err } -// method id "androidpublisher.edits.tracks.create": +// method id "androidpublisher.grants.create": -type EditsTracksCreateCall struct { - s *Service - packageName string - editId string - trackconfig *TrackConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type GrantsCreateCall struct { + s *Service + parent string + grant *Grant + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a new track. +// Create: Grant access for a user to the given package. // -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -func (r *EditsTracksService) Create(packageName string, editId string, trackconfig *TrackConfig) *EditsTracksCreateCall { - c := &EditsTracksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.packageName = packageName - c.editId = editId - c.trackconfig = trackconfig +// - parent: The user which needs permission. Format: +// developers/{developer}/users/{user}. +func (r *GrantsService) Create(parent string, grant *Grant) *GrantsCreateCall { + c := &GrantsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.grant = grant return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsTracksCreateCall) Fields(s ...googleapi.Field) *EditsTracksCreateCall { +func (c *GrantsCreateCall) Fields(s ...googleapi.Field) *GrantsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13635,21 +16320,21 @@ func (c *EditsTracksCreateCall) Fields(s ...googleapi.Field) *EditsTracksCreateC // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsTracksCreateCall) Context(ctx context.Context) *EditsTracksCreateCall { +func (c *GrantsCreateCall) Context(ctx context.Context) *GrantsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsTracksCreateCall) Header() http.Header { +func (c *GrantsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsTracksCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *GrantsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -13657,14 +16342,14 @@ func (c *EditsTracksCreateCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.trackconfig) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.grant) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+parent}/grants") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -13672,20 +16357,19 @@ func (c *EditsTracksCreateCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.tracks.create" call. -// Exactly one of *Track or error will be non-nil. Any non-2xx status +// Do executes the "androidpublisher.grants.create" call. +// Exactly one of *Grant or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Track.ServerResponse.Header or (if a response was returned at all) +// *Grant.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *EditsTracksCreateCall) Do(opts ...googleapi.CallOption) (*Track, error) { +func (c *GrantsCreateCall) Do(opts ...googleapi.CallOption) (*Grant, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13704,7 +16388,7 @@ func (c *EditsTracksCreateCall) Do(opts ...googleapi.CallOption) (*Track, error) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Track{ + ret := &Grant{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13716,34 +16400,28 @@ func (c *EditsTracksCreateCall) Do(opts ...googleapi.CallOption) (*Track, error) } return ret, nil // { - // "description": "Creates a new track.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks", + // "description": "Grant access for a user to the given package.", + // "flatPath": "androidpublisher/v3/developers/{developersId}/users/{usersId}/grants", // "httpMethod": "POST", - // "id": "androidpublisher.edits.tracks.create", + // "id": "androidpublisher.grants.create", // "parameterOrder": [ - // "packageName", - // "editId" + // "parent" // ], // "parameters": { - // "editId": { - // "description": "Required. Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "packageName": { - // "description": "Required. Package name of the app.", + // "parent": { + // "description": "Required. The user which needs permission. Format: developers/{developer}/users/{user}", // "location": "path", + // "pattern": "^developers/[^/]+/users/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks", + // "path": "androidpublisher/v3/{+parent}/grants", // "request": { - // "$ref": "TrackConfig" + // "$ref": "Grant" // }, // "response": { - // "$ref": "Track" + // "$ref": "Grant" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -13752,167 +16430,105 @@ func (c *EditsTracksCreateCall) Do(opts ...googleapi.CallOption) (*Track, error) } -// method id "androidpublisher.edits.tracks.get": +// method id "androidpublisher.grants.delete": -type EditsTracksGetCall struct { - s *Service - packageName string - editId string - track string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type GrantsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a track. +// Delete: Removes all access for the user to the given package or +// developer account. // -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -// - track: Identifier of the track. More on track name -// (https://developers.google.com/android-publisher/tracks#ff-track-name). -func (r *EditsTracksService) Get(packageName string, editId string, track string) *EditsTracksGetCall { - c := &EditsTracksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.packageName = packageName - c.editId = editId - c.track = track +// - name: The name of the grant to delete. Format: +// developers/{developer}/users/{email}/grants/{package_name}. +func (r *GrantsService) Delete(name string) *GrantsDeleteCall { + c := &GrantsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsTracksGetCall) Fields(s ...googleapi.Field) *EditsTracksGetCall { +func (c *GrantsDeleteCall) Fields(s ...googleapi.Field) *GrantsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *EditsTracksGetCall) IfNoneMatch(entityTag string) *EditsTracksGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsTracksGetCall) Context(ctx context.Context) *EditsTracksGetCall { +func (c *GrantsDeleteCall) Context(ctx context.Context) *GrantsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsTracksGetCall) Header() http.Header { +func (c *GrantsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsTracksGetCall) doRequest(alt string) (*http.Response, error) { +func (c *GrantsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, - "track": c.track, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.tracks.get" call. -// Exactly one of *Track or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Track.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsTracksGetCall) Do(opts ...googleapi.CallOption) (*Track, error) { +// Do executes the "androidpublisher.grants.delete" call. +func (c *GrantsDeleteCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } if err != nil { - return nil, err + return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &Track{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err + return gensupport.WrapError(err) } - return ret, nil + return nil // { - // "description": "Gets a track.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", - // "httpMethod": "GET", - // "id": "androidpublisher.edits.tracks.get", + // "description": "Removes all access for the user to the given package or developer account.", + // "flatPath": "androidpublisher/v3/developers/{developersId}/users/{usersId}/grants/{grantsId}", + // "httpMethod": "DELETE", + // "id": "androidpublisher.grants.delete", // "parameterOrder": [ - // "packageName", - // "editId", - // "track" + // "name" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "packageName": { - // "description": "Package name of the app.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "track": { - // "description": "Identifier of the track. [More on track name](https://developers.google.com/android-publisher/tracks#ff-track-name)", + // "name": { + // "description": "Required. The name of the grant to delete. Format: developers/{developer}/users/{email}/grants/{package_name}", // "location": "path", + // "pattern": "^developers/[^/]+/users/[^/]+/grants/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", - // "response": { - // "$ref": "Track" - // }, + // "path": "androidpublisher/v3/{+name}", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -13920,99 +16536,98 @@ func (c *EditsTracksGetCall) Do(opts ...googleapi.CallOption) (*Track, error) { } -// method id "androidpublisher.edits.tracks.list": +// method id "androidpublisher.grants.patch": -type EditsTracksListCall struct { - s *Service - packageName string - editId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type GrantsPatchCall struct { + s *Service + name string + grant *Grant + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all tracks. +// Patch: Updates access for the user to the given package. // -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -func (r *EditsTracksService) List(packageName string, editId string) *EditsTracksListCall { - c := &EditsTracksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.packageName = packageName - c.editId = editId +// - name: Resource name for this grant, following the pattern +// "developers/{developer}/users/{email}/grants/{package_name}". If +// this grant is for a draft app, the app ID will be used in this +// resource name instead of the package name. +func (r *GrantsService) Patch(name string, grant *Grant) *GrantsPatchCall { + c := &GrantsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.grant = grant + return c +} + +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to be updated. +func (c *GrantsPatchCall) UpdateMask(updateMask string) *GrantsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsTracksListCall) Fields(s ...googleapi.Field) *EditsTracksListCall { +func (c *GrantsPatchCall) Fields(s ...googleapi.Field) *GrantsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *EditsTracksListCall) IfNoneMatch(entityTag string) *EditsTracksListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsTracksListCall) Context(ctx context.Context) *EditsTracksListCall { +func (c *GrantsPatchCall) Context(ctx context.Context) *GrantsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsTracksListCall) Header() http.Header { +func (c *GrantsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsTracksListCall) doRequest(alt string) (*http.Response, error) { +func (c *GrantsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.grant) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.tracks.list" call. -// Exactly one of *TracksListResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *TracksListResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EditsTracksListCall) Do(opts ...googleapi.CallOption) (*TracksListResponse, error) { +// Do executes the "androidpublisher.grants.patch" call. +// Exactly one of *Grant or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Grant.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GrantsPatchCall) Do(opts ...googleapi.CallOption) (*Grant, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14031,7 +16646,7 @@ func (c *EditsTracksListCall) Do(opts ...googleapi.CallOption) (*TracksListRespo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &TracksListResponse{ + ret := &Grant{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14043,31 +16658,34 @@ func (c *EditsTracksListCall) Do(opts ...googleapi.CallOption) (*TracksListRespo } return ret, nil // { - // "description": "Lists all tracks.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks", - // "httpMethod": "GET", - // "id": "androidpublisher.edits.tracks.list", + // "description": "Updates access for the user to the given package.", + // "flatPath": "androidpublisher/v3/developers/{developersId}/users/{usersId}/grants/{grantsId}", + // "httpMethod": "PATCH", + // "id": "androidpublisher.grants.patch", // "parameterOrder": [ - // "packageName", - // "editId" + // "name" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", + // "name": { + // "description": "Required. Resource name for this grant, following the pattern \"developers/{developer}/users/{email}/grants/{package_name}\". If this grant is for a draft app, the app ID will be used in this resource name instead of the package name.", // "location": "path", + // "pattern": "^developers/[^/]+/users/[^/]+/grants/[^/]+$", // "required": true, // "type": "string" // }, - // "packageName": { - // "description": "Package name of the app.", - // "location": "path", - // "required": true, + // "updateMask": { + // "description": "Optional. The list of fields to be updated.", + // "format": "google-fieldmask", + // "location": "query", // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks", + // "path": "androidpublisher/v3/{+name}", + // "request": { + // "$ref": "Grant" + // }, // "response": { - // "$ref": "TracksListResponse" + // "$ref": "Grant" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -14076,38 +16694,37 @@ func (c *EditsTracksListCall) Do(opts ...googleapi.CallOption) (*TracksListRespo } -// method id "androidpublisher.edits.tracks.patch": +// method id "androidpublisher.inappproducts.batchDelete": -type EditsTracksPatchCall struct { - s *Service - packageName string - editId string - track string - track2 *Track - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InappproductsBatchDeleteCall struct { + s *Service + packageName string + inappproductsbatchdeleterequest *InappproductsBatchDeleteRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Patches a track. +// BatchDelete: Deletes in-app products (managed products or +// subscriptions). Set the latencyTolerance field on nested requests to +// PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum +// update throughput. This method should not be used to delete +// subscriptions. See this article +// (https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) +// for more information. // -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -// - track: Identifier of the track. More on track name -// (https://developers.google.com/android-publisher/tracks#ff-track-name). -func (r *EditsTracksService) Patch(packageName string, editId string, track string, track2 *Track) *EditsTracksPatchCall { - c := &EditsTracksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - packageName: Package name of the app. +func (r *InappproductsService) BatchDelete(packageName string, inappproductsbatchdeleterequest *InappproductsBatchDeleteRequest) *InappproductsBatchDeleteCall { + c := &InappproductsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.editId = editId - c.track = track - c.track2 = track2 + c.inappproductsbatchdeleterequest = inappproductsbatchdeleterequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsTracksPatchCall) Fields(s ...googleapi.Field) *EditsTracksPatchCall { +func (c *InappproductsBatchDeleteCall) Fields(s ...googleapi.Field) *InappproductsBatchDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14115,21 +16732,21 @@ func (c *EditsTracksPatchCall) Fields(s ...googleapi.Field) *EditsTracksPatchCal // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsTracksPatchCall) Context(ctx context.Context) *EditsTracksPatchCall { +func (c *InappproductsBatchDeleteCall) Context(ctx context.Context) *InappproductsBatchDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsTracksPatchCall) Header() http.Header { +func (c *InappproductsBatchDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsTracksPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *InappproductsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -14137,101 +16754,57 @@ func (c *EditsTracksPatchCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproductsbatchdeleterequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts:batchDelete") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "editId": c.editId, - "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.tracks.patch" call. -// Exactly one of *Track or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Track.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsTracksPatchCall) Do(opts ...googleapi.CallOption) (*Track, error) { +// Do executes the "androidpublisher.inappproducts.batchDelete" call. +func (c *InappproductsBatchDeleteCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } if err != nil { - return nil, err + return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &Track{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err + return gensupport.WrapError(err) } - return ret, nil + return nil // { - // "description": "Patches a track.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", - // "httpMethod": "PATCH", - // "id": "androidpublisher.edits.tracks.patch", + // "description": "Deletes in-app products (managed products or subscriptions). Set the latencyTolerance field on nested requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update throughput. This method should not be used to delete subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts:batchDelete", + // "httpMethod": "POST", + // "id": "androidpublisher.inappproducts.batchDelete", // "parameterOrder": [ - // "packageName", - // "editId", - // "track" + // "packageName" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" - // }, - // "track": { - // "description": "Identifier of the track. [More on track name](https://developers.google.com/android-publisher/tracks#ff-track-name)", - // "location": "path", - // "required": true, - // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", + // "path": "androidpublisher/v3/applications/{packageName}/inappproducts:batchDelete", // "request": { - // "$ref": "Track" - // }, - // "response": { - // "$ref": "Track" + // "$ref": "InappproductsBatchDeleteRequest" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -14240,97 +16813,106 @@ func (c *EditsTracksPatchCall) Do(opts ...googleapi.CallOption) (*Track, error) } -// method id "androidpublisher.edits.tracks.update": +// method id "androidpublisher.inappproducts.batchGet": -type EditsTracksUpdateCall struct { - s *Service - packageName string - editId string - track string - track2 *Track - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InappproductsBatchGetCall struct { + s *Service + packageName string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Update: Updates a track. +// BatchGet: Reads multiple in-app products, which can be managed +// products or subscriptions. This method should not be used to retrieve +// subscriptions. See this article +// (https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) +// for more information. // -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -// - track: Identifier of the track. More on track name -// (https://developers.google.com/android-publisher/tracks#ff-track-name). -func (r *EditsTracksService) Update(packageName string, editId string, track string, track2 *Track) *EditsTracksUpdateCall { - c := &EditsTracksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - packageName: Package name of the app. +func (r *InappproductsService) BatchGet(packageName string) *InappproductsBatchGetCall { + c := &InappproductsBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.editId = editId - c.track = track - c.track2 = track2 + return c +} + +// Sku sets the optional parameter "sku": Unique identifier for the +// in-app products. +func (c *InappproductsBatchGetCall) Sku(sku ...string) *InappproductsBatchGetCall { + c.urlParams_.SetMulti("sku", append([]string{}, sku...)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsTracksUpdateCall) Fields(s ...googleapi.Field) *EditsTracksUpdateCall { +func (c *InappproductsBatchGetCall) Fields(s ...googleapi.Field) *InappproductsBatchGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InappproductsBatchGetCall) IfNoneMatch(entityTag string) *InappproductsBatchGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsTracksUpdateCall) Context(ctx context.Context) *EditsTracksUpdateCall { +func (c *InappproductsBatchGetCall) Context(ctx context.Context) *InappproductsBatchGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsTracksUpdateCall) Header() http.Header { +func (c *InappproductsBatchGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsTracksUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *InappproductsBatchGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "editId": c.editId, - "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.tracks.update" call. -// Exactly one of *Track or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Track.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsTracksUpdateCall) Do(opts ...googleapi.CallOption) (*Track, error) { +// Do executes the "androidpublisher.inappproducts.batchGet" call. +// Exactly one of *InappproductsBatchGetResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *InappproductsBatchGetResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InappproductsBatchGetCall) Do(opts ...googleapi.CallOption) (*InappproductsBatchGetResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14349,7 +16931,7 @@ func (c *EditsTracksUpdateCall) Do(opts ...googleapi.CallOption) (*Track, error) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Track{ + ret := &InappproductsBatchGetResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14361,41 +16943,30 @@ func (c *EditsTracksUpdateCall) Do(opts ...googleapi.CallOption) (*Track, error) } return ret, nil // { - // "description": "Updates a track.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", - // "httpMethod": "PUT", - // "id": "androidpublisher.edits.tracks.update", + // "description": "Reads multiple in-app products, which can be managed products or subscriptions. This method should not be used to retrieve subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts:batchGet", + // "httpMethod": "GET", + // "id": "androidpublisher.inappproducts.batchGet", // "parameterOrder": [ - // "packageName", - // "editId", - // "track" + // "packageName" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, - // "track": { - // "description": "Identifier of the track. [More on track name](https://developers.google.com/android-publisher/tracks#ff-track-name)", - // "location": "path", - // "required": true, + // "sku": { + // "description": "Unique identifier for the in-app products.", + // "location": "query", + // "repeated": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", - // "request": { - // "$ref": "Track" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/inappproducts:batchGet", // "response": { - // "$ref": "Track" + // "$ref": "InappproductsBatchGetResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -14404,44 +16975,37 @@ func (c *EditsTracksUpdateCall) Do(opts ...googleapi.CallOption) (*Track, error) } -// method id "androidpublisher.externaltransactions.createexternaltransaction": +// method id "androidpublisher.inappproducts.batchUpdate": -type ExternaltransactionsCreateexternaltransactionCall struct { - s *Service - parent string - externaltransaction *ExternalTransaction - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InappproductsBatchUpdateCall struct { + s *Service + packageName string + inappproductsbatchupdaterequest *InappproductsBatchUpdateRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Createexternaltransaction: Creates a new external transaction. +// BatchUpdate: Updates or inserts one or more in-app products (managed +// products or subscriptions). Set the latencyTolerance field on nested +// requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to +// achieve maximum update throughput. This method should no longer be +// used to update subscriptions. See this article +// (https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) +// for more information. // -// - parent: The parent resource where this external transaction will be -// created. Format: applications/{package_name}. -func (r *ExternaltransactionsService) Createexternaltransaction(parent string, externaltransaction *ExternalTransaction) *ExternaltransactionsCreateexternaltransactionCall { - c := &ExternaltransactionsCreateexternaltransactionCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.externaltransaction = externaltransaction - return c -} - -// ExternalTransactionId sets the optional parameter -// "externalTransactionId": Required. The id to use for the external -// transaction. Must be unique across all other transactions for the -// app. This value should be 1-63 characters and valid characters are -// /a-z0-9_-/. Do not use this field to store any Personally -// Identifiable Information (PII) such as emails. Attempting to store -// PII in this field may result in requests being blocked. -func (c *ExternaltransactionsCreateexternaltransactionCall) ExternalTransactionId(externalTransactionId string) *ExternaltransactionsCreateexternaltransactionCall { - c.urlParams_.Set("externalTransactionId", externalTransactionId) +// - packageName: Package name of the app. +func (r *InappproductsService) BatchUpdate(packageName string, inappproductsbatchupdaterequest *InappproductsBatchUpdateRequest) *InappproductsBatchUpdateCall { + c := &InappproductsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.inappproductsbatchupdaterequest = inappproductsbatchupdaterequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ExternaltransactionsCreateexternaltransactionCall) Fields(s ...googleapi.Field) *ExternaltransactionsCreateexternaltransactionCall { +func (c *InappproductsBatchUpdateCall) Fields(s ...googleapi.Field) *InappproductsBatchUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14449,21 +17013,21 @@ func (c *ExternaltransactionsCreateexternaltransactionCall) Fields(s ...googleap // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ExternaltransactionsCreateexternaltransactionCall) Context(ctx context.Context) *ExternaltransactionsCreateexternaltransactionCall { +func (c *InappproductsBatchUpdateCall) Context(ctx context.Context) *InappproductsBatchUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ExternaltransactionsCreateexternaltransactionCall) Header() http.Header { +func (c *InappproductsBatchUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ExternaltransactionsCreateexternaltransactionCall) doRequest(alt string) (*http.Response, error) { +func (c *InappproductsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -14471,14 +17035,14 @@ func (c *ExternaltransactionsCreateexternaltransactionCall) doRequest(alt string } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.externaltransaction) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproductsbatchupdaterequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+parent}/externalTransactions") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts:batchUpdate") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -14486,19 +17050,19 @@ func (c *ExternaltransactionsCreateexternaltransactionCall) doRequest(alt string } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "packageName": c.packageName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.externaltransactions.createexternaltransaction" call. -// Exactly one of *ExternalTransaction or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ExternalTransaction.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was +// Do executes the "androidpublisher.inappproducts.batchUpdate" call. +// Exactly one of *InappproductsBatchUpdateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *InappproductsBatchUpdateResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ExternaltransactionsCreateexternaltransactionCall) Do(opts ...googleapi.CallOption) (*ExternalTransaction, error) { +func (c *InappproductsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*InappproductsBatchUpdateResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14517,7 +17081,7 @@ func (c *ExternaltransactionsCreateexternaltransactionCall) Do(opts ...googleapi if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ExternalTransaction{ + ret := &InappproductsBatchUpdateResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14529,33 +17093,27 @@ func (c *ExternaltransactionsCreateexternaltransactionCall) Do(opts ...googleapi } return ret, nil // { - // "description": "Creates a new external transaction.", - // "flatPath": "androidpublisher/v3/applications/{applicationsId}/externalTransactions", + // "description": "Updates or inserts one or more in-app products (managed products or subscriptions). Set the latencyTolerance field on nested requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update throughput. This method should no longer be used to update subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts:batchUpdate", // "httpMethod": "POST", - // "id": "androidpublisher.externaltransactions.createexternaltransaction", + // "id": "androidpublisher.inappproducts.batchUpdate", // "parameterOrder": [ - // "parent" + // "packageName" // ], // "parameters": { - // "externalTransactionId": { - // "description": "Required. The id to use for the external transaction. Must be unique across all other transactions for the app. This value should be 1-63 characters and valid characters are /a-z0-9_-/. Do not use this field to store any Personally Identifiable Information (PII) such as emails. Attempting to store PII in this field may result in requests being blocked.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent resource where this external transaction will be created. Format: applications/{package_name}", + // "packageName": { + // "description": "Package name of the app.", // "location": "path", - // "pattern": "^applications/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/{+parent}/externalTransactions", + // "path": "androidpublisher/v3/applications/{packageName}/inappproducts:batchUpdate", // "request": { - // "$ref": "ExternalTransaction" + // "$ref": "InappproductsBatchUpdateRequest" // }, // "response": { - // "$ref": "ExternalTransaction" + // "$ref": "InappproductsBatchUpdateResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -14564,147 +17122,158 @@ func (c *ExternaltransactionsCreateexternaltransactionCall) Do(opts ...googleapi } -// method id "androidpublisher.externaltransactions.getexternaltransaction": +// method id "androidpublisher.inappproducts.delete": + +type InappproductsDeleteCall struct { + s *Service + packageName string + skuid string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} -type ExternaltransactionsGetexternaltransactionCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// Delete: Deletes an in-app product (a managed product or a +// subscription). This method should no longer be used to delete +// subscriptions. See this article +// (https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) +// for more information. +// +// - packageName: Package name of the app. +// - sku: Unique identifier for the in-app product. +func (r *InappproductsService) Delete(packageName string, skuid string) *InappproductsDeleteCall { + c := &InappproductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.skuid = skuid + return c } -// Getexternaltransaction: Gets an existing external transaction. +// LatencyTolerance sets the optional parameter "latencyTolerance": The +// latency tolerance for the propagation of this product update. +// Defaults to latency-sensitive. // -// - name: The name of the external transaction to retrieve. Format: -// applications/{package_name}/externalTransactions/{external_transacti -// on}. -func (r *ExternaltransactionsService) Getexternaltransaction(name string) *ExternaltransactionsGetexternaltransactionCall { - c := &ExternaltransactionsGetexternaltransactionCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// Possible values: +// +// "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" - Defaults to +// +// PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE. +// +// "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" - The update +// +// will propagate to clients within several minutes on average and up to +// a few hours in rare cases. Throughput is limited to 7,200 updates per +// app per hour. +// +// "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" - The update +// +// will propagate to clients within 24 hours. Supports high throughput +// of up to 720,000 updates per app per hour using batch modification +// methods. +func (c *InappproductsDeleteCall) LatencyTolerance(latencyTolerance string) *InappproductsDeleteCall { + c.urlParams_.Set("latencyTolerance", latencyTolerance) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ExternaltransactionsGetexternaltransactionCall) Fields(s ...googleapi.Field) *ExternaltransactionsGetexternaltransactionCall { +func (c *InappproductsDeleteCall) Fields(s ...googleapi.Field) *InappproductsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ExternaltransactionsGetexternaltransactionCall) IfNoneMatch(entityTag string) *ExternaltransactionsGetexternaltransactionCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ExternaltransactionsGetexternaltransactionCall) Context(ctx context.Context) *ExternaltransactionsGetexternaltransactionCall { +func (c *InappproductsDeleteCall) Context(ctx context.Context) *InappproductsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ExternaltransactionsGetexternaltransactionCall) Header() http.Header { +func (c *InappproductsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ExternaltransactionsGetexternaltransactionCall) doRequest(alt string) (*http.Response, error) { +func (c *InappproductsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "packageName": c.packageName, + "sku": c.skuid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.externaltransactions.getexternaltransaction" call. -// Exactly one of *ExternalTransaction or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ExternalTransaction.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ExternaltransactionsGetexternaltransactionCall) Do(opts ...googleapi.CallOption) (*ExternalTransaction, error) { +// Do executes the "androidpublisher.inappproducts.delete" call. +func (c *InappproductsDeleteCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } if err != nil { - return nil, err + return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &ExternalTransaction{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err + return gensupport.WrapError(err) } - return ret, nil + return nil // { - // "description": "Gets an existing external transaction.", - // "flatPath": "androidpublisher/v3/applications/{applicationsId}/externalTransactions/{externalTransactionsId}", - // "httpMethod": "GET", - // "id": "androidpublisher.externaltransactions.getexternaltransaction", + // "description": "Deletes an in-app product (a managed product or a subscription). This method should no longer be used to delete subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", + // "httpMethod": "DELETE", + // "id": "androidpublisher.inappproducts.delete", // "parameterOrder": [ - // "name" + // "packageName", + // "sku" // ], // "parameters": { - // "name": { - // "description": "Required. The name of the external transaction to retrieve. Format: applications/{package_name}/externalTransactions/{external_transaction}", + // "latencyTolerance": { + // "description": "Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.", + // "enum": [ + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED", + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE", + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" + // ], + // "enumDescriptions": [ + // "Defaults to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE.", + // "The update will propagate to clients within several minutes on average and up to a few hours in rare cases. Throughput is limited to 7,200 updates per app per hour.", + // "The update will propagate to clients within 24 hours. Supports high throughput of up to 720,000 updates per app per hour using batch modification methods." + // ], + // "location": "query", + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sku": { + // "description": "Unique identifier for the in-app product.", // "location": "path", - // "pattern": "^applications/[^/]+/externalTransactions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/{+name}", - // "response": { - // "$ref": "ExternalTransaction" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -14712,92 +17281,103 @@ func (c *ExternaltransactionsGetexternaltransactionCall) Do(opts ...googleapi.Ca } -// method id "androidpublisher.externaltransactions.refundexternaltransaction": +// method id "androidpublisher.inappproducts.get": -type ExternaltransactionsRefundexternaltransactionCall struct { - s *Service - name string - refundexternaltransactionrequest *RefundExternalTransactionRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InappproductsGetCall struct { + s *Service + packageName string + skuid string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Refundexternaltransaction: Refunds or partially refunds an existing -// external transaction. +// Get: Gets an in-app product, which can be a managed product or a +// subscription. This method should no longer be used to retrieve +// subscriptions. See this article +// (https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) +// for more information. // -// - name: The name of the external transaction that will be refunded. -// Format: -// applications/{package_name}/externalTransactions/{external_transacti -// on}. -func (r *ExternaltransactionsService) Refundexternaltransaction(name string, refundexternaltransactionrequest *RefundExternalTransactionRequest) *ExternaltransactionsRefundexternaltransactionCall { - c := &ExternaltransactionsRefundexternaltransactionCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.refundexternaltransactionrequest = refundexternaltransactionrequest +// - packageName: Package name of the app. +// - sku: Unique identifier for the in-app product. +func (r *InappproductsService) Get(packageName string, skuid string) *InappproductsGetCall { + c := &InappproductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.skuid = skuid return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ExternaltransactionsRefundexternaltransactionCall) Fields(s ...googleapi.Field) *ExternaltransactionsRefundexternaltransactionCall { +func (c *InappproductsGetCall) Fields(s ...googleapi.Field) *InappproductsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InappproductsGetCall) IfNoneMatch(entityTag string) *InappproductsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ExternaltransactionsRefundexternaltransactionCall) Context(ctx context.Context) *ExternaltransactionsRefundexternaltransactionCall { +func (c *InappproductsGetCall) Context(ctx context.Context) *InappproductsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ExternaltransactionsRefundexternaltransactionCall) Header() http.Header { +func (c *InappproductsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ExternaltransactionsRefundexternaltransactionCall) doRequest(alt string) (*http.Response, error) { +func (c *InappproductsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.refundexternaltransactionrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+name}:refund") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "packageName": c.packageName, + "sku": c.skuid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.externaltransactions.refundexternaltransaction" call. -// Exactly one of *ExternalTransaction or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ExternalTransaction.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ExternaltransactionsRefundexternaltransactionCall) Do(opts ...googleapi.CallOption) (*ExternalTransaction, error) { +// Do executes the "androidpublisher.inappproducts.get" call. +// Exactly one of *InAppProduct or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *InAppProduct.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InappproductsGetCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14816,7 +17396,7 @@ func (c *ExternaltransactionsRefundexternaltransactionCall) Do(opts ...googleapi if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ExternalTransaction{ + ret := &InAppProduct{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14828,28 +17408,31 @@ func (c *ExternaltransactionsRefundexternaltransactionCall) Do(opts ...googleapi } return ret, nil // { - // "description": "Refunds or partially refunds an existing external transaction.", - // "flatPath": "androidpublisher/v3/applications/{applicationsId}/externalTransactions/{externalTransactionsId}:refund", - // "httpMethod": "POST", - // "id": "androidpublisher.externaltransactions.refundexternaltransaction", + // "description": "Gets an in-app product, which can be a managed product or a subscription. This method should no longer be used to retrieve subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", + // "httpMethod": "GET", + // "id": "androidpublisher.inappproducts.get", // "parameterOrder": [ - // "name" + // "packageName", + // "sku" // ], // "parameters": { - // "name": { - // "description": "Required. The name of the external transaction that will be refunded. Format: applications/{package_name}/externalTransactions/{external_transaction}", + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sku": { + // "description": "Unique identifier for the in-app product.", // "location": "path", - // "pattern": "^applications/[^/]+/externalTransactions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/{+name}:refund", - // "request": { - // "$ref": "RefundExternalTransactionRequest" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", // "response": { - // "$ref": "ExternalTransaction" + // "$ref": "InAppProduct" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -14858,194 +17441,219 @@ func (c *ExternaltransactionsRefundexternaltransactionCall) Do(opts ...googleapi } -// method id "androidpublisher.generatedapks.download": +// method id "androidpublisher.inappproducts.insert": -type GeneratedapksDownloadCall struct { +type InappproductsInsertCall struct { s *Service packageName string - versionCode int64 - downloadId string + inappproduct *InAppProduct urlParams_ gensupport.URLParams - ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Download: Downloads a single signed APK generated from an app bundle. +// Insert: Creates an in-app product (a managed product or a +// subscription). This method should no longer be used to create +// subscriptions. See this article +// (https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) +// for more information. // -// - downloadId: Download ID, which uniquely identifies the APK to -// download. Can be obtained from the response of `generatedapks.list` -// method. -// - packageName: Package name of the app. -// - versionCode: Version code of the app bundle. -func (r *GeneratedapksService) Download(packageName string, versionCode int64, downloadId string) *GeneratedapksDownloadCall { - c := &GeneratedapksDownloadCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - packageName: Package name of the app. +func (r *InappproductsService) Insert(packageName string, inappproduct *InAppProduct) *InappproductsInsertCall { + c := &InappproductsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.versionCode = versionCode - c.downloadId = downloadId + c.inappproduct = inappproduct + return c +} + +// AutoConvertMissingPrices sets the optional parameter +// "autoConvertMissingPrices": If true the prices for all regions +// targeted by the parent app that don't have a price specified for this +// in-app product will be auto converted to the target currency based on +// the default price. Defaults to false. +func (c *InappproductsInsertCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsInsertCall { + c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *GeneratedapksDownloadCall) Fields(s ...googleapi.Field) *GeneratedapksDownloadCall { +func (c *InappproductsInsertCall) Fields(s ...googleapi.Field) *InappproductsInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *GeneratedapksDownloadCall) IfNoneMatch(entityTag string) *GeneratedapksDownloadCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do and Download -// methods. Any pending HTTP request will be aborted if the provided -// context is canceled. -func (c *GeneratedapksDownloadCall) Context(ctx context.Context) *GeneratedapksDownloadCall { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InappproductsInsertCall) Context(ctx context.Context) *InappproductsInsertCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *GeneratedapksDownloadCall) Header() http.Header { +func (c *InappproductsInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *GeneratedapksDownloadCall) doRequest(alt string) (*http.Response, error) { +func (c *InappproductsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}/downloads/{downloadId}:download") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "versionCode": strconv.FormatInt(c.versionCode, 10), - "downloadId": c.downloadId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Download fetches the API endpoint's "media" value, instead of the normal -// API response value. If the returned error is nil, the Response is guaranteed to -// have a 2xx status code. Callers must close the Response.Body as usual. -func (c *GeneratedapksDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { +// Do executes the "androidpublisher.inappproducts.insert" call. +// Exactly one of *InAppProduct or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *InAppProduct.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InappproductsInsertCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) { gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("media") + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } if err != nil { return nil, err } + defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - res.Body.Close() return nil, gensupport.WrapError(err) } - return res, nil -} - -// Do executes the "androidpublisher.generatedapks.download" call. -func (c *GeneratedapksDownloadCall) Do(opts ...googleapi.CallOption) error { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if err != nil { - return err + ret := &InAppProduct{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return gensupport.WrapError(err) + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err } - return nil + return ret, nil // { - // "description": "Downloads a single signed APK generated from an app bundle.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}/downloads/{downloadId}:download", - // "httpMethod": "GET", - // "id": "androidpublisher.generatedapks.download", + // "description": "Creates an in-app product (a managed product or a subscription). This method should no longer be used to create subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts", + // "httpMethod": "POST", + // "id": "androidpublisher.inappproducts.insert", // "parameterOrder": [ - // "packageName", - // "versionCode", - // "downloadId" + // "packageName" // ], // "parameters": { - // "downloadId": { - // "description": "Download ID, which uniquely identifies the APK to download. Can be obtained from the response of `generatedapks.list` method.", - // "location": "path", - // "required": true, - // "type": "string" + // "autoConvertMissingPrices": { + // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", + // "location": "query", + // "type": "boolean" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" - // }, - // "versionCode": { - // "description": "Version code of the app bundle.", - // "format": "int32", - // "location": "path", - // "required": true, - // "type": "integer" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}/downloads/{downloadId}:download", + // "path": "androidpublisher/v3/applications/{packageName}/inappproducts", + // "request": { + // "$ref": "InAppProduct" + // }, + // "response": { + // "$ref": "InAppProduct" + // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ], - // "supportsMediaDownload": true, - // "useMediaDownloadService": true + // ] // } } -// method id "androidpublisher.generatedapks.list": +// method id "androidpublisher.inappproducts.list": -type GeneratedapksListCall struct { +type InappproductsListCall struct { s *Service packageName string - versionCode int64 urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Returns download metadata for all APKs that were generated from -// a given app bundle. +// List: Lists all in-app products - both managed products and +// subscriptions. If an app has a large number of in-app products, the +// response may be paginated. In this case the response field +// `tokenPagination.nextPageToken` will be set and the caller should +// provide its value as a `token` request parameter to retrieve the next +// page. This method should no longer be used to retrieve subscriptions. +// See this article +// (https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) +// for more information. // // - packageName: Package name of the app. -// - versionCode: Version code of the app bundle. -func (r *GeneratedapksService) List(packageName string, versionCode int64) *GeneratedapksListCall { - c := &GeneratedapksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InappproductsService) List(packageName string) *InappproductsListCall { + c := &InappproductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.versionCode = versionCode + return c +} + +// MaxResults sets the optional parameter "maxResults": Deprecated and +// ignored. The page size is determined by the server. +func (c *InappproductsListCall) MaxResults(maxResults int64) *InappproductsListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// StartIndex sets the optional parameter "startIndex": Deprecated and +// ignored. Set the `token` parameter to retrieve the next page. +func (c *InappproductsListCall) StartIndex(startIndex int64) *InappproductsListCall { + c.urlParams_.Set("startIndex", fmt.Sprint(startIndex)) + return c +} + +// Token sets the optional parameter "token": Pagination token. If +// empty, list starts at the first product. +func (c *InappproductsListCall) Token(token string) *InappproductsListCall { + c.urlParams_.Set("token", token) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *GeneratedapksListCall) Fields(s ...googleapi.Field) *GeneratedapksListCall { +func (c *InappproductsListCall) Fields(s ...googleapi.Field) *InappproductsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15055,7 +17663,7 @@ func (c *GeneratedapksListCall) Fields(s ...googleapi.Field) *GeneratedapksListC // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *GeneratedapksListCall) IfNoneMatch(entityTag string) *GeneratedapksListCall { +func (c *InappproductsListCall) IfNoneMatch(entityTag string) *InappproductsListCall { c.ifNoneMatch_ = entityTag return c } @@ -15063,21 +17671,21 @@ func (c *GeneratedapksListCall) IfNoneMatch(entityTag string) *GeneratedapksList // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *GeneratedapksListCall) Context(ctx context.Context) *GeneratedapksListCall { +func (c *InappproductsListCall) Context(ctx context.Context) *InappproductsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *GeneratedapksListCall) Header() http.Header { +func (c *InappproductsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *GeneratedapksListCall) doRequest(alt string) (*http.Response, error) { +func (c *InappproductsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -15090,7 +17698,7 @@ func (c *GeneratedapksListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -15099,19 +17707,18 @@ func (c *GeneratedapksListCall) doRequest(alt string) (*http.Response, error) { req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "versionCode": strconv.FormatInt(c.versionCode, 10), }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.generatedapks.list" call. -// Exactly one of *GeneratedApksListResponse or error will be non-nil. +// Do executes the "androidpublisher.inappproducts.list" call. +// Exactly one of *InappproductsListResponse or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either -// *GeneratedApksListResponse.ServerResponse.Header or (if a response +// *InappproductsListResponse.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *GeneratedapksListCall) Do(opts ...googleapi.CallOption) (*GeneratedApksListResponse, error) { +func (c *InappproductsListCall) Do(opts ...googleapi.CallOption) (*InappproductsListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15130,7 +17737,7 @@ func (c *GeneratedapksListCall) Do(opts ...googleapi.CallOption) (*GeneratedApks if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GeneratedApksListResponse{ + ret := &InappproductsListResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15142,32 +17749,43 @@ func (c *GeneratedapksListCall) Do(opts ...googleapi.CallOption) (*GeneratedApks } return ret, nil // { - // "description": "Returns download metadata for all APKs that were generated from a given app bundle.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}", + // "description": "Lists all in-app products - both managed products and subscriptions. If an app has a large number of in-app products, the response may be paginated. In this case the response field `tokenPagination.nextPageToken` will be set and the caller should provide its value as a `token` request parameter to retrieve the next page. This method should no longer be used to retrieve subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts", // "httpMethod": "GET", - // "id": "androidpublisher.generatedapks.list", + // "id": "androidpublisher.inappproducts.list", // "parameterOrder": [ - // "packageName", - // "versionCode" + // "packageName" // ], // "parameters": { + // "maxResults": { + // "deprecated": true, + // "description": "Deprecated and ignored. The page size is determined by the server.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, - // "versionCode": { - // "description": "Version code of the app bundle.", - // "format": "int32", - // "location": "path", - // "required": true, + // "startIndex": { + // "deprecated": true, + // "description": "Deprecated and ignored. Set the `token` parameter to retrieve the next page.", + // "format": "uint32", + // "location": "query", // "type": "integer" + // }, + // "token": { + // "description": "Pagination token. If empty, list starts at the first product.", + // "location": "query", + // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}", + // "path": "androidpublisher/v3/applications/{packageName}/inappproducts", // "response": { - // "$ref": "GeneratedApksListResponse" + // "$ref": "InappproductsListResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -15176,32 +17794,74 @@ func (c *GeneratedapksListCall) Do(opts ...googleapi.CallOption) (*GeneratedApks } -// method id "androidpublisher.grants.create": +// method id "androidpublisher.inappproducts.patch": + +type InappproductsPatchCall struct { + s *Service + packageName string + skuid string + inappproduct *InAppProduct + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Patches an in-app product (a managed product or a +// subscription). This method should no longer be used to update +// subscriptions. See this article +// (https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) +// for more information. +// +// - packageName: Package name of the app. +// - sku: Unique identifier for the in-app product. +func (r *InappproductsService) Patch(packageName string, skuid string, inappproduct *InAppProduct) *InappproductsPatchCall { + c := &InappproductsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.skuid = skuid + c.inappproduct = inappproduct + return c +} -type GrantsCreateCall struct { - s *Service - parent string - grant *Grant - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// AutoConvertMissingPrices sets the optional parameter +// "autoConvertMissingPrices": If true the prices for all regions +// targeted by the parent app that don't have a price specified for this +// in-app product will be auto converted to the target currency based on +// the default price. Defaults to false. +func (c *InappproductsPatchCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsPatchCall { + c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices)) + return c } -// Create: Grant access for a user to the given package. +// LatencyTolerance sets the optional parameter "latencyTolerance": The +// latency tolerance for the propagation of this product update. +// Defaults to latency-sensitive. // -// - parent: The user which needs permission. Format: -// developers/{developer}/users/{user}. -func (r *GrantsService) Create(parent string, grant *Grant) *GrantsCreateCall { - c := &GrantsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.grant = grant +// Possible values: +// +// "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" - Defaults to +// +// PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE. +// +// "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" - The update +// +// will propagate to clients within several minutes on average and up to +// a few hours in rare cases. Throughput is limited to 7,200 updates per +// app per hour. +// +// "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" - The update +// +// will propagate to clients within 24 hours. Supports high throughput +// of up to 720,000 updates per app per hour using batch modification +// methods. +func (c *InappproductsPatchCall) LatencyTolerance(latencyTolerance string) *InappproductsPatchCall { + c.urlParams_.Set("latencyTolerance", latencyTolerance) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *GrantsCreateCall) Fields(s ...googleapi.Field) *GrantsCreateCall { +func (c *InappproductsPatchCall) Fields(s ...googleapi.Field) *InappproductsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15209,21 +17869,21 @@ func (c *GrantsCreateCall) Fields(s ...googleapi.Field) *GrantsCreateCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *GrantsCreateCall) Context(ctx context.Context) *GrantsCreateCall { +func (c *InappproductsPatchCall) Context(ctx context.Context) *InappproductsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *GrantsCreateCall) Header() http.Header { +func (c *InappproductsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *GrantsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *InappproductsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -15231,34 +17891,35 @@ func (c *GrantsCreateCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.grant) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+parent}/grants") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "packageName": c.packageName, + "sku": c.skuid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.grants.create" call. -// Exactly one of *Grant or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Grant.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *GrantsCreateCall) Do(opts ...googleapi.CallOption) (*Grant, error) { +// Do executes the "androidpublisher.inappproducts.patch" call. +// Exactly one of *InAppProduct or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *InAppProduct.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InappproductsPatchCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15277,7 +17938,7 @@ func (c *GrantsCreateCall) Do(opts ...googleapi.CallOption) (*Grant, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Grant{ + ret := &InAppProduct{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15289,28 +17950,54 @@ func (c *GrantsCreateCall) Do(opts ...googleapi.CallOption) (*Grant, error) { } return ret, nil // { - // "description": "Grant access for a user to the given package.", - // "flatPath": "androidpublisher/v3/developers/{developersId}/users/{usersId}/grants", - // "httpMethod": "POST", - // "id": "androidpublisher.grants.create", + // "description": "Patches an in-app product (a managed product or a subscription). This method should no longer be used to update subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", + // "httpMethod": "PATCH", + // "id": "androidpublisher.inappproducts.patch", // "parameterOrder": [ - // "parent" + // "packageName", + // "sku" // ], // "parameters": { - // "parent": { - // "description": "Required. The user which needs permission. Format: developers/{developer}/users/{user}", + // "autoConvertMissingPrices": { + // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", + // "location": "query", + // "type": "boolean" + // }, + // "latencyTolerance": { + // "description": "Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.", + // "enum": [ + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED", + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE", + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" + // ], + // "enumDescriptions": [ + // "Defaults to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE.", + // "The update will propagate to clients within several minutes on average and up to a few hours in rare cases. Throughput is limited to 7,200 updates per app per hour.", + // "The update will propagate to clients within 24 hours. Supports high throughput of up to 720,000 updates per app per hour using batch modification methods." + // ], + // "location": "query", + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sku": { + // "description": "Unique identifier for the in-app product.", // "location": "path", - // "pattern": "^developers/[^/]+/users/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/{+parent}/grants", + // "path": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", // "request": { - // "$ref": "Grant" + // "$ref": "InAppProduct" // }, // "response": { - // "$ref": "Grant" + // "$ref": "InAppProduct" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -15319,31 +18006,82 @@ func (c *GrantsCreateCall) Do(opts ...googleapi.CallOption) (*Grant, error) { } -// method id "androidpublisher.grants.delete": +// method id "androidpublisher.inappproducts.update": -type GrantsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InappproductsUpdateCall struct { + s *Service + packageName string + skuid string + inappproduct *InAppProduct + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Removes all access for the user to the given package or -// developer account. +// Update: Updates an in-app product (a managed product or a +// subscription). This method should no longer be used to update +// subscriptions. See this article +// (https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) +// for more information. // -// - name: The name of the grant to delete. Format: -// developers/{developer}/users/{email}/grants/{package_name}. -func (r *GrantsService) Delete(name string) *GrantsDeleteCall { - c := &GrantsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - packageName: Package name of the app. +// - sku: Unique identifier for the in-app product. +func (r *InappproductsService) Update(packageName string, skuid string, inappproduct *InAppProduct) *InappproductsUpdateCall { + c := &InappproductsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.skuid = skuid + c.inappproduct = inappproduct + return c +} + +// AllowMissing sets the optional parameter "allowMissing": If set to +// true, and the in-app product with the given package_name and sku +// doesn't exist, the in-app product will be created. +func (c *InappproductsUpdateCall) AllowMissing(allowMissing bool) *InappproductsUpdateCall { + c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) + return c +} + +// AutoConvertMissingPrices sets the optional parameter +// "autoConvertMissingPrices": If true the prices for all regions +// targeted by the parent app that don't have a price specified for this +// in-app product will be auto converted to the target currency based on +// the default price. Defaults to false. +func (c *InappproductsUpdateCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsUpdateCall { + c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices)) + return c +} + +// LatencyTolerance sets the optional parameter "latencyTolerance": The +// latency tolerance for the propagation of this product update. +// Defaults to latency-sensitive. +// +// Possible values: +// +// "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" - Defaults to +// +// PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE. +// +// "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" - The update +// +// will propagate to clients within several minutes on average and up to +// a few hours in rare cases. Throughput is limited to 7,200 updates per +// app per hour. +// +// "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" - The update +// +// will propagate to clients within 24 hours. Supports high throughput +// of up to 720,000 updates per app per hour using batch modification +// methods. +func (c *InappproductsUpdateCall) LatencyTolerance(latencyTolerance string) *InappproductsUpdateCall { + c.urlParams_.Set("latencyTolerance", latencyTolerance) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *GrantsDeleteCall) Fields(s ...googleapi.Field) *GrantsDeleteCall { +func (c *InappproductsUpdateCall) Fields(s ...googleapi.Field) *InappproductsUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15351,21 +18089,21 @@ func (c *GrantsDeleteCall) Fields(s ...googleapi.Field) *GrantsDeleteCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *GrantsDeleteCall) Context(ctx context.Context) *GrantsDeleteCall { +func (c *InappproductsUpdateCall) Context(ctx context.Context) *InappproductsUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *GrantsDeleteCall) Header() http.Header { +func (c *InappproductsUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *GrantsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *InappproductsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -15373,51 +18111,119 @@ func (c *GrantsDeleteCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "packageName": c.packageName, + "sku": c.skuid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.grants.delete" call. -func (c *GrantsDeleteCall) Do(opts ...googleapi.CallOption) error { +// Do executes the "androidpublisher.inappproducts.update" call. +// Exactly one of *InAppProduct or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *InAppProduct.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InappproductsUpdateCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } if err != nil { - return err + return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return gensupport.WrapError(err) + return nil, gensupport.WrapError(err) } - return nil + ret := &InAppProduct{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil // { - // "description": "Removes all access for the user to the given package or developer account.", - // "flatPath": "androidpublisher/v3/developers/{developersId}/users/{usersId}/grants/{grantsId}", - // "httpMethod": "DELETE", - // "id": "androidpublisher.grants.delete", + // "description": "Updates an in-app product (a managed product or a subscription). This method should no longer be used to update subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", + // "httpMethod": "PUT", + // "id": "androidpublisher.inappproducts.update", // "parameterOrder": [ - // "name" + // "packageName", + // "sku" // ], // "parameters": { - // "name": { - // "description": "Required. The name of the grant to delete. Format: developers/{developer}/users/{email}/grants/{package_name}", + // "allowMissing": { + // "description": "If set to true, and the in-app product with the given package_name and sku doesn't exist, the in-app product will be created.", + // "location": "query", + // "type": "boolean" + // }, + // "autoConvertMissingPrices": { + // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", + // "location": "query", + // "type": "boolean" + // }, + // "latencyTolerance": { + // "description": "Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.", + // "enum": [ + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED", + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE", + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" + // ], + // "enumDescriptions": [ + // "Defaults to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE.", + // "The update will propagate to clients within several minutes on average and up to a few hours in rare cases. Throughput is limited to 7,200 updates per app per hour.", + // "The update will propagate to clients within 24 hours. Supports high throughput of up to 720,000 updates per app per hour using batch modification methods." + // ], + // "location": "query", + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sku": { + // "description": "Unique identifier for the in-app product.", // "location": "path", - // "pattern": "^developers/[^/]+/users/[^/]+/grants/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/{+name}", + // "path": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", + // "request": { + // "$ref": "InAppProduct" + // }, + // "response": { + // "$ref": "InAppProduct" + // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -15425,41 +18231,72 @@ func (c *GrantsDeleteCall) Do(opts ...googleapi.CallOption) error { } -// method id "androidpublisher.grants.patch": +// method id "androidpublisher.internalappsharingartifacts.uploadapk": -type GrantsPatchCall struct { - s *Service - name string - grant *Grant - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InternalappsharingartifactsUploadapkCall struct { + s *Service + packageName string + urlParams_ gensupport.URLParams + mediaInfo_ *gensupport.MediaInfo + ctx_ context.Context + header_ http.Header } -// Patch: Updates access for the user to the given package. +// Uploadapk: Uploads an APK to internal app sharing. If you are using +// the Google API client libraries, please increase the timeout of the +// http request before calling this endpoint (a timeout of 2 minutes is +// recommended). See Timeouts and Errors +// (https://developers.google.com/api-client-library/java/google-api-java-client/errors) +// for an example in java. // -// - name: Resource name for this grant, following the pattern -// "developers/{developer}/users/{email}/grants/{package_name}". If -// this grant is for a draft app, the app ID will be used in this -// resource name instead of the package name. -func (r *GrantsService) Patch(name string, grant *Grant) *GrantsPatchCall { - c := &GrantsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.grant = grant +// - packageName: Package name of the app. +func (r *InternalappsharingartifactsService) Uploadapk(packageName string) *InternalappsharingartifactsUploadapkCall { + c := &InternalappsharingartifactsUploadapkCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName return c } -// UpdateMask sets the optional parameter "updateMask": The list of -// fields to be updated. -func (c *GrantsPatchCall) UpdateMask(updateMask string) *GrantsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// Media specifies the media to upload in one or more chunks. The chunk +// size may be controlled by supplying a MediaOption generated by +// googleapi.ChunkSize. The chunk size defaults to +// googleapi.DefaultUploadChunkSize.The Content-Type header used in the +// upload request will be determined by sniffing the contents of r, +// unless a MediaOption generated by googleapi.ContentType is +// supplied. +// At most one of Media and ResumableMedia may be set. +func (c *InternalappsharingartifactsUploadapkCall) Media(r io.Reader, options ...googleapi.MediaOption) *InternalappsharingartifactsUploadapkCall { + c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be +// canceled with ctx. +// +// Deprecated: use Media instead. +// +// At most one of Media and ResumableMedia may be set. mediaType +// identifies the MIME media type of the upload, such as "image/png". If +// mediaType is "", it will be auto-detected. The provided ctx will +// supersede any context previously provided to the Context method. +func (c *InternalappsharingartifactsUploadapkCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *InternalappsharingartifactsUploadapkCall { + c.ctx_ = ctx + c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) + return c +} + +// ProgressUpdater provides a callback function that will be called +// after every chunk. It should be a low-latency function in order to +// not slow down the upload operation. This should only be called when +// using ResumableMedia (as opposed to Media). +func (c *InternalappsharingartifactsUploadapkCall) ProgressUpdater(pu googleapi.ProgressUpdater) *InternalappsharingartifactsUploadapkCall { + c.mediaInfo_.SetProgressUpdater(pu) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *GrantsPatchCall) Fields(s ...googleapi.Field) *GrantsPatchCall { +func (c *InternalappsharingartifactsUploadapkCall) Fields(s ...googleapi.Field) *InternalappsharingartifactsUploadapkCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15467,21 +18304,23 @@ func (c *GrantsPatchCall) Fields(s ...googleapi.Field) *GrantsPatchCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *GrantsPatchCall) Context(ctx context.Context) *GrantsPatchCall { +// This context will supersede any context previously provided to the +// ResumableMedia method. +func (c *InternalappsharingartifactsUploadapkCall) Context(ctx context.Context) *InternalappsharingartifactsUploadapkCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *GrantsPatchCall) Header() http.Header { +func (c *InternalappsharingartifactsUploadapkCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *GrantsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *InternalappsharingartifactsUploadapkCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -15489,34 +18328,40 @@ func (c *GrantsPatchCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.grant) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk") + if c.mediaInfo_ != nil { + urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk") + c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) + } + if body == nil { + body = new(bytes.Buffer) + reqHeaders.Set("Content-Type", "application/json") + } + body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders + req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "packageName": c.packageName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.grants.patch" call. -// Exactly one of *Grant or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Grant.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *GrantsPatchCall) Do(opts ...googleapi.CallOption) (*Grant, error) { +// Do executes the "androidpublisher.internalappsharingartifacts.uploadapk" call. +// Exactly one of *InternalAppSharingArtifact or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *InternalAppSharingArtifact.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InternalappsharingartifactsUploadapkCall) Do(opts ...googleapi.CallOption) (*InternalAppSharingArtifact, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15535,7 +18380,24 @@ func (c *GrantsPatchCall) Do(opts ...googleapi.CallOption) (*Grant, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Grant{ + rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) + if rx != nil { + rx.Client = c.s.client + rx.UserAgent = c.s.userAgent() + ctx := c.ctx_ + if ctx == nil { + ctx = context.TODO() + } + res, err = rx.Upload(ctx) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + } + ret := &InternalAppSharingArtifact{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15547,72 +18409,116 @@ func (c *GrantsPatchCall) Do(opts ...googleapi.CallOption) (*Grant, error) { } return ret, nil // { - // "description": "Updates access for the user to the given package.", - // "flatPath": "androidpublisher/v3/developers/{developersId}/users/{usersId}/grants/{grantsId}", - // "httpMethod": "PATCH", - // "id": "androidpublisher.grants.patch", + // "description": "Uploads an APK to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See [Timeouts and Errors](https://developers.google.com/api-client-library/java/google-api-java-client/errors) for an example in java.", + // "flatPath": "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk", + // "httpMethod": "POST", + // "id": "androidpublisher.internalappsharingartifacts.uploadapk", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream", + // "application/vnd.android.package-archive" + // ], + // "maxSize": "1073741824", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk" + // } + // } + // }, // "parameterOrder": [ - // "name" + // "packageName" // ], // "parameters": { - // "name": { - // "description": "Required. Resource name for this grant, following the pattern \"developers/{developer}/users/{email}/grants/{package_name}\". If this grant is for a draft app, the app ID will be used in this resource name instead of the package name.", + // "packageName": { + // "description": "Package name of the app.", // "location": "path", - // "pattern": "^developers/[^/]+/users/[^/]+/grants/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Optional. The list of fields to be updated.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "androidpublisher/v3/{+name}", - // "request": { - // "$ref": "Grant" - // }, + // "path": "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk", // "response": { - // "$ref": "Grant" + // "$ref": "InternalAppSharingArtifact" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ] + // ], + // "supportsMediaUpload": true // } } -// method id "androidpublisher.inappproducts.delete": +// method id "androidpublisher.internalappsharingartifacts.uploadbundle": -type InappproductsDeleteCall struct { +type InternalappsharingartifactsUploadbundleCall struct { s *Service packageName string - skuid string urlParams_ gensupport.URLParams + mediaInfo_ *gensupport.MediaInfo ctx_ context.Context header_ http.Header } -// Delete: Deletes an in-app product (a managed product or a -// subscription). This method should no longer be used to delete -// subscriptions. See this article -// (https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) -// for more information. +// Uploadbundle: Uploads an app bundle to internal app sharing. If you +// are using the Google API client libraries, please increase the +// timeout of the http request before calling this endpoint (a timeout +// of 2 minutes is recommended). See Timeouts and Errors +// (https://developers.google.com/api-client-library/java/google-api-java-client/errors) +// for an example in java. +// +// - packageName: Package name of the app. +func (r *InternalappsharingartifactsService) Uploadbundle(packageName string) *InternalappsharingartifactsUploadbundleCall { + c := &InternalappsharingartifactsUploadbundleCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + return c +} + +// Media specifies the media to upload in one or more chunks. The chunk +// size may be controlled by supplying a MediaOption generated by +// googleapi.ChunkSize. The chunk size defaults to +// googleapi.DefaultUploadChunkSize.The Content-Type header used in the +// upload request will be determined by sniffing the contents of r, +// unless a MediaOption generated by googleapi.ContentType is +// supplied. +// At most one of Media and ResumableMedia may be set. +func (c *InternalappsharingartifactsUploadbundleCall) Media(r io.Reader, options ...googleapi.MediaOption) *InternalappsharingartifactsUploadbundleCall { + c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be +// canceled with ctx. // -// - packageName: Package name of the app. -// - sku: Unique identifier for the in-app product. -func (r *InappproductsService) Delete(packageName string, skuid string) *InappproductsDeleteCall { - c := &InappproductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.packageName = packageName - c.skuid = skuid +// Deprecated: use Media instead. +// +// At most one of Media and ResumableMedia may be set. mediaType +// identifies the MIME media type of the upload, such as "image/png". If +// mediaType is "", it will be auto-detected. The provided ctx will +// supersede any context previously provided to the Context method. +func (c *InternalappsharingartifactsUploadbundleCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *InternalappsharingartifactsUploadbundleCall { + c.ctx_ = ctx + c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) + return c +} + +// ProgressUpdater provides a callback function that will be called +// after every chunk. It should be a low-latency function in order to +// not slow down the upload operation. This should only be called when +// using ResumableMedia (as opposed to Media). +func (c *InternalappsharingartifactsUploadbundleCall) ProgressUpdater(pu googleapi.ProgressUpdater) *InternalappsharingartifactsUploadbundleCall { + c.mediaInfo_.SetProgressUpdater(pu) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *InappproductsDeleteCall) Fields(s ...googleapi.Field) *InappproductsDeleteCall { +func (c *InternalappsharingartifactsUploadbundleCall) Fields(s ...googleapi.Field) *InternalappsharingartifactsUploadbundleCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15620,21 +18526,23 @@ func (c *InappproductsDeleteCall) Fields(s ...googleapi.Field) *InappproductsDel // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *InappproductsDeleteCall) Context(ctx context.Context) *InappproductsDeleteCall { +// This context will supersede any context previously provided to the +// ResumableMedia method. +func (c *InternalappsharingartifactsUploadbundleCall) Context(ctx context.Context) *InternalappsharingartifactsUploadbundleCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *InappproductsDeleteCall) Header() http.Header { +func (c *InternalappsharingartifactsUploadbundleCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InappproductsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *InternalappsharingartifactsUploadbundleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -15644,40 +18552,107 @@ func (c *InappproductsDeleteCall) doRequest(alt string) (*http.Response, error) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle") + if c.mediaInfo_ != nil { + urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle") + c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) + } + if body == nil { + body = new(bytes.Buffer) + reqHeaders.Set("Content-Type", "application/json") + } + body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders + req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "sku": c.skuid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.inappproducts.delete" call. -func (c *InappproductsDeleteCall) Do(opts ...googleapi.CallOption) error { +// Do executes the "androidpublisher.internalappsharingartifacts.uploadbundle" call. +// Exactly one of *InternalAppSharingArtifact or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *InternalAppSharingArtifact.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InternalappsharingartifactsUploadbundleCall) Do(opts ...googleapi.CallOption) (*InternalAppSharingArtifact, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } if err != nil { - return err + return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return gensupport.WrapError(err) + return nil, gensupport.WrapError(err) } - return nil + rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) + if rx != nil { + rx.Client = c.s.client + rx.UserAgent = c.s.userAgent() + ctx := c.ctx_ + if ctx == nil { + ctx = context.TODO() + } + res, err = rx.Upload(ctx) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + } + ret := &InternalAppSharingArtifact{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil // { - // "description": "Deletes an in-app product (a managed product or a subscription). This method should no longer be used to delete subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", - // "httpMethod": "DELETE", - // "id": "androidpublisher.inappproducts.delete", + // "description": "Uploads an app bundle to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See [Timeouts and Errors](https://developers.google.com/api-client-library/java/google-api-java-client/errors) for an example in java.", + // "flatPath": "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle", + // "httpMethod": "POST", + // "id": "androidpublisher.internalappsharingartifacts.uploadbundle", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream" + // ], + // "maxSize": "10737418240", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle" + // } + // } + // }, // "parameterOrder": [ - // "packageName", - // "sku" + // "packageName" // ], // "parameters": { // "packageName": { @@ -15685,119 +18660,104 @@ func (c *InappproductsDeleteCall) Do(opts ...googleapi.CallOption) error { // "location": "path", // "required": true, // "type": "string" - // }, - // "sku": { - // "description": "Unique identifier for the in-app product.", - // "location": "path", - // "required": true, - // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", + // "path": "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle", + // "response": { + // "$ref": "InternalAppSharingArtifact" + // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ] + // ], + // "supportsMediaUpload": true // } } -// method id "androidpublisher.inappproducts.get": +// method id "androidpublisher.monetization.convertRegionPrices": -type InappproductsGetCall struct { - s *Service - packageName string - skuid string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type MonetizationConvertRegionPricesCall struct { + s *Service + packageName string + convertregionpricesrequest *ConvertRegionPricesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets an in-app product, which can be a managed product or a -// subscription. This method should no longer be used to retrieve -// subscriptions. See this article -// (https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) -// for more information. +// ConvertRegionPrices: Calculates the region prices, using today's +// exchange rate and country-specific pricing patterns, based on the +// price in the request for a set of regions. // -// - packageName: Package name of the app. -// - sku: Unique identifier for the in-app product. -func (r *InappproductsService) Get(packageName string, skuid string) *InappproductsGetCall { - c := &InappproductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - packageName: The app package name. +func (r *MonetizationService) ConvertRegionPrices(packageName string, convertregionpricesrequest *ConvertRegionPricesRequest) *MonetizationConvertRegionPricesCall { + c := &MonetizationConvertRegionPricesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.skuid = skuid + c.convertregionpricesrequest = convertregionpricesrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *InappproductsGetCall) Fields(s ...googleapi.Field) *InappproductsGetCall { +func (c *MonetizationConvertRegionPricesCall) Fields(s ...googleapi.Field) *MonetizationConvertRegionPricesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *InappproductsGetCall) IfNoneMatch(entityTag string) *InappproductsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *InappproductsGetCall) Context(ctx context.Context) *InappproductsGetCall { +func (c *MonetizationConvertRegionPricesCall) Context(ctx context.Context) *MonetizationConvertRegionPricesCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *InappproductsGetCall) Header() http.Header { +func (c *MonetizationConvertRegionPricesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InappproductsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationConvertRegionPricesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.convertregionpricesrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/pricing:convertRegionPrices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "sku": c.skuid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.inappproducts.get" call. -// Exactly one of *InAppProduct or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *InAppProduct.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *InappproductsGetCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) { +// Do executes the "androidpublisher.monetization.convertRegionPrices" call. +// Exactly one of *ConvertRegionPricesResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ConvertRegionPricesResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MonetizationConvertRegionPricesCall) Do(opts ...googleapi.CallOption) (*ConvertRegionPricesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15816,7 +18776,7 @@ func (c *InappproductsGetCall) Do(opts ...googleapi.CallOption) (*InAppProduct, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InAppProduct{ + ret := &ConvertRegionPricesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15828,31 +18788,27 @@ func (c *InappproductsGetCall) Do(opts ...googleapi.CallOption) (*InAppProduct, } return ret, nil // { - // "description": "Gets an in-app product, which can be a managed product or a subscription. This method should no longer be used to retrieve subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", - // "httpMethod": "GET", - // "id": "androidpublisher.inappproducts.get", + // "description": "Calculates the region prices, using today's exchange rate and country-specific pricing patterns, based on the price in the request for a set of regions.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/pricing:convertRegionPrices", + // "httpMethod": "POST", + // "id": "androidpublisher.monetization.convertRegionPrices", // "parameterOrder": [ - // "packageName", - // "sku" + // "packageName" // ], // "parameters": { - // "packageName": { - // "description": "Package name of the app.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "sku": { - // "description": "Unique identifier for the in-app product.", + // "packageName": { + // "description": "Required. The app package name.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", + // "path": "androidpublisher/v3/applications/{packageName}/pricing:convertRegionPrices", + // "request": { + // "$ref": "ConvertRegionPricesRequest" + // }, // "response": { - // "$ref": "InAppProduct" + // "$ref": "ConvertRegionPricesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -15861,45 +18817,38 @@ func (c *InappproductsGetCall) Do(opts ...googleapi.CallOption) (*InAppProduct, } -// method id "androidpublisher.inappproducts.insert": +// method id "androidpublisher.monetization.subscriptions.archive": -type InappproductsInsertCall struct { - s *Service - packageName string - inappproduct *InAppProduct - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsArchiveCall struct { + s *Service + packageName string + productId string + archivesubscriptionrequest *ArchiveSubscriptionRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Insert: Creates an in-app product (a managed product or a -// subscription). This method should no longer be used to create -// subscriptions. See this article -// (https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) -// for more information. +// Archive: Archives a subscription. Can only be done if at least one +// base plan was active in the past, and no base plan is available for +// new or existing subscribers currently. This action is irreversible, +// and the subscription ID will remain reserved. // -// - packageName: Package name of the app. -func (r *InappproductsService) Insert(packageName string, inappproduct *InAppProduct) *InappproductsInsertCall { - c := &InappproductsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - packageName: The parent app (package name) of the app of the +// subscription to delete. +// - productId: The unique product ID of the subscription to delete. +func (r *MonetizationSubscriptionsService) Archive(packageName string, productId string, archivesubscriptionrequest *ArchiveSubscriptionRequest) *MonetizationSubscriptionsArchiveCall { + c := &MonetizationSubscriptionsArchiveCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.inappproduct = inappproduct - return c -} - -// AutoConvertMissingPrices sets the optional parameter -// "autoConvertMissingPrices": If true the prices for all regions -// targeted by the parent app that don't have a price specified for this -// in-app product will be auto converted to the target currency based on -// the default price. Defaults to false. -func (c *InappproductsInsertCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsInsertCall { - c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices)) + c.productId = productId + c.archivesubscriptionrequest = archivesubscriptionrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *InappproductsInsertCall) Fields(s ...googleapi.Field) *InappproductsInsertCall { +func (c *MonetizationSubscriptionsArchiveCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsArchiveCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15907,21 +18856,21 @@ func (c *InappproductsInsertCall) Fields(s ...googleapi.Field) *InappproductsIns // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *InappproductsInsertCall) Context(ctx context.Context) *InappproductsInsertCall { +func (c *MonetizationSubscriptionsArchiveCall) Context(ctx context.Context) *MonetizationSubscriptionsArchiveCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *InappproductsInsertCall) Header() http.Header { +func (c *MonetizationSubscriptionsArchiveCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InappproductsInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsArchiveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -15929,14 +18878,14 @@ func (c *InappproductsInsertCall) doRequest(alt string) (*http.Response, error) } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.archivesubscriptionrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}:archive") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -15945,18 +18894,19 @@ func (c *InappproductsInsertCall) doRequest(alt string) (*http.Response, error) req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, + "productId": c.productId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.inappproducts.insert" call. -// Exactly one of *InAppProduct or error will be non-nil. Any non-2xx +// Do executes the "androidpublisher.monetization.subscriptions.archive" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *InAppProduct.ServerResponse.Header or (if a response was returned at +// *Subscription.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *InappproductsInsertCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) { +func (c *MonetizationSubscriptionsArchiveCall) Do(opts ...googleapi.CallOption) (*Subscription, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15975,7 +18925,7 @@ func (c *InappproductsInsertCall) Do(opts ...googleapi.CallOption) (*InAppProduc if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InAppProduct{ + ret := &Subscription{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15987,32 +18937,34 @@ func (c *InappproductsInsertCall) Do(opts ...googleapi.CallOption) (*InAppProduc } return ret, nil // { - // "description": "Creates an in-app product (a managed product or a subscription). This method should no longer be used to create subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts", + // "description": "Archives a subscription. Can only be done if at least one base plan was active in the past, and no base plan is available for new or existing subscribers currently. This action is irreversible, and the subscription ID will remain reserved.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}:archive", // "httpMethod": "POST", - // "id": "androidpublisher.inappproducts.insert", + // "id": "androidpublisher.monetization.subscriptions.archive", // "parameterOrder": [ - // "packageName" + // "packageName", + // "productId" // ], // "parameters": { - // "autoConvertMissingPrices": { - // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", - // "location": "query", - // "type": "boolean" - // }, // "packageName": { - // "description": "Package name of the app.", + // "description": "Required. The parent app (package name) of the app of the subscription to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "productId": { + // "description": "Required. The unique product ID of the subscription to delete.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/inappproducts", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}:archive", // "request": { - // "$ref": "InAppProduct" + // "$ref": "ArchiveSubscriptionRequest" // }, // "response": { - // "$ref": "InAppProduct" + // "$ref": "Subscription" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -16021,9 +18973,9 @@ func (c *InappproductsInsertCall) Do(opts ...googleapi.CallOption) (*InAppProduc } -// method id "androidpublisher.inappproducts.list": +// method id "androidpublisher.monetization.subscriptions.batchGet": -type InappproductsListCall struct { +type MonetizationSubscriptionsBatchGetCall struct { s *Service packageName string urlParams_ gensupport.URLParams @@ -16032,48 +18984,29 @@ type InappproductsListCall struct { header_ http.Header } -// List: Lists all in-app products - both managed products and -// subscriptions. If an app has a large number of in-app products, the -// response may be paginated. In this case the response field -// `tokenPagination.nextPageToken` will be set and the caller should -// provide its value as a `token` request parameter to retrieve the next -// page. This method should no longer be used to retrieve subscriptions. -// See this article -// (https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) -// for more information. +// BatchGet: Reads one or more subscriptions. // -// - packageName: Package name of the app. -func (r *InappproductsService) List(packageName string) *InappproductsListCall { - c := &InappproductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - packageName: The parent app (package name) for which the +// subscriptions should be retrieved. Must be equal to the +// package_name field on all the requests. +func (r *MonetizationSubscriptionsService) BatchGet(packageName string) *MonetizationSubscriptionsBatchGetCall { + c := &MonetizationSubscriptionsBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName return c } -// MaxResults sets the optional parameter "maxResults": Deprecated and -// ignored. The page size is determined by the server. -func (c *InappproductsListCall) MaxResults(maxResults int64) *InappproductsListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// StartIndex sets the optional parameter "startIndex": Deprecated and -// ignored. Set the `token` parameter to retrieve the next page. -func (c *InappproductsListCall) StartIndex(startIndex int64) *InappproductsListCall { - c.urlParams_.Set("startIndex", fmt.Sprint(startIndex)) - return c -} - -// Token sets the optional parameter "token": Pagination token. If -// empty, list starts at the first product. -func (c *InappproductsListCall) Token(token string) *InappproductsListCall { - c.urlParams_.Set("token", token) +// ProductIds sets the optional parameter "productIds": Required. A list +// of up to 100 subscription product IDs to retrieve. All the IDs must +// be different. +func (c *MonetizationSubscriptionsBatchGetCall) ProductIds(productIds ...string) *MonetizationSubscriptionsBatchGetCall { + c.urlParams_.SetMulti("productIds", append([]string{}, productIds...)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *InappproductsListCall) Fields(s ...googleapi.Field) *InappproductsListCall { +func (c *MonetizationSubscriptionsBatchGetCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBatchGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -16083,7 +19016,7 @@ func (c *InappproductsListCall) Fields(s ...googleapi.Field) *InappproductsListC // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *InappproductsListCall) IfNoneMatch(entityTag string) *InappproductsListCall { +func (c *MonetizationSubscriptionsBatchGetCall) IfNoneMatch(entityTag string) *MonetizationSubscriptionsBatchGetCall { c.ifNoneMatch_ = entityTag return c } @@ -16091,21 +19024,21 @@ func (c *InappproductsListCall) IfNoneMatch(entityTag string) *InappproductsList // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *InappproductsListCall) Context(ctx context.Context) *InappproductsListCall { +func (c *MonetizationSubscriptionsBatchGetCall) Context(ctx context.Context) *MonetizationSubscriptionsBatchGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *InappproductsListCall) Header() http.Header { +func (c *MonetizationSubscriptionsBatchGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InappproductsListCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBatchGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -16118,7 +19051,7 @@ func (c *InappproductsListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions:batchGet") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -16131,14 +19064,14 @@ func (c *InappproductsListCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.inappproducts.list" call. -// Exactly one of *InappproductsListResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *InappproductsListResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "androidpublisher.monetization.subscriptions.batchGet" call. +// Exactly one of *BatchGetSubscriptionsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *BatchGetSubscriptionsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *InappproductsListCall) Do(opts ...googleapi.CallOption) (*InappproductsListResponse, error) { +func (c *MonetizationSubscriptionsBatchGetCall) Do(opts ...googleapi.CallOption) (*BatchGetSubscriptionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16157,7 +19090,7 @@ func (c *InappproductsListCall) Do(opts ...googleapi.CallOption) (*Inappproducts if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InappproductsListResponse{ + ret := &BatchGetSubscriptionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16169,43 +19102,30 @@ func (c *InappproductsListCall) Do(opts ...googleapi.CallOption) (*Inappproducts } return ret, nil // { - // "description": "Lists all in-app products - both managed products and subscriptions. If an app has a large number of in-app products, the response may be paginated. In this case the response field `tokenPagination.nextPageToken` will be set and the caller should provide its value as a `token` request parameter to retrieve the next page. This method should no longer be used to retrieve subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts", + // "description": "Reads one or more subscriptions.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions:batchGet", // "httpMethod": "GET", - // "id": "androidpublisher.inappproducts.list", + // "id": "androidpublisher.monetization.subscriptions.batchGet", // "parameterOrder": [ // "packageName" // ], // "parameters": { - // "maxResults": { - // "deprecated": true, - // "description": "Deprecated and ignored. The page size is determined by the server.", - // "format": "uint32", - // "location": "query", - // "type": "integer" - // }, // "packageName": { - // "description": "Package name of the app.", + // "description": "Required. The parent app (package name) for which the subscriptions should be retrieved. Must be equal to the package_name field on all the requests.", // "location": "path", // "required": true, // "type": "string" // }, - // "startIndex": { - // "deprecated": true, - // "description": "Deprecated and ignored. Set the `token` parameter to retrieve the next page.", - // "format": "uint32", - // "location": "query", - // "type": "integer" - // }, - // "token": { - // "description": "Pagination token. If empty, list starts at the first product.", + // "productIds": { + // "description": "Required. A list of up to 100 subscription product IDs to retrieve. All the IDs must be different.", // "location": "query", + // "repeated": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/inappproducts", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions:batchGet", // "response": { - // "$ref": "InappproductsListResponse" + // "$ref": "BatchGetSubscriptionsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -16214,48 +19134,36 @@ func (c *InappproductsListCall) Do(opts ...googleapi.CallOption) (*Inappproducts } -// method id "androidpublisher.inappproducts.patch": +// method id "androidpublisher.monetization.subscriptions.batchUpdate": -type InappproductsPatchCall struct { - s *Service - packageName string - skuid string - inappproduct *InAppProduct - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsBatchUpdateCall struct { + s *Service + packageName string + batchupdatesubscriptionsrequest *BatchUpdateSubscriptionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Patches an in-app product (a managed product or a -// subscription). This method should no longer be used to update -// subscriptions. See this article -// (https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) -// for more information. +// BatchUpdate: Updates a batch of subscriptions. Set the +// latencyTolerance field on nested requests to +// PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum +// update throughput. // -// - packageName: Package name of the app. -// - sku: Unique identifier for the in-app product. -func (r *InappproductsService) Patch(packageName string, skuid string, inappproduct *InAppProduct) *InappproductsPatchCall { - c := &InappproductsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - packageName: The parent app (package name) for which the +// subscriptions should be updated. Must be equal to the package_name +// field on all the Subscription resources. +func (r *MonetizationSubscriptionsService) BatchUpdate(packageName string, batchupdatesubscriptionsrequest *BatchUpdateSubscriptionsRequest) *MonetizationSubscriptionsBatchUpdateCall { + c := &MonetizationSubscriptionsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.skuid = skuid - c.inappproduct = inappproduct - return c -} - -// AutoConvertMissingPrices sets the optional parameter -// "autoConvertMissingPrices": If true the prices for all regions -// targeted by the parent app that don't have a price specified for this -// in-app product will be auto converted to the target currency based on -// the default price. Defaults to false. -func (c *InappproductsPatchCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsPatchCall { - c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices)) + c.batchupdatesubscriptionsrequest = batchupdatesubscriptionsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *InappproductsPatchCall) Fields(s ...googleapi.Field) *InappproductsPatchCall { +func (c *MonetizationSubscriptionsBatchUpdateCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBatchUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -16263,21 +19171,21 @@ func (c *InappproductsPatchCall) Fields(s ...googleapi.Field) *InappproductsPatc // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *InappproductsPatchCall) Context(ctx context.Context) *InappproductsPatchCall { +func (c *MonetizationSubscriptionsBatchUpdateCall) Context(ctx context.Context) *MonetizationSubscriptionsBatchUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *InappproductsPatchCall) Header() http.Header { +func (c *MonetizationSubscriptionsBatchUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InappproductsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -16285,35 +19193,34 @@ func (c *InappproductsPatchCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdatesubscriptionsrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions:batchUpdate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "sku": c.skuid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.inappproducts.patch" call. -// Exactly one of *InAppProduct or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *InAppProduct.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *InappproductsPatchCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) { +// Do executes the "androidpublisher.monetization.subscriptions.batchUpdate" call. +// Exactly one of *BatchUpdateSubscriptionsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *BatchUpdateSubscriptionsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MonetizationSubscriptionsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*BatchUpdateSubscriptionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16332,7 +19239,7 @@ func (c *InappproductsPatchCall) Do(opts ...googleapi.CallOption) (*InAppProduct if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InAppProduct{ + ret := &BatchUpdateSubscriptionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16344,39 +19251,27 @@ func (c *InappproductsPatchCall) Do(opts ...googleapi.CallOption) (*InAppProduct } return ret, nil // { - // "description": "Patches an in-app product (a managed product or a subscription). This method should no longer be used to update subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", - // "httpMethod": "PATCH", - // "id": "androidpublisher.inappproducts.patch", + // "description": "Updates a batch of subscriptions. Set the latencyTolerance field on nested requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update throughput.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions:batchUpdate", + // "httpMethod": "POST", + // "id": "androidpublisher.monetization.subscriptions.batchUpdate", // "parameterOrder": [ - // "packageName", - // "sku" + // "packageName" // ], // "parameters": { - // "autoConvertMissingPrices": { - // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", - // "location": "query", - // "type": "boolean" - // }, // "packageName": { - // "description": "Package name of the app.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "sku": { - // "description": "Unique identifier for the in-app product.", + // "description": "Required. The parent app (package name) for which the subscriptions should be updated. Must be equal to the package_name field on all the Subscription resources.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions:batchUpdate", // "request": { - // "$ref": "InAppProduct" + // "$ref": "BatchUpdateSubscriptionsRequest" // }, // "response": { - // "$ref": "InAppProduct" + // "$ref": "BatchUpdateSubscriptionsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -16385,56 +19280,59 @@ func (c *InappproductsPatchCall) Do(opts ...googleapi.CallOption) (*InAppProduct } -// method id "androidpublisher.inappproducts.update": +// method id "androidpublisher.monetization.subscriptions.create": -type InappproductsUpdateCall struct { +type MonetizationSubscriptionsCreateCall struct { s *Service packageName string - skuid string - inappproduct *InAppProduct + subscription *Subscription urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Update: Updates an in-app product (a managed product or a -// subscription). This method should no longer be used to update -// subscriptions. See this article -// (https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) -// for more information. +// Create: Creates a new subscription. Newly added base plans will +// remain in draft state until activated. // -// - packageName: Package name of the app. -// - sku: Unique identifier for the in-app product. -func (r *InappproductsService) Update(packageName string, skuid string, inappproduct *InAppProduct) *InappproductsUpdateCall { - c := &InappproductsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - packageName: The parent app (package name) for which the +// subscription should be created. Must be equal to the package_name +// field on the Subscription resource. +func (r *MonetizationSubscriptionsService) Create(packageName string, subscription *Subscription) *MonetizationSubscriptionsCreateCall { + c := &MonetizationSubscriptionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.skuid = skuid - c.inappproduct = inappproduct + c.subscription = subscription return c } -// AllowMissing sets the optional parameter "allowMissing": If set to -// true, and the in-app product with the given package_name and sku -// doesn't exist, the in-app product will be created. -func (c *InappproductsUpdateCall) AllowMissing(allowMissing bool) *InappproductsUpdateCall { - c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) +// ProductId sets the optional parameter "productId": Required. The ID +// to use for the subscription. For the requirements on this format, see +// the documentation of the product_id field on the Subscription +// resource. +func (c *MonetizationSubscriptionsCreateCall) ProductId(productId string) *MonetizationSubscriptionsCreateCall { + c.urlParams_.Set("productId", productId) return c } -// AutoConvertMissingPrices sets the optional parameter -// "autoConvertMissingPrices": If true the prices for all regions -// targeted by the parent app that don't have a price specified for this -// in-app product will be auto converted to the target currency based on -// the default price. Defaults to false. -func (c *InappproductsUpdateCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsUpdateCall { - c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices)) +// RegionsVersionVersion sets the optional parameter +// "regionsVersion.version": Required. A string representing the version +// of available regions being used for the specified resource. Regional +// prices for the resource have to be specified according to the +// information published in this article +// (https://support.google.com/googleplay/android-developer/answer/10532353). +// Each time the supported locations substantially change, the version +// will be incremented. Using this field will ensure that creating and +// updating the resource with an older region's version and set of +// regional prices and currencies will succeed even though a new version +// is available. The latest version is 2022/02. +func (c *MonetizationSubscriptionsCreateCall) RegionsVersionVersion(regionsVersionVersion string) *MonetizationSubscriptionsCreateCall { + c.urlParams_.Set("regionsVersion.version", regionsVersionVersion) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *InappproductsUpdateCall) Fields(s ...googleapi.Field) *InappproductsUpdateCall { +func (c *MonetizationSubscriptionsCreateCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -16442,21 +19340,21 @@ func (c *InappproductsUpdateCall) Fields(s ...googleapi.Field) *InappproductsUpd // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *InappproductsUpdateCall) Context(ctx context.Context) *InappproductsUpdateCall { +func (c *MonetizationSubscriptionsCreateCall) Context(ctx context.Context) *MonetizationSubscriptionsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *InappproductsUpdateCall) Header() http.Header { +func (c *MonetizationSubscriptionsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InappproductsUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -16464,35 +19362,34 @@ func (c *InappproductsUpdateCall) doRequest(alt string) (*http.Response, error) } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "sku": c.skuid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.inappproducts.update" call. -// Exactly one of *InAppProduct or error will be non-nil. Any non-2xx +// Do executes the "androidpublisher.monetization.subscriptions.create" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *InAppProduct.ServerResponse.Header or (if a response was returned at +// *Subscription.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *InappproductsUpdateCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) { +func (c *MonetizationSubscriptionsCreateCall) Do(opts ...googleapi.CallOption) (*Subscription, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16511,7 +19408,7 @@ func (c *InappproductsUpdateCall) Do(opts ...googleapi.CallOption) (*InAppProduc if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InAppProduct{ + ret := &Subscription{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16523,44 +19420,37 @@ func (c *InappproductsUpdateCall) Do(opts ...googleapi.CallOption) (*InAppProduc } return ret, nil // { - // "description": "Updates an in-app product (a managed product or a subscription). This method should no longer be used to update subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", - // "httpMethod": "PUT", - // "id": "androidpublisher.inappproducts.update", + // "description": "Creates a new subscription. Newly added base plans will remain in draft state until activated.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions", + // "httpMethod": "POST", + // "id": "androidpublisher.monetization.subscriptions.create", // "parameterOrder": [ - // "packageName", - // "sku" + // "packageName" // ], // "parameters": { - // "allowMissing": { - // "description": "If set to true, and the in-app product with the given package_name and sku doesn't exist, the in-app product will be created.", - // "location": "query", - // "type": "boolean" - // }, - // "autoConvertMissingPrices": { - // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", - // "location": "query", - // "type": "boolean" - // }, // "packageName": { - // "description": "Package name of the app.", + // "description": "Required. The parent app (package name) for which the subscription should be created. Must be equal to the package_name field on the Subscription resource.", // "location": "path", // "required": true, // "type": "string" // }, - // "sku": { - // "description": "Unique identifier for the in-app product.", - // "location": "path", - // "required": true, + // "productId": { + // "description": "Required. The ID to use for the subscription. For the requirements on this format, see the documentation of the product_id field on the Subscription resource.", + // "location": "query", + // "type": "string" + // }, + // "regionsVersion.version": { + // "description": "Required. A string representing the version of available regions being used for the specified resource. Regional prices for the resource have to be specified according to the information published in [this article](https://support.google.com/googleplay/android-developer/answer/10532353). Each time the supported locations substantially change, the version will be incremented. Using this field will ensure that creating and updating the resource with an older region's version and set of regional prices and currencies will succeed even though a new version is available. The latest version is 2022/02.", + // "location": "query", // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions", // "request": { - // "$ref": "InAppProduct" + // "$ref": "Subscription" // }, // "response": { - // "$ref": "InAppProduct" + // "$ref": "Subscription" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -16569,72 +19459,34 @@ func (c *InappproductsUpdateCall) Do(opts ...googleapi.CallOption) (*InAppProduc } -// method id "androidpublisher.internalappsharingartifacts.uploadapk": +// method id "androidpublisher.monetization.subscriptions.delete": -type InternalappsharingartifactsUploadapkCall struct { +type MonetizationSubscriptionsDeleteCall struct { s *Service packageName string + productId string urlParams_ gensupport.URLParams - mediaInfo_ *gensupport.MediaInfo ctx_ context.Context header_ http.Header } -// Uploadapk: Uploads an APK to internal app sharing. If you are using -// the Google API client libraries, please increase the timeout of the -// http request before calling this endpoint (a timeout of 2 minutes is -// recommended). See Timeouts and Errors -// (https://developers.google.com/api-client-library/java/google-api-java-client/errors) -// for an example in java. +// Delete: Deletes a subscription. A subscription can only be deleted if +// it has never had a base plan published. // -// - packageName: Package name of the app. -func (r *InternalappsharingartifactsService) Uploadapk(packageName string) *InternalappsharingartifactsUploadapkCall { - c := &InternalappsharingartifactsUploadapkCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - packageName: The parent app (package name) of the app of the +// subscription to delete. +// - productId: The unique product ID of the subscription to delete. +func (r *MonetizationSubscriptionsService) Delete(packageName string, productId string) *MonetizationSubscriptionsDeleteCall { + c := &MonetizationSubscriptionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - return c -} - -// Media specifies the media to upload in one or more chunks. The chunk -// size may be controlled by supplying a MediaOption generated by -// googleapi.ChunkSize. The chunk size defaults to -// googleapi.DefaultUploadChunkSize.The Content-Type header used in the -// upload request will be determined by sniffing the contents of r, -// unless a MediaOption generated by googleapi.ContentType is -// supplied. -// At most one of Media and ResumableMedia may be set. -func (c *InternalappsharingartifactsUploadapkCall) Media(r io.Reader, options ...googleapi.MediaOption) *InternalappsharingartifactsUploadapkCall { - c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) - return c -} - -// ResumableMedia specifies the media to upload in chunks and can be -// canceled with ctx. -// -// Deprecated: use Media instead. -// -// At most one of Media and ResumableMedia may be set. mediaType -// identifies the MIME media type of the upload, such as "image/png". If -// mediaType is "", it will be auto-detected. The provided ctx will -// supersede any context previously provided to the Context method. -func (c *InternalappsharingartifactsUploadapkCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *InternalappsharingartifactsUploadapkCall { - c.ctx_ = ctx - c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) - return c -} - -// ProgressUpdater provides a callback function that will be called -// after every chunk. It should be a low-latency function in order to -// not slow down the upload operation. This should only be called when -// using ResumableMedia (as opposed to Media). -func (c *InternalappsharingartifactsUploadapkCall) ProgressUpdater(pu googleapi.ProgressUpdater) *InternalappsharingartifactsUploadapkCall { - c.mediaInfo_.SetProgressUpdater(pu) + c.productId = productId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *InternalappsharingartifactsUploadapkCall) Fields(s ...googleapi.Field) *InternalappsharingartifactsUploadapkCall { +func (c *MonetizationSubscriptionsDeleteCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -16642,23 +19494,21 @@ func (c *InternalappsharingartifactsUploadapkCall) Fields(s ...googleapi.Field) // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -// This context will supersede any context previously provided to the -// ResumableMedia method. -func (c *InternalappsharingartifactsUploadapkCall) Context(ctx context.Context) *InternalappsharingartifactsUploadapkCall { +func (c *MonetizationSubscriptionsDeleteCall) Context(ctx context.Context) *MonetizationSubscriptionsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *InternalappsharingartifactsUploadapkCall) Header() http.Header { +func (c *MonetizationSubscriptionsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InternalappsharingartifactsUploadapkCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -16668,260 +19518,157 @@ func (c *InternalappsharingartifactsUploadapkCall) doRequest(alt string) (*http. var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk") - if c.mediaInfo_ != nil { - urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk") - c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) - } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) - defer cleanup() + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders - req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, + "productId": c.productId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.internalappsharingartifacts.uploadapk" call. -// Exactly one of *InternalAppSharingArtifact or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *InternalAppSharingArtifact.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *InternalappsharingartifactsUploadapkCall) Do(opts ...googleapi.CallOption) (*InternalAppSharingArtifact, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) - if rx != nil { - rx.Client = c.s.client - rx.UserAgent = c.s.userAgent() - ctx := c.ctx_ - if ctx == nil { - ctx = context.TODO() - } - res, err = rx.Upload(ctx) - if err != nil { - return nil, err - } - defer res.Body.Close() - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - } - ret := &InternalAppSharingArtifact{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, +// Do executes the "androidpublisher.monetization.subscriptions.delete" call. +func (c *MonetizationSubscriptionsDeleteCall) Do(opts ...googleapi.CallOption) error { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if err != nil { + return err } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return gensupport.WrapError(err) } - return ret, nil + return nil // { - // "description": "Uploads an APK to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See [Timeouts and Errors](https://developers.google.com/api-client-library/java/google-api-java-client/errors) for an example in java.", - // "flatPath": "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk", - // "httpMethod": "POST", - // "id": "androidpublisher.internalappsharingartifacts.uploadapk", - // "mediaUpload": { - // "accept": [ - // "application/octet-stream", - // "application/vnd.android.package-archive" - // ], - // "maxSize": "1073741824", - // "protocols": { - // "resumable": { - // "multipart": true, - // "path": "/resumable/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk" - // }, - // "simple": { - // "multipart": true, - // "path": "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk" - // } - // } - // }, + // "description": "Deletes a subscription. A subscription can only be deleted if it has never had a base plan published.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", + // "httpMethod": "DELETE", + // "id": "androidpublisher.monetization.subscriptions.delete", // "parameterOrder": [ - // "packageName" + // "packageName", + // "productId" // ], // "parameters": { // "packageName": { - // "description": "Package name of the app.", + // "description": "Required. The parent app (package name) of the app of the subscription to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "productId": { + // "description": "Required. The unique product ID of the subscription to delete.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk", - // "response": { - // "$ref": "InternalAppSharingArtifact" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ], - // "supportsMediaUpload": true + // ] // } } -// method id "androidpublisher.internalappsharingartifacts.uploadbundle": +// method id "androidpublisher.monetization.subscriptions.get": -type InternalappsharingartifactsUploadbundleCall struct { - s *Service - packageName string - urlParams_ gensupport.URLParams - mediaInfo_ *gensupport.MediaInfo - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsGetCall struct { + s *Service + packageName string + productId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Uploadbundle: Uploads an app bundle to internal app sharing. If you -// are using the Google API client libraries, please increase the -// timeout of the http request before calling this endpoint (a timeout -// of 2 minutes is recommended). See Timeouts and Errors -// (https://developers.google.com/api-client-library/java/google-api-java-client/errors) -// for an example in java. +// Get: Reads a single subscription. // -// - packageName: Package name of the app. -func (r *InternalappsharingartifactsService) Uploadbundle(packageName string) *InternalappsharingartifactsUploadbundleCall { - c := &InternalappsharingartifactsUploadbundleCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - packageName: The parent app (package name) of the subscription to +// get. +// - productId: The unique product ID of the subscription to get. +func (r *MonetizationSubscriptionsService) Get(packageName string, productId string) *MonetizationSubscriptionsGetCall { + c := &MonetizationSubscriptionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - return c -} - -// Media specifies the media to upload in one or more chunks. The chunk -// size may be controlled by supplying a MediaOption generated by -// googleapi.ChunkSize. The chunk size defaults to -// googleapi.DefaultUploadChunkSize.The Content-Type header used in the -// upload request will be determined by sniffing the contents of r, -// unless a MediaOption generated by googleapi.ContentType is -// supplied. -// At most one of Media and ResumableMedia may be set. -func (c *InternalappsharingartifactsUploadbundleCall) Media(r io.Reader, options ...googleapi.MediaOption) *InternalappsharingartifactsUploadbundleCall { - c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) - return c -} - -// ResumableMedia specifies the media to upload in chunks and can be -// canceled with ctx. -// -// Deprecated: use Media instead. -// -// At most one of Media and ResumableMedia may be set. mediaType -// identifies the MIME media type of the upload, such as "image/png". If -// mediaType is "", it will be auto-detected. The provided ctx will -// supersede any context previously provided to the Context method. -func (c *InternalappsharingartifactsUploadbundleCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *InternalappsharingartifactsUploadbundleCall { - c.ctx_ = ctx - c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) - return c -} - -// ProgressUpdater provides a callback function that will be called -// after every chunk. It should be a low-latency function in order to -// not slow down the upload operation. This should only be called when -// using ResumableMedia (as opposed to Media). -func (c *InternalappsharingartifactsUploadbundleCall) ProgressUpdater(pu googleapi.ProgressUpdater) *InternalappsharingartifactsUploadbundleCall { - c.mediaInfo_.SetProgressUpdater(pu) + c.productId = productId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *InternalappsharingartifactsUploadbundleCall) Fields(s ...googleapi.Field) *InternalappsharingartifactsUploadbundleCall { +func (c *MonetizationSubscriptionsGetCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MonetizationSubscriptionsGetCall) IfNoneMatch(entityTag string) *MonetizationSubscriptionsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -// This context will supersede any context previously provided to the -// ResumableMedia method. -func (c *InternalappsharingartifactsUploadbundleCall) Context(ctx context.Context) *InternalappsharingartifactsUploadbundleCall { +func (c *MonetizationSubscriptionsGetCall) Context(ctx context.Context) *MonetizationSubscriptionsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *InternalappsharingartifactsUploadbundleCall) Header() http.Header { +func (c *MonetizationSubscriptionsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InternalappsharingartifactsUploadbundleCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle") - if c.mediaInfo_ != nil { - urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle") - c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) - } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) - defer cleanup() + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders - req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, + "productId": c.productId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.internalappsharingartifacts.uploadbundle" call. -// Exactly one of *InternalAppSharingArtifact or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *InternalAppSharingArtifact.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *InternalappsharingartifactsUploadbundleCall) Do(opts ...googleapi.CallOption) (*InternalAppSharingArtifact, error) { +// Do executes the "androidpublisher.monetization.subscriptions.get" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MonetizationSubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*Subscription, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16940,24 +19687,7 @@ func (c *InternalappsharingartifactsUploadbundleCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) - if rx != nil { - rx.Client = c.s.client - rx.UserAgent = c.s.userAgent() - ctx := c.ctx_ - if ctx == nil { - ctx = context.TODO() - } - res, err = rx.Upload(ctx) - if err != nil { - return nil, err - } - defer res.Body.Close() - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - } - ret := &InternalAppSharingArtifact{ + ret := &Subscription{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16969,115 +19699,138 @@ func (c *InternalappsharingartifactsUploadbundleCall) Do(opts ...googleapi.CallO } return ret, nil // { - // "description": "Uploads an app bundle to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See [Timeouts and Errors](https://developers.google.com/api-client-library/java/google-api-java-client/errors) for an example in java.", - // "flatPath": "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle", - // "httpMethod": "POST", - // "id": "androidpublisher.internalappsharingartifacts.uploadbundle", - // "mediaUpload": { - // "accept": [ - // "application/octet-stream" - // ], - // "maxSize": "10737418240", - // "protocols": { - // "resumable": { - // "multipart": true, - // "path": "/resumable/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle" - // }, - // "simple": { - // "multipart": true, - // "path": "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle" - // } - // } - // }, + // "description": "Reads a single subscription.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", + // "httpMethod": "GET", + // "id": "androidpublisher.monetization.subscriptions.get", // "parameterOrder": [ - // "packageName" + // "packageName", + // "productId" // ], // "parameters": { // "packageName": { - // "description": "Package name of the app.", + // "description": "Required. The parent app (package name) of the subscription to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "productId": { + // "description": "Required. The unique product ID of the subscription to get.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", // "response": { - // "$ref": "InternalAppSharingArtifact" + // "$ref": "Subscription" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ], - // "supportsMediaUpload": true + // ] // } } -// method id "androidpublisher.monetization.convertRegionPrices": +// method id "androidpublisher.monetization.subscriptions.list": + +type MonetizationSubscriptionsListCall struct { + s *Service + packageName string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists all subscriptions under a given app. +// +// - packageName: The parent app (package name) for which the +// subscriptions should be read. +func (r *MonetizationSubscriptionsService) List(packageName string) *MonetizationSubscriptionsListCall { + c := &MonetizationSubscriptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of subscriptions to return. The service may return fewer than this +// value. If unspecified, at most 50 subscriptions will be returned. The +// maximum value is 1000; values above 1000 will be coerced to 1000. +func (c *MonetizationSubscriptionsListCall) PageSize(pageSize int64) *MonetizationSubscriptionsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} -type MonetizationConvertRegionPricesCall struct { - s *Service - packageName string - convertregionpricesrequest *ConvertRegionPricesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListSubscriptions` call. Provide this to +// retrieve the subsequent page. When paginating, all other parameters +// provided to `ListSubscriptions` must match the call that provided the +// page token. +func (c *MonetizationSubscriptionsListCall) PageToken(pageToken string) *MonetizationSubscriptionsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c } -// ConvertRegionPrices: Calculates the region prices, using today's -// exchange rate and country-specific pricing patterns, based on the -// price in the request for a set of regions. -// -// - packageName: The app package name. -func (r *MonetizationService) ConvertRegionPrices(packageName string, convertregionpricesrequest *ConvertRegionPricesRequest) *MonetizationConvertRegionPricesCall { - c := &MonetizationConvertRegionPricesCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.packageName = packageName - c.convertregionpricesrequest = convertregionpricesrequest +// ShowArchived sets the optional parameter "showArchived": Whether +// archived subscriptions should be included in the response. Defaults +// to false. +func (c *MonetizationSubscriptionsListCall) ShowArchived(showArchived bool) *MonetizationSubscriptionsListCall { + c.urlParams_.Set("showArchived", fmt.Sprint(showArchived)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *MonetizationConvertRegionPricesCall) Fields(s ...googleapi.Field) *MonetizationConvertRegionPricesCall { +func (c *MonetizationSubscriptionsListCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MonetizationSubscriptionsListCall) IfNoneMatch(entityTag string) *MonetizationSubscriptionsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *MonetizationConvertRegionPricesCall) Context(ctx context.Context) *MonetizationConvertRegionPricesCall { +func (c *MonetizationSubscriptionsListCall) Context(ctx context.Context) *MonetizationSubscriptionsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *MonetizationConvertRegionPricesCall) Header() http.Header { +func (c *MonetizationSubscriptionsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MonetizationConvertRegionPricesCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.convertregionpricesrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/pricing:convertRegionPrices") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -17088,14 +19841,14 @@ func (c *MonetizationConvertRegionPricesCall) doRequest(alt string) (*http.Respo return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.monetization.convertRegionPrices" call. -// Exactly one of *ConvertRegionPricesResponse or error will be non-nil. +// Do executes the "androidpublisher.monetization.subscriptions.list" call. +// Exactly one of *ListSubscriptionsResponse or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either -// *ConvertRegionPricesResponse.ServerResponse.Header or (if a response +// *ListSubscriptionsResponse.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *MonetizationConvertRegionPricesCall) Do(opts ...googleapi.CallOption) (*ConvertRegionPricesResponse, error) { +func (c *MonetizationSubscriptionsListCall) Do(opts ...googleapi.CallOption) (*ListSubscriptionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17114,7 +19867,7 @@ func (c *MonetizationConvertRegionPricesCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ConvertRegionPricesResponse{ + ret := &ListSubscriptionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17126,27 +19879,40 @@ func (c *MonetizationConvertRegionPricesCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Calculates the region prices, using today's exchange rate and country-specific pricing patterns, based on the price in the request for a set of regions.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/pricing:convertRegionPrices", - // "httpMethod": "POST", - // "id": "androidpublisher.monetization.convertRegionPrices", + // "description": "Lists all subscriptions under a given app.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions", + // "httpMethod": "GET", + // "id": "androidpublisher.monetization.subscriptions.list", // "parameterOrder": [ // "packageName" // ], // "parameters": { // "packageName": { - // "description": "Required. The app package name.", + // "description": "Required. The parent app (package name) for which the subscriptions should be read.", // "location": "path", // "required": true, // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of subscriptions to return. The service may return fewer than this value. If unspecified, at most 50 subscriptions will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token, received from a previous `ListSubscriptions` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListSubscriptions` must match the call that provided the page token.", + // "location": "query", + // "type": "string" + // }, + // "showArchived": { + // "description": "Whether archived subscriptions should be included in the response. Defaults to false.", + // "location": "query", + // "type": "boolean" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/pricing:convertRegionPrices", - // "request": { - // "$ref": "ConvertRegionPricesRequest" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions", // "response": { - // "$ref": "ConvertRegionPricesResponse" + // "$ref": "ListSubscriptionsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -17155,38 +19921,117 @@ func (c *MonetizationConvertRegionPricesCall) Do(opts ...googleapi.CallOption) ( } -// method id "androidpublisher.monetization.subscriptions.archive": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *MonetizationSubscriptionsListCall) Pages(ctx context.Context, f func(*ListSubscriptionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type MonetizationSubscriptionsArchiveCall struct { - s *Service - packageName string - productId string - archivesubscriptionrequest *ArchiveSubscriptionRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "androidpublisher.monetization.subscriptions.patch": + +type MonetizationSubscriptionsPatchCall struct { + s *Service + packageName string + productId string + subscription *Subscription + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Archive: Archives a subscription. Can only be done if at least one -// base plan was active in the past, and no base plan is available for -// new or existing subscribers currently. This action is irreversible, -// and the subscription ID will remain reserved. +// Patch: Updates an existing subscription. // -// - packageName: The parent app (package name) of the app of the -// subscription to delete. -// - productId: The unique product ID of the subscription to delete. -func (r *MonetizationSubscriptionsService) Archive(packageName string, productId string, archivesubscriptionrequest *ArchiveSubscriptionRequest) *MonetizationSubscriptionsArchiveCall { - c := &MonetizationSubscriptionsArchiveCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - packageName: Immutable. Package name of the parent app. +// - productId: Immutable. Unique product ID of the product. Unique +// within the parent app. Product IDs must be composed of lower-case +// letters (a-z), numbers (0-9), underscores (_) and dots (.). It must +// start with a lower-case letter or number, and be between 1 and 40 +// (inclusive) characters in length. +func (r *MonetizationSubscriptionsService) Patch(packageName string, productId string, subscription *Subscription) *MonetizationSubscriptionsPatchCall { + c := &MonetizationSubscriptionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.productId = productId - c.archivesubscriptionrequest = archivesubscriptionrequest + c.subscription = subscription + return c +} + +// AllowMissing sets the optional parameter "allowMissing": If set to +// true, and the subscription with the given package_name and product_id +// doesn't exist, the subscription will be created. If a new +// subscription is created, update_mask is ignored. +func (c *MonetizationSubscriptionsPatchCall) AllowMissing(allowMissing bool) *MonetizationSubscriptionsPatchCall { + c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) + return c +} + +// LatencyTolerance sets the optional parameter "latencyTolerance": The +// latency tolerance for the propagation of this product update. +// Defaults to latency-sensitive. +// +// Possible values: +// +// "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" - Defaults to +// +// PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE. +// +// "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" - The update +// +// will propagate to clients within several minutes on average and up to +// a few hours in rare cases. Throughput is limited to 7,200 updates per +// app per hour. +// +// "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" - The update +// +// will propagate to clients within 24 hours. Supports high throughput +// of up to 720,000 updates per app per hour using batch modification +// methods. +func (c *MonetizationSubscriptionsPatchCall) LatencyTolerance(latencyTolerance string) *MonetizationSubscriptionsPatchCall { + c.urlParams_.Set("latencyTolerance", latencyTolerance) + return c +} + +// RegionsVersionVersion sets the optional parameter +// "regionsVersion.version": Required. A string representing the version +// of available regions being used for the specified resource. Regional +// prices for the resource have to be specified according to the +// information published in this article +// (https://support.google.com/googleplay/android-developer/answer/10532353). +// Each time the supported locations substantially change, the version +// will be incremented. Using this field will ensure that creating and +// updating the resource with an older region's version and set of +// regional prices and currencies will succeed even though a new version +// is available. The latest version is 2022/02. +func (c *MonetizationSubscriptionsPatchCall) RegionsVersionVersion(regionsVersionVersion string) *MonetizationSubscriptionsPatchCall { + c.urlParams_.Set("regionsVersion.version", regionsVersionVersion) + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. The +// list of fields to be updated. +func (c *MonetizationSubscriptionsPatchCall) UpdateMask(updateMask string) *MonetizationSubscriptionsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *MonetizationSubscriptionsArchiveCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsArchiveCall { +func (c *MonetizationSubscriptionsPatchCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -17194,21 +20039,21 @@ func (c *MonetizationSubscriptionsArchiveCall) Fields(s ...googleapi.Field) *Mon // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *MonetizationSubscriptionsArchiveCall) Context(ctx context.Context) *MonetizationSubscriptionsArchiveCall { +func (c *MonetizationSubscriptionsPatchCall) Context(ctx context.Context) *MonetizationSubscriptionsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *MonetizationSubscriptionsArchiveCall) Header() http.Header { +func (c *MonetizationSubscriptionsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MonetizationSubscriptionsArchiveCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -17216,16 +20061,16 @@ func (c *MonetizationSubscriptionsArchiveCall) doRequest(alt string) (*http.Resp } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.archivesubscriptionrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}:archive") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -17237,14 +20082,14 @@ func (c *MonetizationSubscriptionsArchiveCall) doRequest(alt string) (*http.Resp return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.monetization.subscriptions.archive" call. +// Do executes the "androidpublisher.monetization.subscriptions.patch" call. // Exactly one of *Subscription or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *Subscription.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *MonetizationSubscriptionsArchiveCall) Do(opts ...googleapi.CallOption) (*Subscription, error) { +func (c *MonetizationSubscriptionsPatchCall) Do(opts ...googleapi.CallOption) (*Subscription, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17275,31 +20120,62 @@ func (c *MonetizationSubscriptionsArchiveCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Archives a subscription. Can only be done if at least one base plan was active in the past, and no base plan is available for new or existing subscribers currently. This action is irreversible, and the subscription ID will remain reserved.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}:archive", - // "httpMethod": "POST", - // "id": "androidpublisher.monetization.subscriptions.archive", + // "description": "Updates an existing subscription.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", + // "httpMethod": "PATCH", + // "id": "androidpublisher.monetization.subscriptions.patch", // "parameterOrder": [ // "packageName", // "productId" // ], // "parameters": { + // "allowMissing": { + // "description": "Optional. If set to true, and the subscription with the given package_name and product_id doesn't exist, the subscription will be created. If a new subscription is created, update_mask is ignored.", + // "location": "query", + // "type": "boolean" + // }, + // "latencyTolerance": { + // "description": "Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.", + // "enum": [ + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED", + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE", + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" + // ], + // "enumDescriptions": [ + // "Defaults to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE.", + // "The update will propagate to clients within several minutes on average and up to a few hours in rare cases. Throughput is limited to 7,200 updates per app per hour.", + // "The update will propagate to clients within 24 hours. Supports high throughput of up to 720,000 updates per app per hour using batch modification methods." + // ], + // "location": "query", + // "type": "string" + // }, // "packageName": { - // "description": "Required. The parent app (package name) of the app of the subscription to delete.", + // "description": "Immutable. Package name of the parent app.", // "location": "path", // "required": true, // "type": "string" // }, // "productId": { - // "description": "Required. The unique product ID of the subscription to delete.", + // "description": "Immutable. Unique product ID of the product. Unique within the parent app. Product IDs must be composed of lower-case letters (a-z), numbers (0-9), underscores (_) and dots (.). It must start with a lower-case letter or number, and be between 1 and 40 (inclusive) characters in length.", // "location": "path", // "required": true, // "type": "string" + // }, + // "regionsVersion.version": { + // "description": "Required. A string representing the version of available regions being used for the specified resource. Regional prices for the resource have to be specified according to the information published in [this article](https://support.google.com/googleplay/android-developer/answer/10532353). Each time the supported locations substantially change, the version will be incremented. Using this field will ensure that creating and updating the resource with an older region's version and set of regional prices and currencies will succeed even though a new version is available. The latest version is 2022/02.", + // "location": "query", + // "type": "string" + // }, + // "updateMask": { + // "description": "Required. The list of fields to be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}:archive", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", // "request": { - // "$ref": "ArchiveSubscriptionRequest" + // "$ref": "Subscription" // }, // "response": { // "$ref": "Subscription" @@ -17311,59 +20187,40 @@ func (c *MonetizationSubscriptionsArchiveCall) Do(opts ...googleapi.CallOption) } -// method id "androidpublisher.monetization.subscriptions.create": +// method id "androidpublisher.monetization.subscriptions.basePlans.activate": -type MonetizationSubscriptionsCreateCall struct { - s *Service - packageName string - subscription *Subscription - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsBasePlansActivateCall struct { + s *Service + packageName string + productId string + basePlanId string + activatebaseplanrequest *ActivateBasePlanRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a new subscription. Newly added base plans will -// remain in draft state until activated. +// Activate: Activates a base plan. Once activated, base plans will be +// available to new subscribers. // -// - packageName: The parent app (package name) for which the -// subscription should be created. Must be equal to the package_name -// field on the Subscription resource. -func (r *MonetizationSubscriptionsService) Create(packageName string, subscription *Subscription) *MonetizationSubscriptionsCreateCall { - c := &MonetizationSubscriptionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - basePlanId: The unique base plan ID of the base plan to activate. +// - packageName: The parent app (package name) of the base plan to +// activate. +// - productId: The parent subscription (ID) of the base plan to +// activate. +func (r *MonetizationSubscriptionsBasePlansService) Activate(packageName string, productId string, basePlanId string, activatebaseplanrequest *ActivateBasePlanRequest) *MonetizationSubscriptionsBasePlansActivateCall { + c := &MonetizationSubscriptionsBasePlansActivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.subscription = subscription - return c -} - -// ProductId sets the optional parameter "productId": Required. The ID -// to use for the subscription. For the requirements on this format, see -// the documentation of the product_id field on the Subscription -// resource. -func (c *MonetizationSubscriptionsCreateCall) ProductId(productId string) *MonetizationSubscriptionsCreateCall { - c.urlParams_.Set("productId", productId) - return c -} - -// RegionsVersionVersion sets the optional parameter -// "regionsVersion.version": Required. A string representing the version -// of available regions being used for the specified resource. Regional -// prices for the resource have to be specified according to the -// information published in this article -// (https://support.google.com/googleplay/android-developer/answer/10532353). -// Each time the supported locations substantially change, the version -// will be incremented. Using this field will ensure that creating and -// updating the resource with an older region's version and set of -// regional prices and currencies will succeed even though a new version -// is available. The latest version is 2022/02. -func (c *MonetizationSubscriptionsCreateCall) RegionsVersionVersion(regionsVersionVersion string) *MonetizationSubscriptionsCreateCall { - c.urlParams_.Set("regionsVersion.version", regionsVersionVersion) + c.productId = productId + c.basePlanId = basePlanId + c.activatebaseplanrequest = activatebaseplanrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *MonetizationSubscriptionsCreateCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsCreateCall { +func (c *MonetizationSubscriptionsBasePlansActivateCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansActivateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -17371,21 +20228,21 @@ func (c *MonetizationSubscriptionsCreateCall) Fields(s ...googleapi.Field) *Mone // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *MonetizationSubscriptionsCreateCall) Context(ctx context.Context) *MonetizationSubscriptionsCreateCall { +func (c *MonetizationSubscriptionsBasePlansActivateCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansActivateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *MonetizationSubscriptionsCreateCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansActivateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MonetizationSubscriptionsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansActivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -17393,14 +20250,14 @@ func (c *MonetizationSubscriptionsCreateCall) doRequest(alt string) (*http.Respo } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.activatebaseplanrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:activate") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -17409,18 +20266,20 @@ func (c *MonetizationSubscriptionsCreateCall) doRequest(alt string) (*http.Respo req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, + "productId": c.productId, + "basePlanId": c.basePlanId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.monetization.subscriptions.create" call. +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.activate" call. // Exactly one of *Subscription or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *Subscription.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *MonetizationSubscriptionsCreateCall) Do(opts ...googleapi.CallOption) (*Subscription, error) { +func (c *MonetizationSubscriptionsBasePlansActivateCall) Do(opts ...googleapi.CallOption) (*Subscription, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17451,34 +20310,38 @@ func (c *MonetizationSubscriptionsCreateCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Creates a new subscription. Newly added base plans will remain in draft state until activated.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions", + // "description": "Activates a base plan. Once activated, base plans will be available to new subscribers.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:activate", // "httpMethod": "POST", - // "id": "androidpublisher.monetization.subscriptions.create", + // "id": "androidpublisher.monetization.subscriptions.basePlans.activate", // "parameterOrder": [ - // "packageName" + // "packageName", + // "productId", + // "basePlanId" // ], // "parameters": { - // "packageName": { - // "description": "Required. The parent app (package name) for which the subscription should be created. Must be equal to the package_name field on the Subscription resource.", + // "basePlanId": { + // "description": "Required. The unique base plan ID of the base plan to activate.", // "location": "path", // "required": true, // "type": "string" // }, - // "productId": { - // "description": "Required. The ID to use for the subscription. For the requirements on this format, see the documentation of the product_id field on the Subscription resource.", - // "location": "query", + // "packageName": { + // "description": "Required. The parent app (package name) of the base plan to activate.", + // "location": "path", + // "required": true, // "type": "string" // }, - // "regionsVersion.version": { - // "description": "Required. A string representing the version of available regions being used for the specified resource. Regional prices for the resource have to be specified according to the information published in [this article](https://support.google.com/googleplay/android-developer/answer/10532353). Each time the supported locations substantially change, the version will be incremented. Using this field will ensure that creating and updating the resource with an older region's version and set of regional prices and currencies will succeed even though a new version is available. The latest version is 2022/02.", - // "location": "query", + // "productId": { + // "description": "Required. The parent subscription (ID) of the base plan to activate.", + // "location": "path", + // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/subscriptions", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:activate", // "request": { - // "$ref": "Subscription" + // "$ref": "ActivateBasePlanRequest" // }, // "response": { // "$ref": "Subscription" @@ -17490,34 +20353,42 @@ func (c *MonetizationSubscriptionsCreateCall) Do(opts ...googleapi.CallOption) ( } -// method id "androidpublisher.monetization.subscriptions.delete": +// method id "androidpublisher.monetization.subscriptions.basePlans.batchMigratePrices": -type MonetizationSubscriptionsDeleteCall struct { - s *Service - packageName string - productId string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsBasePlansBatchMigratePricesCall struct { + s *Service + packageName string + productId string + batchmigratebaseplanpricesrequest *BatchMigrateBasePlanPricesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a subscription. A subscription can only be deleted if -// it has never had a base plan published. +// BatchMigratePrices: Batch variant of the MigrateBasePlanPrices +// endpoint. Set the latencyTolerance field on nested requests to +// PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum +// update throughput. // -// - packageName: The parent app (package name) of the app of the -// subscription to delete. -// - productId: The unique product ID of the subscription to delete. -func (r *MonetizationSubscriptionsService) Delete(packageName string, productId string) *MonetizationSubscriptionsDeleteCall { - c := &MonetizationSubscriptionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - packageName: The parent app (package name) for which the +// subscriptions should be created or updated. Must be equal to the +// package_name field on all the Subscription resources. +// - productId: The product ID of the parent subscription, if all +// updated offers belong to the same subscription. If this batch +// update spans multiple subscriptions, set this field to "-". Must be +// set. +func (r *MonetizationSubscriptionsBasePlansService) BatchMigratePrices(packageName string, productId string, batchmigratebaseplanpricesrequest *BatchMigrateBasePlanPricesRequest) *MonetizationSubscriptionsBasePlansBatchMigratePricesCall { + c := &MonetizationSubscriptionsBasePlansBatchMigratePricesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.productId = productId + c.batchmigratebaseplanpricesrequest = batchmigratebaseplanpricesrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *MonetizationSubscriptionsDeleteCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsDeleteCall { +func (c *MonetizationSubscriptionsBasePlansBatchMigratePricesCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansBatchMigratePricesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -17525,21 +20396,21 @@ func (c *MonetizationSubscriptionsDeleteCall) Fields(s ...googleapi.Field) *Mone // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *MonetizationSubscriptionsDeleteCall) Context(ctx context.Context) *MonetizationSubscriptionsDeleteCall { +func (c *MonetizationSubscriptionsBasePlansBatchMigratePricesCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansBatchMigratePricesCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *MonetizationSubscriptionsDeleteCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansBatchMigratePricesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MonetizationSubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansBatchMigratePricesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -17547,11 +20418,16 @@ func (c *MonetizationSubscriptionsDeleteCall) doRequest(alt string) (*http.Respo } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchmigratebaseplanpricesrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans:batchMigratePrices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -17563,42 +20439,74 @@ func (c *MonetizationSubscriptionsDeleteCall) doRequest(alt string) (*http.Respo return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.monetization.subscriptions.delete" call. -func (c *MonetizationSubscriptionsDeleteCall) Do(opts ...googleapi.CallOption) error { +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.batchMigratePrices" call. +// Exactly one of *BatchMigrateBasePlanPricesResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *BatchMigrateBasePlanPricesResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *MonetizationSubscriptionsBasePlansBatchMigratePricesCall) Do(opts ...googleapi.CallOption) (*BatchMigrateBasePlanPricesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } if err != nil { - return err + return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return gensupport.WrapError(err) + return nil, gensupport.WrapError(err) } - return nil + ret := &BatchMigrateBasePlanPricesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil // { - // "description": "Deletes a subscription. A subscription can only be deleted if it has never had a base plan published.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", - // "httpMethod": "DELETE", - // "id": "androidpublisher.monetization.subscriptions.delete", + // "description": "Batch variant of the MigrateBasePlanPrices endpoint. Set the latencyTolerance field on nested requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update throughput.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans:batchMigratePrices", + // "httpMethod": "POST", + // "id": "androidpublisher.monetization.subscriptions.basePlans.batchMigratePrices", // "parameterOrder": [ // "packageName", // "productId" // ], // "parameters": { // "packageName": { - // "description": "Required. The parent app (package name) of the app of the subscription to delete.", + // "description": "Required. The parent app (package name) for which the subscriptions should be created or updated. Must be equal to the package_name field on all the Subscription resources.", // "location": "path", // "required": true, // "type": "string" // }, // "productId": { - // "description": "Required. The unique product ID of the subscription to delete.", + // "description": "Required. The product ID of the parent subscription, if all updated offers belong to the same subscription. If this batch update spans multiple subscriptions, set this field to \"-\". Must be set.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans:batchMigratePrices", + // "request": { + // "$ref": "BatchMigrateBasePlanPricesRequest" + // }, + // "response": { + // "$ref": "BatchMigrateBasePlanPricesResponse" + // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -17606,81 +20514,80 @@ func (c *MonetizationSubscriptionsDeleteCall) Do(opts ...googleapi.CallOption) e } -// method id "androidpublisher.monetization.subscriptions.get": +// method id "androidpublisher.monetization.subscriptions.basePlans.batchUpdateStates": -type MonetizationSubscriptionsGetCall struct { - s *Service - packageName string - productId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsBasePlansBatchUpdateStatesCall struct { + s *Service + packageName string + productId string + batchupdatebaseplanstatesrequest *BatchUpdateBasePlanStatesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Reads a single subscription. +// BatchUpdateStates: Activates or deactivates base plans across one or +// multiple subscriptions. Set the latencyTolerance field on nested +// requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to +// achieve maximum update throughput. // -// - packageName: The parent app (package name) of the subscription to -// get. -// - productId: The unique product ID of the subscription to get. -func (r *MonetizationSubscriptionsService) Get(packageName string, productId string) *MonetizationSubscriptionsGetCall { - c := &MonetizationSubscriptionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - packageName: The parent app (package name) of the updated base +// plans. +// - productId: The product ID of the parent subscription, if all +// updated base plans belong to the same subscription. If this batch +// update spans multiple subscriptions, set this field to "-". Must be +// set. +func (r *MonetizationSubscriptionsBasePlansService) BatchUpdateStates(packageName string, productId string, batchupdatebaseplanstatesrequest *BatchUpdateBasePlanStatesRequest) *MonetizationSubscriptionsBasePlansBatchUpdateStatesCall { + c := &MonetizationSubscriptionsBasePlansBatchUpdateStatesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.productId = productId + c.batchupdatebaseplanstatesrequest = batchupdatebaseplanstatesrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *MonetizationSubscriptionsGetCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsGetCall { +func (c *MonetizationSubscriptionsBasePlansBatchUpdateStatesCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansBatchUpdateStatesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *MonetizationSubscriptionsGetCall) IfNoneMatch(entityTag string) *MonetizationSubscriptionsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *MonetizationSubscriptionsGetCall) Context(ctx context.Context) *MonetizationSubscriptionsGetCall { +func (c *MonetizationSubscriptionsBasePlansBatchUpdateStatesCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansBatchUpdateStatesCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *MonetizationSubscriptionsGetCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansBatchUpdateStatesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MonetizationSubscriptionsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansBatchUpdateStatesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdatebaseplanstatesrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans:batchUpdateStates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -17692,14 +20599,15 @@ func (c *MonetizationSubscriptionsGetCall) doRequest(alt string) (*http.Response return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.monetization.subscriptions.get" call. -// Exactly one of *Subscription or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Subscription.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *MonetizationSubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*Subscription, error) { +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.batchUpdateStates" call. +// Exactly one of *BatchUpdateBasePlanStatesResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *BatchUpdateBasePlanStatesResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *MonetizationSubscriptionsBasePlansBatchUpdateStatesCall) Do(opts ...googleapi.CallOption) (*BatchUpdateBasePlanStatesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17718,7 +20626,7 @@ func (c *MonetizationSubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*Su if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Subscription{ + ret := &BatchUpdateBasePlanStatesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17730,31 +20638,34 @@ func (c *MonetizationSubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*Su } return ret, nil // { - // "description": "Reads a single subscription.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", - // "httpMethod": "GET", - // "id": "androidpublisher.monetization.subscriptions.get", + // "description": "Activates or deactivates base plans across one or multiple subscriptions. Set the latencyTolerance field on nested requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update throughput.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans:batchUpdateStates", + // "httpMethod": "POST", + // "id": "androidpublisher.monetization.subscriptions.basePlans.batchUpdateStates", // "parameterOrder": [ // "packageName", // "productId" // ], // "parameters": { // "packageName": { - // "description": "Required. The parent app (package name) of the subscription to get.", + // "description": "Required. The parent app (package name) of the updated base plans.", // "location": "path", // "required": true, // "type": "string" // }, // "productId": { - // "description": "Required. The unique product ID of the subscription to get.", + // "description": "Required. The product ID of the parent subscription, if all updated base plans belong to the same subscription. If this batch update spans multiple subscriptions, set this field to \"-\". Must be set.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans:batchUpdateStates", + // "request": { + // "$ref": "BatchUpdateBasePlanStatesRequest" + // }, // "response": { - // "$ref": "Subscription" + // "$ref": "BatchUpdateBasePlanStatesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -17763,123 +20674,100 @@ func (c *MonetizationSubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*Su } -// method id "androidpublisher.monetization.subscriptions.list": +// method id "androidpublisher.monetization.subscriptions.basePlans.deactivate": -type MonetizationSubscriptionsListCall struct { - s *Service - packageName string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsBasePlansDeactivateCall struct { + s *Service + packageName string + productId string + basePlanId string + deactivatebaseplanrequest *DeactivateBasePlanRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all subscriptions under a given app. +// Deactivate: Deactivates a base plan. Once deactivated, the base plan +// will become unavailable to new subscribers, but existing subscribers +// will maintain their subscription // -// - packageName: The parent app (package name) for which the -// subscriptions should be read. -func (r *MonetizationSubscriptionsService) List(packageName string) *MonetizationSubscriptionsListCall { - c := &MonetizationSubscriptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - basePlanId: The unique base plan ID of the base plan to deactivate. +// - packageName: The parent app (package name) of the base plan to +// deactivate. +// - productId: The parent subscription (ID) of the base plan to +// deactivate. +func (r *MonetizationSubscriptionsBasePlansService) Deactivate(packageName string, productId string, basePlanId string, deactivatebaseplanrequest *DeactivateBasePlanRequest) *MonetizationSubscriptionsBasePlansDeactivateCall { + c := &MonetizationSubscriptionsBasePlansDeactivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of subscriptions to return. The service may return fewer than this -// value. If unspecified, at most 50 subscriptions will be returned. The -// maximum value is 1000; values above 1000 will be coerced to 1000. -func (c *MonetizationSubscriptionsListCall) PageSize(pageSize int64) *MonetizationSubscriptionsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": A page token, -// received from a previous `ListSubscriptions` call. Provide this to -// retrieve the subsequent page. When paginating, all other parameters -// provided to `ListSubscriptions` must match the call that provided the -// page token. -func (c *MonetizationSubscriptionsListCall) PageToken(pageToken string) *MonetizationSubscriptionsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ShowArchived sets the optional parameter "showArchived": Whether -// archived subscriptions should be included in the response. Defaults -// to false. -func (c *MonetizationSubscriptionsListCall) ShowArchived(showArchived bool) *MonetizationSubscriptionsListCall { - c.urlParams_.Set("showArchived", fmt.Sprint(showArchived)) + c.productId = productId + c.basePlanId = basePlanId + c.deactivatebaseplanrequest = deactivatebaseplanrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *MonetizationSubscriptionsListCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsListCall { +func (c *MonetizationSubscriptionsBasePlansDeactivateCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansDeactivateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *MonetizationSubscriptionsListCall) IfNoneMatch(entityTag string) *MonetizationSubscriptionsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *MonetizationSubscriptionsListCall) Context(ctx context.Context) *MonetizationSubscriptionsListCall { +func (c *MonetizationSubscriptionsBasePlansDeactivateCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansDeactivateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *MonetizationSubscriptionsListCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansDeactivateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MonetizationSubscriptionsListCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansDeactivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.deactivatebaseplanrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:deactivate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, + "productId": c.productId, + "basePlanId": c.basePlanId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.monetization.subscriptions.list" call. -// Exactly one of *ListSubscriptionsResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *ListSubscriptionsResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *MonetizationSubscriptionsListCall) Do(opts ...googleapi.CallOption) (*ListSubscriptionsResponse, error) { +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.deactivate" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MonetizationSubscriptionsBasePlansDeactivateCall) Do(opts ...googleapi.CallOption) (*Subscription, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17898,7 +20786,7 @@ func (c *MonetizationSubscriptionsListCall) Do(opts ...googleapi.CallOption) (*L if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListSubscriptionsResponse{ + ret := &Subscription{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17910,40 +20798,41 @@ func (c *MonetizationSubscriptionsListCall) Do(opts ...googleapi.CallOption) (*L } return ret, nil // { - // "description": "Lists all subscriptions under a given app.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions", - // "httpMethod": "GET", - // "id": "androidpublisher.monetization.subscriptions.list", + // "description": "Deactivates a base plan. Once deactivated, the base plan will become unavailable to new subscribers, but existing subscribers will maintain their subscription", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:deactivate", + // "httpMethod": "POST", + // "id": "androidpublisher.monetization.subscriptions.basePlans.deactivate", // "parameterOrder": [ - // "packageName" + // "packageName", + // "productId", + // "basePlanId" // ], // "parameters": { - // "packageName": { - // "description": "Required. The parent app (package name) for which the subscriptions should be read.", + // "basePlanId": { + // "description": "Required. The unique base plan ID of the base plan to deactivate.", // "location": "path", // "required": true, // "type": "string" // }, - // "pageSize": { - // "description": "The maximum number of subscriptions to return. The service may return fewer than this value. If unspecified, at most 50 subscriptions will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "A page token, received from a previous `ListSubscriptions` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListSubscriptions` must match the call that provided the page token.", - // "location": "query", + // "packageName": { + // "description": "Required. The parent app (package name) of the base plan to deactivate.", + // "location": "path", + // "required": true, // "type": "string" // }, - // "showArchived": { - // "description": "Whether archived subscriptions should be included in the response. Defaults to false.", - // "location": "query", - // "type": "boolean" + // "productId": { + // "description": "Required. The parent subscription (ID) of the base plan to deactivate.", + // "location": "path", + // "required": true, + // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/subscriptions", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:deactivate", + // "request": { + // "$ref": "DeactivateBasePlanRequest" + // }, // "response": { - // "$ref": "ListSubscriptionsResponse" + // "$ref": "Subscription" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -17952,82 +20841,37 @@ func (c *MonetizationSubscriptionsListCall) Do(opts ...googleapi.CallOption) (*L } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *MonetizationSubscriptionsListCall) Pages(ctx context.Context, f func(*ListSubscriptionsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "androidpublisher.monetization.subscriptions.patch": +// method id "androidpublisher.monetization.subscriptions.basePlans.delete": -type MonetizationSubscriptionsPatchCall struct { - s *Service - packageName string - productId string - subscription *Subscription - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsBasePlansDeleteCall struct { + s *Service + packageName string + productId string + basePlanId string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates an existing subscription. +// Delete: Deletes a base plan. Can only be done for draft base plans. +// This action is irreversible. // -// - packageName: Immutable. Package name of the parent app. -// - productId: Immutable. Unique product ID of the product. Unique -// within the parent app. Product IDs must be composed of lower-case -// letters (a-z), numbers (0-9), underscores (_) and dots (.). It must -// start with a lower-case letter or number, and be between 1 and 40 -// (inclusive) characters in length. -func (r *MonetizationSubscriptionsService) Patch(packageName string, productId string, subscription *Subscription) *MonetizationSubscriptionsPatchCall { - c := &MonetizationSubscriptionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - basePlanId: The unique offer ID of the base plan to delete. +// - packageName: The parent app (package name) of the base plan to +// delete. +// - productId: The parent subscription (ID) of the base plan to delete. +func (r *MonetizationSubscriptionsBasePlansService) Delete(packageName string, productId string, basePlanId string) *MonetizationSubscriptionsBasePlansDeleteCall { + c := &MonetizationSubscriptionsBasePlansDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.productId = productId - c.subscription = subscription - return c -} - -// RegionsVersionVersion sets the optional parameter -// "regionsVersion.version": Required. A string representing the version -// of available regions being used for the specified resource. Regional -// prices for the resource have to be specified according to the -// information published in this article -// (https://support.google.com/googleplay/android-developer/answer/10532353). -// Each time the supported locations substantially change, the version -// will be incremented. Using this field will ensure that creating and -// updating the resource with an older region's version and set of -// regional prices and currencies will succeed even though a new version -// is available. The latest version is 2022/02. -func (c *MonetizationSubscriptionsPatchCall) RegionsVersionVersion(regionsVersionVersion string) *MonetizationSubscriptionsPatchCall { - c.urlParams_.Set("regionsVersion.version", regionsVersionVersion) - return c -} - -// UpdateMask sets the optional parameter "updateMask": Required. The -// list of fields to be updated. -func (c *MonetizationSubscriptionsPatchCall) UpdateMask(updateMask string) *MonetizationSubscriptionsPatchCall { - c.urlParams_.Set("updateMask", updateMask) + c.productId = productId + c.basePlanId = basePlanId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *MonetizationSubscriptionsPatchCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsPatchCall { +func (c *MonetizationSubscriptionsBasePlansDeleteCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18035,21 +20879,21 @@ func (c *MonetizationSubscriptionsPatchCall) Fields(s ...googleapi.Field) *Monet // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *MonetizationSubscriptionsPatchCall) Context(ctx context.Context) *MonetizationSubscriptionsPatchCall { +func (c *MonetizationSubscriptionsBasePlansDeleteCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *MonetizationSubscriptionsPatchCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MonetizationSubscriptionsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18057,16 +20901,11 @@ func (c *MonetizationSubscriptionsPatchCall) doRequest(alt string) (*http.Respon } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -18074,88 +20913,54 @@ func (c *MonetizationSubscriptionsPatchCall) doRequest(alt string) (*http.Respon googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "productId": c.productId, + "basePlanId": c.basePlanId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.monetization.subscriptions.patch" call. -// Exactly one of *Subscription or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Subscription.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *MonetizationSubscriptionsPatchCall) Do(opts ...googleapi.CallOption) (*Subscription, error) { +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.delete" call. +func (c *MonetizationSubscriptionsBasePlansDeleteCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } if err != nil { - return nil, err + return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &Subscription{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err + return gensupport.WrapError(err) } - return ret, nil + return nil // { - // "description": "Updates an existing subscription.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", - // "httpMethod": "PATCH", - // "id": "androidpublisher.monetization.subscriptions.patch", + // "description": "Deletes a base plan. Can only be done for draft base plans. This action is irreversible.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}", + // "httpMethod": "DELETE", + // "id": "androidpublisher.monetization.subscriptions.basePlans.delete", // "parameterOrder": [ // "packageName", - // "productId" + // "productId", + // "basePlanId" // ], // "parameters": { - // "packageName": { - // "description": "Immutable. Package name of the parent app.", + // "basePlanId": { + // "description": "Required. The unique offer ID of the base plan to delete.", // "location": "path", // "required": true, // "type": "string" // }, - // "productId": { - // "description": "Immutable. Unique product ID of the product. Unique within the parent app. Product IDs must be composed of lower-case letters (a-z), numbers (0-9), underscores (_) and dots (.). It must start with a lower-case letter or number, and be between 1 and 40 (inclusive) characters in length.", + // "packageName": { + // "description": "Required. The parent app (package name) of the base plan to delete.", // "location": "path", // "required": true, // "type": "string" // }, - // "regionsVersion.version": { - // "description": "Required. A string representing the version of available regions being used for the specified resource. Regional prices for the resource have to be specified according to the information published in [this article](https://support.google.com/googleplay/android-developer/answer/10532353). Each time the supported locations substantially change, the version will be incremented. Using this field will ensure that creating and updating the resource with an older region's version and set of regional prices and currencies will succeed even though a new version is available. The latest version is 2022/02.", - // "location": "query", - // "type": "string" - // }, - // "updateMask": { - // "description": "Required. The list of fields to be updated.", - // "format": "google-fieldmask", - // "location": "query", + // "productId": { + // "description": "Required. The parent subscription (ID) of the base plan to delete.", + // "location": "path", + // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", - // "request": { - // "$ref": "Subscription" - // }, - // "response": { - // "$ref": "Subscription" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -18163,40 +20968,45 @@ func (c *MonetizationSubscriptionsPatchCall) Do(opts ...googleapi.CallOption) (* } -// method id "androidpublisher.monetization.subscriptions.basePlans.activate": +// method id "androidpublisher.monetization.subscriptions.basePlans.migratePrices": -type MonetizationSubscriptionsBasePlansActivateCall struct { - s *Service - packageName string - productId string - basePlanId string - activatebaseplanrequest *ActivateBasePlanRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsBasePlansMigratePricesCall struct { + s *Service + packageName string + productId string + basePlanId string + migratebaseplanpricesrequest *MigrateBasePlanPricesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Activate: Activates a base plan. Once activated, base plans will be -// available to new subscribers. +// MigratePrices: Migrates subscribers who are receiving an historical +// subscription price to the currently-offered price for the specified +// region. Requests will cause price change notifications to be sent to +// users who are currently receiving an historical price older than the +// supplied timestamp. Subscribers who do not agree to the new price +// will have their subscription ended at the next renewal. // -// - basePlanId: The unique base plan ID of the base plan to activate. -// - packageName: The parent app (package name) of the base plan to -// activate. -// - productId: The parent subscription (ID) of the base plan to -// activate. -func (r *MonetizationSubscriptionsBasePlansService) Activate(packageName string, productId string, basePlanId string, activatebaseplanrequest *ActivateBasePlanRequest) *MonetizationSubscriptionsBasePlansActivateCall { - c := &MonetizationSubscriptionsBasePlansActivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - basePlanId: The unique base plan ID of the base plan to update +// prices on. +// - packageName: Package name of the parent app. Must be equal to the +// package_name field on the Subscription resource. +// - productId: The ID of the subscription to update. Must be equal to +// the product_id field on the Subscription resource. +func (r *MonetizationSubscriptionsBasePlansService) MigratePrices(packageName string, productId string, basePlanId string, migratebaseplanpricesrequest *MigrateBasePlanPricesRequest) *MonetizationSubscriptionsBasePlansMigratePricesCall { + c := &MonetizationSubscriptionsBasePlansMigratePricesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.productId = productId c.basePlanId = basePlanId - c.activatebaseplanrequest = activatebaseplanrequest + c.migratebaseplanpricesrequest = migratebaseplanpricesrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *MonetizationSubscriptionsBasePlansActivateCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansActivateCall { +func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansMigratePricesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18204,21 +21014,21 @@ func (c *MonetizationSubscriptionsBasePlansActivateCall) Fields(s ...googleapi.F // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *MonetizationSubscriptionsBasePlansActivateCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansActivateCall { +func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansMigratePricesCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *MonetizationSubscriptionsBasePlansActivateCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MonetizationSubscriptionsBasePlansActivateCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18226,14 +21036,14 @@ func (c *MonetizationSubscriptionsBasePlansActivateCall) doRequest(alt string) ( } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.activatebaseplanrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.migratebaseplanpricesrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:activate") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:migratePrices") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -18248,14 +21058,14 @@ func (c *MonetizationSubscriptionsBasePlansActivateCall) doRequest(alt string) ( return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.monetization.subscriptions.basePlans.activate" call. -// Exactly one of *Subscription or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Subscription.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *MonetizationSubscriptionsBasePlansActivateCall) Do(opts ...googleapi.CallOption) (*Subscription, error) { +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.migratePrices" call. +// Exactly one of *MigrateBasePlanPricesResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *MigrateBasePlanPricesResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) Do(opts ...googleapi.CallOption) (*MigrateBasePlanPricesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18274,7 +21084,7 @@ func (c *MonetizationSubscriptionsBasePlansActivateCall) Do(opts ...googleapi.Ca if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Subscription{ + ret := &MigrateBasePlanPricesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18286,10 +21096,10 @@ func (c *MonetizationSubscriptionsBasePlansActivateCall) Do(opts ...googleapi.Ca } return ret, nil // { - // "description": "Activates a base plan. Once activated, base plans will be available to new subscribers.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:activate", + // "description": "Migrates subscribers who are receiving an historical subscription price to the currently-offered price for the specified region. Requests will cause price change notifications to be sent to users who are currently receiving an historical price older than the supplied timestamp. Subscribers who do not agree to the new price will have their subscription ended at the next renewal.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:migratePrices", // "httpMethod": "POST", - // "id": "androidpublisher.monetization.subscriptions.basePlans.activate", + // "id": "androidpublisher.monetization.subscriptions.basePlans.migratePrices", // "parameterOrder": [ // "packageName", // "productId", @@ -18297,30 +21107,30 @@ func (c *MonetizationSubscriptionsBasePlansActivateCall) Do(opts ...googleapi.Ca // ], // "parameters": { // "basePlanId": { - // "description": "Required. The unique base plan ID of the base plan to activate.", + // "description": "Required. The unique base plan ID of the base plan to update prices on.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { - // "description": "Required. The parent app (package name) of the base plan to activate.", + // "description": "Required. Package name of the parent app. Must be equal to the package_name field on the Subscription resource.", // "location": "path", // "required": true, // "type": "string" // }, // "productId": { - // "description": "Required. The parent subscription (ID) of the base plan to activate.", + // "description": "Required. The ID of the subscription to update. Must be equal to the product_id field on the Subscription resource.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:activate", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:migratePrices", // "request": { - // "$ref": "ActivateBasePlanRequest" + // "$ref": "MigrateBasePlanPricesRequest" // }, // "response": { - // "$ref": "Subscription" + // "$ref": "MigrateBasePlanPricesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -18329,41 +21139,42 @@ func (c *MonetizationSubscriptionsBasePlansActivateCall) Do(opts ...googleapi.Ca } -// method id "androidpublisher.monetization.subscriptions.basePlans.deactivate": +// method id "androidpublisher.monetization.subscriptions.basePlans.offers.activate": -type MonetizationSubscriptionsBasePlansDeactivateCall struct { - s *Service - packageName string - productId string - basePlanId string - deactivatebaseplanrequest *DeactivateBasePlanRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsBasePlansOffersActivateCall struct { + s *Service + packageName string + productId string + basePlanId string + offerId string + activatesubscriptionofferrequest *ActivateSubscriptionOfferRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Deactivate: Deactivates a base plan. Once deactivated, the base plan -// will become unavailable to new subscribers, but existing subscribers -// will maintain their subscription +// Activate: Activates a subscription offer. Once activated, +// subscription offers will be available to new subscribers. // -// - basePlanId: The unique base plan ID of the base plan to deactivate. -// - packageName: The parent app (package name) of the base plan to -// deactivate. -// - productId: The parent subscription (ID) of the base plan to -// deactivate. -func (r *MonetizationSubscriptionsBasePlansService) Deactivate(packageName string, productId string, basePlanId string, deactivatebaseplanrequest *DeactivateBasePlanRequest) *MonetizationSubscriptionsBasePlansDeactivateCall { - c := &MonetizationSubscriptionsBasePlansDeactivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - basePlanId: The parent base plan (ID) of the offer to activate. +// - offerId: The unique offer ID of the offer to activate. +// - packageName: The parent app (package name) of the offer to +// activate. +// - productId: The parent subscription (ID) of the offer to activate. +func (r *MonetizationSubscriptionsBasePlansOffersService) Activate(packageName string, productId string, basePlanId string, offerId string, activatesubscriptionofferrequest *ActivateSubscriptionOfferRequest) *MonetizationSubscriptionsBasePlansOffersActivateCall { + c := &MonetizationSubscriptionsBasePlansOffersActivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.productId = productId c.basePlanId = basePlanId - c.deactivatebaseplanrequest = deactivatebaseplanrequest + c.offerId = offerId + c.activatesubscriptionofferrequest = activatesubscriptionofferrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *MonetizationSubscriptionsBasePlansDeactivateCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansDeactivateCall { +func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansOffersActivateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18371,21 +21182,21 @@ func (c *MonetizationSubscriptionsBasePlansDeactivateCall) Fields(s ...googleapi // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *MonetizationSubscriptionsBasePlansDeactivateCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansDeactivateCall { +func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansOffersActivateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *MonetizationSubscriptionsBasePlansDeactivateCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MonetizationSubscriptionsBasePlansDeactivateCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18393,14 +21204,14 @@ func (c *MonetizationSubscriptionsBasePlansDeactivateCall) doRequest(alt string) } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.deactivatebaseplanrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.activatesubscriptionofferrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:deactivate") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:activate") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -18410,19 +21221,20 @@ func (c *MonetizationSubscriptionsBasePlansDeactivateCall) doRequest(alt string) googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "productId": c.productId, - "basePlanId": c.basePlanId, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "androidpublisher.monetization.subscriptions.basePlans.deactivate" call. -// Exactly one of *Subscription or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Subscription.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *MonetizationSubscriptionsBasePlansDeactivateCall) Do(opts ...googleapi.CallOption) (*Subscription, error) { + "basePlanId": c.basePlanId, + "offerId": c.offerId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.offers.activate" call. +// Exactly one of *SubscriptionOffer or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SubscriptionOffer.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) Do(opts ...googleapi.CallOption) (*SubscriptionOffer, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18441,7 +21253,7 @@ func (c *MonetizationSubscriptionsBasePlansDeactivateCall) Do(opts ...googleapi. if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Subscription{ + ret := &SubscriptionOffer{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18453,41 +21265,48 @@ func (c *MonetizationSubscriptionsBasePlansDeactivateCall) Do(opts ...googleapi. } return ret, nil // { - // "description": "Deactivates a base plan. Once deactivated, the base plan will become unavailable to new subscribers, but existing subscribers will maintain their subscription", - // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:deactivate", + // "description": "Activates a subscription offer. Once activated, subscription offers will be available to new subscribers.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:activate", // "httpMethod": "POST", - // "id": "androidpublisher.monetization.subscriptions.basePlans.deactivate", + // "id": "androidpublisher.monetization.subscriptions.basePlans.offers.activate", // "parameterOrder": [ // "packageName", // "productId", - // "basePlanId" + // "basePlanId", + // "offerId" // ], // "parameters": { // "basePlanId": { - // "description": "Required. The unique base plan ID of the base plan to deactivate.", + // "description": "Required. The parent base plan (ID) of the offer to activate.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "offerId": { + // "description": "Required. The unique offer ID of the offer to activate.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { - // "description": "Required. The parent app (package name) of the base plan to deactivate.", + // "description": "Required. The parent app (package name) of the offer to activate.", // "location": "path", // "required": true, // "type": "string" // }, // "productId": { - // "description": "Required. The parent subscription (ID) of the base plan to deactivate.", + // "description": "Required. The parent subscription (ID) of the offer to activate.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:deactivate", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:activate", // "request": { - // "$ref": "DeactivateBasePlanRequest" + // "$ref": "ActivateSubscriptionOfferRequest" // }, // "response": { - // "$ref": "Subscription" + // "$ref": "SubscriptionOffer" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -18496,37 +21315,43 @@ func (c *MonetizationSubscriptionsBasePlansDeactivateCall) Do(opts ...googleapi. } -// method id "androidpublisher.monetization.subscriptions.basePlans.delete": +// method id "androidpublisher.monetization.subscriptions.basePlans.offers.batchGet": -type MonetizationSubscriptionsBasePlansDeleteCall struct { - s *Service - packageName string - productId string - basePlanId string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsBasePlansOffersBatchGetCall struct { + s *Service + packageName string + productId string + basePlanId string + batchgetsubscriptionoffersrequest *BatchGetSubscriptionOffersRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a base plan. Can only be done for draft base plans. -// This action is irreversible. +// BatchGet: Reads one or more subscription offers. // -// - basePlanId: The unique offer ID of the base plan to delete. -// - packageName: The parent app (package name) of the base plan to -// delete. -// - productId: The parent subscription (ID) of the base plan to delete. -func (r *MonetizationSubscriptionsBasePlansService) Delete(packageName string, productId string, basePlanId string) *MonetizationSubscriptionsBasePlansDeleteCall { - c := &MonetizationSubscriptionsBasePlansDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - basePlanId: The parent base plan (ID) for which the offers should +// be read. May be specified as '-' to read offers from multiple base +// plans. +// - packageName: The parent app (package name) for which the +// subscriptions should be created or updated. Must be equal to the +// package_name field on all the requests. +// - productId: The product ID of the parent subscription, if all +// updated offers belong to the same subscription. If this request +// spans multiple subscriptions, set this field to "-". Must be set. +func (r *MonetizationSubscriptionsBasePlansOffersService) BatchGet(packageName string, productId string, basePlanId string, batchgetsubscriptionoffersrequest *BatchGetSubscriptionOffersRequest) *MonetizationSubscriptionsBasePlansOffersBatchGetCall { + c := &MonetizationSubscriptionsBasePlansOffersBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.productId = productId c.basePlanId = basePlanId + c.batchgetsubscriptionoffersrequest = batchgetsubscriptionoffersrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *MonetizationSubscriptionsBasePlansDeleteCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansDeleteCall { +func (c *MonetizationSubscriptionsBasePlansOffersBatchGetCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansOffersBatchGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18534,21 +21359,21 @@ func (c *MonetizationSubscriptionsBasePlansDeleteCall) Fields(s ...googleapi.Fie // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *MonetizationSubscriptionsBasePlansDeleteCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansDeleteCall { +func (c *MonetizationSubscriptionsBasePlansOffersBatchGetCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansOffersBatchGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *MonetizationSubscriptionsBasePlansDeleteCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansOffersBatchGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MonetizationSubscriptionsBasePlansDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansOffersBatchGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18556,11 +21381,16 @@ func (c *MonetizationSubscriptionsBasePlansDeleteCall) doRequest(alt string) (*h } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchgetsubscriptionoffersrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers:batchGet") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -18573,23 +21403,49 @@ func (c *MonetizationSubscriptionsBasePlansDeleteCall) doRequest(alt string) (*h return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.monetization.subscriptions.basePlans.delete" call. -func (c *MonetizationSubscriptionsBasePlansDeleteCall) Do(opts ...googleapi.CallOption) error { +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.offers.batchGet" call. +// Exactly one of *BatchGetSubscriptionOffersResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *BatchGetSubscriptionOffersResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *MonetizationSubscriptionsBasePlansOffersBatchGetCall) Do(opts ...googleapi.CallOption) (*BatchGetSubscriptionOffersResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } if err != nil { - return err + return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return gensupport.WrapError(err) + return nil, gensupport.WrapError(err) } - return nil + ret := &BatchGetSubscriptionOffersResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil // { - // "description": "Deletes a base plan. Can only be done for draft base plans. This action is irreversible.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}", - // "httpMethod": "DELETE", - // "id": "androidpublisher.monetization.subscriptions.basePlans.delete", + // "description": "Reads one or more subscription offers.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers:batchGet", + // "httpMethod": "POST", + // "id": "androidpublisher.monetization.subscriptions.basePlans.offers.batchGet", // "parameterOrder": [ // "packageName", // "productId", @@ -18597,25 +21453,31 @@ func (c *MonetizationSubscriptionsBasePlansDeleteCall) Do(opts ...googleapi.Call // ], // "parameters": { // "basePlanId": { - // "description": "Required. The unique offer ID of the base plan to delete.", + // "description": "Required. The parent base plan (ID) for which the offers should be read. May be specified as '-' to read offers from multiple base plans.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { - // "description": "Required. The parent app (package name) of the base plan to delete.", + // "description": "Required. The parent app (package name) for which the subscriptions should be created or updated. Must be equal to the package_name field on all the requests.", // "location": "path", // "required": true, // "type": "string" // }, // "productId": { - // "description": "Required. The parent subscription (ID) of the base plan to delete.", + // "description": "Required. The product ID of the parent subscription, if all updated offers belong to the same subscription. If this request spans multiple subscriptions, set this field to \"-\". Must be set.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers:batchGet", + // "request": { + // "$ref": "BatchGetSubscriptionOffersRequest" + // }, + // "response": { + // "$ref": "BatchGetSubscriptionOffersResponse" + // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -18623,45 +21485,46 @@ func (c *MonetizationSubscriptionsBasePlansDeleteCall) Do(opts ...googleapi.Call } -// method id "androidpublisher.monetization.subscriptions.basePlans.migratePrices": +// method id "androidpublisher.monetization.subscriptions.basePlans.offers.batchUpdate": -type MonetizationSubscriptionsBasePlansMigratePricesCall struct { - s *Service - packageName string - productId string - basePlanId string - migratebaseplanpricesrequest *MigrateBasePlanPricesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsBasePlansOffersBatchUpdateCall struct { + s *Service + packageName string + productId string + basePlanId string + batchupdatesubscriptionoffersrequest *BatchUpdateSubscriptionOffersRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// MigratePrices: Migrates subscribers who are receiving an historical -// subscription price to the currently-offered price for the specified -// region. Requests will cause price change notifications to be sent to -// users who are currently receiving an historical price older than the -// supplied timestamp. Subscribers who do not agree to the new price -// will have their subscription ended at the next renewal. +// BatchUpdate: Updates a batch of subscription offers. Set the +// latencyTolerance field on nested requests to +// PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum +// update throughput. // -// - basePlanId: The unique base plan ID of the base plan to update -// prices on. -// - packageName: Package name of the parent app. Must be equal to the -// package_name field on the Subscription resource. -// - productId: The ID of the subscription to update. Must be equal to -// the product_id field on the Subscription resource. -func (r *MonetizationSubscriptionsBasePlansService) MigratePrices(packageName string, productId string, basePlanId string, migratebaseplanpricesrequest *MigrateBasePlanPricesRequest) *MonetizationSubscriptionsBasePlansMigratePricesCall { - c := &MonetizationSubscriptionsBasePlansMigratePricesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - basePlanId: The parent base plan (ID) for which the offers should +// be updated. May be specified as '-' to update offers from multiple +// base plans. +// - packageName: The parent app (package name) of the updated +// subscription offers. Must be equal to the package_name field on all +// the updated SubscriptionOffer resources. +// - productId: The product ID of the parent subscription, if all +// updated offers belong to the same subscription. If this request +// spans multiple subscriptions, set this field to "-". Must be set. +func (r *MonetizationSubscriptionsBasePlansOffersService) BatchUpdate(packageName string, productId string, basePlanId string, batchupdatesubscriptionoffersrequest *BatchUpdateSubscriptionOffersRequest) *MonetizationSubscriptionsBasePlansOffersBatchUpdateCall { + c := &MonetizationSubscriptionsBasePlansOffersBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.productId = productId c.basePlanId = basePlanId - c.migratebaseplanpricesrequest = migratebaseplanpricesrequest + c.batchupdatesubscriptionoffersrequest = batchupdatesubscriptionoffersrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansMigratePricesCall { +func (c *MonetizationSubscriptionsBasePlansOffersBatchUpdateCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansOffersBatchUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18669,21 +21532,21 @@ func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) Fields(s ...google // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansMigratePricesCall { +func (c *MonetizationSubscriptionsBasePlansOffersBatchUpdateCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansOffersBatchUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansOffersBatchUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansOffersBatchUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18691,14 +21554,14 @@ func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) doRequest(alt stri } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.migratebaseplanpricesrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdatesubscriptionoffersrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:migratePrices") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers:batchUpdate") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -18713,14 +21576,15 @@ func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) doRequest(alt stri return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.monetization.subscriptions.basePlans.migratePrices" call. -// Exactly one of *MigrateBasePlanPricesResponse or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *MigrateBasePlanPricesResponse.ServerResponse.Header or (if a +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.offers.batchUpdate" call. +// Exactly one of *BatchUpdateSubscriptionOffersResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *BatchUpdateSubscriptionOffersResponse.ServerResponse.Header or (if a // response was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) Do(opts ...googleapi.CallOption) (*MigrateBasePlanPricesResponse, error) { +func (c *MonetizationSubscriptionsBasePlansOffersBatchUpdateCall) Do(opts ...googleapi.CallOption) (*BatchUpdateSubscriptionOffersResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18739,7 +21603,7 @@ func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) Do(opts ...googlea if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &MigrateBasePlanPricesResponse{ + ret := &BatchUpdateSubscriptionOffersResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18751,10 +21615,10 @@ func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) Do(opts ...googlea } return ret, nil // { - // "description": "Migrates subscribers who are receiving an historical subscription price to the currently-offered price for the specified region. Requests will cause price change notifications to be sent to users who are currently receiving an historical price older than the supplied timestamp. Subscribers who do not agree to the new price will have their subscription ended at the next renewal.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:migratePrices", + // "description": "Updates a batch of subscription offers. Set the latencyTolerance field on nested requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update throughput.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers:batchUpdate", // "httpMethod": "POST", - // "id": "androidpublisher.monetization.subscriptions.basePlans.migratePrices", + // "id": "androidpublisher.monetization.subscriptions.basePlans.offers.batchUpdate", // "parameterOrder": [ // "packageName", // "productId", @@ -18762,30 +21626,30 @@ func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) Do(opts ...googlea // ], // "parameters": { // "basePlanId": { - // "description": "Required. The unique base plan ID of the base plan to update prices on.", + // "description": "Required. The parent base plan (ID) for which the offers should be updated. May be specified as '-' to update offers from multiple base plans.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { - // "description": "Required. Package name of the parent app. Must be equal to the package_name field on the Subscription resource.", + // "description": "Required. The parent app (package name) of the updated subscription offers. Must be equal to the package_name field on all the updated SubscriptionOffer resources.", // "location": "path", // "required": true, // "type": "string" // }, // "productId": { - // "description": "Required. The ID of the subscription to update. Must be equal to the product_id field on the Subscription resource.", + // "description": "Required. The product ID of the parent subscription, if all updated offers belong to the same subscription. If this request spans multiple subscriptions, set this field to \"-\". Must be set.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:migratePrices", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers:batchUpdate", // "request": { - // "$ref": "MigrateBasePlanPricesRequest" + // "$ref": "BatchUpdateSubscriptionOffersRequest" // }, // "response": { - // "$ref": "MigrateBasePlanPricesResponse" + // "$ref": "BatchUpdateSubscriptionOffersResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -18794,42 +21658,46 @@ func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) Do(opts ...googlea } -// method id "androidpublisher.monetization.subscriptions.basePlans.offers.activate": +// method id "androidpublisher.monetization.subscriptions.basePlans.offers.batchUpdateStates": -type MonetizationSubscriptionsBasePlansOffersActivateCall struct { - s *Service - packageName string - productId string - basePlanId string - offerId string - activatesubscriptionofferrequest *ActivateSubscriptionOfferRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsBasePlansOffersBatchUpdateStatesCall struct { + s *Service + packageName string + productId string + basePlanId string + batchupdatesubscriptionofferstatesrequest *BatchUpdateSubscriptionOfferStatesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Activate: Activates a subscription offer. Once activated, -// subscription offers will be available to new subscribers. +// BatchUpdateStates: Updates a batch of subscription offer states. Set +// the latencyTolerance field on nested requests to +// PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum +// update throughput. // -// - basePlanId: The parent base plan (ID) of the offer to activate. -// - offerId: The unique offer ID of the offer to activate. -// - packageName: The parent app (package name) of the offer to -// activate. -// - productId: The parent subscription (ID) of the offer to activate. -func (r *MonetizationSubscriptionsBasePlansOffersService) Activate(packageName string, productId string, basePlanId string, offerId string, activatesubscriptionofferrequest *ActivateSubscriptionOfferRequest) *MonetizationSubscriptionsBasePlansOffersActivateCall { - c := &MonetizationSubscriptionsBasePlansOffersActivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - basePlanId: The parent base plan (ID) for which the offers should +// be updated. May be specified as '-' to update offers from multiple +// base plans. +// - packageName: The parent app (package name) of the updated +// subscription offers. Must be equal to the package_name field on all +// the updated SubscriptionOffer resources. +// - productId: The product ID of the parent subscription, if all +// updated offers belong to the same subscription. If this request +// spans multiple subscriptions, set this field to "-". Must be set. +func (r *MonetizationSubscriptionsBasePlansOffersService) BatchUpdateStates(packageName string, productId string, basePlanId string, batchupdatesubscriptionofferstatesrequest *BatchUpdateSubscriptionOfferStatesRequest) *MonetizationSubscriptionsBasePlansOffersBatchUpdateStatesCall { + c := &MonetizationSubscriptionsBasePlansOffersBatchUpdateStatesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.productId = productId c.basePlanId = basePlanId - c.offerId = offerId - c.activatesubscriptionofferrequest = activatesubscriptionofferrequest + c.batchupdatesubscriptionofferstatesrequest = batchupdatesubscriptionofferstatesrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansOffersActivateCall { +func (c *MonetizationSubscriptionsBasePlansOffersBatchUpdateStatesCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansOffersBatchUpdateStatesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18837,21 +21705,21 @@ func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) Fields(s ...googl // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansOffersActivateCall { +func (c *MonetizationSubscriptionsBasePlansOffersBatchUpdateStatesCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansOffersBatchUpdateStatesCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansOffersBatchUpdateStatesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansOffersBatchUpdateStatesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18859,14 +21727,14 @@ func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) doRequest(alt str } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.activatesubscriptionofferrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdatesubscriptionofferstatesrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:activate") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers:batchUpdateStates") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -18877,19 +21745,20 @@ func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) doRequest(alt str "packageName": c.packageName, "productId": c.productId, "basePlanId": c.basePlanId, - "offerId": c.offerId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.monetization.subscriptions.basePlans.offers.activate" call. -// Exactly one of *SubscriptionOffer or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *SubscriptionOffer.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) Do(opts ...googleapi.CallOption) (*SubscriptionOffer, error) { +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.offers.batchUpdateStates" call. +// Exactly one of *BatchUpdateSubscriptionOfferStatesResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *BatchUpdateSubscriptionOfferStatesResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *MonetizationSubscriptionsBasePlansOffersBatchUpdateStatesCall) Do(opts ...googleapi.CallOption) (*BatchUpdateSubscriptionOfferStatesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18908,7 +21777,7 @@ func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) Do(opts ...google if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &SubscriptionOffer{ + ret := &BatchUpdateSubscriptionOfferStatesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18920,48 +21789,41 @@ func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) Do(opts ...google } return ret, nil // { - // "description": "Activates a subscription offer. Once activated, subscription offers will be available to new subscribers.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:activate", + // "description": "Updates a batch of subscription offer states. Set the latencyTolerance field on nested requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update throughput.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers:batchUpdateStates", // "httpMethod": "POST", - // "id": "androidpublisher.monetization.subscriptions.basePlans.offers.activate", + // "id": "androidpublisher.monetization.subscriptions.basePlans.offers.batchUpdateStates", // "parameterOrder": [ // "packageName", // "productId", - // "basePlanId", - // "offerId" + // "basePlanId" // ], // "parameters": { // "basePlanId": { - // "description": "Required. The parent base plan (ID) of the offer to activate.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "offerId": { - // "description": "Required. The unique offer ID of the offer to activate.", + // "description": "Required. The parent base plan (ID) for which the offers should be updated. May be specified as '-' to update offers from multiple base plans.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { - // "description": "Required. The parent app (package name) of the offer to activate.", + // "description": "Required. The parent app (package name) of the updated subscription offers. Must be equal to the package_name field on all the updated SubscriptionOffer resources.", // "location": "path", // "required": true, // "type": "string" // }, // "productId": { - // "description": "Required. The parent subscription (ID) of the offer to activate.", + // "description": "Required. The product ID of the parent subscription, if all updated offers belong to the same subscription. If this request spans multiple subscriptions, set this field to \"-\". Must be set.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:activate", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers:batchUpdateStates", // "request": { - // "$ref": "ActivateSubscriptionOfferRequest" + // "$ref": "BatchUpdateSubscriptionOfferStatesRequest" // }, // "response": { - // "$ref": "SubscriptionOffer" + // "$ref": "BatchUpdateSubscriptionOfferStatesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -19925,6 +22787,41 @@ func (r *MonetizationSubscriptionsBasePlansOffersService) Patch(packageName stri return c } +// AllowMissing sets the optional parameter "allowMissing": If set to +// true, and the subscription offer with the given package_name, +// product_id, base_plan_id and offer_id doesn't exist, an offer will be +// created. If a new offer is created, update_mask is ignored. +func (c *MonetizationSubscriptionsBasePlansOffersPatchCall) AllowMissing(allowMissing bool) *MonetizationSubscriptionsBasePlansOffersPatchCall { + c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) + return c +} + +// LatencyTolerance sets the optional parameter "latencyTolerance": The +// latency tolerance for the propagation of this product update. +// Defaults to latency-sensitive. +// +// Possible values: +// +// "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" - Defaults to +// +// PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE. +// +// "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" - The update +// +// will propagate to clients within several minutes on average and up to +// a few hours in rare cases. Throughput is limited to 7,200 updates per +// app per hour. +// +// "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" - The update +// +// will propagate to clients within 24 hours. Supports high throughput +// of up to 720,000 updates per app per hour using batch modification +// methods. +func (c *MonetizationSubscriptionsBasePlansOffersPatchCall) LatencyTolerance(latencyTolerance string) *MonetizationSubscriptionsBasePlansOffersPatchCall { + c.urlParams_.Set("latencyTolerance", latencyTolerance) + return c +} + // RegionsVersionVersion sets the optional parameter // "regionsVersion.version": Required. A string representing the version // of available regions being used for the specified resource. Regional @@ -20053,12 +22950,32 @@ func (c *MonetizationSubscriptionsBasePlansOffersPatchCall) Do(opts ...googleapi // "offerId" // ], // "parameters": { + // "allowMissing": { + // "description": "Optional. If set to true, and the subscription offer with the given package_name, product_id, base_plan_id and offer_id doesn't exist, an offer will be created. If a new offer is created, update_mask is ignored.", + // "location": "query", + // "type": "boolean" + // }, // "basePlanId": { // "description": "Required. Immutable. The ID of the base plan to which this offer is an extension.", // "location": "path", // "required": true, // "type": "string" // }, + // "latencyTolerance": { + // "description": "Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.", + // "enum": [ + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED", + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE", + // "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" + // ], + // "enumDescriptions": [ + // "Defaults to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE.", + // "The update will propagate to clients within several minutes on average and up to a few hours in rare cases. Throughput is limited to 7,200 updates per app per hour.", + // "The update will propagate to clients within 24 hours. Supports high throughput of up to 720,000 updates per app per hour using batch modification methods." + // ], + // "location": "query", + // "type": "string" + // }, // "offerId": { // "description": "Required. Immutable. Unique ID of this subscription offer. Must be unique within the base plan.", // "location": "path", diff --git a/cloudbilling/v1/cloudbilling-api.json b/cloudbilling/v1/cloudbilling-api.json index 9650aa9e47f..ae56a36c80b 100644 --- a/cloudbilling/v1/cloudbilling-api.json +++ b/cloudbilling/v1/cloudbilling-api.json @@ -121,7 +121,7 @@ "parameterOrder": [], "parameters": { "parent": { - "description": "Optional. The parent to create a billing account from. Format: - organizations/{organization_id} eg organizations/12345678 - billingAccounts/{billing_account_id} eg `billingAccounts/012345-567890-ABCDEF`", + "description": "Optional. The parent to create a billing account from. Format: - `organizations/{organization_id}`, for example, `organizations/12345678` - `billingAccounts/{billing_account_id}`, for example, `billingAccounts/012345-567890-ABCDEF`", "location": "query", "type": "string" } @@ -206,7 +206,7 @@ "parameterOrder": [], "parameters": { "filter": { - "description": "Options for how to filter the returned billing accounts. This only supports filtering for [subaccounts](https://cloud.google.com/billing/docs/concepts) under a single provided parent billing account. (e.g. \"master_billing_account=billingAccounts/012345-678901-ABCDEF\"). Boolean algebra and other fields are not currently supported.", + "description": "Options for how to filter the returned billing accounts. This only supports filtering for [subaccounts](https://cloud.google.com/billing/docs/concepts) under a single provided parent billing account. (for example, `master_billing_account=billingAccounts/012345-678901-ABCDEF`). Boolean algebra and other fields are not currently supported.", "location": "query", "type": "string" }, @@ -222,7 +222,7 @@ "type": "string" }, "parent": { - "description": "Optional. The parent resource to list billing accounts from. Format: - organizations/{organization_id} eg organizations/12345678 - billingAccounts/{billing_account_id} eg `billingAccounts/012345-567890-ABCDEF`", + "description": "Optional. The parent resource to list billing accounts from. Format: - `organizations/{organization_id}`, for example, `organizations/12345678` - `billingAccounts/{billing_account_id}`, for example, `billingAccounts/012345-567890-ABCDEF`", "location": "query", "type": "string" } @@ -416,7 +416,7 @@ ], "parameters": { "parent": { - "description": "Optional. The parent to create a billing account from. Format: - organizations/{organization_id} eg organizations/12345678 - billingAccounts/{billing_account_id} eg `billingAccounts/012345-567890-ABCDEF`", + "description": "Optional. The parent to create a billing account from. Format: - `organizations/{organization_id}`, for example, `organizations/12345678` - `billingAccounts/{billing_account_id}`, for example, `billingAccounts/012345-567890-ABCDEF`", "location": "path", "pattern": "^billingAccounts/[^/]+$", "required": true, @@ -445,7 +445,7 @@ ], "parameters": { "filter": { - "description": "Options for how to filter the returned billing accounts. This only supports filtering for [subaccounts](https://cloud.google.com/billing/docs/concepts) under a single provided parent billing account. (e.g. \"master_billing_account=billingAccounts/012345-678901-ABCDEF\"). Boolean algebra and other fields are not currently supported.", + "description": "Options for how to filter the returned billing accounts. This only supports filtering for [subaccounts](https://cloud.google.com/billing/docs/concepts) under a single provided parent billing account. (for example, `master_billing_account=billingAccounts/012345-678901-ABCDEF`). Boolean algebra and other fields are not currently supported.", "location": "query", "type": "string" }, @@ -461,7 +461,7 @@ "type": "string" }, "parent": { - "description": "Optional. The parent resource to list billing accounts from. Format: - organizations/{organization_id} eg organizations/12345678 - billingAccounts/{billing_account_id} eg `billingAccounts/012345-567890-ABCDEF`", + "description": "Optional. The parent resource to list billing accounts from. Format: - `organizations/{organization_id}`, for example, `organizations/12345678` - `billingAccounts/{billing_account_id}`, for example, `billingAccounts/012345-567890-ABCDEF`", "location": "path", "pattern": "^billingAccounts/[^/]+$", "required": true, @@ -496,7 +496,7 @@ ], "parameters": { "parent": { - "description": "Optional. The parent to create a billing account from. Format: - organizations/{organization_id} eg organizations/12345678 - billingAccounts/{billing_account_id} eg `billingAccounts/012345-567890-ABCDEF`", + "description": "Optional. The parent to create a billing account from. Format: - `organizations/{organization_id}`, for example, `organizations/12345678` - `billingAccounts/{billing_account_id}`, for example, `billingAccounts/012345-567890-ABCDEF`", "location": "path", "pattern": "^organizations/[^/]+$", "required": true, @@ -525,7 +525,7 @@ ], "parameters": { "filter": { - "description": "Options for how to filter the returned billing accounts. This only supports filtering for [subaccounts](https://cloud.google.com/billing/docs/concepts) under a single provided parent billing account. (e.g. \"master_billing_account=billingAccounts/012345-678901-ABCDEF\"). Boolean algebra and other fields are not currently supported.", + "description": "Options for how to filter the returned billing accounts. This only supports filtering for [subaccounts](https://cloud.google.com/billing/docs/concepts) under a single provided parent billing account. (for example, `master_billing_account=billingAccounts/012345-678901-ABCDEF`). Boolean algebra and other fields are not currently supported.", "location": "query", "type": "string" }, @@ -541,7 +541,7 @@ "type": "string" }, "parent": { - "description": "Optional. The parent resource to list billing accounts from. Format: - organizations/{organization_id} eg organizations/12345678 - billingAccounts/{billing_account_id} eg `billingAccounts/012345-567890-ABCDEF`", + "description": "Optional. The parent resource to list billing accounts from. Format: - `organizations/{organization_id}`, for example, `organizations/12345678` - `billingAccounts/{billing_account_id}`, for example, `billingAccounts/012345-567890-ABCDEF`", "location": "path", "pattern": "^organizations/[^/]+$", "required": true, @@ -751,7 +751,7 @@ } } }, - "revision": "20231115", + "revision": "20231208", "rootUrl": "https://cloudbilling.googleapis.com/", "schemas": { "AggregationInfo": { @@ -863,7 +863,7 @@ "type": "boolean" }, "parent": { - "description": "Output only. The billing account's parent resource identifier. Use the `MoveBillingAccount` method to update the account's parent resource if it is a organization. Format: - organizations/{organization_id}, for example: organizations/12345678 - billingAccounts/{billing_account_id}, for example: `billingAccounts/012345-567890-ABCDEF`", + "description": "Output only. The billing account's parent resource identifier. Use the `MoveBillingAccount` method to update the account's parent resource if it is a organization. Format: - `organizations/{organization_id}`, for example, `organizations/12345678` - `billingAccounts/{billing_account_id}`, for example, `billingAccounts/012345-567890-ABCDEF`", "readOnly": true, "type": "string" } diff --git a/cloudbilling/v1/cloudbilling-gen.go b/cloudbilling/v1/cloudbilling-gen.go index 1e9678423b1..2bedb4c6b56 100644 --- a/cloudbilling/v1/cloudbilling-gen.go +++ b/cloudbilling/v1/cloudbilling-gen.go @@ -428,9 +428,9 @@ type BillingAccount struct { // Parent: Output only. The billing account's parent resource // identifier. Use the `MoveBillingAccount` method to update the // account's parent resource if it is a organization. Format: - - // organizations/{organization_id}, for example: organizations/12345678 - // - billingAccounts/{billing_account_id}, for example: - // `billingAccounts/012345-567890-ABCDEF` + // `organizations/{organization_id}`, for example, + // `organizations/12345678` - `billingAccounts/{billing_account_id}`, + // for example, `billingAccounts/012345-567890-ABCDEF` Parent string `json:"parent,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -1507,8 +1507,9 @@ func (r *BillingAccountsService) Create(billingaccount *BillingAccount) *Billing } // Parent sets the optional parameter "parent": The parent to create a -// billing account from. Format: - organizations/{organization_id} eg -// organizations/12345678 - billingAccounts/{billing_account_id} eg +// billing account from. Format: - `organizations/{organization_id}`, +// for example, `organizations/12345678` - +// `billingAccounts/{billing_account_id}`, for example, // `billingAccounts/012345-567890-ABCDEF` func (c *BillingAccountsCreateCall) Parent(parent string) *BillingAccountsCreateCall { c.urlParams_.Set("parent", parent) @@ -1610,7 +1611,7 @@ func (c *BillingAccountsCreateCall) Do(opts ...googleapi.CallOption) (*BillingAc // "parameterOrder": [], // "parameters": { // "parent": { - // "description": "Optional. The parent to create a billing account from. Format: - organizations/{organization_id} eg organizations/12345678 - billingAccounts/{billing_account_id} eg `billingAccounts/012345-567890-ABCDEF`", + // "description": "Optional. The parent to create a billing account from. Format: - `organizations/{organization_id}`, for example, `organizations/12345678` - `billingAccounts/{billing_account_id}`, for example, `billingAccounts/012345-567890-ABCDEF`", // "location": "query", // "type": "string" // } @@ -1980,8 +1981,8 @@ func (r *BillingAccountsService) List() *BillingAccountsListCall { // Filter sets the optional parameter "filter": Options for how to // filter the returned billing accounts. This only supports filtering // for subaccounts (https://cloud.google.com/billing/docs/concepts) -// under a single provided parent billing account. (e.g. -// "master_billing_account=billingAccounts/012345-678901-ABCDEF"). +// under a single provided parent billing account. (for example, +// `master_billing_account=billingAccounts/012345-678901-ABCDEF`). // Boolean algebra and other fields are not currently supported. func (c *BillingAccountsListCall) Filter(filter string) *BillingAccountsListCall { c.urlParams_.Set("filter", filter) @@ -2006,9 +2007,10 @@ func (c *BillingAccountsListCall) PageToken(pageToken string) *BillingAccountsLi } // Parent sets the optional parameter "parent": The parent resource to -// list billing accounts from. Format: - organizations/{organization_id} -// eg organizations/12345678 - billingAccounts/{billing_account_id} eg -// `billingAccounts/012345-567890-ABCDEF` +// list billing accounts from. Format: - +// `organizations/{organization_id}`, for example, +// `organizations/12345678` - `billingAccounts/{billing_account_id}`, +// for example, `billingAccounts/012345-567890-ABCDEF` func (c *BillingAccountsListCall) Parent(parent string) *BillingAccountsListCall { c.urlParams_.Set("parent", parent) return c @@ -2117,7 +2119,7 @@ func (c *BillingAccountsListCall) Do(opts ...googleapi.CallOption) (*ListBilling // "parameterOrder": [], // "parameters": { // "filter": { - // "description": "Options for how to filter the returned billing accounts. This only supports filtering for [subaccounts](https://cloud.google.com/billing/docs/concepts) under a single provided parent billing account. (e.g. \"master_billing_account=billingAccounts/012345-678901-ABCDEF\"). Boolean algebra and other fields are not currently supported.", + // "description": "Options for how to filter the returned billing accounts. This only supports filtering for [subaccounts](https://cloud.google.com/billing/docs/concepts) under a single provided parent billing account. (for example, `master_billing_account=billingAccounts/012345-678901-ABCDEF`). Boolean algebra and other fields are not currently supported.", // "location": "query", // "type": "string" // }, @@ -2133,7 +2135,7 @@ func (c *BillingAccountsListCall) Do(opts ...googleapi.CallOption) (*ListBilling // "type": "string" // }, // "parent": { - // "description": "Optional. The parent resource to list billing accounts from. Format: - organizations/{organization_id} eg organizations/12345678 - billingAccounts/{billing_account_id} eg `billingAccounts/012345-567890-ABCDEF`", + // "description": "Optional. The parent resource to list billing accounts from. Format: - `organizations/{organization_id}`, for example, `organizations/12345678` - `billingAccounts/{billing_account_id}`, for example, `billingAccounts/012345-567890-ABCDEF`", // "location": "query", // "type": "string" // } @@ -3008,9 +3010,9 @@ type BillingAccountsSubAccountsCreateCall struct { // provisioned for subaccounts. // // - parent: Optional. The parent to create a billing account from. -// Format: - organizations/{organization_id} eg organizations/12345678 -// - billingAccounts/{billing_account_id} eg -// `billingAccounts/012345-567890-ABCDEF`. +// Format: - `organizations/{organization_id}`, for example, +// `organizations/12345678` - `billingAccounts/{billing_account_id}`, +// for example, `billingAccounts/012345-567890-ABCDEF`. func (r *BillingAccountsSubAccountsService) Create(parent string, billingaccount *BillingAccount) *BillingAccountsSubAccountsCreateCall { c := &BillingAccountsSubAccountsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -3118,7 +3120,7 @@ func (c *BillingAccountsSubAccountsCreateCall) Do(opts ...googleapi.CallOption) // ], // "parameters": { // "parent": { - // "description": "Optional. The parent to create a billing account from. Format: - organizations/{organization_id} eg organizations/12345678 - billingAccounts/{billing_account_id} eg `billingAccounts/012345-567890-ABCDEF`", + // "description": "Optional. The parent to create a billing account from. Format: - `organizations/{organization_id}`, for example, `organizations/12345678` - `billingAccounts/{billing_account_id}`, for example, `billingAccounts/012345-567890-ABCDEF`", // "location": "path", // "pattern": "^billingAccounts/[^/]+$", // "required": true, @@ -3156,9 +3158,9 @@ type BillingAccountsSubAccountsListCall struct { // (https://cloud.google.com/billing/docs/how-to/billing-access). // // - parent: Optional. The parent resource to list billing accounts -// from. Format: - organizations/{organization_id} eg -// organizations/12345678 - billingAccounts/{billing_account_id} eg -// `billingAccounts/012345-567890-ABCDEF`. +// from. Format: - `organizations/{organization_id}`, for example, +// `organizations/12345678` - `billingAccounts/{billing_account_id}`, +// for example, `billingAccounts/012345-567890-ABCDEF`. func (r *BillingAccountsSubAccountsService) List(parent string) *BillingAccountsSubAccountsListCall { c := &BillingAccountsSubAccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -3168,8 +3170,8 @@ func (r *BillingAccountsSubAccountsService) List(parent string) *BillingAccounts // Filter sets the optional parameter "filter": Options for how to // filter the returned billing accounts. This only supports filtering // for subaccounts (https://cloud.google.com/billing/docs/concepts) -// under a single provided parent billing account. (e.g. -// "master_billing_account=billingAccounts/012345-678901-ABCDEF"). +// under a single provided parent billing account. (for example, +// `master_billing_account=billingAccounts/012345-678901-ABCDEF`). // Boolean algebra and other fields are not currently supported. func (c *BillingAccountsSubAccountsListCall) Filter(filter string) *BillingAccountsSubAccountsListCall { c.urlParams_.Set("filter", filter) @@ -3301,7 +3303,7 @@ func (c *BillingAccountsSubAccountsListCall) Do(opts ...googleapi.CallOption) (* // ], // "parameters": { // "filter": { - // "description": "Options for how to filter the returned billing accounts. This only supports filtering for [subaccounts](https://cloud.google.com/billing/docs/concepts) under a single provided parent billing account. (e.g. \"master_billing_account=billingAccounts/012345-678901-ABCDEF\"). Boolean algebra and other fields are not currently supported.", + // "description": "Options for how to filter the returned billing accounts. This only supports filtering for [subaccounts](https://cloud.google.com/billing/docs/concepts) under a single provided parent billing account. (for example, `master_billing_account=billingAccounts/012345-678901-ABCDEF`). Boolean algebra and other fields are not currently supported.", // "location": "query", // "type": "string" // }, @@ -3317,7 +3319,7 @@ func (c *BillingAccountsSubAccountsListCall) Do(opts ...googleapi.CallOption) (* // "type": "string" // }, // "parent": { - // "description": "Optional. The parent resource to list billing accounts from. Format: - organizations/{organization_id} eg organizations/12345678 - billingAccounts/{billing_account_id} eg `billingAccounts/012345-567890-ABCDEF`", + // "description": "Optional. The parent resource to list billing accounts from. Format: - `organizations/{organization_id}`, for example, `organizations/12345678` - `billingAccounts/{billing_account_id}`, for example, `billingAccounts/012345-567890-ABCDEF`", // "location": "path", // "pattern": "^billingAccounts/[^/]+$", // "required": true, @@ -3384,9 +3386,9 @@ type OrganizationsBillingAccountsCreateCall struct { // provisioned for subaccounts. // // - parent: Optional. The parent to create a billing account from. -// Format: - organizations/{organization_id} eg organizations/12345678 -// - billingAccounts/{billing_account_id} eg -// `billingAccounts/012345-567890-ABCDEF`. +// Format: - `organizations/{organization_id}`, for example, +// `organizations/12345678` - `billingAccounts/{billing_account_id}`, +// for example, `billingAccounts/012345-567890-ABCDEF`. func (r *OrganizationsBillingAccountsService) Create(parent string, billingaccount *BillingAccount) *OrganizationsBillingAccountsCreateCall { c := &OrganizationsBillingAccountsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -3494,7 +3496,7 @@ func (c *OrganizationsBillingAccountsCreateCall) Do(opts ...googleapi.CallOption // ], // "parameters": { // "parent": { - // "description": "Optional. The parent to create a billing account from. Format: - organizations/{organization_id} eg organizations/12345678 - billingAccounts/{billing_account_id} eg `billingAccounts/012345-567890-ABCDEF`", + // "description": "Optional. The parent to create a billing account from. Format: - `organizations/{organization_id}`, for example, `organizations/12345678` - `billingAccounts/{billing_account_id}`, for example, `billingAccounts/012345-567890-ABCDEF`", // "location": "path", // "pattern": "^organizations/[^/]+$", // "required": true, @@ -3532,9 +3534,9 @@ type OrganizationsBillingAccountsListCall struct { // (https://cloud.google.com/billing/docs/how-to/billing-access). // // - parent: Optional. The parent resource to list billing accounts -// from. Format: - organizations/{organization_id} eg -// organizations/12345678 - billingAccounts/{billing_account_id} eg -// `billingAccounts/012345-567890-ABCDEF`. +// from. Format: - `organizations/{organization_id}`, for example, +// `organizations/12345678` - `billingAccounts/{billing_account_id}`, +// for example, `billingAccounts/012345-567890-ABCDEF`. func (r *OrganizationsBillingAccountsService) List(parent string) *OrganizationsBillingAccountsListCall { c := &OrganizationsBillingAccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -3544,8 +3546,8 @@ func (r *OrganizationsBillingAccountsService) List(parent string) *Organizations // Filter sets the optional parameter "filter": Options for how to // filter the returned billing accounts. This only supports filtering // for subaccounts (https://cloud.google.com/billing/docs/concepts) -// under a single provided parent billing account. (e.g. -// "master_billing_account=billingAccounts/012345-678901-ABCDEF"). +// under a single provided parent billing account. (for example, +// `master_billing_account=billingAccounts/012345-678901-ABCDEF`). // Boolean algebra and other fields are not currently supported. func (c *OrganizationsBillingAccountsListCall) Filter(filter string) *OrganizationsBillingAccountsListCall { c.urlParams_.Set("filter", filter) @@ -3677,7 +3679,7 @@ func (c *OrganizationsBillingAccountsListCall) Do(opts ...googleapi.CallOption) // ], // "parameters": { // "filter": { - // "description": "Options for how to filter the returned billing accounts. This only supports filtering for [subaccounts](https://cloud.google.com/billing/docs/concepts) under a single provided parent billing account. (e.g. \"master_billing_account=billingAccounts/012345-678901-ABCDEF\"). Boolean algebra and other fields are not currently supported.", + // "description": "Options for how to filter the returned billing accounts. This only supports filtering for [subaccounts](https://cloud.google.com/billing/docs/concepts) under a single provided parent billing account. (for example, `master_billing_account=billingAccounts/012345-678901-ABCDEF`). Boolean algebra and other fields are not currently supported.", // "location": "query", // "type": "string" // }, @@ -3693,7 +3695,7 @@ func (c *OrganizationsBillingAccountsListCall) Do(opts ...googleapi.CallOption) // "type": "string" // }, // "parent": { - // "description": "Optional. The parent resource to list billing accounts from. Format: - organizations/{organization_id} eg organizations/12345678 - billingAccounts/{billing_account_id} eg `billingAccounts/012345-567890-ABCDEF`", + // "description": "Optional. The parent resource to list billing accounts from. Format: - `organizations/{organization_id}`, for example, `organizations/12345678` - `billingAccounts/{billing_account_id}`, for example, `billingAccounts/012345-567890-ABCDEF`", // "location": "path", // "pattern": "^organizations/[^/]+$", // "required": true, diff --git a/cloudbilling/v1beta/cloudbilling-api.json b/cloudbilling/v1beta/cloudbilling-api.json index ef93175053a..0fefd41c96d 100644 --- a/cloudbilling/v1beta/cloudbilling-api.json +++ b/cloudbilling/v1beta/cloudbilling-api.json @@ -463,6 +463,53 @@ ] } } + }, + "prices": { + "methods": { + "list": { + "description": "Lists the latest prices for SKUs available to your Cloud Billing account.", + "flatPath": "v1beta/billingAccounts/{billingAccountsId}/skus/{skusId}/prices", + "httpMethod": "GET", + "id": "cloudbilling.billingAccounts.skus.prices.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "currencyCode": { + "description": "Optional. ISO-4217 currency code for the price. If not specified, currency of billing account will be used.", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Optional. Maximum number of billing account price to return. Results may return fewer than this value. Default value is 50 and maximum value is 5000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. Page token received from a previous ListBillingAccountPrices call to retrieve the next page of results. If this field is empty, the first page is returned.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. To list all Billing Account SKUs, use `-` as the SKU ID. Format: `billingAccounts/{billing_account}/skus/-` Note: Specifying an actual SKU resource id will return a collection of one Billing Account Price.", + "location": "path", + "pattern": "^billingAccounts/[^/]+/skus/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+parent}/prices", + "response": { + "$ref": "GoogleCloudBillingBillingaccountpricesV1betaListBillingAccountPricesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-billing", + "https://www.googleapis.com/auth/cloud-billing.readonly", + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } } } } @@ -636,6 +683,53 @@ ] } } + }, + "prices": { + "methods": { + "list": { + "description": "Lists the latest prices for all SKUs.", + "flatPath": "v1beta/skus/{skusId}/prices", + "httpMethod": "GET", + "id": "cloudbilling.skus.prices.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "currencyCode": { + "description": "Optional. ISO-4217 currency code for the price. If not specified, USD will be used.", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Optional. Maximum number of prices to return. Results may return fewer than this value. Default value is 50 and maximum value is 5000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. Page token received from a previous ListPrices call to retrieve the next page of results. If this field is empty, the first page is returned.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. To list the prices for all SKUs, use `-` as the SKU ID. Format: `skus/-` Specifying a specific SKU ID returns a collection with one Price object for the SKU.", + "location": "path", + "pattern": "^skus/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+parent}/prices", + "response": { + "$ref": "GoogleCloudBillingPricesV1betaListPricesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-billing", + "https://www.googleapis.com/auth/cloud-billing.readonly", + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } } } }, @@ -664,7 +758,7 @@ } } }, - "revision": "20231115", + "revision": "20231208", "rootUrl": "https://cloudbilling.googleapis.com/", "schemas": { "CacheFillRegions": { @@ -719,11 +813,11 @@ "type": "object" }, "CloudCdnEgressWorkload": { - "description": "Specifies usage for Cloud CDN egress.", + "description": "Specifies usage for Cloud CDN Data Transfer.", "id": "CloudCdnEgressWorkload", "properties": { "cacheEgressDestination": { - "description": "The destination for the cache egress charges.", + "description": "The destination for the cache data transfer.", "enum": [ "CACHE_EGRESS_DESTINATION_UNSPECIFIED", "CACHE_EGRESS_DESTINATION_ASIA_PACIFIC", @@ -748,7 +842,7 @@ }, "cacheEgressRate": { "$ref": "Usage", - "description": "Cache egress usage. The rate of data cache egressed in the destination. For example : units such as \"GiBy/s\" or \"TBy/mo\"." + "description": "Cache data transfer usage. The rate of data cache transferred to the destination. Use units such as GiB/s or TiB/mo." } }, "type": "object" @@ -787,15 +881,15 @@ "type": "object" }, "CloudInterconnectEgressWorkload": { - "description": "The interconnect egress only includes the Interconnect Egress. Please use the standard egress traffic interface to specify your standard egress usage.", + "description": "Includes the estimate for Interconnect Data Transfer only. To specify usage for data transfer between VMs and internet end-points, use the Standard Tier Internet Data Transfer interface.", "id": "CloudInterconnectEgressWorkload", "properties": { "egressRate": { "$ref": "Usage", - "description": "Data egress usage. This usage applies when you move or copy data from one Google Cloud service to another service. Expected units such as \"GiBy/s, By/s, etc.\"" + "description": "Outbound data transfer usage. This usage applies when you move or copy data from one Google Cloud service to another service. The units are \"GiB/s, B/s, and so on.\"" }, "interconnectConnectionLocation": { - "description": "Locations in the [Interconnect connection location table](https://cloud.google.com/vpc/network-pricing#interconnect-pricing). This is the interconnect egress charges.", + "description": "Locations in the [Interconnect connection location table](https://cloud.google.com/vpc/network-pricing#interconnect-pricing). These are the Interconnect Data Transfer charges.", "enum": [ "INTERCONNECT_CONNECTION_LOCATION_UNSPECIFIED", "INTERCONNECT_CONNECTION_LOCATION_ASIA", @@ -864,7 +958,7 @@ "type": "object" }, "CloudStorageEgressWorkload": { - "description": "Specification of a network type. Network egress within Google Cloud applies when you move or copy data from one Cloud Storage bucket to another or when another Google Cloud service accesses data in your Cloud Storage bucket.This includes the network egress within Google Cloud and the general network usage.", + "description": "Specification of a network type. Network data transfer within Google Cloud applies when you move or copy data from one Cloud Storage bucket to another or when another Google Cloud service accesses data in your Cloud Storage bucket.This includes the network data transfer within Google Cloud and the general network usage.", "id": "CloudStorageEgressWorkload", "properties": { "destinationContinent": { @@ -889,7 +983,7 @@ }, "egressRate": { "$ref": "Usage", - "description": "Egress usage rate. This usage applies when you move or copy data from one Cloud Storage bucket to another or when another Google Cloud service accesses data in your Cloud Storage bucket. Expected units such as \"GiBy/s, By/s, ...\"" + "description": "Data transfer usage rate. This usage applies when you move or copy data from one Cloud Storage bucket to another or when another Google Cloud service accesses data in your Cloud Storage bucket. Expected units such as \"GiB/s, B/s, ...\"" }, "sourceContinent": { "description": "Where the data comes from.", @@ -1342,6 +1436,24 @@ }, "type": "object" }, + "GoogleCloudBillingBillingaccountpricesV1betaListBillingAccountPricesResponse": { + "description": "Response message for ListBillingAccountPrices.", + "id": "GoogleCloudBillingBillingaccountpricesV1betaListBillingAccountPricesResponse", + "properties": { + "billingAccountPrices": { + "description": "The returned billing account prices.", + "items": { + "$ref": "GoogleCloudBillingBillingaccountpricesV1betaBillingAccountPrice" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Token that can be sent as `page_token` in the subsequent request to retrieve the next page. If this field is empty, there are no subsequent pages.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudBillingBillingaccountpricesV1betaListPriceAsCeiling": { "description": "Encapsulates a contract feature that the list price (DefaultPrice) will be used for the price if the current list price drops lower than the custom fixed price. Available to new contracts after March 21, 2022. Applies to all fixed price SKUs in the contract, including FixedPrice, FixedDiscount, MigratedPrice, and MergedPrice.", "id": "GoogleCloudBillingBillingaccountpricesV1betaListPriceAsCeiling", @@ -1875,6 +1987,24 @@ }, "type": "object" }, + "GoogleCloudBillingPricesV1betaListPricesResponse": { + "description": "Response message for ListPrices.", + "id": "GoogleCloudBillingPricesV1betaListPricesResponse", + "properties": { + "nextPageToken": { + "description": "Token that can be sent as `page_token` in the subsequent request to retrieve the next page. If this field is empty, there are no subsequent pages.", + "type": "string" + }, + "prices": { + "description": "The returned publicly listed prices.", + "items": { + "$ref": "GoogleCloudBillingPricesV1betaPrice" + }, + "type": "array" + } + }, + "type": "object" + }, "GoogleCloudBillingPricesV1betaPrice": { "description": "Encapsulates the latest price for a SKU.", "id": "GoogleCloudBillingPricesV1betaPrice", @@ -2155,31 +2285,31 @@ "type": "object" }, "InterRegionEgress": { - "description": "Egress traffic between two regions.", + "description": "Data transfer between two regions.", "id": "InterRegionEgress", "properties": { "destinationRegion": { - "description": "Which [region](https://cloud.google.com/compute/docs/regions-zones) the egress data goes to.", + "description": "Which [region](https://cloud.google.com/compute/docs/regions-zones) the data is transferred to.", "type": "string" }, "egressRate": { "$ref": "Usage", - "description": "VM to VM egress usage. Expected units such as \"GiBy/s, By/s, etc.\"" + "description": "VM to VM data transfer usage. The expected units such are GiB/s, B/s, and so on." }, "sourceRegion": { - "description": "Which [region](https://cloud.google.com/compute/docs/regions-zones) the egress data comes from.", + "description": "Which [region](https://cloud.google.com/compute/docs/regions-zones) the data is transferred from.", "type": "string" } }, "type": "object" }, "IntraRegionEgress": { - "description": "Egress traffic within the same region. When source region and destination region are in the same zone, using the internal IP addresses, there isn't any egress charge.", + "description": "Data transfer within the same region. When the source region and destination region are in the same zone, using internal IP addresses, there isn't any charge for data transfer.", "id": "IntraRegionEgress", "properties": { "egressRate": { "$ref": "Usage", - "description": "VM to VM egress usage. Expected units such as \"GiBy/s, By/s, etc.\"" + "description": "VM to VM data transfer usage. The expected are GiB/s, B/s, and so on." } }, "type": "object" @@ -2274,7 +2404,7 @@ "type": "object" }, "PremiumTierEgressWorkload": { - "description": "Specify Premium Tier Internet egress networking.", + "description": "Specify a Premium Tier Internet Data Transfer networking workload.", "id": "PremiumTierEgressWorkload", "properties": { "destinationContinent": { @@ -2313,10 +2443,10 @@ }, "egressRate": { "$ref": "Usage", - "description": "Premium Tier egress usage. Expected units such as \"GiBy/s, By/s, etc.\"" + "description": "Premium Tier Data Transfer usage. The expected units are GiB/s, B/s, and so on." }, "sourceRegion": { - "description": "Which [region](https://cloud.google.com/compute/docs/regions-zones) the egress data comes from.", + "description": "Which [region](https://cloud.google.com/compute/docs/regions-zones) the data comes from.", "type": "string" } }, @@ -2479,15 +2609,15 @@ "type": "object" }, "StandardTierEgressWorkload": { - "description": "Specify Standard Tier Internet egress networking.", + "description": "Specify Standard Tier Internet Data Transfer.", "id": "StandardTierEgressWorkload", "properties": { "egressRate": { "$ref": "Usage", - "description": "Standard tier egress usage. Expected units such as \"GiBy/s, By/s, etc.\"" + "description": "Standard Tier Data Transfer usage. The expected units are GiB/s, B/s, and so on." }, "sourceRegion": { - "description": "Which [region](https://cloud.google.com/compute/docs/regions-zones) the egress data comes from.", + "description": "Which [region](https://cloud.google.com/compute/docs/regions-zones) the data is transferred from.", "type": "string" } }, @@ -2627,7 +2757,7 @@ "type": "object" }, "VmToVmEgressWorkload": { - "description": "Specify VM to VM egress.", + "description": "Specify VM to VM data transfer.", "id": "VmToVmEgressWorkload", "properties": { "interRegionEgress": { @@ -2645,7 +2775,7 @@ "properties": { "cloudCdnEgressWorkload": { "$ref": "CloudCdnEgressWorkload", - "description": "Usage on Google Cloud CDN Egress." + "description": "Usage on Google Cloud CDN Data Transfer." }, "cloudCdnWorkload": { "$ref": "CloudCdnWorkload", @@ -2653,7 +2783,7 @@ }, "cloudInterconnectEgressWorkload": { "$ref": "CloudInterconnectEgressWorkload", - "description": "Usage on Google Cloud Interconnect Egress." + "description": "Usage on Google Cloud Interconnect Data Transfer." }, "cloudInterconnectWorkload": { "$ref": "CloudInterconnectWorkload", @@ -2661,7 +2791,7 @@ }, "cloudStorageEgressWorkload": { "$ref": "CloudStorageEgressWorkload", - "description": "Usage on a cloud storage egress." + "description": "Usage on Cloud Storage Data Transfer." }, "cloudStorageWorkload": { "$ref": "CloudStorageWorkload", @@ -2677,15 +2807,15 @@ }, "premiumTierEgressWorkload": { "$ref": "PremiumTierEgressWorkload", - "description": "Usage on Premium Tier Internet Egress." + "description": "Usage on Premium Tier Internet Data Transfer." }, "standardTierEgressWorkload": { "$ref": "StandardTierEgressWorkload", - "description": "Usage on Standard Tier Internet Egress." + "description": "Usage on Standard Tier Internet Data Transfer." }, "vmToVmEgressWorkload": { "$ref": "VmToVmEgressWorkload", - "description": "Usage on Vm to Vm Egress." + "description": "Usage on VM to VM Data Transfer." } }, "type": "object" diff --git a/cloudbilling/v1beta/cloudbilling-gen.go b/cloudbilling/v1beta/cloudbilling-gen.go index 799b46688f2..f28365d3bb8 100644 --- a/cloudbilling/v1beta/cloudbilling-gen.go +++ b/cloudbilling/v1beta/cloudbilling-gen.go @@ -224,6 +224,7 @@ type BillingAccountsSkuGroupsSkusService struct { func NewBillingAccountsSkusService(s *Service) *BillingAccountsSkusService { rs := &BillingAccountsSkusService{s: s} rs.Price = NewBillingAccountsSkusPriceService(s) + rs.Prices = NewBillingAccountsSkusPricesService(s) return rs } @@ -231,6 +232,8 @@ type BillingAccountsSkusService struct { s *Service Price *BillingAccountsSkusPriceService + + Prices *BillingAccountsSkusPricesService } func NewBillingAccountsSkusPriceService(s *Service) *BillingAccountsSkusPriceService { @@ -242,6 +245,15 @@ type BillingAccountsSkusPriceService struct { s *Service } +func NewBillingAccountsSkusPricesService(s *Service) *BillingAccountsSkusPricesService { + rs := &BillingAccountsSkusPricesService{s: s} + return rs +} + +type BillingAccountsSkusPricesService struct { + s *Service +} + func NewSkuGroupsService(s *Service) *SkuGroupsService { rs := &SkuGroupsService{s: s} rs.Skus = NewSkuGroupsSkusService(s) @@ -266,6 +278,7 @@ type SkuGroupsSkusService struct { func NewSkusService(s *Service) *SkusService { rs := &SkusService{s: s} rs.Price = NewSkusPriceService(s) + rs.Prices = NewSkusPricesService(s) return rs } @@ -273,6 +286,8 @@ type SkusService struct { s *Service Price *SkusPriceService + + Prices *SkusPricesService } func NewSkusPriceService(s *Service) *SkusPriceService { @@ -284,6 +299,15 @@ type SkusPriceService struct { s *Service } +func NewSkusPricesService(s *Service) *SkusPricesService { + rs := &SkusPricesService{s: s} + return rs +} + +type SkusPricesService struct { + s *Service +} + func NewV1betaService(s *Service) *V1betaService { rs := &V1betaService{s: s} return rs @@ -343,9 +367,9 @@ func (s *CacheFillRegions) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// CloudCdnEgressWorkload: Specifies usage for Cloud CDN egress. +// CloudCdnEgressWorkload: Specifies usage for Cloud CDN Data Transfer. type CloudCdnEgressWorkload struct { - // CacheEgressDestination: The destination for the cache egress charges. + // CacheEgressDestination: The destination for the cache data transfer. // // Possible values: // "CACHE_EGRESS_DESTINATION_UNSPECIFIED" - Unspecified. @@ -362,8 +386,8 @@ type CloudCdnEgressWorkload struct { // destinations (including Africa and Antarctica) CacheEgressDestination string `json:"cacheEgressDestination,omitempty"` - // CacheEgressRate: Cache egress usage. The rate of data cache egressed - // in the destination. For example : units such as "GiBy/s" or "TBy/mo". + // CacheEgressRate: Cache data transfer usage. The rate of data cache + // transferred to the destination. Use units such as GiB/s or TiB/mo. CacheEgressRate *Usage `json:"cacheEgressRate,omitempty"` // ForceSendFields is a list of field names (e.g. @@ -441,19 +465,20 @@ func (s *CloudCdnWorkload) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// CloudInterconnectEgressWorkload: The interconnect egress only -// includes the Interconnect Egress. Please use the standard egress -// traffic interface to specify your standard egress usage. +// CloudInterconnectEgressWorkload: Includes the estimate for +// Interconnect Data Transfer only. To specify usage for data transfer +// between VMs and internet end-points, use the Standard Tier Internet +// Data Transfer interface. type CloudInterconnectEgressWorkload struct { - // EgressRate: Data egress usage. This usage applies when you move or - // copy data from one Google Cloud service to another service. Expected - // units such as "GiBy/s, By/s, etc." + // EgressRate: Outbound data transfer usage. This usage applies when you + // move or copy data from one Google Cloud service to another service. + // The units are "GiB/s, B/s, and so on." EgressRate *Usage `json:"egressRate,omitempty"` // InterconnectConnectionLocation: Locations in the Interconnect // connection location table // (https://cloud.google.com/vpc/network-pricing#interconnect-pricing). - // This is the interconnect egress charges. + // These are the Interconnect Data Transfer charges. // // Possible values: // "INTERCONNECT_CONNECTION_LOCATION_UNSPECIFIED" - Unspecified. @@ -540,10 +565,11 @@ func (s *CloudInterconnectWorkload) MarshalJSON() ([]byte, error) { } // CloudStorageEgressWorkload: Specification of a network type. Network -// egress within Google Cloud applies when you move or copy data from -// one Cloud Storage bucket to another or when another Google Cloud +// data transfer within Google Cloud applies when you move or copy data +// from one Cloud Storage bucket to another or when another Google Cloud // service accesses data in your Cloud Storage bucket.This includes the -// network egress within Google Cloud and the general network usage. +// network data transfer within Google Cloud and the general network +// usage. type CloudStorageEgressWorkload struct { // DestinationContinent: Where the data is sent to. // @@ -556,10 +582,10 @@ type CloudStorageEgressWorkload struct { // "DESTINATION_CONTINENT_SOUTH_AMERICA" - South America DestinationContinent string `json:"destinationContinent,omitempty"` - // EgressRate: Egress usage rate. This usage applies when you move or - // copy data from one Cloud Storage bucket to another or when another - // Google Cloud service accesses data in your Cloud Storage bucket. - // Expected units such as "GiBy/s, By/s, ..." + // EgressRate: Data transfer usage rate. This usage applies when you + // move or copy data from one Cloud Storage bucket to another or when + // another Google Cloud service accesses data in your Cloud Storage + // bucket. Expected units such as "GiB/s, B/s, ..." EgressRate *Usage `json:"egressRate,omitempty"` // SourceContinent: Where the data comes from. @@ -1443,6 +1469,46 @@ func (s *GoogleCloudBillingBillingaccountpricesV1betaFloatingDiscount) MarshalJS return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudBillingBillingaccountpricesV1betaListBillingAccountPricesRe +// sponse: Response message for ListBillingAccountPrices. +type GoogleCloudBillingBillingaccountpricesV1betaListBillingAccountPricesResponse struct { + // BillingAccountPrices: The returned billing account prices. + BillingAccountPrices []*GoogleCloudBillingBillingaccountpricesV1betaBillingAccountPrice `json:"billingAccountPrices,omitempty"` + + // NextPageToken: Token that can be sent as `page_token` in the + // subsequent request to retrieve the next page. If this field is empty, + // there are no subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "BillingAccountPrices") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "BillingAccountPrices") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudBillingBillingaccountpricesV1betaListBillingAccountPricesResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudBillingBillingaccountpricesV1betaListBillingAccountPricesResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudBillingBillingaccountpricesV1betaListPriceAsCeiling: // Encapsulates a contract feature that the list price (DefaultPrice) // will be used for the price if the current list price drops lower than @@ -2500,6 +2566,44 @@ func (s *GoogleCloudBillingPricesV1betaAggregationInfo) MarshalJSON() ([]byte, e return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudBillingPricesV1betaListPricesResponse: Response message +// for ListPrices. +type GoogleCloudBillingPricesV1betaListPricesResponse struct { + // NextPageToken: Token that can be sent as `page_token` in the + // subsequent request to retrieve the next page. If this field is empty, + // there are no subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Prices: The returned publicly listed prices. + Prices []*GoogleCloudBillingPricesV1betaPrice `json:"prices,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudBillingPricesV1betaListPricesResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudBillingPricesV1betaListPricesResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudBillingPricesV1betaPrice: Encapsulates the latest price // for a SKU. type GoogleCloudBillingPricesV1betaPrice struct { @@ -3064,20 +3168,20 @@ func (s *GuestAccelerator) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// InterRegionEgress: Egress traffic between two regions. +// InterRegionEgress: Data transfer between two regions. type InterRegionEgress struct { // DestinationRegion: Which region - // (https://cloud.google.com/compute/docs/regions-zones) the egress data - // goes to. + // (https://cloud.google.com/compute/docs/regions-zones) the data is + // transferred to. DestinationRegion string `json:"destinationRegion,omitempty"` - // EgressRate: VM to VM egress usage. Expected units such as "GiBy/s, - // By/s, etc." + // EgressRate: VM to VM data transfer usage. The expected units such are + // GiB/s, B/s, and so on. EgressRate *Usage `json:"egressRate,omitempty"` // SourceRegion: Which region - // (https://cloud.google.com/compute/docs/regions-zones) the egress data - // comes from. + // (https://cloud.google.com/compute/docs/regions-zones) the data is + // transferred from. SourceRegion string `json:"sourceRegion,omitempty"` // ForceSendFields is a list of field names (e.g. "DestinationRegion") @@ -3104,12 +3208,12 @@ func (s *InterRegionEgress) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// IntraRegionEgress: Egress traffic within the same region. When source -// region and destination region are in the same zone, using the -// internal IP addresses, there isn't any egress charge. +// IntraRegionEgress: Data transfer within the same region. When the +// source region and destination region are in the same zone, using +// internal IP addresses, there isn't any charge for data transfer. type IntraRegionEgress struct { - // EgressRate: VM to VM egress usage. Expected units such as "GiBy/s, - // By/s, etc." + // EgressRate: VM to VM data transfer usage. The expected are GiB/s, + // B/s, and so on. EgressRate *Usage `json:"egressRate,omitempty"` // ForceSendFields is a list of field names (e.g. "EgressRate") to @@ -3315,8 +3419,8 @@ func (s *PredefinedMachineType) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// PremiumTierEgressWorkload: Specify Premium Tier Internet egress -// networking. +// PremiumTierEgressWorkload: Specify a Premium Tier Internet Data +// Transfer networking workload. type PremiumTierEgressWorkload struct { // DestinationContinent: Where the data is sent to. // @@ -3337,13 +3441,13 @@ type PremiumTierEgressWorkload struct { // "DESTINATION_CONTINENT_SOUTH_AMERICA" - South America. DestinationContinent string `json:"destinationContinent,omitempty"` - // EgressRate: Premium Tier egress usage. Expected units such as - // "GiBy/s, By/s, etc." + // EgressRate: Premium Tier Data Transfer usage. The expected units are + // GiB/s, B/s, and so on. EgressRate *Usage `json:"egressRate,omitempty"` // SourceRegion: Which region - // (https://cloud.google.com/compute/docs/regions-zones) the egress data - // comes from. + // (https://cloud.google.com/compute/docs/regions-zones) the data comes + // from. SourceRegion string `json:"sourceRegion,omitempty"` // ForceSendFields is a list of field names (e.g. @@ -3704,16 +3808,16 @@ func (s *SkuCostEstimate) UnmarshalJSON(data []byte) error { return nil } -// StandardTierEgressWorkload: Specify Standard Tier Internet egress -// networking. +// StandardTierEgressWorkload: Specify Standard Tier Internet Data +// Transfer. type StandardTierEgressWorkload struct { - // EgressRate: Standard tier egress usage. Expected units such as - // "GiBy/s, By/s, etc." + // EgressRate: Standard Tier Data Transfer usage. The expected units are + // GiB/s, B/s, and so on. EgressRate *Usage `json:"egressRate,omitempty"` // SourceRegion: Which region - // (https://cloud.google.com/compute/docs/regions-zones) the egress data - // comes from. + // (https://cloud.google.com/compute/docs/regions-zones) the data is + // transferred from. SourceRegion string `json:"sourceRegion,omitempty"` // ForceSendFields is a list of field names (e.g. "EgressRate") to @@ -4005,7 +4109,7 @@ func (s *VmResourceBasedCud) UnmarshalJSON(data []byte) error { return nil } -// VmToVmEgressWorkload: Specify VM to VM egress. +// VmToVmEgressWorkload: Specify VM to VM data transfer. type VmToVmEgressWorkload struct { InterRegionEgress *InterRegionEgress `json:"interRegionEgress,omitempty"` @@ -4040,20 +4144,20 @@ func (s *VmToVmEgressWorkload) MarshalJSON() ([]byte, error) { // specific product configuration parameters of the product usage // amounts along each dimension in which the product is billed. type Workload struct { - // CloudCdnEgressWorkload: Usage on Google Cloud CDN Egress. + // CloudCdnEgressWorkload: Usage on Google Cloud CDN Data Transfer. CloudCdnEgressWorkload *CloudCdnEgressWorkload `json:"cloudCdnEgressWorkload,omitempty"` // CloudCdnWorkload: Usage on Google Cloud CDN. CloudCdnWorkload *CloudCdnWorkload `json:"cloudCdnWorkload,omitempty"` // CloudInterconnectEgressWorkload: Usage on Google Cloud Interconnect - // Egress. + // Data Transfer. CloudInterconnectEgressWorkload *CloudInterconnectEgressWorkload `json:"cloudInterconnectEgressWorkload,omitempty"` // CloudInterconnectWorkload: Usage on Google Cloud Interconnect. CloudInterconnectWorkload *CloudInterconnectWorkload `json:"cloudInterconnectWorkload,omitempty"` - // CloudStorageEgressWorkload: Usage on a cloud storage egress. + // CloudStorageEgressWorkload: Usage on Cloud Storage Data Transfer. CloudStorageEgressWorkload *CloudStorageEgressWorkload `json:"cloudStorageEgressWorkload,omitempty"` // CloudStorageWorkload: Usage on Google Cloud Storage. @@ -4067,13 +4171,15 @@ type Workload struct { // 128 characters long. Name string `json:"name,omitempty"` - // PremiumTierEgressWorkload: Usage on Premium Tier Internet Egress. + // PremiumTierEgressWorkload: Usage on Premium Tier Internet Data + // Transfer. PremiumTierEgressWorkload *PremiumTierEgressWorkload `json:"premiumTierEgressWorkload,omitempty"` - // StandardTierEgressWorkload: Usage on Standard Tier Internet Egress. + // StandardTierEgressWorkload: Usage on Standard Tier Internet Data + // Transfer. StandardTierEgressWorkload *StandardTierEgressWorkload `json:"standardTierEgressWorkload,omitempty"` - // VmToVmEgressWorkload: Usage on Vm to Vm Egress. + // VmToVmEgressWorkload: Usage on VM to VM Data Transfer. VmToVmEgressWorkload *VmToVmEgressWorkload `json:"vmToVmEgressWorkload,omitempty"` // ForceSendFields is a list of field names (e.g. @@ -5883,6 +5989,223 @@ func (c *BillingAccountsSkusPriceGetCall) Do(opts ...googleapi.CallOption) (*Goo } +// method id "cloudbilling.billingAccounts.skus.prices.list": + +type BillingAccountsSkusPricesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the latest prices for SKUs available to your Cloud +// Billing account. +// +// - parent: To list all Billing Account SKUs, use `-` as the SKU ID. +// Format: `billingAccounts/{billing_account}/skus/-` Note: Specifying +// an actual SKU resource id will return a collection of one Billing +// Account Price. +func (r *BillingAccountsSkusPricesService) List(parent string) *BillingAccountsSkusPricesListCall { + c := &BillingAccountsSkusPricesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// CurrencyCode sets the optional parameter "currencyCode": ISO-4217 +// currency code for the price. If not specified, currency of billing +// account will be used. +func (c *BillingAccountsSkusPricesListCall) CurrencyCode(currencyCode string) *BillingAccountsSkusPricesListCall { + c.urlParams_.Set("currencyCode", currencyCode) + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// billing account price to return. Results may return fewer than this +// value. Default value is 50 and maximum value is 5000. +func (c *BillingAccountsSkusPricesListCall) PageSize(pageSize int64) *BillingAccountsSkusPricesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token +// received from a previous ListBillingAccountPrices call to retrieve +// the next page of results. If this field is empty, the first page is +// returned. +func (c *BillingAccountsSkusPricesListCall) PageToken(pageToken string) *BillingAccountsSkusPricesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BillingAccountsSkusPricesListCall) Fields(s ...googleapi.Field) *BillingAccountsSkusPricesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BillingAccountsSkusPricesListCall) IfNoneMatch(entityTag string) *BillingAccountsSkusPricesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *BillingAccountsSkusPricesListCall) Context(ctx context.Context) *BillingAccountsSkusPricesListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *BillingAccountsSkusPricesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *BillingAccountsSkusPricesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/prices") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "cloudbilling.billingAccounts.skus.prices.list" call. +// Exactly one of +// *GoogleCloudBillingBillingaccountpricesV1betaListBillingAccountPricesR +// esponse or error will be non-nil. Any non-2xx status code is an +// error. Response headers are in either +// *GoogleCloudBillingBillingaccountpricesV1betaListBillingAccountPricesR +// esponse.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BillingAccountsSkusPricesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudBillingBillingaccountpricesV1betaListBillingAccountPricesResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudBillingBillingaccountpricesV1betaListBillingAccountPricesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the latest prices for SKUs available to your Cloud Billing account.", + // "flatPath": "v1beta/billingAccounts/{billingAccountsId}/skus/{skusId}/prices", + // "httpMethod": "GET", + // "id": "cloudbilling.billingAccounts.skus.prices.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "currencyCode": { + // "description": "Optional. ISO-4217 currency code for the price. If not specified, currency of billing account will be used.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "Optional. Maximum number of billing account price to return. Results may return fewer than this value. Default value is 50 and maximum value is 5000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Page token received from a previous ListBillingAccountPrices call to retrieve the next page of results. If this field is empty, the first page is returned.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. To list all Billing Account SKUs, use `-` as the SKU ID. Format: `billingAccounts/{billing_account}/skus/-` Note: Specifying an actual SKU resource id will return a collection of one Billing Account Price.", + // "location": "path", + // "pattern": "^billingAccounts/[^/]+/skus/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+parent}/prices", + // "response": { + // "$ref": "GoogleCloudBillingBillingaccountpricesV1betaListBillingAccountPricesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-billing", + // "https://www.googleapis.com/auth/cloud-billing.readonly", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *BillingAccountsSkusPricesListCall) Pages(ctx context.Context, f func(*GoogleCloudBillingBillingaccountpricesV1betaListBillingAccountPricesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + // method id "cloudbilling.skuGroups.get": type SkuGroupsGetCall struct { @@ -6734,6 +7057,218 @@ func (c *SkusPriceGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudBilling } +// method id "cloudbilling.skus.prices.list": + +type SkusPricesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the latest prices for all SKUs. +// +// - parent: To list the prices for all SKUs, use `-` as the SKU ID. +// Format: `skus/-` Specifying a specific SKU ID returns a collection +// with one Price object for the SKU. +func (r *SkusPricesService) List(parent string) *SkusPricesListCall { + c := &SkusPricesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// CurrencyCode sets the optional parameter "currencyCode": ISO-4217 +// currency code for the price. If not specified, USD will be used. +func (c *SkusPricesListCall) CurrencyCode(currencyCode string) *SkusPricesListCall { + c.urlParams_.Set("currencyCode", currencyCode) + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// prices to return. Results may return fewer than this value. Default +// value is 50 and maximum value is 5000. +func (c *SkusPricesListCall) PageSize(pageSize int64) *SkusPricesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token +// received from a previous ListPrices call to retrieve the next page of +// results. If this field is empty, the first page is returned. +func (c *SkusPricesListCall) PageToken(pageToken string) *SkusPricesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SkusPricesListCall) Fields(s ...googleapi.Field) *SkusPricesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SkusPricesListCall) IfNoneMatch(entityTag string) *SkusPricesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *SkusPricesListCall) Context(ctx context.Context) *SkusPricesListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *SkusPricesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *SkusPricesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/prices") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "cloudbilling.skus.prices.list" call. +// Exactly one of *GoogleCloudBillingPricesV1betaListPricesResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudBillingPricesV1betaListPricesResponse.ServerResponse.Heade +// r or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *SkusPricesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudBillingPricesV1betaListPricesResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudBillingPricesV1betaListPricesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the latest prices for all SKUs.", + // "flatPath": "v1beta/skus/{skusId}/prices", + // "httpMethod": "GET", + // "id": "cloudbilling.skus.prices.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "currencyCode": { + // "description": "Optional. ISO-4217 currency code for the price. If not specified, USD will be used.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "Optional. Maximum number of prices to return. Results may return fewer than this value. Default value is 50 and maximum value is 5000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. Page token received from a previous ListPrices call to retrieve the next page of results. If this field is empty, the first page is returned.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. To list the prices for all SKUs, use `-` as the SKU ID. Format: `skus/-` Specifying a specific SKU ID returns a collection with one Price object for the SKU.", + // "location": "path", + // "pattern": "^skus/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+parent}/prices", + // "response": { + // "$ref": "GoogleCloudBillingPricesV1betaListPricesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-billing", + // "https://www.googleapis.com/auth/cloud-billing.readonly", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *SkusPricesListCall) Pages(ctx context.Context, f func(*GoogleCloudBillingPricesV1betaListPricesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + // method id "cloudbilling.estimateCostScenario": type V1betaEstimateCostScenarioCall struct { diff --git a/language/v1/language-api.json b/language/v1/language-api.json index e0500b933a4..5435de7f558 100644 --- a/language/v1/language-api.json +++ b/language/v1/language-api.json @@ -246,7 +246,7 @@ } } }, - "revision": "20230728", + "revision": "20231209", "rootUrl": "https://language.googleapis.com/", "schemas": { "AnalyzeEntitiesRequest": { @@ -558,7 +558,7 @@ "properties": { "classificationModelOptions": { "$ref": "ClassificationModelOptions", - "description": "Model options to use for classification. Defaults to v1 options if not specified." + "description": "Optional. Model options to use for classification. Defaults to v1 options if not specified." }, "document": { "$ref": "Document", @@ -903,7 +903,7 @@ "properties": { "classificationModelOptions": { "$ref": "ClassificationModelOptions", - "description": "The model options to use for classification. Defaults to v1 options if not specified. Only used if `classify_text` is set to true." + "description": "Optional. The model options to use for classification. Defaults to v1 options if not specified. Only used if `classify_text` is set to true." }, "classifyText": { "description": "Classify the full document into categories.", diff --git a/language/v1/language-gen.go b/language/v1/language-gen.go index 6c66b52c2cf..a0885e0dbe9 100644 --- a/language/v1/language-gen.go +++ b/language/v1/language-gen.go @@ -708,8 +708,8 @@ func (s *ClassificationModelOptions) MarshalJSON() ([]byte, error) { // ClassifyTextRequest: The document classification request message. type ClassifyTextRequest struct { - // ClassificationModelOptions: Model options to use for classification. - // Defaults to v1 options if not specified. + // ClassificationModelOptions: Optional. Model options to use for + // classification. Defaults to v1 options if not specified. ClassificationModelOptions *ClassificationModelOptions `json:"classificationModelOptions,omitempty"` // Document: Required. Input document. @@ -1100,7 +1100,7 @@ func (s *EntityMention) MarshalJSON() ([]byte, error) { // analysis. Setting each one to true will enable that specific analysis // for the input. type Features struct { - // ClassificationModelOptions: The model options to use for + // ClassificationModelOptions: Optional. The model options to use for // classification. Defaults to v1 options if not specified. Only used if // `classify_text` is set to true. ClassificationModelOptions *ClassificationModelOptions `json:"classificationModelOptions,omitempty"` diff --git a/language/v1beta2/language-api.json b/language/v1beta2/language-api.json index 4fb9abbf2b3..85b539d0c94 100644 --- a/language/v1beta2/language-api.json +++ b/language/v1beta2/language-api.json @@ -246,7 +246,7 @@ } } }, - "revision": "20230728", + "revision": "20231209", "rootUrl": "https://language.googleapis.com/", "schemas": { "AnalyzeEntitiesRequest": { @@ -558,7 +558,7 @@ "properties": { "classificationModelOptions": { "$ref": "ClassificationModelOptions", - "description": "Model options to use for classification. Defaults to v1 options if not specified." + "description": "Optional. Model options to use for classification. Defaults to v1 options if not specified." }, "document": { "$ref": "Document", @@ -921,7 +921,7 @@ "properties": { "classificationModelOptions": { "$ref": "ClassificationModelOptions", - "description": "The model options to use for classification. Defaults to v1 options if not specified. Only used if `classify_text` is set to true." + "description": "Optional. The model options to use for classification. Defaults to v1 options if not specified. Only used if `classify_text` is set to true." }, "classifyText": { "description": "Classify the full document into categories. If this is true, the API will use the default model which classifies into a [predefined taxonomy](https://cloud.google.com/natural-language/docs/categories).", diff --git a/language/v1beta2/language-gen.go b/language/v1beta2/language-gen.go index 5e8a1aedc99..3d4870fbb58 100644 --- a/language/v1beta2/language-gen.go +++ b/language/v1beta2/language-gen.go @@ -708,8 +708,8 @@ func (s *ClassificationModelOptions) MarshalJSON() ([]byte, error) { // ClassifyTextRequest: The document classification request message. type ClassifyTextRequest struct { - // ClassificationModelOptions: Model options to use for classification. - // Defaults to v1 options if not specified. + // ClassificationModelOptions: Optional. Model options to use for + // classification. Defaults to v1 options if not specified. ClassificationModelOptions *ClassificationModelOptions `json:"classificationModelOptions,omitempty"` // Document: Required. Input document. @@ -1118,7 +1118,7 @@ func (s *EntityMention) MarshalJSON() ([]byte, error) { // analysis. Setting each one to true will enable that specific analysis // for the input. Next ID: 12 type Features struct { - // ClassificationModelOptions: The model options to use for + // ClassificationModelOptions: Optional. The model options to use for // classification. Defaults to v1 options if not specified. Only used if // `classify_text` is set to true. ClassificationModelOptions *ClassificationModelOptions `json:"classificationModelOptions,omitempty"` diff --git a/monitoring/v1/monitoring-api.json b/monitoring/v1/monitoring-api.json index b1c4c4a52ff..0fa14c1a162 100644 --- a/monitoring/v1/monitoring-api.json +++ b/monitoring/v1/monitoring-api.json @@ -753,7 +753,7 @@ } } }, - "revision": "20231205", + "revision": "20231208", "rootUrl": "https://monitoring.googleapis.com/", "schemas": { "Aggregation": { @@ -2029,6 +2029,21 @@ }, "type": "object" }, + "SectionHeader": { + "description": "A widget that defines a new section header. Sections populate a table of contents and allow easier navigation of long-form content.", + "id": "SectionHeader", + "properties": { + "dividerBelow": { + "description": "Whether to insert a divider below the section in the table of contents", + "type": "boolean" + }, + "subtitle": { + "description": "The subtitle of the section", + "type": "string" + } + }, + "type": "object" + }, "SourceContext": { "description": "SourceContext represents information about the source of a protobuf element, like the file in which it is defined.", "id": "SourceContext", @@ -2626,6 +2641,10 @@ "$ref": "Scorecard", "description": "A scorecard summarizing time series data." }, + "sectionHeader": { + "$ref": "SectionHeader", + "description": "A widget that defines a section header for easier navigation of the dashboard." + }, "text": { "$ref": "Text", "description": "A raw string or markdown displaying textual content." diff --git a/monitoring/v1/monitoring-gen.go b/monitoring/v1/monitoring-gen.go index 9b6260172e1..d9a72b265ca 100644 --- a/monitoring/v1/monitoring-gen.go +++ b/monitoring/v1/monitoring-gen.go @@ -2639,6 +2639,40 @@ func (s *Scorecard) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// SectionHeader: A widget that defines a new section header. Sections +// populate a table of contents and allow easier navigation of long-form +// content. +type SectionHeader struct { + // DividerBelow: Whether to insert a divider below the section in the + // table of contents + DividerBelow bool `json:"dividerBelow,omitempty"` + + // Subtitle: The subtitle of the section + Subtitle string `json:"subtitle,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DividerBelow") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "DividerBelow") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *SectionHeader) MarshalJSON() ([]byte, error) { + type NoMethod SectionHeader + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // SourceContext: SourceContext represents information about the source // of a protobuf element, like the file in which it is defined. type SourceContext struct { @@ -3467,6 +3501,10 @@ type Widget struct { // Scorecard: A scorecard summarizing time series data. Scorecard *Scorecard `json:"scorecard,omitempty"` + // SectionHeader: A widget that defines a section header for easier + // navigation of the dashboard. + SectionHeader *SectionHeader `json:"sectionHeader,omitempty"` + // Text: A raw string or markdown displaying textual content. Text *Text `json:"text,omitempty"` diff --git a/paymentsresellersubscription/v1/paymentsresellersubscription-api.json b/paymentsresellersubscription/v1/paymentsresellersubscription-api.json index 37ec644121e..3199467ad1f 100644 --- a/paymentsresellersubscription/v1/paymentsresellersubscription-api.json +++ b/paymentsresellersubscription/v1/paymentsresellersubscription-api.json @@ -435,7 +435,7 @@ } } }, - "revision": "20231207", + "revision": "20231210", "rootUrl": "https://paymentsresellersubscription.googleapis.com/", "schemas": { "GoogleCloudPaymentsResellerSubscriptionV1Amount": { @@ -482,10 +482,10 @@ "Buyer's remorse.", "Accidential purchase.", "Payment is past due.", - "User account closed.", + "Used for notification only, do not use in Cancel API. User account closed.", "Used for notification only, do not use in Cancel API. Cancellation due to upgrade or downgrade.", "Cancellation due to user delinquency", - "Cancellation due to an unrecoverable system error.", + "Used for notification only, do not use in Cancel API. Cancellation due to an unrecoverable system error.", "Used for notification only, do not use in Cancel API. The subscription is cancelled by Google automatically since it is no longer valid.", "Other reason." ], @@ -1176,10 +1176,10 @@ "Buyer's remorse.", "Accidential purchase.", "Payment is past due.", - "User account closed.", + "Used for notification only, do not use in Cancel API. User account closed.", "Used for notification only, do not use in Cancel API. Cancellation due to upgrade or downgrade.", "Cancellation due to user delinquency", - "Cancellation due to an unrecoverable system error.", + "Used for notification only, do not use in Cancel API. Cancellation due to an unrecoverable system error.", "Used for notification only, do not use in Cancel API. The subscription is cancelled by Google automatically since it is no longer valid.", "Other reason." ], diff --git a/paymentsresellersubscription/v1/paymentsresellersubscription-gen.go b/paymentsresellersubscription/v1/paymentsresellersubscription-gen.go index 4e9adc1d0ec..09439ae73db 100644 --- a/paymentsresellersubscription/v1/paymentsresellersubscription-gen.go +++ b/paymentsresellersubscription/v1/paymentsresellersubscription-gen.go @@ -246,14 +246,16 @@ type GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionRequest struct { // "CANCELLATION_REASON_REMORSE" - Buyer's remorse. // "CANCELLATION_REASON_ACCIDENTAL_PURCHASE" - Accidential purchase. // "CANCELLATION_REASON_PAST_DUE" - Payment is past due. - // "CANCELLATION_REASON_ACCOUNT_CLOSED" - User account closed. + // "CANCELLATION_REASON_ACCOUNT_CLOSED" - Used for notification only, + // do not use in Cancel API. User account closed. // "CANCELLATION_REASON_UPGRADE_DOWNGRADE" - Used for notification // only, do not use in Cancel API. Cancellation due to upgrade or // downgrade. // "CANCELLATION_REASON_USER_DELINQUENCY" - Cancellation due to user // delinquency - // "CANCELLATION_REASON_SYSTEM_ERROR" - Cancellation due to an - // unrecoverable system error. + // "CANCELLATION_REASON_SYSTEM_ERROR" - Used for notification only, do + // not use in Cancel API. Cancellation due to an unrecoverable system + // error. // "CANCELLATION_REASON_SYSTEM_CANCEL" - Used for notification only, // do not use in Cancel API. The subscription is cancelled by Google // automatically since it is no longer valid. @@ -1369,14 +1371,16 @@ type GoogleCloudPaymentsResellerSubscriptionV1SubscriptionCancellationDetails st // "CANCELLATION_REASON_REMORSE" - Buyer's remorse. // "CANCELLATION_REASON_ACCIDENTAL_PURCHASE" - Accidential purchase. // "CANCELLATION_REASON_PAST_DUE" - Payment is past due. - // "CANCELLATION_REASON_ACCOUNT_CLOSED" - User account closed. + // "CANCELLATION_REASON_ACCOUNT_CLOSED" - Used for notification only, + // do not use in Cancel API. User account closed. // "CANCELLATION_REASON_UPGRADE_DOWNGRADE" - Used for notification // only, do not use in Cancel API. Cancellation due to upgrade or // downgrade. // "CANCELLATION_REASON_USER_DELINQUENCY" - Cancellation due to user // delinquency - // "CANCELLATION_REASON_SYSTEM_ERROR" - Cancellation due to an - // unrecoverable system error. + // "CANCELLATION_REASON_SYSTEM_ERROR" - Used for notification only, do + // not use in Cancel API. Cancellation due to an unrecoverable system + // error. // "CANCELLATION_REASON_SYSTEM_CANCEL" - Used for notification only, // do not use in Cancel API. The subscription is cancelled by Google // automatically since it is no longer valid. diff --git a/playdeveloperreporting/v1alpha1/playdeveloperreporting-api.json b/playdeveloperreporting/v1alpha1/playdeveloperreporting-api.json index db744b0e88c..76cdd0a3e90 100644 --- a/playdeveloperreporting/v1alpha1/playdeveloperreporting-api.json +++ b/playdeveloperreporting/v1alpha1/playdeveloperreporting-api.json @@ -941,7 +941,7 @@ } } }, - "revision": "20231207", + "revision": "20231210", "rootUrl": "https://playdeveloperreporting.googleapis.com/", "schemas": { "GooglePlayDeveloperReportingV1alpha1Anomaly": { @@ -1199,6 +1199,10 @@ "description": "An error report received for an app. There reports are produced by the Android platform code when a (potentially fatal) error condition is detected. Identical reports from many users will be deduplicated and coalesced into a single ErrorReport. **Required permissions**: to access this resource, the calling user needs the _View app information (read-only)_ permission for the app.", "id": "GooglePlayDeveloperReportingV1alpha1ErrorReport", "properties": { + "appVersion": { + "$ref": "GooglePlayDeveloperReportingV1alpha1AppVersion", + "description": "The app version on which an event in this error report occurred on." + }, "deviceModel": { "$ref": "GooglePlayDeveloperReportingV1alpha1DeviceModelSummary", "description": "A device model on which an event in this error report occurred on." diff --git a/playdeveloperreporting/v1alpha1/playdeveloperreporting-gen.go b/playdeveloperreporting/v1alpha1/playdeveloperreporting-gen.go index 5e92f6dec06..97bae1c8319 100644 --- a/playdeveloperreporting/v1alpha1/playdeveloperreporting-gen.go +++ b/playdeveloperreporting/v1alpha1/playdeveloperreporting-gen.go @@ -978,6 +978,10 @@ func (s *GooglePlayDeveloperReportingV1alpha1ErrorIssue) MarshalJSON() ([]byte, // resource, the calling user needs the _View app information // (read-only)_ permission for the app. type GooglePlayDeveloperReportingV1alpha1ErrorReport struct { + // AppVersion: The app version on which an event in this error report + // occurred on. + AppVersion *GooglePlayDeveloperReportingV1alpha1AppVersion `json:"appVersion,omitempty"` + // DeviceModel: A device model on which an event in this error report // occurred on. DeviceModel *GooglePlayDeveloperReportingV1alpha1DeviceModelSummary `json:"deviceModel,omitempty"` @@ -1027,7 +1031,7 @@ type GooglePlayDeveloperReportingV1alpha1ErrorReport struct { // respectively. VcsInformation string `json:"vcsInformation,omitempty"` - // ForceSendFields is a list of field names (e.g. "DeviceModel") to + // ForceSendFields is a list of field names (e.g. "AppVersion") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1035,10 +1039,10 @@ type GooglePlayDeveloperReportingV1alpha1ErrorReport struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DeviceModel") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "AppVersion") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` diff --git a/playdeveloperreporting/v1beta1/playdeveloperreporting-api.json b/playdeveloperreporting/v1beta1/playdeveloperreporting-api.json index b99d8284ac1..068c53f8ba8 100644 --- a/playdeveloperreporting/v1beta1/playdeveloperreporting-api.json +++ b/playdeveloperreporting/v1beta1/playdeveloperreporting-api.json @@ -941,7 +941,7 @@ } } }, - "revision": "20231207", + "revision": "20231210", "rootUrl": "https://playdeveloperreporting.googleapis.com/", "schemas": { "GooglePlayDeveloperReportingV1beta1Anomaly": { @@ -1199,6 +1199,10 @@ "description": "An error report received for an app. There reports are produced by the Android platform code when a (potentially fatal) error condition is detected. Identical reports from many users will be deduplicated and coalesced into a single ErrorReport. **Required permissions**: to access this resource, the calling user needs the _View app information (read-only)_ permission for the app.", "id": "GooglePlayDeveloperReportingV1beta1ErrorReport", "properties": { + "appVersion": { + "$ref": "GooglePlayDeveloperReportingV1beta1AppVersion", + "description": "The app version on which an event in this error report occurred on." + }, "deviceModel": { "$ref": "GooglePlayDeveloperReportingV1beta1DeviceModelSummary", "description": "A device model on which an event in this error report occurred on." diff --git a/playdeveloperreporting/v1beta1/playdeveloperreporting-gen.go b/playdeveloperreporting/v1beta1/playdeveloperreporting-gen.go index 970343666e2..f8df3302385 100644 --- a/playdeveloperreporting/v1beta1/playdeveloperreporting-gen.go +++ b/playdeveloperreporting/v1beta1/playdeveloperreporting-gen.go @@ -978,6 +978,10 @@ func (s *GooglePlayDeveloperReportingV1beta1ErrorIssue) MarshalJSON() ([]byte, e // resource, the calling user needs the _View app information // (read-only)_ permission for the app. type GooglePlayDeveloperReportingV1beta1ErrorReport struct { + // AppVersion: The app version on which an event in this error report + // occurred on. + AppVersion *GooglePlayDeveloperReportingV1beta1AppVersion `json:"appVersion,omitempty"` + // DeviceModel: A device model on which an event in this error report // occurred on. DeviceModel *GooglePlayDeveloperReportingV1beta1DeviceModelSummary `json:"deviceModel,omitempty"` @@ -1027,7 +1031,7 @@ type GooglePlayDeveloperReportingV1beta1ErrorReport struct { // respectively. VcsInformation string `json:"vcsInformation,omitempty"` - // ForceSendFields is a list of field names (e.g. "DeviceModel") to + // ForceSendFields is a list of field names (e.g. "AppVersion") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1035,10 +1039,10 @@ type GooglePlayDeveloperReportingV1beta1ErrorReport struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DeviceModel") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "AppVersion") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` diff --git a/policysimulator/v1/policysimulator-api.json b/policysimulator/v1/policysimulator-api.json index 174b73cdfe7..fedac73b7b6 100644 --- a/policysimulator/v1/policysimulator-api.json +++ b/policysimulator/v1/policysimulator-api.json @@ -707,7 +707,7 @@ } } }, - "revision": "20231203", + "revision": "20231210", "rootUrl": "https://policysimulator.googleapis.com/", "schemas": { "GoogleCloudOrgpolicyV2AlternatePolicySpec": { @@ -807,6 +807,10 @@ "$ref": "GoogleCloudOrgpolicyV2PolicySpec", "description": "Dry-run policy. Audit-only policy, can be used to monitor how the policy would have impacted the existing and future resources if it's enforced." }, + "etag": { + "description": "Optional. An opaque tag indicating the current state of the policy, used for concurrency control. This 'etag' is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.", + "type": "string" + }, "name": { "description": "Immutable. The resource name of the policy. Must be one of the following forms, where `constraint_name` is the name of the constraint which this policy configures: * `projects/{project_number}/policies/{constraint_name}` * `folders/{folder_id}/policies/{constraint_name}` * `organizations/{organization_id}/policies/{constraint_name}` For example, `projects/123/policies/compute.disableSerialPortAccess`. Note: `projects/{project_id}/policies/{constraint_name}` is also an acceptable name for API requests, but responses will return the name using the equivalent project number.", "type": "string" diff --git a/policysimulator/v1/policysimulator-gen.go b/policysimulator/v1/policysimulator-gen.go index 02977a09c48..785c15a3a06 100644 --- a/policysimulator/v1/policysimulator-gen.go +++ b/policysimulator/v1/policysimulator-gen.go @@ -469,6 +469,13 @@ type GoogleCloudOrgpolicyV2Policy struct { // if it's enforced. DryRunSpec *GoogleCloudOrgpolicyV2PolicySpec `json:"dryRunSpec,omitempty"` + // Etag: Optional. An opaque tag indicating the current state of the + // policy, used for concurrency control. This 'etag' is computed by the + // server based on the value of other fields, and may be sent on update + // and delete requests to ensure the client has an up-to-date value + // before proceeding. + Etag string `json:"etag,omitempty"` + // Name: Immutable. The resource name of the policy. Must be one of the // following forms, where `constraint_name` is the name of the // constraint which this policy configures: * diff --git a/policysimulator/v1alpha/policysimulator-api.json b/policysimulator/v1alpha/policysimulator-api.json index 955b1b05fcb..eba0e10b860 100644 --- a/policysimulator/v1alpha/policysimulator-api.json +++ b/policysimulator/v1alpha/policysimulator-api.json @@ -1047,7 +1047,7 @@ } } }, - "revision": "20231203", + "revision": "20231210", "rootUrl": "https://policysimulator.googleapis.com/", "schemas": { "GoogleCloudOrgpolicyV2AlternatePolicySpec": { @@ -1147,6 +1147,10 @@ "$ref": "GoogleCloudOrgpolicyV2PolicySpec", "description": "Dry-run policy. Audit-only policy, can be used to monitor how the policy would have impacted the existing and future resources if it's enforced." }, + "etag": { + "description": "Optional. An opaque tag indicating the current state of the policy, used for concurrency control. This 'etag' is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.", + "type": "string" + }, "name": { "description": "Immutable. The resource name of the policy. Must be one of the following forms, where `constraint_name` is the name of the constraint which this policy configures: * `projects/{project_number}/policies/{constraint_name}` * `folders/{folder_id}/policies/{constraint_name}` * `organizations/{organization_id}/policies/{constraint_name}` For example, `projects/123/policies/compute.disableSerialPortAccess`. Note: `projects/{project_id}/policies/{constraint_name}` is also an acceptable name for API requests, but responses will return the name using the equivalent project number.", "type": "string" diff --git a/policysimulator/v1alpha/policysimulator-gen.go b/policysimulator/v1alpha/policysimulator-gen.go index 4604dae380c..3326241a566 100644 --- a/policysimulator/v1alpha/policysimulator-gen.go +++ b/policysimulator/v1alpha/policysimulator-gen.go @@ -553,6 +553,13 @@ type GoogleCloudOrgpolicyV2Policy struct { // if it's enforced. DryRunSpec *GoogleCloudOrgpolicyV2PolicySpec `json:"dryRunSpec,omitempty"` + // Etag: Optional. An opaque tag indicating the current state of the + // policy, used for concurrency control. This 'etag' is computed by the + // server based on the value of other fields, and may be sent on update + // and delete requests to ensure the client has an up-to-date value + // before proceeding. + Etag string `json:"etag,omitempty"` + // Name: Immutable. The resource name of the policy. Must be one of the // following forms, where `constraint_name` is the name of the // constraint which this policy configures: * diff --git a/policysimulator/v1beta/policysimulator-api.json b/policysimulator/v1beta/policysimulator-api.json index adcd1598747..f90f830460e 100644 --- a/policysimulator/v1beta/policysimulator-api.json +++ b/policysimulator/v1beta/policysimulator-api.json @@ -1047,7 +1047,7 @@ } } }, - "revision": "20231203", + "revision": "20231210", "rootUrl": "https://policysimulator.googleapis.com/", "schemas": { "GoogleCloudOrgpolicyV2AlternatePolicySpec": { @@ -1147,6 +1147,10 @@ "$ref": "GoogleCloudOrgpolicyV2PolicySpec", "description": "Dry-run policy. Audit-only policy, can be used to monitor how the policy would have impacted the existing and future resources if it's enforced." }, + "etag": { + "description": "Optional. An opaque tag indicating the current state of the policy, used for concurrency control. This 'etag' is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.", + "type": "string" + }, "name": { "description": "Immutable. The resource name of the policy. Must be one of the following forms, where `constraint_name` is the name of the constraint which this policy configures: * `projects/{project_number}/policies/{constraint_name}` * `folders/{folder_id}/policies/{constraint_name}` * `organizations/{organization_id}/policies/{constraint_name}` For example, `projects/123/policies/compute.disableSerialPortAccess`. Note: `projects/{project_id}/policies/{constraint_name}` is also an acceptable name for API requests, but responses will return the name using the equivalent project number.", "type": "string" diff --git a/policysimulator/v1beta/policysimulator-gen.go b/policysimulator/v1beta/policysimulator-gen.go index 28af9f7dfa6..c87cb5dd9fd 100644 --- a/policysimulator/v1beta/policysimulator-gen.go +++ b/policysimulator/v1beta/policysimulator-gen.go @@ -553,6 +553,13 @@ type GoogleCloudOrgpolicyV2Policy struct { // if it's enforced. DryRunSpec *GoogleCloudOrgpolicyV2PolicySpec `json:"dryRunSpec,omitempty"` + // Etag: Optional. An opaque tag indicating the current state of the + // policy, used for concurrency control. This 'etag' is computed by the + // server based on the value of other fields, and may be sent on update + // and delete requests to ensure the client has an up-to-date value + // before proceeding. + Etag string `json:"etag,omitempty"` + // Name: Immutable. The resource name of the policy. Must be one of the // following forms, where `constraint_name` is the name of the // constraint which this policy configures: * diff --git a/retail/v2alpha/retail-api.json b/retail/v2alpha/retail-api.json index 9016d0af20e..5516369722c 100644 --- a/retail/v2alpha/retail-api.json +++ b/retail/v2alpha/retail-api.json @@ -2416,7 +2416,7 @@ } } }, - "revision": "20231130", + "revision": "20231207", "rootUrl": "https://retail.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -5016,6 +5016,14 @@ "datasetId": { "description": "Required. The ID of a BigQuery Dataset.", "type": "string" + }, + "tableIdPrefix": { + "description": "Required. The prefix of exported BigQuery tables.", + "type": "string" + }, + "tableType": { + "description": "Required. Describes the table type. The following values are supported: * `table`: A BigQuery native table. * `view`: A virtual table defined by a SQL query.", + "type": "string" } }, "type": "object" diff --git a/retail/v2alpha/retail-gen.go b/retail/v2alpha/retail-gen.go index 28e5fcfb623..676a9f1b5c9 100644 --- a/retail/v2alpha/retail-gen.go +++ b/retail/v2alpha/retail-gen.go @@ -5247,6 +5247,14 @@ type GoogleCloudRetailV2alphaOutputConfigBigQueryDestination struct { // DatasetId: Required. The ID of a BigQuery Dataset. DatasetId string `json:"datasetId,omitempty"` + // TableIdPrefix: Required. The prefix of exported BigQuery tables. + TableIdPrefix string `json:"tableIdPrefix,omitempty"` + + // TableType: Required. Describes the table type. The following values + // are supported: * `table`: A BigQuery native table. * `view`: A + // virtual table defined by a SQL query. + TableType string `json:"tableType,omitempty"` + // ForceSendFields is a list of field names (e.g. "DatasetId") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any diff --git a/script/v1/script-api.json b/script/v1/script-api.json index a2945d686d8..4daf6d94ce5 100644 --- a/script/v1/script-api.json +++ b/script/v1/script-api.json @@ -891,7 +891,7 @@ } } }, - "revision": "20231029", + "revision": "20231203", "rootUrl": "https://script.googleapis.com/", "schemas": { "Content": { @@ -905,6 +905,10 @@ }, "type": "array" }, + "revertFlumeInvoked": { + "description": "Set to true if called from revert flume to allow deletion of system generated manifest file while validating content request. This value is false by default.", + "type": "boolean" + }, "scriptId": { "description": "The script project's Drive ID.", "type": "string" diff --git a/script/v1/script-gen.go b/script/v1/script-gen.go index db3e602ea21..56b9cf8d35a 100644 --- a/script/v1/script-gen.go +++ b/script/v1/script-gen.go @@ -288,6 +288,11 @@ type Content struct { // include the manifest configurations for the project. Files []*File `json:"files,omitempty"` + // RevertFlumeInvoked: Set to true if called from revert flume to allow + // deletion of system generated manifest file while validating content + // request. This value is false by default. + RevertFlumeInvoked bool `json:"revertFlumeInvoked,omitempty"` + // ScriptId: The script project's Drive ID. ScriptId string `json:"scriptId,omitempty"` diff --git a/securitycenter/v1/securitycenter-api.json b/securitycenter/v1/securitycenter-api.json index d326c56260c..d694e04d608 100644 --- a/securitycenter/v1/securitycenter-api.json +++ b/securitycenter/v1/securitycenter-api.json @@ -402,6 +402,293 @@ } } }, + "eventThreatDetectionSettings": { + "methods": { + "validateCustomModule": { + "description": "Validates the given Event Threat Detection custom module.", + "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings:validateCustomModule", + "httpMethod": "POST", + "id": "securitycenter.folders.eventThreatDetectionSettings.validateCustomModule", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. Resource name of the parent to validate the Custom Module under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + "location": "path", + "pattern": "^folders/[^/]+/eventThreatDetectionSettings$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}:validateCustomModule", + "request": { + "$ref": "ValidateEventThreatDetectionCustomModuleRequest" + }, + "response": { + "$ref": "ValidateEventThreatDetectionCustomModuleResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, + "resources": { + "customModules": { + "methods": { + "create": { + "description": "Creates a resident Event Threat Detection custom module at the scope of the given Resource Manager parent, and also creates inherited custom modules for all descendants of the given parent. These modules are enabled by default.", + "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules", + "httpMethod": "POST", + "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The new custom module's parent. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + "location": "path", + "pattern": "^folders/[^/]+/eventThreatDetectionSettings$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/customModules", + "request": { + "$ref": "EventThreatDetectionCustomModule" + }, + "response": { + "$ref": "EventThreatDetectionCustomModule" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes the specified Event Threat Detection custom module and all of its descendants in the Resource Manager hierarchy. This method is only supported for resident custom modules.", + "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules/{customModulesId}", + "httpMethod": "DELETE", + "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the custom module to delete. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", + "location": "path", + "pattern": "^folders/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets an Event Threat Detection custom module.", + "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules/{customModulesId}", + "httpMethod": "GET", + "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the custom module to get. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", + "location": "path", + "pattern": "^folders/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "EventThreatDetectionCustomModule" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists all Event Threat Detection custom modules for the given Resource Manager parent. This includes resident modules defined at the scope of the parent along with modules inherited from ancestors.", + "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules", + "httpMethod": "GET", + "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "The maximum number of modules to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListEventThreatDetectionCustomModules` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of the parent to list custom modules under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + "location": "path", + "pattern": "^folders/[^/]+/eventThreatDetectionSettings$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/customModules", + "response": { + "$ref": "ListEventThreatDetectionCustomModulesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "listDescendant": { + "description": "Lists all resident Event Threat Detection custom modules under the given Resource Manager parent and its descendants.", + "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules:listDescendant", + "httpMethod": "GET", + "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.listDescendant", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "The maximum number of modules to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListDescendantEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListDescendantEventThreatDetectionCustomModules` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of the parent to list custom modules under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + "location": "path", + "pattern": "^folders/[^/]+/eventThreatDetectionSettings$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/customModules:listDescendant", + "response": { + "$ref": "ListDescendantEventThreatDetectionCustomModulesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Updates the Event Threat Detection custom module with the given name based on the given update mask. Updating the enablement state is supported for both resident and inherited modules (though resident modules cannot have an enablement state of \"inherited\"). Updating the display name or configuration of a module is supported for resident modules only. The type of a module cannot be changed.", + "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules/{customModulesId}", + "httpMethod": "PATCH", + "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Immutable. The resource name of the Event Threat Detection custom module. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", + "location": "path", + "pattern": "^folders/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "The list of fields to be updated. If empty all mutable fields will be updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+name}", + "request": { + "$ref": "EventThreatDetectionCustomModule" + }, + "response": { + "$ref": "EventThreatDetectionCustomModule" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "effectiveCustomModules": { + "methods": { + "get": { + "description": "Gets an effective Event Threat Detection custom module at the given level.", + "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/effectiveCustomModules/{effectiveCustomModulesId}", + "httpMethod": "GET", + "id": "securitycenter.folders.eventThreatDetectionSettings.effectiveCustomModules.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the effective Event Threat Detection custom module. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}\".", + "location": "path", + "pattern": "^folders/[^/]+/eventThreatDetectionSettings/effectiveCustomModules/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "EffectiveEventThreatDetectionCustomModule" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists all effective Event Threat Detection custom modules for the given parent. This includes resident modules defined at the scope of the parent along with modules inherited from its ancestors.", + "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/effectiveCustomModules", + "httpMethod": "GET", + "id": "securitycenter.folders.eventThreatDetectionSettings.effectiveCustomModules.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "The maximum number of modules to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListEffectiveEventThreatDetectionCustomModules` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of the parent to list custom modules for. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + "location": "path", + "pattern": "^folders/[^/]+/eventThreatDetectionSettings$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/effectiveCustomModules", + "response": { + "$ref": "ListEffectiveEventThreatDetectionCustomModulesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + }, "findings": { "methods": { "bulkMute": { @@ -1011,7 +1298,7 @@ "type": "string" }, "updateMask": { - "description": "The list of fields to update.", + "description": "The list of fields to be updated. The only fields that can be updated are `enablement_state` and `custom_config`. If empty or set to the wildcard value `*`, both `enablement_state` and `custom_config` are updated.", "format": "google-fieldmask", "location": "query", "type": "string" @@ -1834,7 +2121,7 @@ ], "parameters": { "parent": { - "description": "Required. Resource name of the parent to validate the Custom Module under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\".", + "description": "Required. Resource name of the parent to validate the Custom Module under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", "location": "path", "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", "required": true, @@ -1857,7 +2144,7 @@ "customModules": { "methods": { "create": { - "description": "Creates an Event Threat Detection custom module.", + "description": "Creates a resident Event Threat Detection custom module at the scope of the given Resource Manager parent, and also creates inherited custom modules for all descendants of the given parent. These modules are enabled by default.", "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules", "httpMethod": "POST", "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.create", @@ -1866,7 +2153,7 @@ ], "parameters": { "parent": { - "description": "Required. The new custom module's parent. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\".", + "description": "Required. The new custom module's parent. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", "location": "path", "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", "required": true, @@ -1885,7 +2172,7 @@ ] }, "delete": { - "description": "Deletes an Event Threat Detection custom module.", + "description": "Deletes the specified Event Threat Detection custom module and all of its descendants in the Resource Manager hierarchy. This method is only supported for resident custom modules.", "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", "httpMethod": "DELETE", "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.delete", @@ -1894,7 +2181,7 @@ ], "parameters": { "name": { - "description": "Required. Name of the custom module to delete. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\".", + "description": "Required. Name of the custom module to delete. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", "location": "path", "pattern": "^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", "required": true, @@ -1919,7 +2206,7 @@ ], "parameters": { "name": { - "description": "Required. Name of the custom module to get. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\".", + "description": "Required. Name of the custom module to get. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", "location": "path", "pattern": "^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", "required": true, @@ -1935,7 +2222,7 @@ ] }, "list": { - "description": "Lists Event Threat Detection custom modules.", + "description": "Lists all Event Threat Detection custom modules for the given Resource Manager parent. This includes resident modules defined at the scope of the parent along with modules inherited from ancestors.", "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules", "httpMethod": "GET", "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.list", @@ -1955,7 +2242,7 @@ "type": "string" }, "parent": { - "description": "Required. Name of the parent to list custom modules under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\".", + "description": "Required. Name of the parent to list custom modules under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", "location": "path", "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", "required": true, @@ -1970,8 +2257,44 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "listDescendant": { + "description": "Lists all resident Event Threat Detection custom modules under the given Resource Manager parent and its descendants.", + "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules:listDescendant", + "httpMethod": "GET", + "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.listDescendant", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "The maximum number of modules to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListDescendantEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListDescendantEventThreatDetectionCustomModules` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of the parent to list custom modules under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + "location": "path", + "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/customModules:listDescendant", + "response": { + "$ref": "ListDescendantEventThreatDetectionCustomModulesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "patch": { - "description": "Updates an Event Threat Detection custom module.", + "description": "Updates the Event Threat Detection custom module with the given name based on the given update mask. Updating the enablement state is supported for both resident and inherited modules (though resident modules cannot have an enablement state of \"inherited\"). Updating the display name or configuration of a module is supported for resident modules only. The type of a module cannot be changed.", "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", "httpMethod": "PATCH", "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.patch", @@ -2005,6 +2328,71 @@ ] } } + }, + "effectiveCustomModules": { + "methods": { + "get": { + "description": "Gets an effective Event Threat Detection custom module at the given level.", + "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/effectiveCustomModules/{effectiveCustomModulesId}", + "httpMethod": "GET", + "id": "securitycenter.organizations.eventThreatDetectionSettings.effectiveCustomModules.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the effective Event Threat Detection custom module. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}\".", + "location": "path", + "pattern": "^organizations/[^/]+/eventThreatDetectionSettings/effectiveCustomModules/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "EffectiveEventThreatDetectionCustomModule" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists all effective Event Threat Detection custom modules for the given parent. This includes resident modules defined at the scope of the parent along with modules inherited from its ancestors.", + "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/effectiveCustomModules", + "httpMethod": "GET", + "id": "securitycenter.organizations.eventThreatDetectionSettings.effectiveCustomModules.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "The maximum number of modules to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListEffectiveEventThreatDetectionCustomModules` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of the parent to list custom modules for. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + "location": "path", + "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/effectiveCustomModules", + "response": { + "$ref": "ListEffectiveEventThreatDetectionCustomModulesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } } } }, @@ -2889,7 +3277,7 @@ "type": "string" }, "updateMask": { - "description": "The list of fields to update.", + "description": "The list of fields to be updated. The only fields that can be updated are `enablement_state` and `custom_config`. If empty or set to the wildcard value `*`, both `enablement_state` and `custom_config` are updated.", "format": "google-fieldmask", "location": "query", "type": "string" @@ -4044,60 +4432,347 @@ "location": "query", "type": "integer" }, - "pageToken": { - "description": "A page token, received from a previous `ListBigQueryExports` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListBigQueryExports` must match the call that provided the page token.", - "location": "query", - "type": "string" + "pageToken": { + "description": "A page token, received from a previous `ListBigQueryExports` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListBigQueryExports` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent, which owns the collection of BigQuery exports. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", + "location": "path", + "pattern": "^projects/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/bigQueryExports", + "response": { + "$ref": "ListBigQueryExportsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Updates a BigQuery export.", + "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", + "httpMethod": "PATCH", + "id": "securitycenter.projects.bigQueryExports.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The relative resource name of this export. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name. Example format: \"organizations/{organization_id}/bigQueryExports/{export_id}\" Example format: \"folders/{folder_id}/bigQueryExports/{export_id}\" Example format: \"projects/{project_id}/bigQueryExports/{export_id}\" This field is provided in responses, and is ignored when provided in create requests.", + "location": "path", + "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "The list of fields to be updated. If empty all mutable fields will be updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+name}", + "request": { + "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + }, + "response": { + "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "eventThreatDetectionSettings": { + "methods": { + "validateCustomModule": { + "description": "Validates the given Event Threat Detection custom module.", + "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings:validateCustomModule", + "httpMethod": "POST", + "id": "securitycenter.projects.eventThreatDetectionSettings.validateCustomModule", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. Resource name of the parent to validate the Custom Module under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + "location": "path", + "pattern": "^projects/[^/]+/eventThreatDetectionSettings$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}:validateCustomModule", + "request": { + "$ref": "ValidateEventThreatDetectionCustomModuleRequest" + }, + "response": { + "$ref": "ValidateEventThreatDetectionCustomModuleResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, + "resources": { + "customModules": { + "methods": { + "create": { + "description": "Creates a resident Event Threat Detection custom module at the scope of the given Resource Manager parent, and also creates inherited custom modules for all descendants of the given parent. These modules are enabled by default.", + "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules", + "httpMethod": "POST", + "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The new custom module's parent. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + "location": "path", + "pattern": "^projects/[^/]+/eventThreatDetectionSettings$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/customModules", + "request": { + "$ref": "EventThreatDetectionCustomModule" + }, + "response": { + "$ref": "EventThreatDetectionCustomModule" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes the specified Event Threat Detection custom module and all of its descendants in the Resource Manager hierarchy. This method is only supported for resident custom modules.", + "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules/{customModulesId}", + "httpMethod": "DELETE", + "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the custom module to delete. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", + "location": "path", + "pattern": "^projects/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets an Event Threat Detection custom module.", + "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules/{customModulesId}", + "httpMethod": "GET", + "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the custom module to get. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", + "location": "path", + "pattern": "^projects/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "EventThreatDetectionCustomModule" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists all Event Threat Detection custom modules for the given Resource Manager parent. This includes resident modules defined at the scope of the parent along with modules inherited from ancestors.", + "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules", + "httpMethod": "GET", + "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "The maximum number of modules to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListEventThreatDetectionCustomModules` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of the parent to list custom modules under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + "location": "path", + "pattern": "^projects/[^/]+/eventThreatDetectionSettings$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/customModules", + "response": { + "$ref": "ListEventThreatDetectionCustomModulesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "listDescendant": { + "description": "Lists all resident Event Threat Detection custom modules under the given Resource Manager parent and its descendants.", + "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules:listDescendant", + "httpMethod": "GET", + "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.listDescendant", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "The maximum number of modules to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListDescendantEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListDescendantEventThreatDetectionCustomModules` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of the parent to list custom modules under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + "location": "path", + "pattern": "^projects/[^/]+/eventThreatDetectionSettings$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/customModules:listDescendant", + "response": { + "$ref": "ListDescendantEventThreatDetectionCustomModulesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] }, - "parent": { - "description": "Required. The parent, which owns the collection of BigQuery exports. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", - "location": "path", - "pattern": "^projects/[^/]+$", - "required": true, - "type": "string" + "patch": { + "description": "Updates the Event Threat Detection custom module with the given name based on the given update mask. Updating the enablement state is supported for both resident and inherited modules (though resident modules cannot have an enablement state of \"inherited\"). Updating the display name or configuration of a module is supported for resident modules only. The type of a module cannot be changed.", + "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules/{customModulesId}", + "httpMethod": "PATCH", + "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Immutable. The resource name of the Event Threat Detection custom module. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", + "location": "path", + "pattern": "^projects/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "The list of fields to be updated. If empty all mutable fields will be updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+name}", + "request": { + "$ref": "EventThreatDetectionCustomModule" + }, + "response": { + "$ref": "EventThreatDetectionCustomModule" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] } - }, - "path": "v1/{+parent}/bigQueryExports", - "response": { - "$ref": "ListBigQueryExportsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] + } }, - "patch": { - "description": "Updates a BigQuery export.", - "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", - "httpMethod": "PATCH", - "id": "securitycenter.projects.bigQueryExports.patch", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "The relative resource name of this export. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name. Example format: \"organizations/{organization_id}/bigQueryExports/{export_id}\" Example format: \"folders/{folder_id}/bigQueryExports/{export_id}\" Example format: \"projects/{project_id}/bigQueryExports/{export_id}\" This field is provided in responses, and is ignored when provided in create requests.", - "location": "path", - "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", - "required": true, - "type": "string" + "effectiveCustomModules": { + "methods": { + "get": { + "description": "Gets an effective Event Threat Detection custom module at the given level.", + "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/effectiveCustomModules/{effectiveCustomModulesId}", + "httpMethod": "GET", + "id": "securitycenter.projects.eventThreatDetectionSettings.effectiveCustomModules.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the effective Event Threat Detection custom module. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}\".", + "location": "path", + "pattern": "^projects/[^/]+/eventThreatDetectionSettings/effectiveCustomModules/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "EffectiveEventThreatDetectionCustomModule" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] }, - "updateMask": { - "description": "The list of fields to be updated. If empty all mutable fields will be updated.", - "format": "google-fieldmask", - "location": "query", - "type": "string" + "list": { + "description": "Lists all effective Event Threat Detection custom modules for the given parent. This includes resident modules defined at the scope of the parent along with modules inherited from its ancestors.", + "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/effectiveCustomModules", + "httpMethod": "GET", + "id": "securitycenter.projects.eventThreatDetectionSettings.effectiveCustomModules.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "The maximum number of modules to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListEffectiveEventThreatDetectionCustomModules` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of the parent to list custom modules for. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + "location": "path", + "pattern": "^projects/[^/]+/eventThreatDetectionSettings$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/effectiveCustomModules", + "response": { + "$ref": "ListEffectiveEventThreatDetectionCustomModulesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] } - }, - "path": "v1/{+name}", - "request": { - "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" - }, - "response": { - "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] + } } } }, @@ -4710,7 +5385,7 @@ "type": "string" }, "updateMask": { - "description": "The list of fields to update.", + "description": "The list of fields to be updated. The only fields that can be updated are `enablement_state` and `custom_config`. If empty or set to the wildcard value `*`, both `enablement_state` and `custom_config` are updated.", "format": "google-fieldmask", "location": "query", "type": "string" @@ -5135,7 +5810,7 @@ } } }, - "revision": "20231128", + "revision": "20231208", "rootUrl": "https://securitycenter.googleapis.com/", "schemas": { "Access": { @@ -6163,6 +6838,57 @@ }, "type": "object" }, + "EffectiveEventThreatDetectionCustomModule": { + "description": "An EffectiveEventThreatDetectionCustomModule is the representation of an Event Threat Detection custom module at a specified level of the resource hierarchy: organization, folder, or project. If a custom module is inherited from a parent organization or folder, the value of the `enablement_state` property in EffectiveEventThreatDetectionCustomModule is set to the value that is effective in the parent, instead of `INHERITED`. For example, if the module is enabled in a parent organization or folder, the effective `enablement_state` for the module in all child folders or projects is also `enabled`. EffectiveEventThreatDetectionCustomModule is read-only.", + "id": "EffectiveEventThreatDetectionCustomModule", + "properties": { + "config": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "Output only. Config for the effective module.", + "readOnly": true, + "type": "object" + }, + "description": { + "description": "Output only. The description for the module.", + "readOnly": true, + "type": "string" + }, + "displayName": { + "description": "Output only. The human readable name to be displayed for the module.", + "readOnly": true, + "type": "string" + }, + "enablementState": { + "description": "Output only. The effective state of enablement for the module at the given level of the hierarchy.", + "enum": [ + "ENABLEMENT_STATE_UNSPECIFIED", + "ENABLED", + "DISABLED" + ], + "enumDescriptions": [ + "Unspecified enablement state.", + "The module is enabled at the given level.", + "The module is disabled at the given level." + ], + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Output only. The resource name of the effective ETD custom module. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}\".", + "readOnly": true, + "type": "string" + }, + "type": { + "description": "Output only. Type for the module. e.g. CONFIGURABLE_BAD_IP.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "Empty": { "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", "id": "Empty", @@ -6185,9 +6911,14 @@ "type": "object" }, "EventThreatDetectionCustomModule": { - "description": "Represents an instance of an Event Threat Detection custom module, including its full module name, display name, enablement state, and last updated time. You can create a custom module at the organization level only.", + "description": "Represents an instance of an Event Threat Detection custom module, including its full module name, display name, enablement state, and last updated time. You can create a custom module at the organization, folder, or project level. Custom modules that you create at the organization or folder level are inherited by child folders and projects.", "id": "EventThreatDetectionCustomModule", "properties": { + "ancestorModule": { + "description": "Output only. The closest ancestor module that this module inherits the enablement state from. The format is the same as the EventThreatDetectionCustomModule resource name.", + "readOnly": true, + "type": "string" + }, "config": { "additionalProperties": { "description": "Properties of the object.", @@ -6209,12 +6940,14 @@ "enum": [ "ENABLEMENT_STATE_UNSPECIFIED", "ENABLED", - "DISABLED" + "DISABLED", + "INHERITED" ], "enumDescriptions": [ "Unspecified enablement state.", "The module is enabled at the given level.", - "The module is disabled at the given level." + "The module is disabled at the given level.", + "When the enablement state is inherited." ], "type": "string" }, @@ -9882,6 +10615,24 @@ }, "type": "object" }, + "ListDescendantEventThreatDetectionCustomModulesResponse": { + "description": "Response for listing current and descendant resident Event Threat Detection custom modules.", + "id": "ListDescendantEventThreatDetectionCustomModulesResponse", + "properties": { + "eventThreatDetectionCustomModules": { + "description": "Custom modules belonging to the requested parent.", + "items": { + "$ref": "EventThreatDetectionCustomModule" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + } + }, + "type": "object" + }, "ListDescendantSecurityHealthAnalyticsCustomModulesResponse": { "description": "Response message for listing descendant Security Health Analytics custom modules.", "id": "ListDescendantSecurityHealthAnalyticsCustomModulesResponse", @@ -9900,6 +10651,24 @@ }, "type": "object" }, + "ListEffectiveEventThreatDetectionCustomModulesResponse": { + "description": "Response for listing EffectiveEventThreatDetectionCustomModules.", + "id": "ListEffectiveEventThreatDetectionCustomModulesResponse", + "properties": { + "effectiveEventThreatDetectionCustomModules": { + "description": "Effective custom modules belonging to the requested parent.", + "items": { + "$ref": "EffectiveEventThreatDetectionCustomModule" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + } + }, + "type": "object" + }, "ListEffectiveSecurityHealthAnalyticsCustomModulesResponse": { "description": "Response message for listing effective Security Health Analytics custom modules.", "id": "ListEffectiveSecurityHealthAnalyticsCustomModulesResponse", diff --git a/securitycenter/v1/securitycenter-gen.go b/securitycenter/v1/securitycenter-gen.go index c662f88af64..ef9c72a0747 100644 --- a/securitycenter/v1/securitycenter-gen.go +++ b/securitycenter/v1/securitycenter-gen.go @@ -161,6 +161,7 @@ func NewFoldersService(s *Service) *FoldersService { rs := &FoldersService{s: s} rs.Assets = NewFoldersAssetsService(s) rs.BigQueryExports = NewFoldersBigQueryExportsService(s) + rs.EventThreatDetectionSettings = NewFoldersEventThreatDetectionSettingsService(s) rs.Findings = NewFoldersFindingsService(s) rs.Locations = NewFoldersLocationsService(s) rs.MuteConfigs = NewFoldersMuteConfigsService(s) @@ -177,6 +178,8 @@ type FoldersService struct { BigQueryExports *FoldersBigQueryExportsService + EventThreatDetectionSettings *FoldersEventThreatDetectionSettingsService + Findings *FoldersFindingsService Locations *FoldersLocationsService @@ -208,6 +211,39 @@ type FoldersBigQueryExportsService struct { s *Service } +func NewFoldersEventThreatDetectionSettingsService(s *Service) *FoldersEventThreatDetectionSettingsService { + rs := &FoldersEventThreatDetectionSettingsService{s: s} + rs.CustomModules = NewFoldersEventThreatDetectionSettingsCustomModulesService(s) + rs.EffectiveCustomModules = NewFoldersEventThreatDetectionSettingsEffectiveCustomModulesService(s) + return rs +} + +type FoldersEventThreatDetectionSettingsService struct { + s *Service + + CustomModules *FoldersEventThreatDetectionSettingsCustomModulesService + + EffectiveCustomModules *FoldersEventThreatDetectionSettingsEffectiveCustomModulesService +} + +func NewFoldersEventThreatDetectionSettingsCustomModulesService(s *Service) *FoldersEventThreatDetectionSettingsCustomModulesService { + rs := &FoldersEventThreatDetectionSettingsCustomModulesService{s: s} + return rs +} + +type FoldersEventThreatDetectionSettingsCustomModulesService struct { + s *Service +} + +func NewFoldersEventThreatDetectionSettingsEffectiveCustomModulesService(s *Service) *FoldersEventThreatDetectionSettingsEffectiveCustomModulesService { + rs := &FoldersEventThreatDetectionSettingsEffectiveCustomModulesService{s: s} + return rs +} + +type FoldersEventThreatDetectionSettingsEffectiveCustomModulesService struct { + s *Service +} + func NewFoldersFindingsService(s *Service) *FoldersFindingsService { rs := &FoldersFindingsService{s: s} return rs @@ -388,6 +424,7 @@ type OrganizationsBigQueryExportsService struct { func NewOrganizationsEventThreatDetectionSettingsService(s *Service) *OrganizationsEventThreatDetectionSettingsService { rs := &OrganizationsEventThreatDetectionSettingsService{s: s} rs.CustomModules = NewOrganizationsEventThreatDetectionSettingsCustomModulesService(s) + rs.EffectiveCustomModules = NewOrganizationsEventThreatDetectionSettingsEffectiveCustomModulesService(s) return rs } @@ -395,6 +432,8 @@ type OrganizationsEventThreatDetectionSettingsService struct { s *Service CustomModules *OrganizationsEventThreatDetectionSettingsCustomModulesService + + EffectiveCustomModules *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesService } func NewOrganizationsEventThreatDetectionSettingsCustomModulesService(s *Service) *OrganizationsEventThreatDetectionSettingsCustomModulesService { @@ -406,6 +445,15 @@ type OrganizationsEventThreatDetectionSettingsCustomModulesService struct { s *Service } +func NewOrganizationsEventThreatDetectionSettingsEffectiveCustomModulesService(s *Service) *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesService { + rs := &OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesService{s: s} + return rs +} + +type OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesService struct { + s *Service +} + func NewOrganizationsFindingsService(s *Service) *OrganizationsFindingsService { rs := &OrganizationsFindingsService{s: s} return rs @@ -623,6 +671,7 @@ func NewProjectsService(s *Service) *ProjectsService { rs := &ProjectsService{s: s} rs.Assets = NewProjectsAssetsService(s) rs.BigQueryExports = NewProjectsBigQueryExportsService(s) + rs.EventThreatDetectionSettings = NewProjectsEventThreatDetectionSettingsService(s) rs.Findings = NewProjectsFindingsService(s) rs.Locations = NewProjectsLocationsService(s) rs.MuteConfigs = NewProjectsMuteConfigsService(s) @@ -639,6 +688,8 @@ type ProjectsService struct { BigQueryExports *ProjectsBigQueryExportsService + EventThreatDetectionSettings *ProjectsEventThreatDetectionSettingsService + Findings *ProjectsFindingsService Locations *ProjectsLocationsService @@ -670,6 +721,39 @@ type ProjectsBigQueryExportsService struct { s *Service } +func NewProjectsEventThreatDetectionSettingsService(s *Service) *ProjectsEventThreatDetectionSettingsService { + rs := &ProjectsEventThreatDetectionSettingsService{s: s} + rs.CustomModules = NewProjectsEventThreatDetectionSettingsCustomModulesService(s) + rs.EffectiveCustomModules = NewProjectsEventThreatDetectionSettingsEffectiveCustomModulesService(s) + return rs +} + +type ProjectsEventThreatDetectionSettingsService struct { + s *Service + + CustomModules *ProjectsEventThreatDetectionSettingsCustomModulesService + + EffectiveCustomModules *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesService +} + +func NewProjectsEventThreatDetectionSettingsCustomModulesService(s *Service) *ProjectsEventThreatDetectionSettingsCustomModulesService { + rs := &ProjectsEventThreatDetectionSettingsCustomModulesService{s: s} + return rs +} + +type ProjectsEventThreatDetectionSettingsCustomModulesService struct { + s *Service +} + +func NewProjectsEventThreatDetectionSettingsEffectiveCustomModulesService(s *Service) *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesService { + rs := &ProjectsEventThreatDetectionSettingsEffectiveCustomModulesService{s: s} + return rs +} + +type ProjectsEventThreatDetectionSettingsEffectiveCustomModulesService struct { + s *Service +} + func NewProjectsFindingsService(s *Service) *ProjectsFindingsService { rs := &ProjectsFindingsService{s: s} return rs @@ -2478,6 +2562,78 @@ func (s *Detection) UnmarshalJSON(data []byte) error { return nil } +// EffectiveEventThreatDetectionCustomModule: An +// EffectiveEventThreatDetectionCustomModule is the representation of an +// Event Threat Detection custom module at a specified level of the +// resource hierarchy: organization, folder, or project. If a custom +// module is inherited from a parent organization or folder, the value +// of the `enablement_state` property in +// EffectiveEventThreatDetectionCustomModule is set to the value that is +// effective in the parent, instead of `INHERITED`. For example, if the +// module is enabled in a parent organization or folder, the effective +// `enablement_state` for the module in all child folders or projects is +// also `enabled`. EffectiveEventThreatDetectionCustomModule is +// read-only. +type EffectiveEventThreatDetectionCustomModule struct { + // Config: Output only. Config for the effective module. + Config googleapi.RawMessage `json:"config,omitempty"` + + // Description: Output only. The description for the module. + Description string `json:"description,omitempty"` + + // DisplayName: Output only. The human readable name to be displayed for + // the module. + DisplayName string `json:"displayName,omitempty"` + + // EnablementState: Output only. The effective state of enablement for + // the module at the given level of the hierarchy. + // + // Possible values: + // "ENABLEMENT_STATE_UNSPECIFIED" - Unspecified enablement state. + // "ENABLED" - The module is enabled at the given level. + // "DISABLED" - The module is disabled at the given level. + EnablementState string `json:"enablementState,omitempty"` + + // Name: Output only. The resource name of the effective ETD custom + // module. Its format is: * + // "organizations/{organization}/eventThreatDetectionSettings/effectiveCu + // stomModules/{module}". * + // "folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/ + // {module}". * + // "projects/{project}/eventThreatDetectionSettings/effectiveCustomModule + // s/{module}". + Name string `json:"name,omitempty"` + + // Type: Output only. Type for the module. e.g. CONFIGURABLE_BAD_IP. + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Config") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Config") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *EffectiveEventThreatDetectionCustomModule) MarshalJSON() ([]byte, error) { + type NoMethod EffectiveEventThreatDetectionCustomModule + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Empty: A generic empty message that you can re-use to avoid defining // duplicated empty messages in your APIs. A typical example is to use // it as the request or the response type of an API method. For @@ -2524,8 +2680,15 @@ func (s *EnvironmentVariable) MarshalJSON() ([]byte, error) { // EventThreatDetectionCustomModule: Represents an instance of an Event // Threat Detection custom module, including its full module name, // display name, enablement state, and last updated time. You can create -// a custom module at the organization level only. +// a custom module at the organization, folder, or project level. Custom +// modules that you create at the organization or folder level are +// inherited by child folders and projects. type EventThreatDetectionCustomModule struct { + // AncestorModule: Output only. The closest ancestor module that this + // module inherits the enablement state from. The format is the same as + // the EventThreatDetectionCustomModule resource name. + AncestorModule string `json:"ancestorModule,omitempty"` + // Config: Config for the module. For the resident module, its config // value is defined at this level. For the inherited module, its config // value is inherited from the ancestor module. @@ -2544,6 +2707,7 @@ type EventThreatDetectionCustomModule struct { // "ENABLEMENT_STATE_UNSPECIFIED" - Unspecified enablement state. // "ENABLED" - The module is enabled at the given level. // "DISABLED" - The module is disabled at the given level. + // "INHERITED" - When the enablement state is inherited. EnablementState string `json:"enablementState,omitempty"` // LastEditor: Output only. The editor the module was last updated by. @@ -2569,7 +2733,7 @@ type EventThreatDetectionCustomModule struct { // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Config") to + // ForceSendFields is a list of field names (e.g. "AncestorModule") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2577,12 +2741,13 @@ type EventThreatDetectionCustomModule struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Config") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "AncestorModule") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } @@ -8132,6 +8297,48 @@ func (s *ListBigQueryExportsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ListDescendantEventThreatDetectionCustomModulesResponse: Response for +// listing current and descendant resident Event Threat Detection custom +// modules. +type ListDescendantEventThreatDetectionCustomModulesResponse struct { + // EventThreatDetectionCustomModules: Custom modules belonging to the + // requested parent. + EventThreatDetectionCustomModules []*EventThreatDetectionCustomModule `json:"eventThreatDetectionCustomModules,omitempty"` + + // NextPageToken: A token, which can be sent as `page_token` to retrieve + // the next page. If this field is omitted, there are no subsequent + // pages. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "EventThreatDetectionCustomModules") to unconditionally include in + // API requests. By default, fields with empty or default values are + // omitted from API requests. However, any non-pointer, non-interface + // field appearing in ForceSendFields will be sent to the server + // regardless of whether the field is empty or not. This may be used to + // include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. + // "EventThreatDetectionCustomModules") to include in API requests with + // the JSON null value. By default, fields with empty values are omitted + // from API requests. However, any field with an empty value appearing + // in NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ListDescendantEventThreatDetectionCustomModulesResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListDescendantEventThreatDetectionCustomModulesResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // ListDescendantSecurityHealthAnalyticsCustomModulesResponse: Response // message for listing descendant Security Health Analytics custom // modules. @@ -8171,6 +8378,47 @@ func (s *ListDescendantSecurityHealthAnalyticsCustomModulesResponse) MarshalJSON return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ListEffectiveEventThreatDetectionCustomModulesResponse: Response for +// listing EffectiveEventThreatDetectionCustomModules. +type ListEffectiveEventThreatDetectionCustomModulesResponse struct { + // EffectiveEventThreatDetectionCustomModules: Effective custom modules + // belonging to the requested parent. + EffectiveEventThreatDetectionCustomModules []*EffectiveEventThreatDetectionCustomModule `json:"effectiveEventThreatDetectionCustomModules,omitempty"` + + // NextPageToken: A token, which can be sent as `page_token` to retrieve + // the next page. If this field is omitted, there are no subsequent + // pages. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "EffectiveEventThreatDetectionCustomModules") to unconditionally + // include in API requests. By default, fields with empty or default + // values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. + // "EffectiveEventThreatDetectionCustomModules") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ListEffectiveEventThreatDetectionCustomModulesResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListEffectiveEventThreatDetectionCustomModulesResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // ListEffectiveSecurityHealthAnalyticsCustomModulesResponse: Response // message for listing effective Security Health Analytics custom // modules. @@ -12087,36 +12335,36 @@ func (c *FoldersBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) (*Goo } -// method id "securitycenter.folders.findings.bulkMute": +// method id "securitycenter.folders.eventThreatDetectionSettings.validateCustomModule": -type FoldersFindingsBulkMuteCall struct { - s *Service - parent string - bulkmutefindingsrequest *BulkMuteFindingsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersEventThreatDetectionSettingsValidateCustomModuleCall struct { + s *Service + parent string + validateeventthreatdetectioncustommodulerequest *ValidateEventThreatDetectionCustomModuleRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// BulkMute: Kicks off an LRO to bulk mute findings for a parent based -// on a filter. The parent can be either an organization, folder or -// project. The findings matched by the filter will be muted after the -// LRO is done. +// ValidateCustomModule: Validates the given Event Threat Detection +// custom module. // -// - parent: The parent, at which bulk action needs to be applied. Its -// format is "organizations/[organization_id]", "folders/[folder_id]", -// "projects/[project_id]". -func (r *FoldersFindingsService) BulkMute(parent string, bulkmutefindingsrequest *BulkMuteFindingsRequest) *FoldersFindingsBulkMuteCall { - c := &FoldersFindingsBulkMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Resource name of the parent to validate the Custom Module +// under. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings". * +// "folders/{folder}/eventThreatDetectionSettings". * +// "projects/{project}/eventThreatDetectionSettings". +func (r *FoldersEventThreatDetectionSettingsService) ValidateCustomModule(parent string, validateeventthreatdetectioncustommodulerequest *ValidateEventThreatDetectionCustomModuleRequest) *FoldersEventThreatDetectionSettingsValidateCustomModuleCall { + c := &FoldersEventThreatDetectionSettingsValidateCustomModuleCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.bulkmutefindingsrequest = bulkmutefindingsrequest + c.validateeventthreatdetectioncustommodulerequest = validateeventthreatdetectioncustommodulerequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersFindingsBulkMuteCall) Fields(s ...googleapi.Field) *FoldersFindingsBulkMuteCall { +func (c *FoldersEventThreatDetectionSettingsValidateCustomModuleCall) Fields(s ...googleapi.Field) *FoldersEventThreatDetectionSettingsValidateCustomModuleCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12124,21 +12372,21 @@ func (c *FoldersFindingsBulkMuteCall) Fields(s ...googleapi.Field) *FoldersFindi // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersFindingsBulkMuteCall) Context(ctx context.Context) *FoldersFindingsBulkMuteCall { +func (c *FoldersEventThreatDetectionSettingsValidateCustomModuleCall) Context(ctx context.Context) *FoldersEventThreatDetectionSettingsValidateCustomModuleCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersFindingsBulkMuteCall) Header() http.Header { +func (c *FoldersEventThreatDetectionSettingsValidateCustomModuleCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersFindingsBulkMuteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersEventThreatDetectionSettingsValidateCustomModuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -12146,14 +12394,14 @@ func (c *FoldersFindingsBulkMuteCall) doRequest(alt string) (*http.Response, err } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkmutefindingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.validateeventthreatdetectioncustommodulerequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings:bulkMute") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:validateCustomModule") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -12166,14 +12414,16 @@ func (c *FoldersFindingsBulkMuteCall) doRequest(alt string) (*http.Response, err return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.findings.bulkMute" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *FoldersFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "securitycenter.folders.eventThreatDetectionSettings.validateCustomModule" call. +// Exactly one of *ValidateEventThreatDetectionCustomModuleResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ValidateEventThreatDetectionCustomModuleResponse.ServerResponse.Heade +// r or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FoldersEventThreatDetectionSettingsValidateCustomModuleCall) Do(opts ...googleapi.CallOption) (*ValidateEventThreatDetectionCustomModuleResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12192,7 +12442,7 @@ func (c *FoldersFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operati if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &ValidateEventThreatDetectionCustomModuleResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12204,28 +12454,28 @@ func (c *FoldersFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operati } return ret, nil // { - // "description": "Kicks off an LRO to bulk mute findings for a parent based on a filter. The parent can be either an organization, folder or project. The findings matched by the filter will be muted after the LRO is done.", - // "flatPath": "v1/folders/{foldersId}/findings:bulkMute", + // "description": "Validates the given Event Threat Detection custom module.", + // "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings:validateCustomModule", // "httpMethod": "POST", - // "id": "securitycenter.folders.findings.bulkMute", + // "id": "securitycenter.folders.eventThreatDetectionSettings.validateCustomModule", // "parameterOrder": [ // "parent" // ], // "parameters": { // "parent": { - // "description": "Required. The parent, at which bulk action needs to be applied. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", + // "description": "Required. Resource name of the parent to validate the Custom Module under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^folders/[^/]+/eventThreatDetectionSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/findings:bulkMute", + // "path": "v1/{+parent}:validateCustomModule", // "request": { - // "$ref": "BulkMuteFindingsRequest" + // "$ref": "ValidateEventThreatDetectionCustomModuleRequest" // }, // "response": { - // "$ref": "Operation" + // "$ref": "ValidateEventThreatDetectionCustomModuleResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12234,9 +12484,157 @@ func (c *FoldersFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operati } -// method id "securitycenter.folders.locations.muteConfigs.delete": +// method id "securitycenter.folders.eventThreatDetectionSettings.customModules.create": -type FoldersLocationsMuteConfigsDeleteCall struct { +type FoldersEventThreatDetectionSettingsCustomModulesCreateCall struct { + s *Service + parent string + eventthreatdetectioncustommodule *EventThreatDetectionCustomModule + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a resident Event Threat Detection custom module at +// the scope of the given Resource Manager parent, and also creates +// inherited custom modules for all descendants of the given parent. +// These modules are enabled by default. +// +// - parent: The new custom module's parent. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings". * +// "folders/{folder}/eventThreatDetectionSettings". * +// "projects/{project}/eventThreatDetectionSettings". +func (r *FoldersEventThreatDetectionSettingsCustomModulesService) Create(parent string, eventthreatdetectioncustommodule *EventThreatDetectionCustomModule) *FoldersEventThreatDetectionSettingsCustomModulesCreateCall { + c := &FoldersEventThreatDetectionSettingsCustomModulesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.eventthreatdetectioncustommodule = eventthreatdetectioncustommodule + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FoldersEventThreatDetectionSettingsCustomModulesCreateCall) Fields(s ...googleapi.Field) *FoldersEventThreatDetectionSettingsCustomModulesCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *FoldersEventThreatDetectionSettingsCustomModulesCreateCall) Context(ctx context.Context) *FoldersEventThreatDetectionSettingsCustomModulesCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *FoldersEventThreatDetectionSettingsCustomModulesCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *FoldersEventThreatDetectionSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.folders.eventThreatDetectionSettings.customModules.create" call. +// Exactly one of *EventThreatDetectionCustomModule or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersEventThreatDetectionSettingsCustomModulesCreateCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &EventThreatDetectionCustomModule{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a resident Event Threat Detection custom module at the scope of the given Resource Manager parent, and also creates inherited custom modules for all descendants of the given parent. These modules are enabled by default.", + // "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules", + // "httpMethod": "POST", + // "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The new custom module's parent. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + // "location": "path", + // "pattern": "^folders/[^/]+/eventThreatDetectionSettings$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/customModules", + // "request": { + // "$ref": "EventThreatDetectionCustomModule" + // }, + // "response": { + // "$ref": "EventThreatDetectionCustomModule" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.folders.eventThreatDetectionSettings.customModules.delete": + +type FoldersEventThreatDetectionSettingsCustomModulesDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -12244,17 +12642,19 @@ type FoldersLocationsMuteConfigsDeleteCall struct { header_ http.Header } -// Delete: Deletes an existing mute config. +// Delete: Deletes the specified Event Threat Detection custom module +// and all of its descendants in the Resource Manager hierarchy. This +// method is only supported for resident custom modules. // -// - name: Name of the mute config to delete. Its format is -// organizations/{organization}/muteConfigs/{config_id}, -// folders/{folder}/muteConfigs/{config_id}, -// projects/{project}/muteConfigs/{config_id}, -// organizations/{organization}/locations/global/muteConfigs/{config_id -// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or -// projects/{project}/locations/global/muteConfigs/{config_id}. -func (r *FoldersLocationsMuteConfigsService) Delete(name string) *FoldersLocationsMuteConfigsDeleteCall { - c := &FoldersLocationsMuteConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the custom module to delete. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings/customMod +// ules/{module}". * +// "folders/{folder}/eventThreatDetectionSettings/customModules/{module +// }". * +// "projects/{project}/eventThreatDetectionSettings/customModules/{modu +// le}". +func (r *FoldersEventThreatDetectionSettingsCustomModulesService) Delete(name string) *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall { + c := &FoldersEventThreatDetectionSettingsCustomModulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -12262,7 +12662,7 @@ func (r *FoldersLocationsMuteConfigsService) Delete(name string) *FoldersLocatio // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsMuteConfigsDeleteCall { +func (c *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall) Fields(s ...googleapi.Field) *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12270,21 +12670,21 @@ func (c *FoldersLocationsMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *Fo // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsMuteConfigsDeleteCall) Context(ctx context.Context) *FoldersLocationsMuteConfigsDeleteCall { +func (c *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall) Context(ctx context.Context) *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsMuteConfigsDeleteCall) Header() http.Header { +func (c *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -12307,14 +12707,14 @@ func (c *FoldersLocationsMuteConfigsDeleteCall) doRequest(alt string) (*http.Res return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.locations.muteConfigs.delete" call. +// Do executes the "securitycenter.folders.eventThreatDetectionSettings.customModules.delete" call. // Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Empty.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *FoldersLocationsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12345,18 +12745,18 @@ func (c *FoldersLocationsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Deletes an existing mute config.", - // "flatPath": "v1/folders/{foldersId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + // "description": "Deletes the specified Event Threat Detection custom module and all of its descendants in the Resource Manager hierarchy. This method is only supported for resident custom modules.", + // "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules/{customModulesId}", // "httpMethod": "DELETE", - // "id": "securitycenter.folders.locations.muteConfigs.delete", + // "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", + // "description": "Required. Name of the custom module to delete. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^folders/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", // "required": true, // "type": "string" // } @@ -12372,9 +12772,9 @@ func (c *FoldersLocationsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.folders.locations.muteConfigs.get": +// method id "securitycenter.folders.eventThreatDetectionSettings.customModules.get": -type FoldersLocationsMuteConfigsGetCall struct { +type FoldersEventThreatDetectionSettingsCustomModulesGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -12383,17 +12783,17 @@ type FoldersLocationsMuteConfigsGetCall struct { header_ http.Header } -// Get: Gets a mute config. +// Get: Gets an Event Threat Detection custom module. // -// - name: Name of the mute config to retrieve. Its format is -// organizations/{organization}/muteConfigs/{config_id}, -// folders/{folder}/muteConfigs/{config_id}, -// projects/{project}/muteConfigs/{config_id}, -// organizations/{organization}/locations/global/muteConfigs/{config_id -// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or -// projects/{project}/locations/global/muteConfigs/{config_id}. -func (r *FoldersLocationsMuteConfigsService) Get(name string) *FoldersLocationsMuteConfigsGetCall { - c := &FoldersLocationsMuteConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the custom module to get. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings/customMod +// ules/{module}". * +// "folders/{folder}/eventThreatDetectionSettings/customModules/{module +// }". * +// "projects/{project}/eventThreatDetectionSettings/customModules/{modu +// le}". +func (r *FoldersEventThreatDetectionSettingsCustomModulesService) Get(name string) *FoldersEventThreatDetectionSettingsCustomModulesGetCall { + c := &FoldersEventThreatDetectionSettingsCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -12401,7 +12801,7 @@ func (r *FoldersLocationsMuteConfigsService) Get(name string) *FoldersLocationsM // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsMuteConfigsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsMuteConfigsGetCall { +func (c *FoldersEventThreatDetectionSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *FoldersEventThreatDetectionSettingsCustomModulesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12411,7 +12811,7 @@ func (c *FoldersLocationsMuteConfigsGetCall) Fields(s ...googleapi.Field) *Folde // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *FoldersLocationsMuteConfigsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsMuteConfigsGetCall { +func (c *FoldersEventThreatDetectionSettingsCustomModulesGetCall) IfNoneMatch(entityTag string) *FoldersEventThreatDetectionSettingsCustomModulesGetCall { c.ifNoneMatch_ = entityTag return c } @@ -12419,21 +12819,21 @@ func (c *FoldersLocationsMuteConfigsGetCall) IfNoneMatch(entityTag string) *Fold // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsMuteConfigsGetCall) Context(ctx context.Context) *FoldersLocationsMuteConfigsGetCall { +func (c *FoldersEventThreatDetectionSettingsCustomModulesGetCall) Context(ctx context.Context) *FoldersEventThreatDetectionSettingsCustomModulesGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsMuteConfigsGetCall) Header() http.Header { +func (c *FoldersEventThreatDetectionSettingsCustomModulesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsMuteConfigsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersEventThreatDetectionSettingsCustomModulesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -12459,15 +12859,14 @@ func (c *FoldersLocationsMuteConfigsGetCall) doRequest(alt string) (*http.Respon return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.locations.muteConfigs.get" call. -// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was +// Do executes the "securitycenter.folders.eventThreatDetectionSettings.customModules.get" call. +// Exactly one of *EventThreatDetectionCustomModule or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *FoldersLocationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { +func (c *FoldersEventThreatDetectionSettingsCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12486,7 +12885,7 @@ func (c *FoldersLocationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &EventThreatDetectionCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12498,25 +12897,25 @@ func (c *FoldersLocationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Gets a mute config.", - // "flatPath": "v1/folders/{foldersId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + // "description": "Gets an Event Threat Detection custom module.", + // "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules/{customModulesId}", // "httpMethod": "GET", - // "id": "securitycenter.folders.locations.muteConfigs.get", + // "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", + // "description": "Required. Name of the custom module to get. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^folders/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "EventThreatDetectionCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12525,102 +12924,122 @@ func (c *FoldersLocationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (* } -// method id "securitycenter.folders.locations.muteConfigs.patch": +// method id "securitycenter.folders.eventThreatDetectionSettings.customModules.list": -type FoldersLocationsMuteConfigsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersEventThreatDetectionSettingsCustomModulesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates a mute config. +// List: Lists all Event Threat Detection custom modules for the given +// Resource Manager parent. This includes resident modules defined at +// the scope of the parent along with modules inherited from ancestors. // -// - name: This field will be ignored if provided on config creation. -// Format "organizations/{organization}/muteConfigs/{mute_config}" -// "folders/{folder}/muteConfigs/{mute_config}" -// "projects/{project}/muteConfigs/{mute_config}" -// "organizations/{organization}/locations/global/muteConfigs/{mute_con -// fig}" "folders/{folder}/locations/global/muteConfigs/{mute_config}" -// "projects/{project}/locations/global/muteConfigs/{mute_config}". -func (r *FoldersLocationsMuteConfigsService) Patch(name string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *FoldersLocationsMuteConfigsPatchCall { - c := &FoldersLocationsMuteConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googlecloudsecuritycenterv1muteconfig = googlecloudsecuritycenterv1muteconfig +// - parent: Name of the parent to list custom modules under. Its format +// is: * "organizations/{organization}/eventThreatDetectionSettings". +// - "folders/{folder}/eventThreatDetectionSettings". * +// "projects/{project}/eventThreatDetectionSettings". +func (r *FoldersEventThreatDetectionSettingsCustomModulesService) List(parent string) *FoldersEventThreatDetectionSettingsCustomModulesListCall { + c := &FoldersEventThreatDetectionSettingsCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// UpdateMask sets the optional parameter "updateMask": The list of -// fields to be updated. If empty all mutable fields will be updated. -func (c *FoldersLocationsMuteConfigsPatchCall) UpdateMask(updateMask string) *FoldersLocationsMuteConfigsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// PageSize sets the optional parameter "pageSize": The maximum number +// of modules to return. The service may return fewer than this value. +// If unspecified, at most 10 configs will be returned. The maximum +// value is 1000; values above 1000 will be coerced to 1000. +func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) PageSize(pageSize int64) *FoldersEventThreatDetectionSettingsCustomModulesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListEventThreatDetectionCustomModules` +// call. Provide this to retrieve the subsequent page. When paginating, +// all other parameters provided to +// `ListEventThreatDetectionCustomModules` must match the call that +// provided the page token. +func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) PageToken(pageToken string) *FoldersEventThreatDetectionSettingsCustomModulesListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsMuteConfigsPatchCall) Fields(s ...googleapi.Field) *FoldersLocationsMuteConfigsPatchCall { +func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) Fields(s ...googleapi.Field) *FoldersEventThreatDetectionSettingsCustomModulesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) IfNoneMatch(entityTag string) *FoldersEventThreatDetectionSettingsCustomModulesListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsMuteConfigsPatchCall) Context(ctx context.Context) *FoldersLocationsMuteConfigsPatchCall { +func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) Context(ctx context.Context) *FoldersEventThreatDetectionSettingsCustomModulesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsMuteConfigsPatchCall) Header() http.Header { +func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsMuteConfigsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.locations.muteConfigs.patch" call. -// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *FoldersLocationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { +// Do executes the "securitycenter.folders.eventThreatDetectionSettings.customModules.list" call. +// Exactly one of *ListEventThreatDetectionCustomModulesResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ListEventThreatDetectionCustomModulesResponse.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListEventThreatDetectionCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12639,7 +13058,7 @@ func (c *FoldersLocationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &ListEventThreatDetectionCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12651,34 +13070,36 @@ func (c *FoldersLocationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Updates a mute config.", - // "flatPath": "v1/folders/{foldersId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.folders.locations.muteConfigs.patch", + // "description": "Lists all Event Threat Detection custom modules for the given Resource Manager parent. This includes resident modules defined at the scope of the parent along with modules inherited from ancestors.", + // "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules", + // "httpMethod": "GET", + // "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "This field will be ignored if provided on config creation. Format \"organizations/{organization}/muteConfigs/{mute_config}\" \"folders/{folder}/muteConfigs/{mute_config}\" \"projects/{project}/muteConfigs/{mute_config}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", - // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", - // "required": true, - // "type": "string" + // "pageSize": { + // "description": "The maximum number of modules to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" // }, - // "updateMask": { - // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", + // "pageToken": { + // "description": "A page token, received from a previous `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListEventThreatDetectionCustomModules` must match the call that provided the page token.", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of the parent to list custom modules under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + // "location": "path", + // "pattern": "^folders/[^/]+/eventThreatDetectionSettings$", + // "required": true, + // "type": "string" // } // }, - // "path": "v1/{+name}", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" - // }, + // "path": "v1/{+parent}/customModules", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "ListEventThreatDetectionCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12687,82 +13108,123 @@ func (c *FoldersLocationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.folders.muteConfigs.create": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) Pages(ctx context.Context, f func(*ListEventThreatDetectionCustomModulesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type FoldersMuteConfigsCreateCall struct { - s *Service - parent string - googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.folders.eventThreatDetectionSettings.customModules.listDescendant": + +type FoldersEventThreatDetectionSettingsCustomModulesListDescendantCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a mute config. +// ListDescendant: Lists all resident Event Threat Detection custom +// modules under the given Resource Manager parent and its descendants. // -// - parent: Resource name of the new mute configs's parent. Its format -// is "organizations/[organization_id]", "folders/[folder_id]", or -// "projects/[project_id]". -func (r *FoldersMuteConfigsService) Create(parent string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *FoldersMuteConfigsCreateCall { - c := &FoldersMuteConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Name of the parent to list custom modules under. Its format +// is: * "organizations/{organization}/eventThreatDetectionSettings". +// - "folders/{folder}/eventThreatDetectionSettings". * +// "projects/{project}/eventThreatDetectionSettings". +func (r *FoldersEventThreatDetectionSettingsCustomModulesService) ListDescendant(parent string) *FoldersEventThreatDetectionSettingsCustomModulesListDescendantCall { + c := &FoldersEventThreatDetectionSettingsCustomModulesListDescendantCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.googlecloudsecuritycenterv1muteconfig = googlecloudsecuritycenterv1muteconfig return c } -// MuteConfigId sets the optional parameter "muteConfigId": Required. -// Unique identifier provided by the client within the parent scope. It -// must consist of only lowercase letters, numbers, and hyphens, must -// start with a letter, must end with either a letter or a number, and -// must be 63 characters or less. -func (c *FoldersMuteConfigsCreateCall) MuteConfigId(muteConfigId string) *FoldersMuteConfigsCreateCall { - c.urlParams_.Set("muteConfigId", muteConfigId) +// PageSize sets the optional parameter "pageSize": The maximum number +// of modules to return. The service may return fewer than this value. +// If unspecified, at most 10 configs will be returned. The maximum +// value is 1000; values above 1000 will be coerced to 1000. +func (c *FoldersEventThreatDetectionSettingsCustomModulesListDescendantCall) PageSize(pageSize int64) *FoldersEventThreatDetectionSettingsCustomModulesListDescendantCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous +// `ListDescendantEventThreatDetectionCustomModules` call. Provide this +// to retrieve the subsequent page. When paginating, all other +// parameters provided to +// `ListDescendantEventThreatDetectionCustomModules` must match the call +// that provided the page token. +func (c *FoldersEventThreatDetectionSettingsCustomModulesListDescendantCall) PageToken(pageToken string) *FoldersEventThreatDetectionSettingsCustomModulesListDescendantCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersMuteConfigsCreateCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsCreateCall { +func (c *FoldersEventThreatDetectionSettingsCustomModulesListDescendantCall) Fields(s ...googleapi.Field) *FoldersEventThreatDetectionSettingsCustomModulesListDescendantCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersEventThreatDetectionSettingsCustomModulesListDescendantCall) IfNoneMatch(entityTag string) *FoldersEventThreatDetectionSettingsCustomModulesListDescendantCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersMuteConfigsCreateCall) Context(ctx context.Context) *FoldersMuteConfigsCreateCall { +func (c *FoldersEventThreatDetectionSettingsCustomModulesListDescendantCall) Context(ctx context.Context) *FoldersEventThreatDetectionSettingsCustomModulesListDescendantCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersMuteConfigsCreateCall) Header() http.Header { +func (c *FoldersEventThreatDetectionSettingsCustomModulesListDescendantCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersMuteConfigsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersEventThreatDetectionSettingsCustomModulesListDescendantCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/muteConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules:listDescendant") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -12773,15 +13235,17 @@ func (c *FoldersMuteConfigsCreateCall) doRequest(alt string) (*http.Response, er return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.muteConfigs.create" call. -// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *FoldersMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { +// Do executes the "securitycenter.folders.eventThreatDetectionSettings.customModules.listDescendant" call. +// Exactly one of +// *ListDescendantEventThreatDetectionCustomModulesResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ListDescendantEventThreatDetectionCustomModulesResponse.ServerRespons +// e.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FoldersEventThreatDetectionSettingsCustomModulesListDescendantCall) Do(opts ...googleapi.CallOption) (*ListDescendantEventThreatDetectionCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12800,7 +13264,7 @@ func (c *FoldersMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*Google if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &ListDescendantEventThreatDetectionCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12812,33 +13276,36 @@ func (c *FoldersMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*Google } return ret, nil // { - // "description": "Creates a mute config.", - // "flatPath": "v1/folders/{foldersId}/muteConfigs", - // "httpMethod": "POST", - // "id": "securitycenter.folders.muteConfigs.create", + // "description": "Lists all resident Event Threat Detection custom modules under the given Resource Manager parent and its descendants.", + // "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules:listDescendant", + // "httpMethod": "GET", + // "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.listDescendant", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "muteConfigId": { - // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of only lowercase letters, numbers, and hyphens, must start with a letter, must end with either a letter or a number, and must be 63 characters or less.", + // "pageSize": { + // "description": "The maximum number of modules to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token, received from a previous `ListDescendantEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListDescendantEventThreatDetectionCustomModules` must match the call that provided the page token.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. Resource name of the new mute configs's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "description": "Required. Name of the parent to list custom modules under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^folders/[^/]+/eventThreatDetectionSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/muteConfigs", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" - // }, + // "path": "v1/{+parent}/customModules:listDescendant", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "ListDescendantEventThreatDetectionCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12847,35 +13314,71 @@ func (c *FoldersMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*Google } -// method id "securitycenter.folders.muteConfigs.delete": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *FoldersEventThreatDetectionSettingsCustomModulesListDescendantCall) Pages(ctx context.Context, f func(*ListDescendantEventThreatDetectionCustomModulesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type FoldersMuteConfigsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.folders.eventThreatDetectionSettings.customModules.patch": + +type FoldersEventThreatDetectionSettingsCustomModulesPatchCall struct { + s *Service + name string + eventthreatdetectioncustommodule *EventThreatDetectionCustomModule + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an existing mute config. +// Patch: Updates the Event Threat Detection custom module with the +// given name based on the given update mask. Updating the enablement +// state is supported for both resident and inherited modules (though +// resident modules cannot have an enablement state of "inherited"). +// Updating the display name or configuration of a module is supported +// for resident modules only. The type of a module cannot be changed. // -// - name: Name of the mute config to delete. Its format is -// organizations/{organization}/muteConfigs/{config_id}, -// folders/{folder}/muteConfigs/{config_id}, -// projects/{project}/muteConfigs/{config_id}, -// organizations/{organization}/locations/global/muteConfigs/{config_id -// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or -// projects/{project}/locations/global/muteConfigs/{config_id}. -func (r *FoldersMuteConfigsService) Delete(name string) *FoldersMuteConfigsDeleteCall { - c := &FoldersMuteConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Immutable. The resource name of the Event Threat Detection +// custom module. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings/customMod +// ules/{module}". * +// "folders/{folder}/eventThreatDetectionSettings/customModules/{module +// }". * +// "projects/{project}/eventThreatDetectionSettings/customModules/{modu +// le}". +func (r *FoldersEventThreatDetectionSettingsCustomModulesService) Patch(name string, eventthreatdetectioncustommodule *EventThreatDetectionCustomModule) *FoldersEventThreatDetectionSettingsCustomModulesPatchCall { + c := &FoldersEventThreatDetectionSettingsCustomModulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.eventthreatdetectioncustommodule = eventthreatdetectioncustommodule + return c +} + +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to be updated. If empty all mutable fields will be updated. +func (c *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) UpdateMask(updateMask string) *FoldersEventThreatDetectionSettingsCustomModulesPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsDeleteCall { +func (c *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) Fields(s ...googleapi.Field) *FoldersEventThreatDetectionSettingsCustomModulesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12883,21 +13386,21 @@ func (c *FoldersMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *FoldersMute // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersMuteConfigsDeleteCall) Context(ctx context.Context) *FoldersMuteConfigsDeleteCall { +func (c *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) Context(ctx context.Context) *FoldersEventThreatDetectionSettingsCustomModulesPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersMuteConfigsDeleteCall) Header() http.Header { +func (c *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -12905,11 +13408,16 @@ func (c *FoldersMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, er } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -12920,14 +13428,14 @@ func (c *FoldersMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, er return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.muteConfigs.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *FoldersMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "securitycenter.folders.eventThreatDetectionSettings.customModules.patch" call. +// Exactly one of *EventThreatDetectionCustomModule or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12946,7 +13454,7 @@ func (c *FoldersMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &EventThreatDetectionCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12958,25 +13466,34 @@ func (c *FoldersMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, } return ret, nil // { - // "description": "Deletes an existing mute config.", - // "flatPath": "v1/folders/{foldersId}/muteConfigs/{muteConfigsId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.folders.muteConfigs.delete", + // "description": "Updates the Event Threat Detection custom module with the given name based on the given update mask. Updating the enablement state is supported for both resident and inherited modules (though resident modules cannot have an enablement state of \"inherited\"). Updating the display name or configuration of a module is supported for resident modules only. The type of a module cannot be changed.", + // "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules/{customModulesId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", + // "description": "Immutable. The resource name of the Event Threat Detection custom module. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", // "location": "path", - // "pattern": "^folders/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^folders/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v1/{+name}", + // "request": { + // "$ref": "EventThreatDetectionCustomModule" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "EventThreatDetectionCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12985,9 +13502,9 @@ func (c *FoldersMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, } -// method id "securitycenter.folders.muteConfigs.get": +// method id "securitycenter.folders.eventThreatDetectionSettings.effectiveCustomModules.get": -type FoldersMuteConfigsGetCall struct { +type FoldersEventThreatDetectionSettingsEffectiveCustomModulesGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -12996,17 +13513,19 @@ type FoldersMuteConfigsGetCall struct { header_ http.Header } -// Get: Gets a mute config. +// Get: Gets an effective Event Threat Detection custom module at the +// given level. // -// - name: Name of the mute config to retrieve. Its format is -// organizations/{organization}/muteConfigs/{config_id}, -// folders/{folder}/muteConfigs/{config_id}, -// projects/{project}/muteConfigs/{config_id}, -// organizations/{organization}/locations/global/muteConfigs/{config_id -// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or -// projects/{project}/locations/global/muteConfigs/{config_id}. -func (r *FoldersMuteConfigsService) Get(name string) *FoldersMuteConfigsGetCall { - c := &FoldersMuteConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the effective Event Threat Detection +// custom module. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings/effective +// CustomModules/{module}". * +// "folders/{folder}/eventThreatDetectionSettings/effectiveCustomModule +// s/{module}". * +// "projects/{project}/eventThreatDetectionSettings/effectiveCustomModu +// les/{module}". +func (r *FoldersEventThreatDetectionSettingsEffectiveCustomModulesService) Get(name string) *FoldersEventThreatDetectionSettingsEffectiveCustomModulesGetCall { + c := &FoldersEventThreatDetectionSettingsEffectiveCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -13014,7 +13533,7 @@ func (r *FoldersMuteConfigsService) Get(name string) *FoldersMuteConfigsGetCall // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersMuteConfigsGetCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsGetCall { +func (c *FoldersEventThreatDetectionSettingsEffectiveCustomModulesGetCall) Fields(s ...googleapi.Field) *FoldersEventThreatDetectionSettingsEffectiveCustomModulesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13024,7 +13543,7 @@ func (c *FoldersMuteConfigsGetCall) Fields(s ...googleapi.Field) *FoldersMuteCon // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *FoldersMuteConfigsGetCall) IfNoneMatch(entityTag string) *FoldersMuteConfigsGetCall { +func (c *FoldersEventThreatDetectionSettingsEffectiveCustomModulesGetCall) IfNoneMatch(entityTag string) *FoldersEventThreatDetectionSettingsEffectiveCustomModulesGetCall { c.ifNoneMatch_ = entityTag return c } @@ -13032,21 +13551,21 @@ func (c *FoldersMuteConfigsGetCall) IfNoneMatch(entityTag string) *FoldersMuteCo // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersMuteConfigsGetCall) Context(ctx context.Context) *FoldersMuteConfigsGetCall { +func (c *FoldersEventThreatDetectionSettingsEffectiveCustomModulesGetCall) Context(ctx context.Context) *FoldersEventThreatDetectionSettingsEffectiveCustomModulesGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersMuteConfigsGetCall) Header() http.Header { +func (c *FoldersEventThreatDetectionSettingsEffectiveCustomModulesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersMuteConfigsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersEventThreatDetectionSettingsEffectiveCustomModulesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -13072,15 +13591,16 @@ func (c *FoldersMuteConfigsGetCall) doRequest(alt string) (*http.Response, error return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.muteConfigs.get" call. -// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *FoldersMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { +// Do executes the "securitycenter.folders.eventThreatDetectionSettings.effectiveCustomModules.get" call. +// Exactly one of *EffectiveEventThreatDetectionCustomModule or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *EffectiveEventThreatDetectionCustomModule.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FoldersEventThreatDetectionSettingsEffectiveCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*EffectiveEventThreatDetectionCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13099,7 +13619,7 @@ func (c *FoldersMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleClo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &EffectiveEventThreatDetectionCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13111,25 +13631,25 @@ func (c *FoldersMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleClo } return ret, nil // { - // "description": "Gets a mute config.", - // "flatPath": "v1/folders/{foldersId}/muteConfigs/{muteConfigsId}", + // "description": "Gets an effective Event Threat Detection custom module at the given level.", + // "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/effectiveCustomModules/{effectiveCustomModulesId}", // "httpMethod": "GET", - // "id": "securitycenter.folders.muteConfigs.get", + // "id": "securitycenter.folders.eventThreatDetectionSettings.effectiveCustomModules.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", + // "description": "Required. The resource name of the effective Event Threat Detection custom module. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}\".", // "location": "path", - // "pattern": "^folders/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^folders/[^/]+/eventThreatDetectionSettings/effectiveCustomModules/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "EffectiveEventThreatDetectionCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13138,9 +13658,9 @@ func (c *FoldersMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleClo } -// method id "securitycenter.folders.muteConfigs.list": +// method id "securitycenter.folders.eventThreatDetectionSettings.effectiveCustomModules.list": -type FoldersMuteConfigsListCall struct { +type FoldersEventThreatDetectionSettingsEffectiveCustomModulesListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -13149,32 +13669,37 @@ type FoldersMuteConfigsListCall struct { header_ http.Header } -// List: Lists mute configs. +// List: Lists all effective Event Threat Detection custom modules for +// the given parent. This includes resident modules defined at the scope +// of the parent along with modules inherited from its ancestors. // -// - parent: The parent, which owns the collection of mute configs. Its -// format is "organizations/[organization_id]", "folders/[folder_id]", -// "projects/[project_id]". -func (r *FoldersMuteConfigsService) List(parent string) *FoldersMuteConfigsListCall { - c := &FoldersMuteConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Name of the parent to list custom modules for. Its format +// is: * "organizations/{organization}/eventThreatDetectionSettings". +// - "folders/{folder}/eventThreatDetectionSettings". * +// "projects/{project}/eventThreatDetectionSettings". +func (r *FoldersEventThreatDetectionSettingsEffectiveCustomModulesService) List(parent string) *FoldersEventThreatDetectionSettingsEffectiveCustomModulesListCall { + c := &FoldersEventThreatDetectionSettingsEffectiveCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } // PageSize sets the optional parameter "pageSize": The maximum number -// of configs to return. The service may return fewer than this value. +// of modules to return. The service may return fewer than this value. // If unspecified, at most 10 configs will be returned. The maximum // value is 1000; values above 1000 will be coerced to 1000. -func (c *FoldersMuteConfigsListCall) PageSize(pageSize int64) *FoldersMuteConfigsListCall { +func (c *FoldersEventThreatDetectionSettingsEffectiveCustomModulesListCall) PageSize(pageSize int64) *FoldersEventThreatDetectionSettingsEffectiveCustomModulesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": A page token, -// received from a previous `ListMuteConfigs` call. Provide this to -// retrieve the subsequent page. When paginating, all other parameters -// provided to `ListMuteConfigs` must match the call that provided the -// page token. -func (c *FoldersMuteConfigsListCall) PageToken(pageToken string) *FoldersMuteConfigsListCall { +// received from a previous +// `ListEffectiveEventThreatDetectionCustomModules` call. Provide this +// to retrieve the subsequent page. When paginating, all other +// parameters provided to +// `ListEffectiveEventThreatDetectionCustomModules` must match the call +// that provided the page token. +func (c *FoldersEventThreatDetectionSettingsEffectiveCustomModulesListCall) PageToken(pageToken string) *FoldersEventThreatDetectionSettingsEffectiveCustomModulesListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -13182,7 +13707,7 @@ func (c *FoldersMuteConfigsListCall) PageToken(pageToken string) *FoldersMuteCon // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersMuteConfigsListCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsListCall { +func (c *FoldersEventThreatDetectionSettingsEffectiveCustomModulesListCall) Fields(s ...googleapi.Field) *FoldersEventThreatDetectionSettingsEffectiveCustomModulesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13192,7 +13717,7 @@ func (c *FoldersMuteConfigsListCall) Fields(s ...googleapi.Field) *FoldersMuteCo // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *FoldersMuteConfigsListCall) IfNoneMatch(entityTag string) *FoldersMuteConfigsListCall { +func (c *FoldersEventThreatDetectionSettingsEffectiveCustomModulesListCall) IfNoneMatch(entityTag string) *FoldersEventThreatDetectionSettingsEffectiveCustomModulesListCall { c.ifNoneMatch_ = entityTag return c } @@ -13200,21 +13725,21 @@ func (c *FoldersMuteConfigsListCall) IfNoneMatch(entityTag string) *FoldersMuteC // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersMuteConfigsListCall) Context(ctx context.Context) *FoldersMuteConfigsListCall { +func (c *FoldersEventThreatDetectionSettingsEffectiveCustomModulesListCall) Context(ctx context.Context) *FoldersEventThreatDetectionSettingsEffectiveCustomModulesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersMuteConfigsListCall) Header() http.Header { +func (c *FoldersEventThreatDetectionSettingsEffectiveCustomModulesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersMuteConfigsListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersEventThreatDetectionSettingsEffectiveCustomModulesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -13227,7 +13752,7 @@ func (c *FoldersMuteConfigsListCall) doRequest(alt string) (*http.Response, erro var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/muteConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/effectiveCustomModules") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -13240,14 +13765,17 @@ func (c *FoldersMuteConfigsListCall) doRequest(alt string) (*http.Response, erro return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.muteConfigs.list" call. -// Exactly one of *ListMuteConfigsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListMuteConfigsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *FoldersMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMuteConfigsResponse, error) { +// Do executes the "securitycenter.folders.eventThreatDetectionSettings.effectiveCustomModules.list" call. +// Exactly one of +// *ListEffectiveEventThreatDetectionCustomModulesResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *ListEffectiveEventThreatDetectionCustomModulesResponse.ServerResponse +// .Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FoldersEventThreatDetectionSettingsEffectiveCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListEffectiveEventThreatDetectionCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13266,7 +13794,7 @@ func (c *FoldersMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMute if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListMuteConfigsResponse{ + ret := &ListEffectiveEventThreatDetectionCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13278,36 +13806,36 @@ func (c *FoldersMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMute } return ret, nil // { - // "description": "Lists mute configs.", - // "flatPath": "v1/folders/{foldersId}/muteConfigs", + // "description": "Lists all effective Event Threat Detection custom modules for the given parent. This includes resident modules defined at the scope of the parent along with modules inherited from its ancestors.", + // "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/effectiveCustomModules", // "httpMethod": "GET", - // "id": "securitycenter.folders.muteConfigs.list", + // "id": "securitycenter.folders.eventThreatDetectionSettings.effectiveCustomModules.list", // "parameterOrder": [ // "parent" // ], // "parameters": { // "pageSize": { - // "description": "The maximum number of configs to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "description": "The maximum number of modules to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "A page token, received from a previous `ListMuteConfigs` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListMuteConfigs` must match the call that provided the page token.", + // "description": "A page token, received from a previous `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListEffectiveEventThreatDetectionCustomModules` must match the call that provided the page token.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The parent, which owns the collection of mute configs. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", + // "description": "Required. Name of the parent to list custom modules for. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^folders/[^/]+/eventThreatDetectionSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/muteConfigs", + // "path": "v1/{+parent}/effectiveCustomModules", // "response": { - // "$ref": "ListMuteConfigsResponse" + // "$ref": "ListEffectiveEventThreatDetectionCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13319,7 +13847,7 @@ func (c *FoldersMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMute // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *FoldersMuteConfigsListCall) Pages(ctx context.Context, f func(*ListMuteConfigsResponse) error) error { +func (c *FoldersEventThreatDetectionSettingsEffectiveCustomModulesListCall) Pages(ctx context.Context, f func(*ListEffectiveEventThreatDetectionCustomModulesResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -13337,44 +13865,36 @@ func (c *FoldersMuteConfigsListCall) Pages(ctx context.Context, f func(*ListMute } } -// method id "securitycenter.folders.muteConfigs.patch": +// method id "securitycenter.folders.findings.bulkMute": -type FoldersMuteConfigsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersFindingsBulkMuteCall struct { + s *Service + parent string + bulkmutefindingsrequest *BulkMuteFindingsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a mute config. +// BulkMute: Kicks off an LRO to bulk mute findings for a parent based +// on a filter. The parent can be either an organization, folder or +// project. The findings matched by the filter will be muted after the +// LRO is done. // -// - name: This field will be ignored if provided on config creation. -// Format "organizations/{organization}/muteConfigs/{mute_config}" -// "folders/{folder}/muteConfigs/{mute_config}" -// "projects/{project}/muteConfigs/{mute_config}" -// "organizations/{organization}/locations/global/muteConfigs/{mute_con -// fig}" "folders/{folder}/locations/global/muteConfigs/{mute_config}" -// "projects/{project}/locations/global/muteConfigs/{mute_config}". -func (r *FoldersMuteConfigsService) Patch(name string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *FoldersMuteConfigsPatchCall { - c := &FoldersMuteConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googlecloudsecuritycenterv1muteconfig = googlecloudsecuritycenterv1muteconfig - return c -} - -// UpdateMask sets the optional parameter "updateMask": The list of -// fields to be updated. If empty all mutable fields will be updated. -func (c *FoldersMuteConfigsPatchCall) UpdateMask(updateMask string) *FoldersMuteConfigsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// - parent: The parent, at which bulk action needs to be applied. Its +// format is "organizations/[organization_id]", "folders/[folder_id]", +// "projects/[project_id]". +func (r *FoldersFindingsService) BulkMute(parent string, bulkmutefindingsrequest *BulkMuteFindingsRequest) *FoldersFindingsBulkMuteCall { + c := &FoldersFindingsBulkMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.bulkmutefindingsrequest = bulkmutefindingsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersMuteConfigsPatchCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsPatchCall { +func (c *FoldersFindingsBulkMuteCall) Fields(s ...googleapi.Field) *FoldersFindingsBulkMuteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13382,21 +13902,21 @@ func (c *FoldersMuteConfigsPatchCall) Fields(s ...googleapi.Field) *FoldersMuteC // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersMuteConfigsPatchCall) Context(ctx context.Context) *FoldersMuteConfigsPatchCall { +func (c *FoldersFindingsBulkMuteCall) Context(ctx context.Context) *FoldersFindingsBulkMuteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersMuteConfigsPatchCall) Header() http.Header { +func (c *FoldersFindingsBulkMuteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersMuteConfigsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersFindingsBulkMuteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -13404,35 +13924,34 @@ func (c *FoldersMuteConfigsPatchCall) doRequest(alt string) (*http.Response, err } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkmutefindingsrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings:bulkMute") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.muteConfigs.patch" call. -// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *FoldersMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { +// Do executes the "securitycenter.folders.findings.bulkMute" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FoldersFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13451,7 +13970,7 @@ func (c *FoldersMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleC if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13463,34 +13982,28 @@ func (c *FoldersMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleC } return ret, nil // { - // "description": "Updates a mute config.", - // "flatPath": "v1/folders/{foldersId}/muteConfigs/{muteConfigsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.folders.muteConfigs.patch", + // "description": "Kicks off an LRO to bulk mute findings for a parent based on a filter. The parent can be either an organization, folder or project. The findings matched by the filter will be muted after the LRO is done.", + // "flatPath": "v1/folders/{foldersId}/findings:bulkMute", + // "httpMethod": "POST", + // "id": "securitycenter.folders.findings.bulkMute", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "This field will be ignored if provided on config creation. Format \"organizations/{organization}/muteConfigs/{mute_config}\" \"folders/{folder}/muteConfigs/{mute_config}\" \"projects/{project}/muteConfigs/{mute_config}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", + // "parent": { + // "description": "Required. The parent, at which bulk action needs to be applied. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", // "location": "path", - // "pattern": "^folders/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/findings:bulkMute", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "BulkMuteFindingsRequest" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13499,42 +14012,35 @@ func (c *FoldersMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleC } -// method id "securitycenter.folders.notificationConfigs.create": +// method id "securitycenter.folders.locations.muteConfigs.delete": -type FoldersNotificationConfigsCreateCall struct { - s *Service - parent string - notificationconfig *NotificationConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersLocationsMuteConfigsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a notification config. +// Delete: Deletes an existing mute config. // -// - parent: Resource name of the new notification config's parent. Its -// format is "organizations/[organization_id]", "folders/[folder_id]", -// or "projects/[project_id]". -func (r *FoldersNotificationConfigsService) Create(parent string, notificationconfig *NotificationConfig) *FoldersNotificationConfigsCreateCall { - c := &FoldersNotificationConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.notificationconfig = notificationconfig - return c -} - -// ConfigId sets the optional parameter "configId": Required. Unique -// identifier provided by the client within the parent scope. It must be -// between 1 and 128 characters and contain alphanumeric characters, -// underscores, or hyphens only. -func (c *FoldersNotificationConfigsCreateCall) ConfigId(configId string) *FoldersNotificationConfigsCreateCall { - c.urlParams_.Set("configId", configId) +// - name: Name of the mute config to delete. Its format is +// organizations/{organization}/muteConfigs/{config_id}, +// folders/{folder}/muteConfigs/{config_id}, +// projects/{project}/muteConfigs/{config_id}, +// organizations/{organization}/locations/global/muteConfigs/{config_id +// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or +// projects/{project}/locations/global/muteConfigs/{config_id}. +func (r *FoldersLocationsMuteConfigsService) Delete(name string) *FoldersLocationsMuteConfigsDeleteCall { + c := &FoldersLocationsMuteConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersNotificationConfigsCreateCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsCreateCall { +func (c *FoldersLocationsMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsMuteConfigsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13542,21 +14048,21 @@ func (c *FoldersNotificationConfigsCreateCall) Fields(s ...googleapi.Field) *Fol // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersNotificationConfigsCreateCall) Context(ctx context.Context) *FoldersNotificationConfigsCreateCall { +func (c *FoldersLocationsMuteConfigsDeleteCall) Context(ctx context.Context) *FoldersLocationsMuteConfigsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersNotificationConfigsCreateCall) Header() http.Header { +func (c *FoldersLocationsMuteConfigsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersNotificationConfigsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -13564,34 +14070,29 @@ func (c *FoldersNotificationConfigsCreateCall) doRequest(alt string) (*http.Resp } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notificationConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.notificationConfigs.create" call. -// Exactly one of *NotificationConfig or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *NotificationConfig.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *FoldersNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { +// Do executes the "securitycenter.folders.locations.muteConfigs.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *FoldersLocationsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13610,7 +14111,7 @@ func (c *FoldersNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NotificationConfig{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13622,33 +14123,25 @@ func (c *FoldersNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Creates a notification config.", - // "flatPath": "v1/folders/{foldersId}/notificationConfigs", - // "httpMethod": "POST", - // "id": "securitycenter.folders.notificationConfigs.create", + // "description": "Deletes an existing mute config.", + // "flatPath": "v1/folders/{foldersId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.folders.locations.muteConfigs.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "configId": { - // "description": "Required. Unique identifier provided by the client within the parent scope. It must be between 1 and 128 characters and contain alphanumeric characters, underscores, or hyphens only.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Resource name of the new notification config's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "name": { + // "description": "Required. Name of the mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/notificationConfigs", - // "request": { - // "$ref": "NotificationConfig" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "NotificationConfig" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13657,24 +14150,28 @@ func (c *FoldersNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.folders.notificationConfigs.delete": +// method id "securitycenter.folders.locations.muteConfigs.get": -type FoldersNotificationConfigsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersLocationsMuteConfigsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a notification config. +// Get: Gets a mute config. // -// - name: Name of the notification config to delete. Its format is -// "organizations/[organization_id]/notificationConfigs/[config_id]", -// "folders/[folder_id]/notificationConfigs/[config_id]", or -// "projects/[project_id]/notificationConfigs/[config_id]". -func (r *FoldersNotificationConfigsService) Delete(name string) *FoldersNotificationConfigsDeleteCall { - c := &FoldersNotificationConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the mute config to retrieve. Its format is +// organizations/{organization}/muteConfigs/{config_id}, +// folders/{folder}/muteConfigs/{config_id}, +// projects/{project}/muteConfigs/{config_id}, +// organizations/{organization}/locations/global/muteConfigs/{config_id +// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or +// projects/{project}/locations/global/muteConfigs/{config_id}. +func (r *FoldersLocationsMuteConfigsService) Get(name string) *FoldersLocationsMuteConfigsGetCall { + c := &FoldersLocationsMuteConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -13682,41 +14179,54 @@ func (r *FoldersNotificationConfigsService) Delete(name string) *FoldersNotifica // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersNotificationConfigsDeleteCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsDeleteCall { +func (c *FoldersLocationsMuteConfigsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsMuteConfigsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersLocationsMuteConfigsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsMuteConfigsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersNotificationConfigsDeleteCall) Context(ctx context.Context) *FoldersNotificationConfigsDeleteCall { +func (c *FoldersLocationsMuteConfigsGetCall) Context(ctx context.Context) *FoldersLocationsMuteConfigsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersNotificationConfigsDeleteCall) Header() http.Header { +func (c *FoldersLocationsMuteConfigsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersNotificationConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsMuteConfigsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -13727,14 +14237,15 @@ func (c *FoldersNotificationConfigsDeleteCall) doRequest(alt string) (*http.Resp return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.notificationConfigs.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *FoldersNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "securitycenter.folders.locations.muteConfigs.get" call. +// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersLocationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13753,7 +14264,7 @@ func (c *FoldersNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13765,25 +14276,25 @@ func (c *FoldersNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Deletes a notification config.", - // "flatPath": "v1/folders/{foldersId}/notificationConfigs/{notificationConfigsId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.folders.notificationConfigs.delete", + // "description": "Gets a mute config.", + // "flatPath": "v1/folders/{foldersId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "GET", + // "id": "securitycenter.folders.locations.muteConfigs.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the notification config to delete. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\", \"folders/[folder_id]/notificationConfigs/[config_id]\", or \"projects/[project_id]/notificationConfigs/[config_id]\".", + // "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", // "location": "path", - // "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13792,80 +14303,83 @@ func (c *FoldersNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.folders.notificationConfigs.get": +// method id "securitycenter.folders.locations.muteConfigs.patch": -type FoldersNotificationConfigsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersLocationsMuteConfigsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a notification config. +// Patch: Updates a mute config. // -// - name: Name of the notification config to get. Its format is -// "organizations/[organization_id]/notificationConfigs/[config_id]", -// "folders/[folder_id]/notificationConfigs/[config_id]", or -// "projects/[project_id]/notificationConfigs/[config_id]". -func (r *FoldersNotificationConfigsService) Get(name string) *FoldersNotificationConfigsGetCall { - c := &FoldersNotificationConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: This field will be ignored if provided on config creation. +// Format "organizations/{organization}/muteConfigs/{mute_config}" +// "folders/{folder}/muteConfigs/{mute_config}" +// "projects/{project}/muteConfigs/{mute_config}" +// "organizations/{organization}/locations/global/muteConfigs/{mute_con +// fig}" "folders/{folder}/locations/global/muteConfigs/{mute_config}" +// "projects/{project}/locations/global/muteConfigs/{mute_config}". +func (r *FoldersLocationsMuteConfigsService) Patch(name string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *FoldersLocationsMuteConfigsPatchCall { + c := &FoldersLocationsMuteConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googlecloudsecuritycenterv1muteconfig = googlecloudsecuritycenterv1muteconfig + return c +} + +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to be updated. If empty all mutable fields will be updated. +func (c *FoldersLocationsMuteConfigsPatchCall) UpdateMask(updateMask string) *FoldersLocationsMuteConfigsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersNotificationConfigsGetCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsGetCall { +func (c *FoldersLocationsMuteConfigsPatchCall) Fields(s ...googleapi.Field) *FoldersLocationsMuteConfigsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *FoldersNotificationConfigsGetCall) IfNoneMatch(entityTag string) *FoldersNotificationConfigsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersNotificationConfigsGetCall) Context(ctx context.Context) *FoldersNotificationConfigsGetCall { +func (c *FoldersLocationsMuteConfigsPatchCall) Context(ctx context.Context) *FoldersLocationsMuteConfigsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersNotificationConfigsGetCall) Header() http.Header { +func (c *FoldersLocationsMuteConfigsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersNotificationConfigsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsMuteConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -13876,14 +14390,15 @@ func (c *FoldersNotificationConfigsGetCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.notificationConfigs.get" call. -// Exactly one of *NotificationConfig or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *NotificationConfig.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "securitycenter.folders.locations.muteConfigs.patch" call. +// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *FoldersNotificationConfigsGetCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { +func (c *FoldersLocationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13902,7 +14417,7 @@ func (c *FoldersNotificationConfigsGetCall) Do(opts ...googleapi.CallOption) (*N if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NotificationConfig{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13914,25 +14429,34 @@ func (c *FoldersNotificationConfigsGetCall) Do(opts ...googleapi.CallOption) (*N } return ret, nil // { - // "description": "Gets a notification config.", - // "flatPath": "v1/folders/{foldersId}/notificationConfigs/{notificationConfigsId}", - // "httpMethod": "GET", - // "id": "securitycenter.folders.notificationConfigs.get", + // "description": "Updates a mute config.", + // "flatPath": "v1/folders/{foldersId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.folders.locations.muteConfigs.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the notification config to get. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\", \"folders/[folder_id]/notificationConfigs/[config_id]\", or \"projects/[project_id]/notificationConfigs/[config_id]\".", + // "description": "This field will be ignored if provided on config creation. Format \"organizations/{organization}/muteConfigs/{mute_config}\" \"folders/{folder}/muteConfigs/{mute_config}\" \"projects/{project}/muteConfigs/{mute_config}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", // "location": "path", - // "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v1/{+name}", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // }, // "response": { - // "$ref": "NotificationConfig" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13941,96 +14465,82 @@ func (c *FoldersNotificationConfigsGetCall) Do(opts ...googleapi.CallOption) (*N } -// method id "securitycenter.folders.notificationConfigs.list": +// method id "securitycenter.folders.muteConfigs.create": -type FoldersNotificationConfigsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersMuteConfigsCreateCall struct { + s *Service + parent string + googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists notification configs. +// Create: Creates a mute config. // -// - parent: The name of the parent in which to list the notification -// configurations. Its format is "organizations/[organization_id]", -// "folders/[folder_id]", or "projects/[project_id]". -func (r *FoldersNotificationConfigsService) List(parent string) *FoldersNotificationConfigsListCall { - c := &FoldersNotificationConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Resource name of the new mute configs's parent. Its format +// is "organizations/[organization_id]", "folders/[folder_id]", or +// "projects/[project_id]". +func (r *FoldersMuteConfigsService) Create(parent string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *FoldersMuteConfigsCreateCall { + c := &FoldersMuteConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent + c.googlecloudsecuritycenterv1muteconfig = googlecloudsecuritycenterv1muteconfig return c } -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *FoldersNotificationConfigsListCall) PageSize(pageSize int64) *FoldersNotificationConfigsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListNotificationConfigsResponse`; indicates that this is -// a continuation of a prior `ListNotificationConfigs` call, and that -// the system should return the next page of data. -func (c *FoldersNotificationConfigsListCall) PageToken(pageToken string) *FoldersNotificationConfigsListCall { - c.urlParams_.Set("pageToken", pageToken) +// MuteConfigId sets the optional parameter "muteConfigId": Required. +// Unique identifier provided by the client within the parent scope. It +// must consist of only lowercase letters, numbers, and hyphens, must +// start with a letter, must end with either a letter or a number, and +// must be 63 characters or less. +func (c *FoldersMuteConfigsCreateCall) MuteConfigId(muteConfigId string) *FoldersMuteConfigsCreateCall { + c.urlParams_.Set("muteConfigId", muteConfigId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersNotificationConfigsListCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsListCall { +func (c *FoldersMuteConfigsCreateCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *FoldersNotificationConfigsListCall) IfNoneMatch(entityTag string) *FoldersNotificationConfigsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersNotificationConfigsListCall) Context(ctx context.Context) *FoldersNotificationConfigsListCall { +func (c *FoldersMuteConfigsCreateCall) Context(ctx context.Context) *FoldersMuteConfigsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersNotificationConfigsListCall) Header() http.Header { +func (c *FoldersMuteConfigsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersNotificationConfigsListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersMuteConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notificationConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/muteConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -14041,14 +14551,15 @@ func (c *FoldersNotificationConfigsListCall) doRequest(alt string) (*http.Respon return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.notificationConfigs.list" call. -// Exactly one of *ListNotificationConfigsResponse or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *ListNotificationConfigsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was +// Do executes the "securitycenter.folders.muteConfigs.create" call. +// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *FoldersNotificationConfigsListCall) Do(opts ...googleapi.CallOption) (*ListNotificationConfigsResponse, error) { +func (c *FoldersMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14067,7 +14578,7 @@ func (c *FoldersNotificationConfigsListCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListNotificationConfigsResponse{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14079,36 +14590,33 @@ func (c *FoldersNotificationConfigsListCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Lists notification configs.", - // "flatPath": "v1/folders/{foldersId}/notificationConfigs", - // "httpMethod": "GET", - // "id": "securitycenter.folders.notificationConfigs.list", + // "description": "Creates a mute config.", + // "flatPath": "v1/folders/{foldersId}/muteConfigs", + // "httpMethod": "POST", + // "id": "securitycenter.folders.muteConfigs.create", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last `ListNotificationConfigsResponse`; indicates that this is a continuation of a prior `ListNotificationConfigs` call, and that the system should return the next page of data.", + // "muteConfigId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of only lowercase letters, numbers, and hyphens, must start with a letter, must end with either a letter or a number, and must be 63 characters or less.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The name of the parent in which to list the notification configurations. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "description": "Required. Resource name of the new mute configs's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/notificationConfigs", + // "path": "v1/{+parent}/muteConfigs", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // }, // "response": { - // "$ref": "ListNotificationConfigsResponse" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14117,67 +14625,35 @@ func (c *FoldersNotificationConfigsListCall) Do(opts ...googleapi.CallOption) (* } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *FoldersNotificationConfigsListCall) Pages(ctx context.Context, f func(*ListNotificationConfigsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "securitycenter.folders.notificationConfigs.patch": +// method id "securitycenter.folders.muteConfigs.delete": -type FoldersNotificationConfigsPatchCall struct { - s *Service - name string - notificationconfig *NotificationConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersMuteConfigsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a notification config. The following update fields -// are allowed: description, pubsub_topic, streaming_config.filter +// Delete: Deletes an existing mute config. // -// - name: The relative resource name of this notification config. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Example: -// "organizations/{organization_id}/notificationConfigs/notify_public_b -// ucket", -// "folders/{folder_id}/notificationConfigs/notify_public_bucket", or -// "projects/{project_id}/notificationConfigs/notify_public_bucket". -func (r *FoldersNotificationConfigsService) Patch(name string, notificationconfig *NotificationConfig) *FoldersNotificationConfigsPatchCall { - c := &FoldersNotificationConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the mute config to delete. Its format is +// organizations/{organization}/muteConfigs/{config_id}, +// folders/{folder}/muteConfigs/{config_id}, +// projects/{project}/muteConfigs/{config_id}, +// organizations/{organization}/locations/global/muteConfigs/{config_id +// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or +// projects/{project}/locations/global/muteConfigs/{config_id}. +func (r *FoldersMuteConfigsService) Delete(name string) *FoldersMuteConfigsDeleteCall { + c := &FoldersMuteConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.notificationconfig = notificationconfig - return c -} - -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the notification config. If empty all mutable -// fields will be updated. -func (c *FoldersNotificationConfigsPatchCall) UpdateMask(updateMask string) *FoldersNotificationConfigsPatchCall { - c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersNotificationConfigsPatchCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsPatchCall { +func (c *FoldersMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14185,21 +14661,21 @@ func (c *FoldersNotificationConfigsPatchCall) Fields(s ...googleapi.Field) *Fold // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersNotificationConfigsPatchCall) Context(ctx context.Context) *FoldersNotificationConfigsPatchCall { +func (c *FoldersMuteConfigsDeleteCall) Context(ctx context.Context) *FoldersMuteConfigsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersNotificationConfigsPatchCall) Header() http.Header { +func (c *FoldersMuteConfigsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersNotificationConfigsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -14207,16 +14683,11 @@ func (c *FoldersNotificationConfigsPatchCall) doRequest(alt string) (*http.Respo } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -14227,14 +14698,14 @@ func (c *FoldersNotificationConfigsPatchCall) doRequest(alt string) (*http.Respo return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.notificationConfigs.patch" call. -// Exactly one of *NotificationConfig or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *NotificationConfig.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *FoldersNotificationConfigsPatchCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { +// Do executes the "securitycenter.folders.muteConfigs.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *FoldersMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14253,7 +14724,7 @@ func (c *FoldersNotificationConfigsPatchCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NotificationConfig{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14265,34 +14736,25 @@ func (c *FoldersNotificationConfigsPatchCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", - // "flatPath": "v1/folders/{foldersId}/notificationConfigs/{notificationConfigsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.folders.notificationConfigs.patch", + // "description": "Deletes an existing mute config.", + // "flatPath": "v1/folders/{foldersId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.folders.muteConfigs.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The relative resource name of this notification config. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/notificationConfigs/notify_public_bucket\", \"folders/{folder_id}/notificationConfigs/notify_public_bucket\", or \"projects/{project_id}/notificationConfigs/notify_public_bucket\".", + // "description": "Required. Name of the mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", // "location": "path", - // "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", + // "pattern": "^folders/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the notification config. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, // "path": "v1/{+name}", - // "request": { - // "$ref": "NotificationConfig" - // }, // "response": { - // "$ref": "NotificationConfig" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14301,97 +14763,102 @@ func (c *FoldersNotificationConfigsPatchCall) Do(opts ...googleapi.CallOption) ( } -// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.create": +// method id "securitycenter.folders.muteConfigs.get": -type FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall struct { - s *Service - parent string - googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersMuteConfigsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a resident SecurityHealthAnalyticsCustomModule at the -// scope of the given CRM parent, and also creates inherited -// SecurityHealthAnalyticsCustomModules for all CRM descendants of the -// given parent. These modules are enabled by default. +// Get: Gets a mute config. // -// - parent: Resource name of the new custom module's parent. Its format -// is "organizations/{organization}/securityHealthAnalyticsSettings", -// "folders/{folder}/securityHealthAnalyticsSettings", or -// "projects/{project}/securityHealthAnalyticsSettings". -func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Create(parent string, googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule) *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall { - c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule = googlecloudsecuritycenterv1securityhealthanalyticscustommodule +// - name: Name of the mute config to retrieve. Its format is +// organizations/{organization}/muteConfigs/{config_id}, +// folders/{folder}/muteConfigs/{config_id}, +// projects/{project}/muteConfigs/{config_id}, +// organizations/{organization}/locations/global/muteConfigs/{config_id +// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or +// projects/{project}/locations/global/muteConfigs/{config_id}. +func (r *FoldersMuteConfigsService) Get(name string) *FoldersMuteConfigsGetCall { + c := &FoldersMuteConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall { +func (c *FoldersMuteConfigsGetCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersMuteConfigsGetCall) IfNoneMatch(entityTag string) *FoldersMuteConfigsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall { +func (c *FoldersMuteConfigsGetCall) Context(ctx context.Context) *FoldersMuteConfigsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Header() http.Header { +func (c *FoldersMuteConfigsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersMuteConfigsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.create" call. -// Exactly one of -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server -// Response.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { +// Do executes the "securitycenter.folders.muteConfigs.get" call. +// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14410,7 +14877,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do(opts if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14422,28 +14889,25 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do(opts } return ret, nil // { - // "description": "Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the given CRM parent, and also creates inherited SecurityHealthAnalyticsCustomModules for all CRM descendants of the given parent. These modules are enabled by default.", - // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules", - // "httpMethod": "POST", - // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.create", + // "description": "Gets a mute config.", + // "flatPath": "v1/folders/{foldersId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "GET", + // "id": "securitycenter.folders.muteConfigs.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. Resource name of the new custom module's parent. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", + // "name": { + // "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", // "location": "path", - // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$", + // "pattern": "^folders/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14452,89 +14916,116 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do(opts } -// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.delete": +// method id "securitycenter.folders.muteConfigs.list": -type FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersMuteConfigsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified SecurityHealthAnalyticsCustomModule and -// all of its descendants in the CRM hierarchy. This method is only -// supported for resident custom modules. +// List: Lists mute configs. // -// - name: Name of the custom module to delete. Its format is -// "organizations/{organization}/securityHealthAnalyticsSettings/custom -// Modules/{customModule}", -// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus -// tomModule}", or -// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c -// ustomModule}". -func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Delete(name string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { - c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The parent, which owns the collection of mute configs. Its +// format is "organizations/[organization_id]", "folders/[folder_id]", +// "projects/[project_id]". +func (r *FoldersMuteConfigsService) List(parent string) *FoldersMuteConfigsListCall { + c := &FoldersMuteConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of configs to return. The service may return fewer than this value. +// If unspecified, at most 10 configs will be returned. The maximum +// value is 1000; values above 1000 will be coerced to 1000. +func (c *FoldersMuteConfigsListCall) PageSize(pageSize int64) *FoldersMuteConfigsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListMuteConfigs` call. Provide this to +// retrieve the subsequent page. When paginating, all other parameters +// provided to `ListMuteConfigs` must match the call that provided the +// page token. +func (c *FoldersMuteConfigsListCall) PageToken(pageToken string) *FoldersMuteConfigsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { +func (c *FoldersMuteConfigsListCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersMuteConfigsListCall) IfNoneMatch(entityTag string) *FoldersMuteConfigsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { +func (c *FoldersMuteConfigsListCall) Context(ctx context.Context) *FoldersMuteConfigsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Header() http.Header { +func (c *FoldersMuteConfigsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersMuteConfigsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/muteConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "securitycenter.folders.muteConfigs.list" call. +// Exactly one of *ListMuteConfigsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListMuteConfigsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMuteConfigsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14553,7 +15044,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do(opts if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &ListMuteConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14565,25 +15056,36 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do(opts } return ret, nil // { - // "description": "Deletes the specified SecurityHealthAnalyticsCustomModule and all of its descendants in the CRM hierarchy. This method is only supported for resident custom modules.", - // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.delete", + // "description": "Lists mute configs.", + // "flatPath": "v1/folders/{foldersId}/muteConfigs", + // "httpMethod": "GET", + // "id": "securitycenter.folders.muteConfigs.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Name of the custom module to delete. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", + // "pageSize": { + // "description": "The maximum number of configs to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token, received from a previous `ListMuteConfigs` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListMuteConfigs` must match the call that provided the page token.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent, which owns the collection of mute configs. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", // "location": "path", - // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/muteConfigs", // "response": { - // "$ref": "Empty" + // "$ref": "ListMuteConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14592,83 +15094,104 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do(opts } -// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.get": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *FoldersMuteConfigsListCall) Pages(ctx context.Context, f func(*ListMuteConfigsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "securitycenter.folders.muteConfigs.patch": + +type FoldersMuteConfigsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Retrieves a SecurityHealthAnalyticsCustomModule. +// Patch: Updates a mute config. // -// - name: Name of the custom module to get. Its format is -// "organizations/{organization}/securityHealthAnalyticsSettings/custom -// Modules/{customModule}", -// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus -// tomModule}", or -// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c -// ustomModule}". -func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Get(name string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall { - c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: This field will be ignored if provided on config creation. +// Format "organizations/{organization}/muteConfigs/{mute_config}" +// "folders/{folder}/muteConfigs/{mute_config}" +// "projects/{project}/muteConfigs/{mute_config}" +// "organizations/{organization}/locations/global/muteConfigs/{mute_con +// fig}" "folders/{folder}/locations/global/muteConfigs/{mute_config}" +// "projects/{project}/locations/global/muteConfigs/{mute_config}". +func (r *FoldersMuteConfigsService) Patch(name string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *FoldersMuteConfigsPatchCall { + c := &FoldersMuteConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googlecloudsecuritycenterv1muteconfig = googlecloudsecuritycenterv1muteconfig + return c +} + +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to be updated. If empty all mutable fields will be updated. +func (c *FoldersMuteConfigsPatchCall) UpdateMask(updateMask string) *FoldersMuteConfigsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall { +func (c *FoldersMuteConfigsPatchCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall { +func (c *FoldersMuteConfigsPatchCall) Context(ctx context.Context) *FoldersMuteConfigsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Header() http.Header { +func (c *FoldersMuteConfigsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersMuteConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -14679,17 +15202,15 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) doRequest(a return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.get" call. -// Exactly one of -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server -// Response.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { +// Do executes the "securitycenter.folders.muteConfigs.patch" call. +// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14708,7 +15229,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(opts ... if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14720,25 +15241,34 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(opts ... } return ret, nil // { - // "description": "Retrieves a SecurityHealthAnalyticsCustomModule.", - // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", - // "httpMethod": "GET", - // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.get", + // "description": "Updates a mute config.", + // "flatPath": "v1/folders/{foldersId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.folders.muteConfigs.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the custom module to get. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", + // "description": "This field will be ignored if provided on config creation. Format \"organizations/{organization}/muteConfigs/{mute_config}\" \"folders/{folder}/muteConfigs/{mute_config}\" \"projects/{project}/muteConfigs/{mute_config}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", // "location": "path", - // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", + // "pattern": "^folders/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v1/{+name}", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14747,97 +15277,81 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(opts ... } -// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.list": +// method id "securitycenter.folders.notificationConfigs.create": -type FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersNotificationConfigsCreateCall struct { + s *Service + parent string + notificationconfig *NotificationConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Returns a list of all SecurityHealthAnalyticsCustomModules for -// the given parent. This includes resident modules defined at the scope -// of the parent, and inherited modules, inherited from CRM ancestors. +// Create: Creates a notification config. // -// - parent: Name of parent to list custom modules. Its format is -// "organizations/{organization}/securityHealthAnalyticsSettings", -// "folders/{folder}/securityHealthAnalyticsSettings", or -// "projects/{project}/securityHealthAnalyticsSettings". -func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) List(parent string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { - c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Resource name of the new notification config's parent. Its +// format is "organizations/[organization_id]", "folders/[folder_id]", +// or "projects/[project_id]". +func (r *FoldersNotificationConfigsService) Create(parent string, notificationconfig *NotificationConfig) *FoldersNotificationConfigsCreateCall { + c := &FoldersNotificationConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent + c.notificationconfig = notificationconfig return c } -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) PageSize(pageSize int64) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last call indicating a continuation -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) PageToken(pageToken string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { - c.urlParams_.Set("pageToken", pageToken) +// ConfigId sets the optional parameter "configId": Required. Unique +// identifier provided by the client within the parent scope. It must be +// between 1 and 128 characters and contain alphanumeric characters, +// underscores, or hyphens only. +func (c *FoldersNotificationConfigsCreateCall) ConfigId(configId string) *FoldersNotificationConfigsCreateCall { + c.urlParams_.Set("configId", configId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { +func (c *FoldersNotificationConfigsCreateCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { +func (c *FoldersNotificationConfigsCreateCall) Context(ctx context.Context) *FoldersNotificationConfigsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Header() http.Header { +func (c *FoldersNotificationConfigsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersNotificationConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notificationConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -14848,16 +15362,14 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) doRequest( return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.list" call. -// Exactly one of *ListSecurityHealthAnalyticsCustomModulesResponse or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *ListSecurityHealthAnalyticsCustomModulesResponse.ServerResponse.Heade -// r or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListSecurityHealthAnalyticsCustomModulesResponse, error) { +// Do executes the "securitycenter.folders.notificationConfigs.create" call. +// Exactly one of *NotificationConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *NotificationConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14876,7 +15388,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(opts .. if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListSecurityHealthAnalyticsCustomModulesResponse{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14888,36 +15400,33 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(opts .. } return ret, nil // { - // "description": "Returns a list of all SecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", - // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules", - // "httpMethod": "GET", - // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.list", + // "description": "Creates a notification config.", + // "flatPath": "v1/folders/{foldersId}/notificationConfigs", + // "httpMethod": "POST", + // "id": "securitycenter.folders.notificationConfigs.create", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last call indicating a continuation", + // "configId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must be between 1 and 128 characters and contain alphanumeric characters, underscores, or hyphens only.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. Name of parent to list custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", + // "description": "Required. Resource name of the new notification config's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", - // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules", + // "path": "v1/{+parent}/notificationConfigs", + // "request": { + // "$ref": "NotificationConfig" + // }, // "response": { - // "$ref": "ListSecurityHealthAnalyticsCustomModulesResponse" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14926,140 +15435,84 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(opts .. } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Pages(ctx context.Context, f func(*ListSecurityHealthAnalyticsCustomModulesResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.listDescendant": +// method id "securitycenter.folders.notificationConfigs.delete": -type FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersNotificationConfigsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// ListDescendant: Returns a list of all resident -// SecurityHealthAnalyticsCustomModules under the given CRM parent and -// all of the parent’s CRM descendants. +// Delete: Deletes a notification config. // -// - parent: Name of parent to list descendant custom modules. Its -// format is -// "organizations/{organization}/securityHealthAnalyticsSettings", -// "folders/{folder}/securityHealthAnalyticsSettings", or -// "projects/{project}/securityHealthAnalyticsSettings". -func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) ListDescendant(parent string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { - c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) PageSize(pageSize int64) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last call indicating a continuation -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) PageToken(pageToken string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: Name of the notification config to delete. Its format is +// "organizations/[organization_id]/notificationConfigs/[config_id]", +// "folders/[folder_id]/notificationConfigs/[config_id]", or +// "projects/[project_id]/notificationConfigs/[config_id]". +func (r *FoldersNotificationConfigsService) Delete(name string) *FoldersNotificationConfigsDeleteCall { + c := &FoldersNotificationConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { +func (c *FoldersNotificationConfigsDeleteCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { +func (c *FoldersNotificationConfigsDeleteCall) Context(ctx context.Context) *FoldersNotificationConfigsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Header() http.Header { +func (c *FoldersNotificationConfigsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersNotificationConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules:listDescendant") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.listDescendant" call. -// Exactly one of -// *ListDescendantSecurityHealthAnalyticsCustomModulesResponse or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *ListDescendantSecurityHealthAnalyticsCustomModulesResponse.ServerResp -// onse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Do(opts ...googleapi.CallOption) (*ListDescendantSecurityHealthAnalyticsCustomModulesResponse, error) { +// Do executes the "securitycenter.folders.notificationConfigs.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *FoldersNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15078,7 +15531,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListDescendantSecurityHealthAnalyticsCustomModulesResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15090,36 +15543,25 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) } return ret, nil // { - // "description": "Returns a list of all resident SecurityHealthAnalyticsCustomModules under the given CRM parent and all of the parent’s CRM descendants.", - // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules:listDescendant", - // "httpMethod": "GET", - // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.listDescendant", + // "description": "Deletes a notification config.", + // "flatPath": "v1/folders/{foldersId}/notificationConfigs/{notificationConfigsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.folders.notificationConfigs.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last call indicating a continuation", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Name of parent to list descendant custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", + // "name": { + // "description": "Required. Name of the notification config to delete. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\", \"folders/[folder_id]/notificationConfigs/[config_id]\", or \"projects/[project_id]/notificationConfigs/[config_id]\".", // "location": "path", - // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$", + // "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules:listDescendant", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListDescendantSecurityHealthAnalyticsCustomModulesResponse" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15128,111 +15570,80 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Pages(ctx context.Context, f func(*ListDescendantSecurityHealthAnalyticsCustomModulesResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.patch": +// method id "securitycenter.folders.notificationConfigs.get": -type FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersNotificationConfigsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates the SecurityHealthAnalyticsCustomModule under the -// given name based on the given update mask. Updating the enablement -// state is supported on both resident and inherited modules (though -// resident modules cannot have an enablement state of "inherited"). -// Updating the display name and custom config of a module is supported -// on resident modules only. +// Get: Gets a notification config. // -// - name: Immutable. The resource name of the custom module. Its format -// is -// "organizations/{organization}/securityHealthAnalyticsSettings/custom -// Modules/{customModule}", or -// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus -// tomModule}", or -// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c -// ustomModule}" The id {customModule} is server-generated and is not -// user settable. It will be a numeric id containing 1-20 digits. -func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Patch(name string, googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule) *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall { - c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the notification config to get. Its format is +// "organizations/[organization_id]/notificationConfigs/[config_id]", +// "folders/[folder_id]/notificationConfigs/[config_id]", or +// "projects/[project_id]/notificationConfigs/[config_id]". +func (r *FoldersNotificationConfigsService) Get(name string) *FoldersNotificationConfigsGetCall { + c := &FoldersNotificationConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule = googlecloudsecuritycenterv1securityhealthanalyticscustommodule - return c -} - -// UpdateMask sets the optional parameter "updateMask": The list of -// fields to update. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) UpdateMask(updateMask string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall { - c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall { +func (c *FoldersNotificationConfigsGetCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersNotificationConfigsGetCall) IfNoneMatch(entityTag string) *FoldersNotificationConfigsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall { +func (c *FoldersNotificationConfigsGetCall) Context(ctx context.Context) *FoldersNotificationConfigsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Header() http.Header { +func (c *FoldersNotificationConfigsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersNotificationConfigsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -15243,17 +15654,14 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) doRequest return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.patch" call. -// Exactly one of -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server -// Response.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { +// Do executes the "securitycenter.folders.notificationConfigs.get" call. +// Exactly one of *NotificationConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *NotificationConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersNotificationConfigsGetCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15272,7 +15680,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do(opts . if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15284,34 +15692,25 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do(opts . } return ret, nil // { - // "description": "Updates the SecurityHealthAnalyticsCustomModule under the given name based on the given update mask. Updating the enablement state is supported on both resident and inherited modules (though resident modules cannot have an enablement state of \"inherited\"). Updating the display name and custom config of a module is supported on resident modules only.", - // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.patch", + // "description": "Gets a notification config.", + // "flatPath": "v1/folders/{foldersId}/notificationConfigs/{notificationConfigsId}", + // "httpMethod": "GET", + // "id": "securitycenter.folders.notificationConfigs.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Immutable. The resource name of the custom module. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\" The id {customModule} is server-generated and is not user settable. It will be a numeric id containing 1-20 digits.", + // "description": "Required. Name of the notification config to get. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\", \"folders/[folder_id]/notificationConfigs/[config_id]\", or \"projects/[project_id]/notificationConfigs/[config_id]\".", // "location": "path", - // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", + // "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "The list of fields to update.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, // "path": "v1/{+name}", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" - // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15320,75 +15719,96 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do(opts . } -// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.simulate": +// method id "securitycenter.folders.notificationConfigs.list": -type FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall struct { - s *Service - parent string - simulatesecurityhealthanalyticscustommodulerequest *SimulateSecurityHealthAnalyticsCustomModuleRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersNotificationConfigsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Simulate: Simulates a given SecurityHealthAnalyticsCustomModule and -// Resource. +// List: Lists notification configs. // -// - parent: The relative resource name of the organization, project, or -// folder. For more information about relative resource names, see -// Relative Resource Name -// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) -// Example: `organizations/{organization_id}`. -func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Simulate(parent string, simulatesecurityhealthanalyticscustommodulerequest *SimulateSecurityHealthAnalyticsCustomModuleRequest) *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { - c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The name of the parent in which to list the notification +// configurations. Its format is "organizations/[organization_id]", +// "folders/[folder_id]", or "projects/[project_id]". +func (r *FoldersNotificationConfigsService) List(parent string) *FoldersNotificationConfigsListCall { + c := &FoldersNotificationConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.simulatesecurityhealthanalyticscustommodulerequest = simulatesecurityhealthanalyticscustommodulerequest + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *FoldersNotificationConfigsListCall) PageSize(pageSize int64) *FoldersNotificationConfigsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListNotificationConfigsResponse`; indicates that this is +// a continuation of a prior `ListNotificationConfigs` call, and that +// the system should return the next page of data. +func (c *FoldersNotificationConfigsListCall) PageToken(pageToken string) *FoldersNotificationConfigsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { +func (c *FoldersNotificationConfigsListCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersNotificationConfigsListCall) IfNoneMatch(entityTag string) *FoldersNotificationConfigsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { +func (c *FoldersNotificationConfigsListCall) Context(ctx context.Context) *FoldersNotificationConfigsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Header() http.Header { +func (c *FoldersNotificationConfigsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersNotificationConfigsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.simulatesecurityhealthanalyticscustommodulerequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules:simulate") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notificationConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -15399,16 +15819,14 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) doRequ return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.simulate" call. -// Exactly one of *SimulateSecurityHealthAnalyticsCustomModuleResponse -// or error will be non-nil. Any non-2xx status code is an error. -// Response headers are in either -// *SimulateSecurityHealthAnalyticsCustomModuleResponse.ServerResponse.He -// ader or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Do(opts ...googleapi.CallOption) (*SimulateSecurityHealthAnalyticsCustomModuleResponse, error) { +// Do executes the "securitycenter.folders.notificationConfigs.list" call. +// Exactly one of *ListNotificationConfigsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListNotificationConfigsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersNotificationConfigsListCall) Do(opts ...googleapi.CallOption) (*ListNotificationConfigsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15427,7 +15845,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Do(opt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &SimulateSecurityHealthAnalyticsCustomModuleResponse{ + ret := &ListNotificationConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15439,28 +15857,36 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Do(opt } return ret, nil // { - // "description": "Simulates a given SecurityHealthAnalyticsCustomModule and Resource.", - // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules:simulate", - // "httpMethod": "POST", - // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.simulate", + // "description": "Lists notification configs.", + // "flatPath": "v1/folders/{foldersId}/notificationConfigs", + // "httpMethod": "GET", + // "id": "securitycenter.folders.notificationConfigs.list", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListNotificationConfigsResponse`; indicates that this is a continuation of a prior `ListNotificationConfigs` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, // "parent": { - // "description": "Required. The relative resource name of the organization, project, or folder. For more information about relative resource names, see [Relative Resource Name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) Example: `organizations/{organization_id}`", + // "description": "Required. The name of the parent in which to list the notification configurations. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", - // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules:simulate", - // "request": { - // "$ref": "SimulateSecurityHealthAnalyticsCustomModuleRequest" - // }, + // "path": "v1/{+parent}/notificationConfigs", // "response": { - // "$ref": "SimulateSecurityHealthAnalyticsCustomModuleResponse" + // "$ref": "ListNotificationConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15469,83 +15895,106 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Do(opt } -// method id "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.get": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *FoldersNotificationConfigsListCall) Pages(ctx context.Context, f func(*ListNotificationConfigsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "securitycenter.folders.notificationConfigs.patch": + +type FoldersNotificationConfigsPatchCall struct { + s *Service + name string + notificationconfig *NotificationConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. +// Patch: Updates a notification config. The following update fields +// are allowed: description, pubsub_topic, streaming_config.filter // -// - name: Name of the effective custom module to get. Its format is -// "organizations/{organization}/securityHealthAnalyticsSettings/effect -// iveCustomModules/{customModule}", -// "folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomMod -// ules/{customModule}", or -// "projects/{project}/securityHealthAnalyticsSettings/effectiveCustomM -// odules/{customModule}". -func (r *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesService) Get(name string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { - c := &FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The relative resource name of this notification config. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// Example: +// "organizations/{organization_id}/notificationConfigs/notify_public_b +// ucket", +// "folders/{folder_id}/notificationConfigs/notify_public_bucket", or +// "projects/{project_id}/notificationConfigs/notify_public_bucket". +func (r *FoldersNotificationConfigsService) Patch(name string, notificationconfig *NotificationConfig) *FoldersNotificationConfigsPatchCall { + c := &FoldersNotificationConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.notificationconfig = notificationconfig + return c +} + +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the notification config. If empty all mutable +// fields will be updated. +func (c *FoldersNotificationConfigsPatchCall) UpdateMask(updateMask string) *FoldersNotificationConfigsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { +func (c *FoldersNotificationConfigsPatchCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { +func (c *FoldersNotificationConfigsPatchCall) Context(ctx context.Context) *FoldersNotificationConfigsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Header() http.Header { +func (c *FoldersNotificationConfigsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersNotificationConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -15556,17 +16005,14 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) do return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.get" call. -// Exactly one of -// *GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModu -// le or error will be non-nil. Any non-2xx status code is an error. -// Response headers are in either -// *GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModu -// le.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule, error) { +// Do executes the "securitycenter.folders.notificationConfigs.patch" call. +// Exactly one of *NotificationConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *NotificationConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersNotificationConfigsPatchCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15585,7 +16031,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Do if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15597,25 +16043,34 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Do } return ret, nil // { - // "description": "Retrieves an EffectiveSecurityHealthAnalyticsCustomModule.", - // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/effectiveCustomModules/{effectiveCustomModulesId}", - // "httpMethod": "GET", - // "id": "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.get", + // "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", + // "flatPath": "v1/folders/{foldersId}/notificationConfigs/{notificationConfigsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.folders.notificationConfigs.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the effective custom module to get. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\"", + // "description": "The relative resource name of this notification config. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/notificationConfigs/notify_public_bucket\", \"folders/{folder_id}/notificationConfigs/notify_public_bucket\", or \"projects/{project_id}/notificationConfigs/notify_public_bucket\".", // "location": "path", - // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings/effectiveCustomModules/[^/]+$", + // "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the notification config. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v1/{+name}", + // "request": { + // "$ref": "NotificationConfig" + // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15624,98 +16079,76 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Do } -// method id "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.list": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.create": -type FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall struct { + s *Service + parent string + googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Returns a list of all -// EffectiveSecurityHealthAnalyticsCustomModules for the given parent. -// This includes resident modules defined at the scope of the parent, -// and inherited modules, inherited from CRM ancestors. +// Create: Creates a resident SecurityHealthAnalyticsCustomModule at the +// scope of the given CRM parent, and also creates inherited +// SecurityHealthAnalyticsCustomModules for all CRM descendants of the +// given parent. These modules are enabled by default. // -// - parent: Name of parent to list effective custom modules. Its format +// - parent: Resource name of the new custom module's parent. Its format // is "organizations/{organization}/securityHealthAnalyticsSettings", // "folders/{folder}/securityHealthAnalyticsSettings", or // "projects/{project}/securityHealthAnalyticsSettings". -func (r *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesService) List(parent string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { - c := &FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Create(parent string, googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule) *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall { + c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) PageSize(pageSize int64) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last call indicating a continuation -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) PageToken(pageToken string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { - c.urlParams_.Set("pageToken", pageToken) + c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule = googlecloudsecuritycenterv1securityhealthanalyticscustommodule return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/effectiveCustomModules") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -15726,17 +16159,17 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) d return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.list" call. +// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.create" call. // Exactly one of -// *ListEffectiveSecurityHealthAnalyticsCustomModulesResponse or error -// will be non-nil. Any non-2xx status code is an error. Response +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or +// error will be non-nil. Any non-2xx status code is an error. Response // headers are in either -// *ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.ServerRespo -// nse.Header or (if a response was returned at all) in +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server +// Response.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListEffectiveSecurityHealthAnalyticsCustomModulesResponse, error) { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15755,7 +16188,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) D if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListEffectiveSecurityHealthAnalyticsCustomModulesResponse{ + ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15767,36 +16200,28 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) D } return ret, nil // { - // "description": "Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", - // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/effectiveCustomModules", - // "httpMethod": "GET", - // "id": "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.list", + // "description": "Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the given CRM parent, and also creates inherited SecurityHealthAnalyticsCustomModules for all CRM descendants of the given parent. These modules are enabled by default.", + // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules", + // "httpMethod": "POST", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.create", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last call indicating a continuation", - // "location": "query", - // "type": "string" - // }, // "parent": { - // "description": "Required. Name of parent to list effective custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", + // "description": "Required. Resource name of the new custom module's parent. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", // "location": "path", // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/effectiveCustomModules", + // "path": "v1/{+parent}/customModules", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // }, // "response": { - // "$ref": "ListEffectiveSecurityHealthAnalyticsCustomModulesResponse" + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15805,135 +16230,89 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) D } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Pages(ctx context.Context, f func(*ListEffectiveSecurityHealthAnalyticsCustomModulesResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "securitycenter.folders.sources.list": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.delete": -type FoldersSourcesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all sources belonging to an organization. +// Delete: Deletes the specified SecurityHealthAnalyticsCustomModule and +// all of its descendants in the CRM hierarchy. This method is only +// supported for resident custom modules. // -// - parent: Resource name of the parent of sources to list. Its format -// should be "organizations/[organization_id]", "folders/[folder_id]", -// or "projects/[project_id]". -func (r *FoldersSourcesService) List(parent string) *FoldersSourcesListCall { - c := &FoldersSourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *FoldersSourcesListCall) PageSize(pageSize int64) *FoldersSourcesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListSourcesResponse`; indicates that this is a -// continuation of a prior `ListSources` call, and that the system -// should return the next page of data. -func (c *FoldersSourcesListCall) PageToken(pageToken string) *FoldersSourcesListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: Name of the custom module to delete. Its format is +// "organizations/{organization}/securityHealthAnalyticsSettings/custom +// Modules/{customModule}", +// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus +// tomModule}", or +// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c +// ustomModule}". +func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Delete(name string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { + c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSourcesListCall) Fields(s ...googleapi.Field) *FoldersSourcesListCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *FoldersSourcesListCall) IfNoneMatch(entityTag string) *FoldersSourcesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSourcesListCall) Context(ctx context.Context) *FoldersSourcesListCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSourcesListCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSourcesListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sources") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.sources.list" call. -// Exactly one of *ListSourcesResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListSourcesResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *FoldersSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSourcesResponse, error) { +// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15952,7 +16331,7 @@ func (c *FoldersSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSourcesR if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListSourcesResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15964,36 +16343,25 @@ func (c *FoldersSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSourcesR } return ret, nil // { - // "description": "Lists all sources belonging to an organization.", - // "flatPath": "v1/folders/{foldersId}/sources", - // "httpMethod": "GET", - // "id": "securitycenter.folders.sources.list", + // "description": "Deletes the specified SecurityHealthAnalyticsCustomModule and all of its descendants in the CRM hierarchy. This method is only supported for resident custom modules.", + // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last `ListSourcesResponse`; indicates that this is a continuation of a prior `ListSources` call, and that the system should return the next page of data.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "name": { + // "description": "Required. Name of the custom module to delete. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/sources", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListSourcesResponse" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -16002,120 +16370,104 @@ func (c *FoldersSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSourcesR } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *FoldersSourcesListCall) Pages(ctx context.Context, f func(*ListSourcesResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } +// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.get": + +type FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// method id "securitycenter.folders.sources.findings.group": +// Get: Retrieves a SecurityHealthAnalyticsCustomModule. +// +// - name: Name of the custom module to get. Its format is +// "organizations/{organization}/securityHealthAnalyticsSettings/custom +// Modules/{customModule}", +// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus +// tomModule}", or +// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c +// ustomModule}". +func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Get(name string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall { + c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} -type FoldersSourcesFindingsGroupCall struct { - s *Service - parent string - groupfindingsrequest *GroupFindingsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c } -// Group: Filters an organization or source's findings and groups them -// by their specified properties. To group across all sources provide a -// `-` as the source id. Example: -// /v1/organizations/{organization_id}/sources/-/findings, -// /v1/folders/{folder_id}/sources/-/findings, -// /v1/projects/{project_id}/sources/-/findings -// -// - parent: Name of the source to groupBy. Its format is -// "organizations/[organization_id]/sources/[source_id]", -// folders/[folder_id]/sources/[source_id], or -// projects/[project_id]/sources/[source_id]. To groupBy across all -// sources provide a source_id of `-`. For example: -// organizations/{organization_id}/sources/-, -// folders/{folder_id}/sources/-, or projects/{project_id}/sources/-. -func (r *FoldersSourcesFindingsService) Group(parent string, groupfindingsrequest *GroupFindingsRequest) *FoldersSourcesFindingsGroupCall { - c := &FoldersSourcesFindingsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.groupfindingsrequest = groupfindingsrequest - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *FoldersSourcesFindingsGroupCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsGroupCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall { + c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSourcesFindingsGroupCall) Context(ctx context.Context) *FoldersSourcesFindingsGroupCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSourcesFindingsGroupCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSourcesFindingsGroupCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupfindingsrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings:group") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.sources.findings.group" call. -// Exactly one of *GroupFindingsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *GroupFindingsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *FoldersSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) (*GroupFindingsResponse, error) { +// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.get" call. +// Exactly one of +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server +// Response.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16134,7 +16486,7 @@ func (c *FoldersSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) (*Gro if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GroupFindingsResponse{ + ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16146,28 +16498,25 @@ func (c *FoldersSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) (*Gro } return ret, nil // { - // "description": "Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings", - // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings:group", - // "httpMethod": "POST", - // "id": "securitycenter.folders.sources.findings.group", + // "description": "Retrieves a SecurityHealthAnalyticsCustomModule.", + // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", + // "httpMethod": "GET", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. Name of the source to groupBy. Its format is \"organizations/[organization_id]/sources/[source_id]\", folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]. To groupBy across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, or projects/{project_id}/sources/-", + // "name": { + // "description": "Required. Name of the custom module to get. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", // "location": "path", - // "pattern": "^folders/[^/]+/sources/[^/]+$", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/findings:group", - // "request": { - // "$ref": "GroupFindingsRequest" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "GroupFindingsResponse" + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -16176,30 +16525,9 @@ func (c *FoldersSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) (*Gro } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *FoldersSourcesFindingsGroupCall) Pages(ctx context.Context, f func(*GroupFindingsResponse) error) error { - c.ctx_ = ctx - defer func(pt string) { c.groupfindingsrequest.PageToken = pt }(c.groupfindingsrequest.PageToken) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.groupfindingsrequest.PageToken = x.NextPageToken - } -} - -// method id "securitycenter.folders.sources.findings.list": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.list": -type FoldersSourcesFindingsListCall struct { +type FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -16208,141 +16536,39 @@ type FoldersSourcesFindingsListCall struct { header_ http.Header } -// List: Lists an organization or source's findings. To list across all -// sources provide a `-` as the source id. Example: -// /v1/organizations/{organization_id}/sources/-/findings +// List: Returns a list of all SecurityHealthAnalyticsCustomModules for +// the given parent. This includes resident modules defined at the scope +// of the parent, and inherited modules, inherited from CRM ancestors. // -// - parent: Name of the source the findings belong to. Its format is -// "organizations/[organization_id]/sources/[source_id], -// folders/[folder_id]/sources/[source_id], or -// projects/[project_id]/sources/[source_id]". To list across all -// sources provide a source_id of `-`. For example: -// organizations/{organization_id}/sources/-, -// folders/{folder_id}/sources/- or projects/{projects_id}/sources/-. -func (r *FoldersSourcesFindingsService) List(parent string) *FoldersSourcesFindingsListCall { - c := &FoldersSourcesFindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Name of parent to list custom modules. Its format is +// "organizations/{organization}/securityHealthAnalyticsSettings", +// "folders/{folder}/securityHealthAnalyticsSettings", or +// "projects/{project}/securityHealthAnalyticsSettings". +func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) List(parent string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { + c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } -// CompareDuration sets the optional parameter "compareDuration": When -// compare_duration is set, the ListFindingsResult's "state_change" -// attribute is updated to indicate whether the finding had its state -// changed, the finding's state remained unchanged, or if the finding -// was added in any state during the compare_duration period of time -// that precedes the read_time. This is the time between (read_time - -// compare_duration) and read_time. The state_change value is derived -// based on the presence and state of the finding at the two points in -// time. Intermediate state changes between the two times don't affect -// the result. For example, the results aren't affected if the finding -// is made inactive and then active again. Possible "state_change" -// values when compare_duration is specified: * "CHANGED": indicates -// that the finding was present and matched the given filter at the -// start of compare_duration, but changed its state at read_time. * -// "UNCHANGED": indicates that the finding was present and matched the -// given filter at the start of compare_duration and did not change -// state at read_time. * "ADDED": indicates that the finding did not -// match the given filter or was not present at the start of -// compare_duration, but was present at read_time. * "REMOVED": -// indicates that the finding was present and matched the filter at the -// start of compare_duration, but did not match the filter at read_time. -// If compare_duration is not specified, then the only possible -// state_change is "UNUSED", which will be the state_change set for all -// findings present at read_time. -func (c *FoldersSourcesFindingsListCall) CompareDuration(compareDuration string) *FoldersSourcesFindingsListCall { - c.urlParams_.Set("compareDuration", compareDuration) - return c -} - -// FieldMask sets the optional parameter "fieldMask": A field mask to -// specify the Finding fields to be listed in the response. An empty -// field mask will list all fields. -func (c *FoldersSourcesFindingsListCall) FieldMask(fieldMask string) *FoldersSourcesFindingsListCall { - c.urlParams_.Set("fieldMask", fieldMask) - return c -} - -// Filter sets the optional parameter "filter": Expression that defines -// the filter to apply across findings. The expression is a list of one -// or more restrictions combined via logical operators `AND` and `OR`. -// Parentheses are supported, and `OR` has higher precedence than `AND`. -// Restrictions have the form ` ` and may have a `-` character in front -// of them to indicate negation. Examples include: * name * -// source_properties.a_property * security_marks.marks.marka The -// supported operators are: * `=` for all value types. * `>`, `<`, `>=`, -// `<=` for integer values. * `:`, meaning substring matching, for -// strings. The supported value types are: * string literals in quotes. -// * integer literals without quotes. * boolean literals `true` and -// `false` without quotes. The following field and operator combinations -// are supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, -// `:` * state: `=`, `:` * category: `=`, `:` * external_uri: `=`, `:` * -// event_time: `=`, `>`, `<`, `>=`, `<=` Usage: This should be -// milliseconds since epoch or an RFC3339 string. Examples: `event_time -// = "2019-06-10T16:07:18-07:00" `event_time = 1560208038000` * -// severity: `=`, `:` * workflow_state: `=`, `:` * security_marks.marks: -// `=`, `:` * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` For -// example, `source_properties.size = 100` is a valid filter string. Use -// a partial match on the empty string to filter based on a property -// existing: `source_properties.my_property : "" Use a negated partial -// match on the empty string to filter based on a property not existing: -// `-source_properties.my_property : "" * resource: * resource.name: -// `=`, `:` * resource.parent_name: `=`, `:` * -// resource.parent_display_name: `=`, `:` * resource.project_name: `=`, -// `:` * resource.project_display_name: `=`, `:` * resource.type: `=`, -// `:` * resource.folders.resource_folder: `=`, `:` * -// resource.display_name: `=`, `:` -func (c *FoldersSourcesFindingsListCall) Filter(filter string) *FoldersSourcesFindingsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// OrderBy sets the optional parameter "orderBy": Expression that -// defines what fields and order to use for sorting. The string value -// should follow SQL syntax: comma separated list of fields. For -// example: "name,resource_properties.a_property". The default sorting -// order is ascending. To specify descending order for a field, a suffix -// " desc" should be appended to the field name. For example: "name -// desc,source_properties.a_property". Redundant space characters in the -// syntax are insignificant. "name desc,source_properties.a_property" -// and " name desc , source_properties.a_property " are equivalent. The -// following fields are supported: name parent state category -// resource_name event_time source_properties security_marks.marks -func (c *FoldersSourcesFindingsListCall) OrderBy(orderBy string) *FoldersSourcesFindingsListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - // PageSize sets the optional parameter "pageSize": The maximum number // of results to return in a single response. Default is 10, minimum is // 1, maximum is 1000. -func (c *FoldersSourcesFindingsListCall) PageSize(pageSize int64) *FoldersSourcesFindingsListCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) PageSize(pageSize int64) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListFindingsResponse`; indicates that this is a -// continuation of a prior `ListFindings` call, and that the system -// should return the next page of data. -func (c *FoldersSourcesFindingsListCall) PageToken(pageToken string) *FoldersSourcesFindingsListCall { +// by the last call indicating a continuation +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) PageToken(pageToken string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { c.urlParams_.Set("pageToken", pageToken) return c } -// ReadTime sets the optional parameter "readTime": Time used as a -// reference point when filtering findings. The filter is limited to -// findings existing at the supplied time and their values are those at -// that specific time. Absence of this field will default to the API's -// version of NOW. -func (c *FoldersSourcesFindingsListCall) ReadTime(readTime string) *FoldersSourcesFindingsListCall { - c.urlParams_.Set("readTime", readTime) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSourcesFindingsListCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsListCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -16352,7 +16578,7 @@ func (c *FoldersSourcesFindingsListCall) Fields(s ...googleapi.Field) *FoldersSo // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *FoldersSourcesFindingsListCall) IfNoneMatch(entityTag string) *FoldersSourcesFindingsListCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { c.ifNoneMatch_ = entityTag return c } @@ -16360,21 +16586,21 @@ func (c *FoldersSourcesFindingsListCall) IfNoneMatch(entityTag string) *FoldersS // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSourcesFindingsListCall) Context(ctx context.Context) *FoldersSourcesFindingsListCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSourcesFindingsListCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSourcesFindingsListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -16387,7 +16613,7 @@ func (c *FoldersSourcesFindingsListCall) doRequest(alt string) (*http.Response, var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -16400,14 +16626,16 @@ func (c *FoldersSourcesFindingsListCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.sources.findings.list" call. -// Exactly one of *ListFindingsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListFindingsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *FoldersSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*ListFindingsResponse, error) { +// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.list" call. +// Exactly one of *ListSecurityHealthAnalyticsCustomModulesResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ListSecurityHealthAnalyticsCustomModulesResponse.ServerResponse.Heade +// r or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListSecurityHealthAnalyticsCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16426,7 +16654,7 @@ func (c *FoldersSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*List if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListFindingsResponse{ + ret := &ListSecurityHealthAnalyticsCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16438,36 +16666,14 @@ func (c *FoldersSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*List } return ret, nil // { - // "description": "Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings", - // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings", + // "description": "Returns a list of all SecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", + // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules", // "httpMethod": "GET", - // "id": "securitycenter.folders.sources.findings.list", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.list", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "compareDuration": { - // "description": "When compare_duration is set, the ListFindingsResult's \"state_change\" attribute is updated to indicate whether the finding had its state changed, the finding's state remained unchanged, or if the finding was added in any state during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence and state of the finding at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the finding is made inactive and then active again. Possible \"state_change\" values when compare_duration is specified: * \"CHANGED\": indicates that the finding was present and matched the given filter at the start of compare_duration, but changed its state at read_time. * \"UNCHANGED\": indicates that the finding was present and matched the given filter at the start of compare_duration and did not change state at read_time. * \"ADDED\": indicates that the finding did not match the given filter or was not present at the start of compare_duration, but was present at read_time. * \"REMOVED\": indicates that the finding was present and matched the filter at the start of compare_duration, but did not match the filter at read_time. If compare_duration is not specified, then the only possible state_change is \"UNUSED\", which will be the state_change set for all findings present at read_time.", - // "format": "google-duration", - // "location": "query", - // "type": "string" - // }, - // "fieldMask": { - // "description": "A field mask to specify the Finding fields to be listed in the response. An empty field mask will list all fields.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" - // }, - // "filter": { - // "description": "Expression that defines the filter to apply across findings. The expression is a list of one or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. Examples include: * name * source_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following field and operator combinations are supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, `:` * state: `=`, `:` * category: `=`, `:` * external_uri: `=`, `:` * event_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `event_time = \"2019-06-10T16:07:18-07:00\"` `event_time = 1560208038000` * severity: `=`, `:` * workflow_state: `=`, `:` * security_marks.marks: `=`, `:` * source_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` For example, `source_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `source_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-source_properties.my_property : \"\"` * resource: * resource.name: `=`, `:` * resource.parent_name: `=`, `:` * resource.parent_display_name: `=`, `:` * resource.project_name: `=`, `:` * resource.project_display_name: `=`, `:` * resource.type: `=`, `:` * resource.folders.resource_folder: `=`, `:` * resource.display_name: `=`, `:`", - // "location": "query", - // "type": "string" - // }, - // "orderBy": { - // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,source_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,source_properties.a_property\" and \" name desc , source_properties.a_property \" are equivalent. The following fields are supported: name parent state category resource_name event_time source_properties security_marks.marks", - // "location": "query", - // "type": "string" - // }, // "pageSize": { // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", // "format": "int32", @@ -16475,27 +16681,21 @@ func (c *FoldersSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*List // "type": "integer" // }, // "pageToken": { - // "description": "The value returned by the last `ListFindingsResponse`; indicates that this is a continuation of a prior `ListFindings` call, and that the system should return the next page of data.", + // "description": "The value returned by the last call indicating a continuation", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. Name of the source the findings belong to. Its format is \"organizations/[organization_id]/sources/[source_id], folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]\". To list across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or projects/{projects_id}/sources/-", + // "description": "Required. Name of parent to list custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", // "location": "path", - // "pattern": "^folders/[^/]+/sources/[^/]+$", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$", // "required": true, // "type": "string" - // }, - // "readTime": { - // "description": "Time used as a reference point when filtering findings. The filter is limited to findings existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.", - // "format": "google-datetime", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1/{+parent}/findings", + // "path": "v1/{+parent}/customModules", // "response": { - // "$ref": "ListFindingsResponse" + // "$ref": "ListSecurityHealthAnalyticsCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -16507,7 +16707,7 @@ func (c *FoldersSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*List // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *FoldersSourcesFindingsListCall) Pages(ctx context.Context, f func(*ListFindingsResponse) error) error { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Pages(ctx context.Context, f func(*ListSecurityHealthAnalyticsCustomModulesResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -16525,106 +16725,119 @@ func (c *FoldersSourcesFindingsListCall) Pages(ctx context.Context, f func(*List } } -// method id "securitycenter.folders.sources.findings.patch": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.listDescendant": -type FoldersSourcesFindingsPatchCall struct { - s *Service - name string - finding *Finding - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Creates or updates a finding. The corresponding source must -// exist for a finding creation to succeed. +// ListDescendant: Returns a list of all resident +// SecurityHealthAnalyticsCustomModules under the given CRM parent and +// all of the parent’s CRM descendants. // -// - name: The relative resource name -// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) -// of the finding. Example: -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}", -// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", -// "projects/{project_id}/sources/{source_id}/findings/{finding_id}". -func (r *FoldersSourcesFindingsService) Patch(name string, finding *Finding) *FoldersSourcesFindingsPatchCall { - c := &FoldersSourcesFindingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.finding = finding +// - parent: Name of parent to list descendant custom modules. Its +// format is +// "organizations/{organization}/securityHealthAnalyticsSettings", +// "folders/{folder}/securityHealthAnalyticsSettings", or +// "projects/{project}/securityHealthAnalyticsSettings". +func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) ListDescendant(parent string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { + c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the finding resource. This field should not be -// specified when creating a finding. When updating a finding, an empty -// mask is treated as updating all mutable fields and replacing -// source_properties. Individual source_properties can be added/updated -// by using "source_properties." in the field mask. -func (c *FoldersSourcesFindingsPatchCall) UpdateMask(updateMask string) *FoldersSourcesFindingsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) PageSize(pageSize int64) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last call indicating a continuation +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) PageToken(pageToken string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSourcesFindingsPatchCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsPatchCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSourcesFindingsPatchCall) Context(ctx context.Context) *FoldersSourcesFindingsPatchCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSourcesFindingsPatchCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSourcesFindingsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.finding) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules:listDescendant") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.sources.findings.patch" call. -// Exactly one of *Finding or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Finding.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *FoldersSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Finding, error) { +// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.listDescendant" call. +// Exactly one of +// *ListDescendantSecurityHealthAnalyticsCustomModulesResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ListDescendantSecurityHealthAnalyticsCustomModulesResponse.ServerResp +// onse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Do(opts ...googleapi.CallOption) (*ListDescendantSecurityHealthAnalyticsCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16643,7 +16856,7 @@ func (c *FoldersSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Fin if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Finding{ + ret := &ListDescendantSecurityHealthAnalyticsCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16655,34 +16868,36 @@ func (c *FoldersSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Fin } return ret, nil // { - // "description": "Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", - // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.folders.sources.findings.patch", + // "description": "Returns a list of all resident SecurityHealthAnalyticsCustomModules under the given CRM parent and all of the parent’s CRM descendants.", + // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules:listDescendant", + // "httpMethod": "GET", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.listDescendant", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{finding_id}\".", - // "location": "path", - // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", - // "required": true, - // "type": "string" + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the finding resource. This field should not be specified when creating a finding. When updating a finding, an empty mask is treated as updating all mutable fields and replacing source_properties. Individual source_properties can be added/updated by using \"source_properties.\" in the field mask.", - // "format": "google-fieldmask", + // "pageToken": { + // "description": "The value returned by the last call indicating a continuation", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of parent to list descendant custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", + // "location": "path", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$", + // "required": true, + // "type": "string" // } // }, - // "path": "v1/{+name}", - // "request": { - // "$ref": "Finding" - // }, + // "path": "v1/{+parent}/customModules:listDescendant", // "response": { - // "$ref": "Finding" + // "$ref": "ListDescendantSecurityHealthAnalyticsCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -16691,37 +16906,75 @@ func (c *FoldersSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Fin } -// method id "securitycenter.folders.sources.findings.setMute": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Pages(ctx context.Context, f func(*ListDescendantSecurityHealthAnalyticsCustomModulesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type FoldersSourcesFindingsSetMuteCall struct { - s *Service - name string - setmuterequest *SetMuteRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.patch": + +type FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetMute: Updates the mute state of a finding. +// Patch: Updates the SecurityHealthAnalyticsCustomModule under the +// given name based on the given update mask. Updating the enablement +// state is supported on both resident and inherited modules (though +// resident modules cannot have an enablement state of "inherited"). +// Updating the display name and custom config of a module is supported +// on resident modules only. // -// - name: The relative resource name -// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) -// of the finding. Example: -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}", -// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", -// "projects/{project_id}/sources/{source_id}/findings/{finding_id}". -func (r *FoldersSourcesFindingsService) SetMute(name string, setmuterequest *SetMuteRequest) *FoldersSourcesFindingsSetMuteCall { - c := &FoldersSourcesFindingsSetMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Immutable. The resource name of the custom module. Its format +// is +// "organizations/{organization}/securityHealthAnalyticsSettings/custom +// Modules/{customModule}", or +// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus +// tomModule}", or +// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c +// ustomModule}" The id {customModule} is server-generated and is not +// user settable. It will be a numeric id containing 1-20 digits. +func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Patch(name string, googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule) *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall { + c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.setmuterequest = setmuterequest + c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule = googlecloudsecuritycenterv1securityhealthanalyticscustommodule + return c +} + +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to be updated. The only fields that can be updated are +// `enablement_state` and `custom_config`. If empty or set to the +// wildcard value `*`, both `enablement_state` and `custom_config` are +// updated. +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) UpdateMask(updateMask string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSourcesFindingsSetMuteCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsSetMuteCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -16729,21 +16982,21 @@ func (c *FoldersSourcesFindingsSetMuteCall) Fields(s ...googleapi.Field) *Folder // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSourcesFindingsSetMuteCall) Context(ctx context.Context) *FoldersSourcesFindingsSetMuteCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSourcesFindingsSetMuteCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSourcesFindingsSetMuteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -16751,16 +17004,16 @@ func (c *FoldersSourcesFindingsSetMuteCall) doRequest(alt string) (*http.Respons } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmuterequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setMute") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -16771,14 +17024,17 @@ func (c *FoldersSourcesFindingsSetMuteCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.sources.findings.setMute" call. -// Exactly one of *Finding or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Finding.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *FoldersSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOption) (*Finding, error) { +// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.patch" call. +// Exactly one of +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server +// Response.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16797,7 +17053,7 @@ func (c *FoldersSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOption) (*F if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Finding{ + ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16809,28 +17065,34 @@ func (c *FoldersSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOption) (*F } return ret, nil // { - // "description": "Updates the mute state of a finding.", - // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}:setMute", - // "httpMethod": "POST", - // "id": "securitycenter.folders.sources.findings.setMute", + // "description": "Updates the SecurityHealthAnalyticsCustomModule under the given name based on the given update mask. Updating the enablement state is supported on both resident and inherited modules (though resident modules cannot have an enablement state of \"inherited\"). Updating the display name and custom config of a module is supported on resident modules only.", + // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{finding_id}\".", + // "description": "Immutable. The resource name of the custom module. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\" The id {customModule} is server-generated and is not user settable. It will be a numeric id containing 1-20 digits.", // "location": "path", - // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The list of fields to be updated. The only fields that can be updated are `enablement_state` and `custom_config`. If empty or set to the wildcard value `*`, both `enablement_state` and `custom_config` are updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1/{+name}:setMute", + // "path": "v1/{+name}", // "request": { - // "$ref": "SetMuteRequest" + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, // "response": { - // "$ref": "Finding" + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -16839,37 +17101,36 @@ func (c *FoldersSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOption) (*F } -// method id "securitycenter.folders.sources.findings.setState": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.simulate": -type FoldersSourcesFindingsSetStateCall struct { - s *Service - name string - setfindingstaterequest *SetFindingStateRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall struct { + s *Service + parent string + simulatesecurityhealthanalyticscustommodulerequest *SimulateSecurityHealthAnalyticsCustomModuleRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetState: Updates the state of a finding. +// Simulate: Simulates a given SecurityHealthAnalyticsCustomModule and +// Resource. // -// - name: The relative resource name +// - parent: The relative resource name of the organization, project, or +// folder. For more information about relative resource names, see +// Relative Resource Name // (https://cloud.google.com/apis/design/resource_names#relative_resource_name) -// of the finding. Example: -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}", -// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", -// "projects/{project_id}/sources/{source_id}/findings/{finding_id}". -func (r *FoldersSourcesFindingsService) SetState(name string, setfindingstaterequest *SetFindingStateRequest) *FoldersSourcesFindingsSetStateCall { - c := &FoldersSourcesFindingsSetStateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.setfindingstaterequest = setfindingstaterequest +// Example: `organizations/{organization_id}`. +func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Simulate(parent string, simulatesecurityhealthanalyticscustommodulerequest *SimulateSecurityHealthAnalyticsCustomModuleRequest) *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { + c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.simulatesecurityhealthanalyticscustommodulerequest = simulatesecurityhealthanalyticscustommodulerequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSourcesFindingsSetStateCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsSetStateCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -16877,21 +17138,21 @@ func (c *FoldersSourcesFindingsSetStateCall) Fields(s ...googleapi.Field) *Folde // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSourcesFindingsSetStateCall) Context(ctx context.Context) *FoldersSourcesFindingsSetStateCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSourcesFindingsSetStateCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSourcesFindingsSetStateCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -16899,14 +17160,14 @@ func (c *FoldersSourcesFindingsSetStateCall) doRequest(alt string) (*http.Respon } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setfindingstaterequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.simulatesecurityhealthanalyticscustommodulerequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setState") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules:simulate") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -16914,19 +17175,21 @@ func (c *FoldersSourcesFindingsSetStateCall) doRequest(alt string) (*http.Respon } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.sources.findings.setState" call. -// Exactly one of *Finding or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Finding.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *FoldersSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOption) (*Finding, error) { +// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.simulate" call. +// Exactly one of *SimulateSecurityHealthAnalyticsCustomModuleResponse +// or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *SimulateSecurityHealthAnalyticsCustomModuleResponse.ServerResponse.He +// ader or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Do(opts ...googleapi.CallOption) (*SimulateSecurityHealthAnalyticsCustomModuleResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16945,7 +17208,7 @@ func (c *FoldersSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Finding{ + ret := &SimulateSecurityHealthAnalyticsCustomModuleResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16957,28 +17220,28 @@ func (c *FoldersSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Updates the state of a finding.", - // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}:setState", + // "description": "Simulates a given SecurityHealthAnalyticsCustomModule and Resource.", + // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules:simulate", // "httpMethod": "POST", - // "id": "securitycenter.folders.sources.findings.setState", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.simulate", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{finding_id}\".", + // "parent": { + // "description": "Required. The relative resource name of the organization, project, or folder. For more information about relative resource names, see [Relative Resource Name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) Example: `organizations/{organization_id}`", // "location": "path", - // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}:setState", + // "path": "v1/{+parent}/customModules:simulate", // "request": { - // "$ref": "SetFindingStateRequest" + // "$ref": "SimulateSecurityHealthAnalyticsCustomModuleRequest" // }, // "response": { - // "$ref": "Finding" + // "$ref": "SimulateSecurityHealthAnalyticsCustomModuleResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -16987,94 +17250,83 @@ func (c *FoldersSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOption) (* } -// method id "securitycenter.folders.sources.findings.updateSecurityMarks": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.get": -type FoldersSourcesFindingsUpdateSecurityMarksCall struct { - s *Service - name string - securitymarks *SecurityMarks - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// UpdateSecurityMarks: Updates security marks. +// Get: Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. // -// - name: The relative resource name of the SecurityMarks. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Examples: -// "organizations/{organization_id}/assets/{asset_id}/securityMarks" -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}/securityMarks". -func (r *FoldersSourcesFindingsService) UpdateSecurityMarks(name string, securitymarks *SecurityMarks) *FoldersSourcesFindingsUpdateSecurityMarksCall { - c := &FoldersSourcesFindingsUpdateSecurityMarksCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the effective custom module to get. Its format is +// "organizations/{organization}/securityHealthAnalyticsSettings/effect +// iveCustomModules/{customModule}", +// "folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomMod +// ules/{customModule}", or +// "projects/{project}/securityHealthAnalyticsSettings/effectiveCustomM +// odules/{customModule}". +func (r *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesService) Get(name string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { + c := &FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.securitymarks = securitymarks - return c -} - -// StartTime sets the optional parameter "startTime": The time at which -// the updated SecurityMarks take effect. If not set uses current server -// time. Updates will be applied to the SecurityMarks that are active -// immediately preceding this time. Must be earlier or equal to the -// server time. -func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) StartTime(startTime string) *FoldersSourcesFindingsUpdateSecurityMarksCall { - c.urlParams_.Set("startTime", startTime) - return c -} - -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the security marks resource. The field mask must -// not contain duplicate fields. If empty or set to "marks", all marks -// will be replaced. Individual marks can be updated using "marks.". -func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) UpdateMask(updateMask string) *FoldersSourcesFindingsUpdateSecurityMarksCall { - c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsUpdateSecurityMarksCall { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Context(ctx context.Context) *FoldersSourcesFindingsUpdateSecurityMarksCall { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -17085,14 +17337,17 @@ func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) doRequest(alt string) (* return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.sources.findings.updateSecurityMarks" call. -// Exactly one of *SecurityMarks or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *SecurityMarks.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, error) { +// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.get" call. +// Exactly one of +// *GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModu +// le or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModu +// le.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17111,7 +17366,7 @@ func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googleapi.Cal if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &SecurityMarks{ + ret := &GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17123,40 +17378,25 @@ func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googleapi.Cal } return ret, nil // { - // "description": "Updates security marks.", - // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}/securityMarks", - // "httpMethod": "PATCH", - // "id": "securitycenter.folders.sources.findings.updateSecurityMarks", + // "description": "Retrieves an EffectiveSecurityHealthAnalyticsCustomModule.", + // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/effectiveCustomModules/{effectiveCustomModulesId}", + // "httpMethod": "GET", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", + // "description": "Required. Name of the effective custom module to get. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\"", // "location": "path", - // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks$", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings/effectiveCustomModules/[^/]+$", // "required": true, // "type": "string" - // }, - // "startTime": { - // "description": "The time at which the updated SecurityMarks take effect. If not set uses current server time. Updates will be applied to the SecurityMarks that are active immediately preceding this time. Must be earlier or equal to the server time.", - // "format": "google-datetime", - // "location": "query", - // "type": "string" - // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the security marks resource. The field mask must not contain duplicate fields. If empty or set to \"marks\", all marks will be replaced. Individual marks can be updated using \"marks.\".", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, // "path": "v1/{+name}", - // "request": { - // "$ref": "SecurityMarks" - // }, // "response": { - // "$ref": "SecurityMarks" + // "$ref": "GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -17165,102 +17405,119 @@ func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googleapi.Cal } -// method id "securitycenter.folders.sources.findings.externalSystems.patch": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.list": -type FoldersSourcesFindingsExternalSystemsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates external system. This is for a given finding. +// List: Returns a list of all +// EffectiveSecurityHealthAnalyticsCustomModules for the given parent. +// This includes resident modules defined at the scope of the parent, +// and inherited modules, inherited from CRM ancestors. // -// - name: Full resource name of the external system, for example: -// "organizations/1234/sources/5678/findings/123456/externalSystems/jir -// a", -// "folders/1234/sources/5678/findings/123456/externalSystems/jira", -// "projects/1234/sources/5678/findings/123456/externalSystems/jira". -func (r *FoldersSourcesFindingsExternalSystemsService) Patch(name string, googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem) *FoldersSourcesFindingsExternalSystemsPatchCall { - c := &FoldersSourcesFindingsExternalSystemsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googlecloudsecuritycenterv1externalsystem = googlecloudsecuritycenterv1externalsystem +// - parent: Name of parent to list effective custom modules. Its format +// is "organizations/{organization}/securityHealthAnalyticsSettings", +// "folders/{folder}/securityHealthAnalyticsSettings", or +// "projects/{project}/securityHealthAnalyticsSettings". +func (r *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesService) List(parent string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { + c := &FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the external system resource. If empty all mutable -// fields will be updated. -func (c *FoldersSourcesFindingsExternalSystemsPatchCall) UpdateMask(updateMask string) *FoldersSourcesFindingsExternalSystemsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) PageSize(pageSize int64) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last call indicating a continuation +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) PageToken(pageToken string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsExternalSystemsPatchCall { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Context(ctx context.Context) *FoldersSourcesFindingsExternalSystemsPatchCall { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSourcesFindingsExternalSystemsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1externalsystem) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/effectiveCustomModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.sources.findings.externalSystems.patch" call. -// Exactly one of *GoogleCloudSecuritycenterV1ExternalSystem or error +// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.list" call. +// Exactly one of +// *ListEffectiveSecurityHealthAnalyticsCustomModulesResponse or error // will be non-nil. Any non-2xx status code is an error. Response // headers are in either -// *GoogleCloudSecuritycenterV1ExternalSystem.ServerResponse.Header or -// (if a response was returned at all) in +// *ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.ServerRespo +// nse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1ExternalSystem, error) { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListEffectiveSecurityHealthAnalyticsCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17279,7 +17536,7 @@ func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Do(opts ...googleapi.Ca if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1ExternalSystem{ + ret := &ListEffectiveSecurityHealthAnalyticsCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17291,34 +17548,36 @@ func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Do(opts ...googleapi.Ca } return ret, nil // { - // "description": "Updates external system. This is for a given finding.", - // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}/externalSystems/{externalSystemsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.folders.sources.findings.externalSystems.patch", + // "description": "Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", + // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/effectiveCustomModules", + // "httpMethod": "GET", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Full resource name of the external system, for example: \"organizations/1234/sources/5678/findings/123456/externalSystems/jira\", \"folders/1234/sources/5678/findings/123456/externalSystems/jira\", \"projects/1234/sources/5678/findings/123456/externalSystems/jira\"", - // "location": "path", - // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+$", - // "required": true, - // "type": "string" + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the external system resource. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", + // "pageToken": { + // "description": "The value returned by the last call indicating a continuation", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of parent to list effective custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", + // "location": "path", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$", + // "required": true, + // "type": "string" // } // }, - // "path": "v1/{+name}", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" - // }, + // "path": "v1/{+parent}/effectiveCustomModules", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" + // "$ref": "ListEffectiveSecurityHealthAnalyticsCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -17327,42 +17586,80 @@ func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Do(opts ...googleapi.Ca } -// method id "securitycenter.organizations.getOrganizationSettings": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Pages(ctx context.Context, f func(*ListEffectiveSecurityHealthAnalyticsCustomModulesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type OrganizationsGetOrganizationSettingsCall struct { +// method id "securitycenter.folders.sources.list": + +type FoldersSourcesListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// GetOrganizationSettings: Gets the settings for an organization. +// List: Lists all sources belonging to an organization. // -// - name: Name of the organization to get organization settings for. -// Its format is -// "organizations/[organization_id]/organizationSettings". -func (r *OrganizationsService) GetOrganizationSettings(name string) *OrganizationsGetOrganizationSettingsCall { - c := &OrganizationsGetOrganizationSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Resource name of the parent of sources to list. Its format +// should be "organizations/[organization_id]", "folders/[folder_id]", +// or "projects/[project_id]". +func (r *FoldersSourcesService) List(parent string) *FoldersSourcesListCall { + c := &FoldersSourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *OrganizationsGetOrganizationSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetOrganizationSettingsCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *FoldersSourcesListCall) PageSize(pageSize int64) *FoldersSourcesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsGetOrganizationSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetOrganizationSettingsCall { +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListSourcesResponse`; indicates that this is a +// continuation of a prior `ListSources` call, and that the system +// should return the next page of data. +func (c *FoldersSourcesListCall) PageToken(pageToken string) *FoldersSourcesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FoldersSourcesListCall) Fields(s ...googleapi.Field) *FoldersSourcesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersSourcesListCall) IfNoneMatch(entityTag string) *FoldersSourcesListCall { c.ifNoneMatch_ = entityTag return c } @@ -17370,21 +17667,21 @@ func (c *OrganizationsGetOrganizationSettingsCall) IfNoneMatch(entityTag string) // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsGetOrganizationSettingsCall) Context(ctx context.Context) *OrganizationsGetOrganizationSettingsCall { +func (c *FoldersSourcesListCall) Context(ctx context.Context) *FoldersSourcesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsGetOrganizationSettingsCall) Header() http.Header { +func (c *FoldersSourcesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsGetOrganizationSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSourcesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -17397,7 +17694,7 @@ func (c *OrganizationsGetOrganizationSettingsCall) doRequest(alt string) (*http. var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sources") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -17405,19 +17702,19 @@ func (c *OrganizationsGetOrganizationSettingsCall) doRequest(alt string) (*http. } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.getOrganizationSettings" call. -// Exactly one of *OrganizationSettings or error will be non-nil. Any +// Do executes the "securitycenter.folders.sources.list" call. +// Exactly one of *ListSourcesResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *OrganizationSettings.ServerResponse.Header or (if a response was +// *ListSourcesResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsGetOrganizationSettingsCall) Do(opts ...googleapi.CallOption) (*OrganizationSettings, error) { +func (c *FoldersSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSourcesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17436,7 +17733,7 @@ func (c *OrganizationsGetOrganizationSettingsCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &OrganizationSettings{ + ret := &ListSourcesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17448,25 +17745,36 @@ func (c *OrganizationsGetOrganizationSettingsCall) Do(opts ...googleapi.CallOpti } return ret, nil // { - // "description": "Gets the settings for an organization.", - // "flatPath": "v1/organizations/{organizationsId}/organizationSettings", + // "description": "Lists all sources belonging to an organization.", + // "flatPath": "v1/folders/{foldersId}/sources", // "httpMethod": "GET", - // "id": "securitycenter.organizations.getOrganizationSettings", + // "id": "securitycenter.folders.sources.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Name of the organization to get organization settings for. Its format is \"organizations/[organization_id]/organizationSettings\".", + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListSourcesResponse`; indicates that this is a continuation of a prior `ListSources` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/organizationSettings$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/sources", // "response": { - // "$ref": "OrganizationSettings" + // "$ref": "ListSourcesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -17475,192 +17783,63 @@ func (c *OrganizationsGetOrganizationSettingsCall) Do(opts ...googleapi.CallOpti } -// method id "securitycenter.organizations.updateOrganizationSettings": - -type OrganizationsUpdateOrganizationSettingsCall struct { - s *Service - name string - organizationsettings *OrganizationSettings - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// UpdateOrganizationSettings: Updates an organization's settings. -// -// - name: The relative resource name of the settings. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Example: "organizations/{organization_id}/organizationSettings". -func (r *OrganizationsService) UpdateOrganizationSettings(name string, organizationsettings *OrganizationSettings) *OrganizationsUpdateOrganizationSettingsCall { - c := &OrganizationsUpdateOrganizationSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.organizationsettings = organizationsettings - return c -} - -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the settings resource. If empty all mutable fields -// will be updated. -func (c *OrganizationsUpdateOrganizationSettingsCall) UpdateMask(updateMask string) *OrganizationsUpdateOrganizationSettingsCall { - c.urlParams_.Set("updateMask", updateMask) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *OrganizationsUpdateOrganizationSettingsCall) Fields(s ...googleapi.Field) *OrganizationsUpdateOrganizationSettingsCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *OrganizationsUpdateOrganizationSettingsCall) Context(ctx context.Context) *OrganizationsUpdateOrganizationSettingsCall { +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *FoldersSourcesListCall) Pages(ctx context.Context, f func(*ListSourcesResponse) error) error { c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *OrganizationsUpdateOrganizationSettingsCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *OrganizationsUpdateOrganizationSettingsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.organizationsettings) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "name": c.name, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "securitycenter.organizations.updateOrganizationSettings" call. -// Exactly one of *OrganizationSettings or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *OrganizationSettings.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsUpdateOrganizationSettingsCall) Do(opts ...googleapi.CallOption) (*OrganizationSettings, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &OrganizationSettings{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) } - return ret, nil - // { - // "description": "Updates an organization's settings.", - // "flatPath": "v1/organizations/{organizationsId}/organizationSettings", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.updateOrganizationSettings", - // "parameterOrder": [ - // "name" - // ], - // "parameters": { - // "name": { - // "description": "The relative resource name of the settings. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/organizationSettings\".", - // "location": "path", - // "pattern": "^organizations/[^/]+/organizationSettings$", - // "required": true, - // "type": "string" - // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the settings resource. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "v1/{+name}", - // "request": { - // "$ref": "OrganizationSettings" - // }, - // "response": { - // "$ref": "OrganizationSettings" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform" - // ] - // } - } -// method id "securitycenter.organizations.assets.group": +// method id "securitycenter.folders.sources.findings.group": -type OrganizationsAssetsGroupCall struct { - s *Service - parent string - groupassetsrequest *GroupAssetsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSourcesFindingsGroupCall struct { + s *Service + parent string + groupfindingsrequest *GroupFindingsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Group: Filters an organization's assets and groups them by their -// specified properties. +// Group: Filters an organization or source's findings and groups them +// by their specified properties. To group across all sources provide a +// `-` as the source id. Example: +// /v1/organizations/{organization_id}/sources/-/findings, +// /v1/folders/{folder_id}/sources/-/findings, +// /v1/projects/{project_id}/sources/-/findings // -// - parent: The name of the parent to group the assets by. Its format -// is "organizations/[organization_id]", "folders/[folder_id]", or -// "projects/[project_id]". -func (r *OrganizationsAssetsService) Group(parent string, groupassetsrequest *GroupAssetsRequest) *OrganizationsAssetsGroupCall { - c := &OrganizationsAssetsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Name of the source to groupBy. Its format is +// "organizations/[organization_id]/sources/[source_id]", +// folders/[folder_id]/sources/[source_id], or +// projects/[project_id]/sources/[source_id]. To groupBy across all +// sources provide a source_id of `-`. For example: +// organizations/{organization_id}/sources/-, +// folders/{folder_id}/sources/-, or projects/{project_id}/sources/-. +func (r *FoldersSourcesFindingsService) Group(parent string, groupfindingsrequest *GroupFindingsRequest) *FoldersSourcesFindingsGroupCall { + c := &FoldersSourcesFindingsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.groupassetsrequest = groupassetsrequest + c.groupfindingsrequest = groupfindingsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsAssetsGroupCall) Fields(s ...googleapi.Field) *OrganizationsAssetsGroupCall { +func (c *FoldersSourcesFindingsGroupCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsGroupCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -17668,21 +17847,21 @@ func (c *OrganizationsAssetsGroupCall) Fields(s ...googleapi.Field) *Organizatio // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsAssetsGroupCall) Context(ctx context.Context) *OrganizationsAssetsGroupCall { +func (c *FoldersSourcesFindingsGroupCall) Context(ctx context.Context) *FoldersSourcesFindingsGroupCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsAssetsGroupCall) Header() http.Header { +func (c *FoldersSourcesFindingsGroupCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsAssetsGroupCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSourcesFindingsGroupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -17690,14 +17869,14 @@ func (c *OrganizationsAssetsGroupCall) doRequest(alt string) (*http.Response, er } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupassetsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupfindingsrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets:group") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings:group") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -17710,14 +17889,14 @@ func (c *OrganizationsAssetsGroupCall) doRequest(alt string) (*http.Response, er return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.assets.group" call. -// Exactly one of *GroupAssetsResponse or error will be non-nil. Any +// Do executes the "securitycenter.folders.sources.findings.group" call. +// Exactly one of *GroupFindingsResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *GroupAssetsResponse.ServerResponse.Header or (if a response was +// *GroupFindingsResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssetsResponse, error) { +func (c *FoldersSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) (*GroupFindingsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17736,7 +17915,7 @@ func (c *OrganizationsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupA if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GroupAssetsResponse{ + ret := &GroupFindingsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17748,29 +17927,28 @@ func (c *OrganizationsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupA } return ret, nil // { - // "deprecated": true, - // "description": "Filters an organization's assets and groups them by their specified properties.", - // "flatPath": "v1/organizations/{organizationsId}/assets:group", + // "description": "Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings", + // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings:group", // "httpMethod": "POST", - // "id": "securitycenter.organizations.assets.group", + // "id": "securitycenter.folders.sources.findings.group", // "parameterOrder": [ // "parent" // ], // "parameters": { // "parent": { - // "description": "Required. The name of the parent to group the assets by. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "description": "Required. Name of the source to groupBy. Its format is \"organizations/[organization_id]/sources/[source_id]\", folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]. To groupBy across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, or projects/{project_id}/sources/-", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^folders/[^/]+/sources/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/assets:group", + // "path": "v1/{+parent}/findings:group", // "request": { - // "$ref": "GroupAssetsRequest" + // "$ref": "GroupFindingsRequest" // }, // "response": { - // "$ref": "GroupAssetsResponse" + // "$ref": "GroupFindingsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -17782,9 +17960,9 @@ func (c *OrganizationsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupA // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *OrganizationsAssetsGroupCall) Pages(ctx context.Context, f func(*GroupAssetsResponse) error) error { +func (c *FoldersSourcesFindingsGroupCall) Pages(ctx context.Context, f func(*GroupFindingsResponse) error) error { c.ctx_ = ctx - defer func(pt string) { c.groupassetsrequest.PageToken = pt }(c.groupassetsrequest.PageToken) // reset paging to original point + defer func(pt string) { c.groupfindingsrequest.PageToken = pt }(c.groupfindingsrequest.PageToken) // reset paging to original point for { x, err := c.Do() if err != nil { @@ -17796,13 +17974,13 @@ func (c *OrganizationsAssetsGroupCall) Pages(ctx context.Context, f func(*GroupA if x.NextPageToken == "" { return nil } - c.groupassetsrequest.PageToken = x.NextPageToken + c.groupfindingsrequest.PageToken = x.NextPageToken } } -// method id "securitycenter.organizations.assets.list": +// method id "securitycenter.folders.sources.findings.list": -type OrganizationsAssetsListCall struct { +type FoldersSourcesFindingsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -17811,88 +17989,90 @@ type OrganizationsAssetsListCall struct { header_ http.Header } -// List: Lists an organization's assets. +// List: Lists an organization or source's findings. To list across all +// sources provide a `-` as the source id. Example: +// /v1/organizations/{organization_id}/sources/-/findings // -// - parent: The name of the parent resource that contains the assets. -// The value that you can specify on parent depends on the method in -// which you specify parent. You can specify one of the following -// values: "organizations/[organization_id]", "folders/[folder_id]", -// or "projects/[project_id]". -func (r *OrganizationsAssetsService) List(parent string) *OrganizationsAssetsListCall { - c := &OrganizationsAssetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Name of the source the findings belong to. Its format is +// "organizations/[organization_id]/sources/[source_id], +// folders/[folder_id]/sources/[source_id], or +// projects/[project_id]/sources/[source_id]". To list across all +// sources provide a source_id of `-`. For example: +// organizations/{organization_id}/sources/-, +// folders/{folder_id}/sources/- or projects/{projects_id}/sources/-. +func (r *FoldersSourcesFindingsService) List(parent string) *FoldersSourcesFindingsListCall { + c := &FoldersSourcesFindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } // CompareDuration sets the optional parameter "compareDuration": When -// compare_duration is set, the ListAssetsResult's "state_change" -// attribute is updated to indicate whether the asset was added, -// removed, or remained present during the compare_duration period of -// time that precedes the read_time. This is the time between (read_time -// - compare_duration) and read_time. The state_change value is derived -// based on the presence of the asset at the two points in time. -// Intermediate state changes between the two times don't affect the -// result. For example, the results aren't affected if the asset is -// removed and re-created again. Possible "state_change" values when -// compare_duration is specified: * "ADDED": indicates that the asset -// was not present at the start of compare_duration, but present at -// read_time. * "REMOVED": indicates that the asset was present at the -// start of compare_duration, but not present at read_time. * "ACTIVE": -// indicates that the asset was present at both the start and the end of -// the time period defined by compare_duration and read_time. If -// compare_duration is not specified, then the only possible +// compare_duration is set, the ListFindingsResult's "state_change" +// attribute is updated to indicate whether the finding had its state +// changed, the finding's state remained unchanged, or if the finding +// was added in any state during the compare_duration period of time +// that precedes the read_time. This is the time between (read_time - +// compare_duration) and read_time. The state_change value is derived +// based on the presence and state of the finding at the two points in +// time. Intermediate state changes between the two times don't affect +// the result. For example, the results aren't affected if the finding +// is made inactive and then active again. Possible "state_change" +// values when compare_duration is specified: * "CHANGED": indicates +// that the finding was present and matched the given filter at the +// start of compare_duration, but changed its state at read_time. * +// "UNCHANGED": indicates that the finding was present and matched the +// given filter at the start of compare_duration and did not change +// state at read_time. * "ADDED": indicates that the finding did not +// match the given filter or was not present at the start of +// compare_duration, but was present at read_time. * "REMOVED": +// indicates that the finding was present and matched the filter at the +// start of compare_duration, but did not match the filter at read_time. +// If compare_duration is not specified, then the only possible // state_change is "UNUSED", which will be the state_change set for all -// assets present at read_time. -func (c *OrganizationsAssetsListCall) CompareDuration(compareDuration string) *OrganizationsAssetsListCall { +// findings present at read_time. +func (c *FoldersSourcesFindingsListCall) CompareDuration(compareDuration string) *FoldersSourcesFindingsListCall { c.urlParams_.Set("compareDuration", compareDuration) return c } // FieldMask sets the optional parameter "fieldMask": A field mask to -// specify the ListAssetsResult fields to be listed in the response. An -// empty field mask will list all fields. -func (c *OrganizationsAssetsListCall) FieldMask(fieldMask string) *OrganizationsAssetsListCall { +// specify the Finding fields to be listed in the response. An empty +// field mask will list all fields. +func (c *FoldersSourcesFindingsListCall) FieldMask(fieldMask string) *FoldersSourcesFindingsListCall { c.urlParams_.Set("fieldMask", fieldMask) return c } // Filter sets the optional parameter "filter": Expression that defines -// the filter to apply across assets. The expression is a list of zero +// the filter to apply across findings. The expression is a list of one // or more restrictions combined via logical operators `AND` and `OR`. // Parentheses are supported, and `OR` has higher precedence than `AND`. // Restrictions have the form ` ` and may have a `-` character in front -// of them to indicate negation. The fields map to those defined in the -// Asset resource. Examples include: * name * -// security_center_properties.resource_name * -// resource_properties.a_property * security_marks.marks.marka The +// of them to indicate negation. Examples include: * name * +// source_properties.a_property * security_marks.marks.marka The // supported operators are: * `=` for all value types. * `>`, `<`, `>=`, // `<=` for integer values. * `:`, meaning substring matching, for // strings. The supported value types are: * string literals in quotes. // * integer literals without quotes. * boolean literals `true` and -// `false` without quotes. The following are the allowed field and -// operator combinations: * name: `=` * update_time: `=`, `>`, `<`, -// `>=`, `<=` Usage: This should be milliseconds since epoch or an -// RFC3339 string. Examples: `update_time = "2019-06-10T16:07:18-07:00" -// `update_time = 1560208038000` * create_time: `=`, `>`, `<`, `>=`, -// `<=` Usage: This should be milliseconds since epoch or an RFC3339 -// string. Examples: `create_time = "2019-06-10T16:07:18-07:00" -// `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * -// resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * -// security_marks.marks: `=`, `:` * -// security_center_properties.resource_name: `=`, `:` * -// security_center_properties.resource_display_name: `=`, `:` * -// security_center_properties.resource_type: `=`, `:` * -// security_center_properties.resource_parent: `=`, `:` * -// security_center_properties.resource_parent_display_name: `=`, `:` * -// security_center_properties.resource_project: `=`, `:` * -// security_center_properties.resource_project_display_name: `=`, `:` * -// security_center_properties.resource_owners: `=`, `:` For example, -// `resource_properties.size = 100` is a valid filter string. Use a -// partial match on the empty string to filter based on a property -// existing: `resource_properties.my_property : "" Use a negated -// partial match on the empty string to filter based on a property not -// existing: `-resource_properties.my_property : "" -func (c *OrganizationsAssetsListCall) Filter(filter string) *OrganizationsAssetsListCall { +// `false` without quotes. The following field and operator combinations +// are supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, +// `:` * state: `=`, `:` * category: `=`, `:` * external_uri: `=`, `:` * +// event_time: `=`, `>`, `<`, `>=`, `<=` Usage: This should be +// milliseconds since epoch or an RFC3339 string. Examples: `event_time +// = "2019-06-10T16:07:18-07:00" `event_time = 1560208038000` * +// severity: `=`, `:` * workflow_state: `=`, `:` * security_marks.marks: +// `=`, `:` * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` For +// example, `source_properties.size = 100` is a valid filter string. Use +// a partial match on the empty string to filter based on a property +// existing: `source_properties.my_property : "" Use a negated partial +// match on the empty string to filter based on a property not existing: +// `-source_properties.my_property : "" * resource: * resource.name: +// `=`, `:` * resource.parent_name: `=`, `:` * +// resource.parent_display_name: `=`, `:` * resource.project_name: `=`, +// `:` * resource.project_display_name: `=`, `:` * resource.type: `=`, +// `:` * resource.folders.resource_folder: `=`, `:` * +// resource.display_name: `=`, `:` +func (c *FoldersSourcesFindingsListCall) Filter(filter string) *FoldersSourcesFindingsListCall { c.urlParams_.Set("filter", filter) return c } @@ -17903,19 +18083,12 @@ func (c *OrganizationsAssetsListCall) Filter(filter string) *OrganizationsAssets // example: "name,resource_properties.a_property". The default sorting // order is ascending. To specify descending order for a field, a suffix // " desc" should be appended to the field name. For example: "name -// desc,resource_properties.a_property". Redundant space characters in -// the syntax are insignificant. "name -// desc,resource_properties.a_property" and " name desc , -// resource_properties.a_property " are equivalent. The following fields -// are supported: name update_time resource_properties -// security_marks.marks security_center_properties.resource_name -// security_center_properties.resource_display_name -// security_center_properties.resource_parent -// security_center_properties.resource_parent_display_name -// security_center_properties.resource_project -// security_center_properties.resource_project_display_name -// security_center_properties.resource_type -func (c *OrganizationsAssetsListCall) OrderBy(orderBy string) *OrganizationsAssetsListCall { +// desc,source_properties.a_property". Redundant space characters in the +// syntax are insignificant. "name desc,source_properties.a_property" +// and " name desc , source_properties.a_property " are equivalent. The +// following fields are supported: name parent state category +// resource_name event_time source_properties security_marks.marks +func (c *FoldersSourcesFindingsListCall) OrderBy(orderBy string) *FoldersSourcesFindingsListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -17923,26 +18096,26 @@ func (c *OrganizationsAssetsListCall) OrderBy(orderBy string) *OrganizationsAsse // PageSize sets the optional parameter "pageSize": The maximum number // of results to return in a single response. Default is 10, minimum is // 1, maximum is 1000. -func (c *OrganizationsAssetsListCall) PageSize(pageSize int64) *OrganizationsAssetsListCall { +func (c *FoldersSourcesFindingsListCall) PageSize(pageSize int64) *FoldersSourcesFindingsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListAssetsResponse`; indicates that this is a -// continuation of a prior `ListAssets` call, and that the system should -// return the next page of data. -func (c *OrganizationsAssetsListCall) PageToken(pageToken string) *OrganizationsAssetsListCall { +// by the last `ListFindingsResponse`; indicates that this is a +// continuation of a prior `ListFindings` call, and that the system +// should return the next page of data. +func (c *FoldersSourcesFindingsListCall) PageToken(pageToken string) *FoldersSourcesFindingsListCall { c.urlParams_.Set("pageToken", pageToken) return c } // ReadTime sets the optional parameter "readTime": Time used as a -// reference point when filtering assets. The filter is limited to -// assets existing at the supplied time and their values are those at +// reference point when filtering findings. The filter is limited to +// findings existing at the supplied time and their values are those at // that specific time. Absence of this field will default to the API's // version of NOW. -func (c *OrganizationsAssetsListCall) ReadTime(readTime string) *OrganizationsAssetsListCall { +func (c *FoldersSourcesFindingsListCall) ReadTime(readTime string) *FoldersSourcesFindingsListCall { c.urlParams_.Set("readTime", readTime) return c } @@ -17950,7 +18123,7 @@ func (c *OrganizationsAssetsListCall) ReadTime(readTime string) *OrganizationsAs // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsAssetsListCall) Fields(s ...googleapi.Field) *OrganizationsAssetsListCall { +func (c *FoldersSourcesFindingsListCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -17960,7 +18133,7 @@ func (c *OrganizationsAssetsListCall) Fields(s ...googleapi.Field) *Organization // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsAssetsListCall) IfNoneMatch(entityTag string) *OrganizationsAssetsListCall { +func (c *FoldersSourcesFindingsListCall) IfNoneMatch(entityTag string) *FoldersSourcesFindingsListCall { c.ifNoneMatch_ = entityTag return c } @@ -17968,21 +18141,21 @@ func (c *OrganizationsAssetsListCall) IfNoneMatch(entityTag string) *Organizatio // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsAssetsListCall) Context(ctx context.Context) *OrganizationsAssetsListCall { +func (c *FoldersSourcesFindingsListCall) Context(ctx context.Context) *FoldersSourcesFindingsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsAssetsListCall) Header() http.Header { +func (c *FoldersSourcesFindingsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsAssetsListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSourcesFindingsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -17995,7 +18168,7 @@ func (c *OrganizationsAssetsListCall) doRequest(alt string) (*http.Response, err var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -18008,14 +18181,14 @@ func (c *OrganizationsAssetsListCall) doRequest(alt string) (*http.Response, err return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.assets.list" call. -// Exactly one of *ListAssetsResponse or error will be non-nil. Any +// Do executes the "securitycenter.folders.sources.findings.list" call. +// Exactly one of *ListFindingsResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListAssetsResponse.ServerResponse.Header or (if a response was +// *ListFindingsResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsResponse, error) { +func (c *FoldersSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*ListFindingsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18034,7 +18207,7 @@ func (c *OrganizationsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAss if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListAssetsResponse{ + ret := &ListFindingsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18046,34 +18219,33 @@ func (c *OrganizationsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAss } return ret, nil // { - // "deprecated": true, - // "description": "Lists an organization's assets.", - // "flatPath": "v1/organizations/{organizationsId}/assets", + // "description": "Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings", + // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings", // "httpMethod": "GET", - // "id": "securitycenter.organizations.assets.list", + // "id": "securitycenter.folders.sources.findings.list", // "parameterOrder": [ // "parent" // ], // "parameters": { // "compareDuration": { - // "description": "When compare_duration is set, the ListAssetsResult's \"state_change\" attribute is updated to indicate whether the asset was added, removed, or remained present during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence of the asset at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the asset is removed and re-created again. Possible \"state_change\" values when compare_duration is specified: * \"ADDED\": indicates that the asset was not present at the start of compare_duration, but present at read_time. * \"REMOVED\": indicates that the asset was present at the start of compare_duration, but not present at read_time. * \"ACTIVE\": indicates that the asset was present at both the start and the end of the time period defined by compare_duration and read_time. If compare_duration is not specified, then the only possible state_change is \"UNUSED\", which will be the state_change set for all assets present at read_time.", + // "description": "When compare_duration is set, the ListFindingsResult's \"state_change\" attribute is updated to indicate whether the finding had its state changed, the finding's state remained unchanged, or if the finding was added in any state during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence and state of the finding at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the finding is made inactive and then active again. Possible \"state_change\" values when compare_duration is specified: * \"CHANGED\": indicates that the finding was present and matched the given filter at the start of compare_duration, but changed its state at read_time. * \"UNCHANGED\": indicates that the finding was present and matched the given filter at the start of compare_duration and did not change state at read_time. * \"ADDED\": indicates that the finding did not match the given filter or was not present at the start of compare_duration, but was present at read_time. * \"REMOVED\": indicates that the finding was present and matched the filter at the start of compare_duration, but did not match the filter at read_time. If compare_duration is not specified, then the only possible state_change is \"UNUSED\", which will be the state_change set for all findings present at read_time.", // "format": "google-duration", // "location": "query", // "type": "string" // }, // "fieldMask": { - // "description": "A field mask to specify the ListAssetsResult fields to be listed in the response. An empty field mask will list all fields.", + // "description": "A field mask to specify the Finding fields to be listed in the response. An empty field mask will list all fields.", // "format": "google-fieldmask", // "location": "query", // "type": "string" // }, // "filter": { - // "description": "Expression that defines the filter to apply across assets. The expression is a list of zero or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. The fields map to those defined in the Asset resource. Examples include: * name * security_center_properties.resource_name * resource_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following are the allowed field and operator combinations: * name: `=` * update_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `update_time = \"2019-06-10T16:07:18-07:00\"` `update_time = 1560208038000` * create_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `create_time = \"2019-06-10T16:07:18-07:00\"` `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * resource_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` * security_marks.marks: `=`, `:` * security_center_properties.resource_name: `=`, `:` * security_center_properties.resource_display_name: `=`, `:` * security_center_properties.resource_type: `=`, `:` * security_center_properties.resource_parent: `=`, `:` * security_center_properties.resource_parent_display_name: `=`, `:` * security_center_properties.resource_project: `=`, `:` * security_center_properties.resource_project_display_name: `=`, `:` * security_center_properties.resource_owners: `=`, `:` For example, `resource_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `resource_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-resource_properties.my_property : \"\"`", + // "description": "Expression that defines the filter to apply across findings. The expression is a list of one or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. Examples include: * name * source_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following field and operator combinations are supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, `:` * state: `=`, `:` * category: `=`, `:` * external_uri: `=`, `:` * event_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `event_time = \"2019-06-10T16:07:18-07:00\"` `event_time = 1560208038000` * severity: `=`, `:` * workflow_state: `=`, `:` * security_marks.marks: `=`, `:` * source_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` For example, `source_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `source_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-source_properties.my_property : \"\"` * resource: * resource.name: `=`, `:` * resource.parent_name: `=`, `:` * resource.parent_display_name: `=`, `:` * resource.project_name: `=`, `:` * resource.project_display_name: `=`, `:` * resource.type: `=`, `:` * resource.folders.resource_folder: `=`, `:` * resource.display_name: `=`, `:`", // "location": "query", // "type": "string" // }, // "orderBy": { - // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,resource_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,resource_properties.a_property\" and \" name desc , resource_properties.a_property \" are equivalent. The following fields are supported: name update_time resource_properties security_marks.marks security_center_properties.resource_name security_center_properties.resource_display_name security_center_properties.resource_parent security_center_properties.resource_parent_display_name security_center_properties.resource_project security_center_properties.resource_project_display_name security_center_properties.resource_type", + // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,source_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,source_properties.a_property\" and \" name desc , source_properties.a_property \" are equivalent. The following fields are supported: name parent state category resource_name event_time source_properties security_marks.marks", // "location": "query", // "type": "string" // }, @@ -18084,27 +18256,27 @@ func (c *OrganizationsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAss // "type": "integer" // }, // "pageToken": { - // "description": "The value returned by the last `ListAssetsResponse`; indicates that this is a continuation of a prior `ListAssets` call, and that the system should return the next page of data.", + // "description": "The value returned by the last `ListFindingsResponse`; indicates that this is a continuation of a prior `ListFindings` call, and that the system should return the next page of data.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The name of the parent resource that contains the assets. The value that you can specify on parent depends on the method in which you specify parent. You can specify one of the following values: \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "description": "Required. Name of the source the findings belong to. Its format is \"organizations/[organization_id]/sources/[source_id], folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]\". To list across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or projects/{projects_id}/sources/-", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^folders/[^/]+/sources/[^/]+$", // "required": true, // "type": "string" // }, // "readTime": { - // "description": "Time used as a reference point when filtering assets. The filter is limited to assets existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.", + // "description": "Time used as a reference point when filtering findings. The filter is limited to findings existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.", // "format": "google-datetime", // "location": "query", // "type": "string" // } // }, - // "path": "v1/{+parent}/assets", + // "path": "v1/{+parent}/findings", // "response": { - // "$ref": "ListAssetsResponse" + // "$ref": "ListFindingsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -18116,7 +18288,7 @@ func (c *OrganizationsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAss // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *OrganizationsAssetsListCall) Pages(ctx context.Context, f func(*ListAssetsResponse) error) error { +func (c *FoldersSourcesFindingsListCall) Pages(ctx context.Context, f func(*ListFindingsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -18134,35 +18306,49 @@ func (c *OrganizationsAssetsListCall) Pages(ctx context.Context, f func(*ListAss } } -// method id "securitycenter.organizations.assets.runDiscovery": +// method id "securitycenter.folders.sources.findings.patch": -type OrganizationsAssetsRunDiscoveryCall struct { - s *Service - parent string - runassetdiscoveryrequest *RunAssetDiscoveryRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSourcesFindingsPatchCall struct { + s *Service + name string + finding *Finding + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// RunDiscovery: Runs asset discovery. The discovery is tracked with a -// long-running operation. This API can only be called with limited -// frequency for an organization. If it is called too frequently the -// caller will receive a TOO_MANY_REQUESTS error. +// Patch: Creates or updates a finding. The corresponding source must +// exist for a finding creation to succeed. // -// - parent: Name of the organization to run asset discovery for. Its -// format is "organizations/[organization_id]". -func (r *OrganizationsAssetsService) RunDiscovery(parent string, runassetdiscoveryrequest *RunAssetDiscoveryRequest) *OrganizationsAssetsRunDiscoveryCall { - c := &OrganizationsAssetsRunDiscoveryCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.runassetdiscoveryrequest = runassetdiscoveryrequest +// - name: The relative resource name +// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) +// of the finding. Example: +// "organizations/{organization_id}/sources/{source_id}/findings/{findi +// ng_id}", +// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", +// "projects/{project_id}/sources/{source_id}/findings/{finding_id}". +func (r *FoldersSourcesFindingsService) Patch(name string, finding *Finding) *FoldersSourcesFindingsPatchCall { + c := &FoldersSourcesFindingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.finding = finding + return c +} + +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the finding resource. This field should not be +// specified when creating a finding. When updating a finding, an empty +// mask is treated as updating all mutable fields and replacing +// source_properties. Individual source_properties can be added/updated +// by using "source_properties." in the field mask. +func (c *FoldersSourcesFindingsPatchCall) UpdateMask(updateMask string) *FoldersSourcesFindingsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsAssetsRunDiscoveryCall) Fields(s ...googleapi.Field) *OrganizationsAssetsRunDiscoveryCall { +func (c *FoldersSourcesFindingsPatchCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18170,21 +18356,21 @@ func (c *OrganizationsAssetsRunDiscoveryCall) Fields(s ...googleapi.Field) *Orga // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsAssetsRunDiscoveryCall) Context(ctx context.Context) *OrganizationsAssetsRunDiscoveryCall { +func (c *FoldersSourcesFindingsPatchCall) Context(ctx context.Context) *FoldersSourcesFindingsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsAssetsRunDiscoveryCall) Header() http.Header { +func (c *FoldersSourcesFindingsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsAssetsRunDiscoveryCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSourcesFindingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18192,34 +18378,34 @@ func (c *OrganizationsAssetsRunDiscoveryCall) doRequest(alt string) (*http.Respo } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runassetdiscoveryrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.finding) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets:runDiscovery") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.assets.runDiscovery" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *OrganizationsAssetsRunDiscoveryCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "securitycenter.folders.sources.findings.patch" call. +// Exactly one of *Finding or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Finding.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *FoldersSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Finding, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18238,7 +18424,7 @@ func (c *OrganizationsAssetsRunDiscoveryCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Finding{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18250,29 +18436,34 @@ func (c *OrganizationsAssetsRunDiscoveryCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "deprecated": true, - // "description": "Runs asset discovery. The discovery is tracked with a long-running operation. This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.", - // "flatPath": "v1/organizations/{organizationsId}/assets:runDiscovery", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.assets.runDiscovery", + // "description": "Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", + // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.folders.sources.findings.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. Name of the organization to run asset discovery for. Its format is \"organizations/[organization_id]\".", + // "name": { + // "description": "The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{finding_id}\".", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the finding resource. This field should not be specified when creating a finding. When updating a finding, an empty mask is treated as updating all mutable fields and replacing source_properties. Individual source_properties can be added/updated by using \"source_properties.\" in the field mask.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1/{+parent}/assets:runDiscovery", + // "path": "v1/{+name}", // "request": { - // "$ref": "RunAssetDiscoveryRequest" + // "$ref": "Finding" // }, // "response": { - // "$ref": "Operation" + // "$ref": "Finding" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -18281,55 +18472,37 @@ func (c *OrganizationsAssetsRunDiscoveryCall) Do(opts ...googleapi.CallOption) ( } -// method id "securitycenter.organizations.assets.updateSecurityMarks": +// method id "securitycenter.folders.sources.findings.setMute": -type OrganizationsAssetsUpdateSecurityMarksCall struct { - s *Service - name string - securitymarks *SecurityMarks - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSourcesFindingsSetMuteCall struct { + s *Service + name string + setmuterequest *SetMuteRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// UpdateSecurityMarks: Updates security marks. +// SetMute: Updates the mute state of a finding. // -// - name: The relative resource name of the SecurityMarks. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Examples: -// "organizations/{organization_id}/assets/{asset_id}/securityMarks" +// - name: The relative resource name +// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) +// of the finding. Example: // "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}/securityMarks". -func (r *OrganizationsAssetsService) UpdateSecurityMarks(name string, securitymarks *SecurityMarks) *OrganizationsAssetsUpdateSecurityMarksCall { - c := &OrganizationsAssetsUpdateSecurityMarksCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// ng_id}", +// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", +// "projects/{project_id}/sources/{source_id}/findings/{finding_id}". +func (r *FoldersSourcesFindingsService) SetMute(name string, setmuterequest *SetMuteRequest) *FoldersSourcesFindingsSetMuteCall { + c := &FoldersSourcesFindingsSetMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.securitymarks = securitymarks - return c -} - -// StartTime sets the optional parameter "startTime": The time at which -// the updated SecurityMarks take effect. If not set uses current server -// time. Updates will be applied to the SecurityMarks that are active -// immediately preceding this time. Must be earlier or equal to the -// server time. -func (c *OrganizationsAssetsUpdateSecurityMarksCall) StartTime(startTime string) *OrganizationsAssetsUpdateSecurityMarksCall { - c.urlParams_.Set("startTime", startTime) - return c -} - -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the security marks resource. The field mask must -// not contain duplicate fields. If empty or set to "marks", all marks -// will be replaced. Individual marks can be updated using "marks.". -func (c *OrganizationsAssetsUpdateSecurityMarksCall) UpdateMask(updateMask string) *OrganizationsAssetsUpdateSecurityMarksCall { - c.urlParams_.Set("updateMask", updateMask) + c.setmuterequest = setmuterequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsAssetsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *OrganizationsAssetsUpdateSecurityMarksCall { +func (c *FoldersSourcesFindingsSetMuteCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsSetMuteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18337,21 +18510,21 @@ func (c *OrganizationsAssetsUpdateSecurityMarksCall) Fields(s ...googleapi.Field // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsAssetsUpdateSecurityMarksCall) Context(ctx context.Context) *OrganizationsAssetsUpdateSecurityMarksCall { +func (c *FoldersSourcesFindingsSetMuteCall) Context(ctx context.Context) *FoldersSourcesFindingsSetMuteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsAssetsUpdateSecurityMarksCall) Header() http.Header { +func (c *FoldersSourcesFindingsSetMuteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsAssetsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSourcesFindingsSetMuteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18359,16 +18532,16 @@ func (c *OrganizationsAssetsUpdateSecurityMarksCall) doRequest(alt string) (*htt } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmuterequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setMute") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -18379,14 +18552,14 @@ func (c *OrganizationsAssetsUpdateSecurityMarksCall) doRequest(alt string) (*htt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.assets.updateSecurityMarks" call. -// Exactly one of *SecurityMarks or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *SecurityMarks.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, error) { +// Do executes the "securitycenter.folders.sources.findings.setMute" call. +// Exactly one of *Finding or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Finding.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *FoldersSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOption) (*Finding, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18405,7 +18578,7 @@ func (c *OrganizationsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &SecurityMarks{ + ret := &Finding{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18417,40 +18590,28 @@ func (c *OrganizationsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Updates security marks.", - // "flatPath": "v1/organizations/{organizationsId}/assets/{assetsId}/securityMarks", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.assets.updateSecurityMarks", + // "description": "Updates the mute state of a finding.", + // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}:setMute", + // "httpMethod": "POST", + // "id": "securitycenter.folders.sources.findings.setMute", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", + // "description": "Required. The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{finding_id}\".", // "location": "path", - // "pattern": "^organizations/[^/]+/assets/[^/]+/securityMarks$", + // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", // "required": true, // "type": "string" - // }, - // "startTime": { - // "description": "The time at which the updated SecurityMarks take effect. If not set uses current server time. Updates will be applied to the SecurityMarks that are active immediately preceding this time. Must be earlier or equal to the server time.", - // "format": "google-datetime", - // "location": "query", - // "type": "string" - // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the security marks resource. The field mask must not contain duplicate fields. If empty or set to \"marks\", all marks will be replaced. Individual marks can be updated using \"marks.\".", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+name}:setMute", // "request": { - // "$ref": "SecurityMarks" + // "$ref": "SetMuteRequest" // }, // "response": { - // "$ref": "SecurityMarks" + // "$ref": "Finding" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -18459,43 +18620,37 @@ func (c *OrganizationsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOp } -// method id "securitycenter.organizations.bigQueryExports.create": +// method id "securitycenter.folders.sources.findings.setState": -type OrganizationsBigQueryExportsCreateCall struct { - s *Service - parent string - googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSourcesFindingsSetStateCall struct { + s *Service + name string + setfindingstaterequest *SetFindingStateRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a BigQuery export. +// SetState: Updates the state of a finding. // -// - parent: The name of the parent resource of the new BigQuery export. -// Its format is "organizations/[organization_id]", -// "folders/[folder_id]", or "projects/[project_id]". -func (r *OrganizationsBigQueryExportsService) Create(parent string, googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport) *OrganizationsBigQueryExportsCreateCall { - c := &OrganizationsBigQueryExportsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googlecloudsecuritycenterv1bigqueryexport = googlecloudsecuritycenterv1bigqueryexport - return c -} - -// BigQueryExportId sets the optional parameter "bigQueryExportId": -// Required. Unique identifier provided by the client within the parent -// scope. It must consist of only lowercase letters, numbers, and -// hyphens, must start with a letter, must end with either a letter or a -// number, and must be 63 characters or less. -func (c *OrganizationsBigQueryExportsCreateCall) BigQueryExportId(bigQueryExportId string) *OrganizationsBigQueryExportsCreateCall { - c.urlParams_.Set("bigQueryExportId", bigQueryExportId) +// - name: The relative resource name +// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) +// of the finding. Example: +// "organizations/{organization_id}/sources/{source_id}/findings/{findi +// ng_id}", +// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", +// "projects/{project_id}/sources/{source_id}/findings/{finding_id}". +func (r *FoldersSourcesFindingsService) SetState(name string, setfindingstaterequest *SetFindingStateRequest) *FoldersSourcesFindingsSetStateCall { + c := &FoldersSourcesFindingsSetStateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.setfindingstaterequest = setfindingstaterequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsBigQueryExportsCreateCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsCreateCall { +func (c *FoldersSourcesFindingsSetStateCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsSetStateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18503,21 +18658,21 @@ func (c *OrganizationsBigQueryExportsCreateCall) Fields(s ...googleapi.Field) *O // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsBigQueryExportsCreateCall) Context(ctx context.Context) *OrganizationsBigQueryExportsCreateCall { +func (c *FoldersSourcesFindingsSetStateCall) Context(ctx context.Context) *FoldersSourcesFindingsSetStateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsBigQueryExportsCreateCall) Header() http.Header { +func (c *FoldersSourcesFindingsSetStateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsBigQueryExportsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSourcesFindingsSetStateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18525,14 +18680,14 @@ func (c *OrganizationsBigQueryExportsCreateCall) doRequest(alt string) (*http.Re } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setfindingstaterequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setState") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -18540,21 +18695,19 @@ func (c *OrganizationsBigQueryExportsCreateCall) doRequest(alt string) (*http.Re } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.bigQueryExports.create" call. -// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { +// Do executes the "securitycenter.folders.sources.findings.setState" call. +// Exactly one of *Finding or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Finding.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *FoldersSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOption) (*Finding, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18573,7 +18726,7 @@ func (c *OrganizationsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &Finding{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18585,33 +18738,28 @@ func (c *OrganizationsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Creates a BigQuery export.", - // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports", + // "description": "Updates the state of a finding.", + // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}:setState", // "httpMethod": "POST", - // "id": "securitycenter.organizations.bigQueryExports.create", + // "id": "securitycenter.folders.sources.findings.setState", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "bigQueryExportId": { - // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of only lowercase letters, numbers, and hyphens, must start with a letter, must end with either a letter or a number, and must be 63 characters or less.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The name of the parent resource of the new BigQuery export. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "name": { + // "description": "Required. The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{finding_id}\".", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/bigQueryExports", + // "path": "v1/{+name}:setState", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "SetFindingStateRequest" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "Finding" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -18620,32 +18768,55 @@ func (c *OrganizationsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption } -// method id "securitycenter.organizations.bigQueryExports.delete": +// method id "securitycenter.folders.sources.findings.updateSecurityMarks": -type OrganizationsBigQueryExportsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSourcesFindingsUpdateSecurityMarksCall struct { + s *Service + name string + securitymarks *SecurityMarks + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an existing BigQuery export. +// UpdateSecurityMarks: Updates security marks. // -// - name: The name of the BigQuery export to delete. Its format is -// organizations/{organization}/bigQueryExports/{export_id}, -// folders/{folder}/bigQueryExports/{export_id}, or -// projects/{project}/bigQueryExports/{export_id}. -func (r *OrganizationsBigQueryExportsService) Delete(name string) *OrganizationsBigQueryExportsDeleteCall { - c := &OrganizationsBigQueryExportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The relative resource name of the SecurityMarks. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// Examples: +// "organizations/{organization_id}/assets/{asset_id}/securityMarks" +// "organizations/{organization_id}/sources/{source_id}/findings/{findi +// ng_id}/securityMarks". +func (r *FoldersSourcesFindingsService) UpdateSecurityMarks(name string, securitymarks *SecurityMarks) *FoldersSourcesFindingsUpdateSecurityMarksCall { + c := &FoldersSourcesFindingsUpdateSecurityMarksCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.securitymarks = securitymarks + return c +} + +// StartTime sets the optional parameter "startTime": The time at which +// the updated SecurityMarks take effect. If not set uses current server +// time. Updates will be applied to the SecurityMarks that are active +// immediately preceding this time. Must be earlier or equal to the +// server time. +func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) StartTime(startTime string) *FoldersSourcesFindingsUpdateSecurityMarksCall { + c.urlParams_.Set("startTime", startTime) + return c +} + +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the security marks resource. The field mask must +// not contain duplicate fields. If empty or set to "marks", all marks +// will be replaced. Individual marks can be updated using "marks.". +func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) UpdateMask(updateMask string) *FoldersSourcesFindingsUpdateSecurityMarksCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsBigQueryExportsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsDeleteCall { +func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsUpdateSecurityMarksCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18653,21 +18824,21 @@ func (c *OrganizationsBigQueryExportsDeleteCall) Fields(s ...googleapi.Field) *O // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsBigQueryExportsDeleteCall) Context(ctx context.Context) *OrganizationsBigQueryExportsDeleteCall { +func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Context(ctx context.Context) *FoldersSourcesFindingsUpdateSecurityMarksCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsBigQueryExportsDeleteCall) Header() http.Header { +func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsBigQueryExportsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18675,11 +18846,16 @@ func (c *OrganizationsBigQueryExportsDeleteCall) doRequest(alt string) (*http.Re } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -18690,14 +18866,14 @@ func (c *OrganizationsBigQueryExportsDeleteCall) doRequest(alt string) (*http.Re return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.bigQueryExports.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "securitycenter.folders.sources.findings.updateSecurityMarks" call. +// Exactly one of *SecurityMarks or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SecurityMarks.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18716,7 +18892,7 @@ func (c *OrganizationsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &SecurityMarks{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18728,25 +18904,40 @@ func (c *OrganizationsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Deletes an existing BigQuery export.", - // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.organizations.bigQueryExports.delete", + // "description": "Updates security marks.", + // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}/securityMarks", + // "httpMethod": "PATCH", + // "id": "securitycenter.folders.sources.findings.updateSecurityMarks", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The name of the BigQuery export to delete. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}", + // "description": "The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", // "location": "path", - // "pattern": "^organizations/[^/]+/bigQueryExports/[^/]+$", + // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks$", // "required": true, // "type": "string" + // }, + // "startTime": { + // "description": "The time at which the updated SecurityMarks take effect. If not set uses current server time. Updates will be applied to the SecurityMarks that are active immediately preceding this time. Must be earlier or equal to the server time.", + // "format": "google-datetime", + // "location": "query", + // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the security marks resource. The field mask must not contain duplicate fields. If empty or set to \"marks\", all marks will be replaced. Individual marks can be updated using \"marks.\".", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v1/{+name}", + // "request": { + // "$ref": "SecurityMarks" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "SecurityMarks" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -18755,80 +18946,82 @@ func (c *OrganizationsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption } -// method id "securitycenter.organizations.bigQueryExports.get": +// method id "securitycenter.folders.sources.findings.externalSystems.patch": -type OrganizationsBigQueryExportsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersSourcesFindingsExternalSystemsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a BigQuery export. +// Patch: Updates external system. This is for a given finding. // -// - name: Name of the BigQuery export to retrieve. Its format is -// organizations/{organization}/bigQueryExports/{export_id}, -// folders/{folder}/bigQueryExports/{export_id}, or -// projects/{project}/bigQueryExports/{export_id}. -func (r *OrganizationsBigQueryExportsService) Get(name string) *OrganizationsBigQueryExportsGetCall { - c := &OrganizationsBigQueryExportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Full resource name of the external system, for example: +// "organizations/1234/sources/5678/findings/123456/externalSystems/jir +// a", +// "folders/1234/sources/5678/findings/123456/externalSystems/jira", +// "projects/1234/sources/5678/findings/123456/externalSystems/jira". +func (r *FoldersSourcesFindingsExternalSystemsService) Patch(name string, googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem) *FoldersSourcesFindingsExternalSystemsPatchCall { + c := &FoldersSourcesFindingsExternalSystemsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googlecloudsecuritycenterv1externalsystem = googlecloudsecuritycenterv1externalsystem + return c +} + +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the external system resource. If empty all mutable +// fields will be updated. +func (c *FoldersSourcesFindingsExternalSystemsPatchCall) UpdateMask(updateMask string) *FoldersSourcesFindingsExternalSystemsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsBigQueryExportsGetCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsGetCall { +func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsExternalSystemsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsBigQueryExportsGetCall) IfNoneMatch(entityTag string) *OrganizationsBigQueryExportsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsBigQueryExportsGetCall) Context(ctx context.Context) *OrganizationsBigQueryExportsGetCall { +func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Context(ctx context.Context) *FoldersSourcesFindingsExternalSystemsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsBigQueryExportsGetCall) Header() http.Header { +func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsBigQueryExportsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSourcesFindingsExternalSystemsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1externalsystem) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -18839,16 +19032,16 @@ func (c *OrganizationsBigQueryExportsGetCall) doRequest(alt string) (*http.Respo return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.bigQueryExports.get" call. -// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error +// Do executes the "securitycenter.folders.sources.findings.externalSystems.patch" call. +// Exactly one of *GoogleCloudSecuritycenterV1ExternalSystem or error // will be non-nil. Any non-2xx status code is an error. Response // headers are in either -// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or +// *GoogleCloudSecuritycenterV1ExternalSystem.ServerResponse.Header or // (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *OrganizationsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { +func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1ExternalSystem, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18867,7 +19060,7 @@ func (c *OrganizationsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &GoogleCloudSecuritycenterV1ExternalSystem{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18879,25 +19072,34 @@ func (c *OrganizationsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Gets a BigQuery export.", - // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.bigQueryExports.get", + // "description": "Updates external system. This is for a given finding.", + // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}/externalSystems/{externalSystemsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.folders.sources.findings.externalSystems.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the BigQuery export to retrieve. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}", + // "description": "Full resource name of the external system, for example: \"organizations/1234/sources/5678/findings/123456/externalSystems/jira\", \"folders/1234/sources/5678/findings/123456/externalSystems/jira\", \"projects/1234/sources/5678/findings/123456/externalSystems/jira\"", // "location": "path", - // "pattern": "^organizations/[^/]+/bigQueryExports/[^/]+$", + // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the external system resource. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v1/{+name}", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" + // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -18906,55 +19108,32 @@ func (c *OrganizationsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) ( } -// method id "securitycenter.organizations.bigQueryExports.list": +// method id "securitycenter.organizations.getOrganizationSettings": -type OrganizationsBigQueryExportsListCall struct { +type OrganizationsGetOrganizationSettingsCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists BigQuery exports. Note that when requesting BigQuery -// exports at a given level all exports under that level are also -// returned e.g. if requesting BigQuery exports under a folder, then all -// BigQuery exports immediately under the folder plus the ones created -// under the projects within the folder are returned. +// GetOrganizationSettings: Gets the settings for an organization. // -// - parent: The parent, which owns the collection of BigQuery exports. -// Its format is "organizations/[organization_id]", -// "folders/[folder_id]", "projects/[project_id]". -func (r *OrganizationsBigQueryExportsService) List(parent string) *OrganizationsBigQueryExportsListCall { - c := &OrganizationsBigQueryExportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of configs to return. The service may return fewer than this value. -// If unspecified, at most 10 configs will be returned. The maximum -// value is 1000; values above 1000 will be coerced to 1000. -func (c *OrganizationsBigQueryExportsListCall) PageSize(pageSize int64) *OrganizationsBigQueryExportsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": A page token, -// received from a previous `ListBigQueryExports` call. Provide this to -// retrieve the subsequent page. When paginating, all other parameters -// provided to `ListBigQueryExports` must match the call that provided -// the page token. -func (c *OrganizationsBigQueryExportsListCall) PageToken(pageToken string) *OrganizationsBigQueryExportsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: Name of the organization to get organization settings for. +// Its format is +// "organizations/[organization_id]/organizationSettings". +func (r *OrganizationsService) GetOrganizationSettings(name string) *OrganizationsGetOrganizationSettingsCall { + c := &OrganizationsGetOrganizationSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsBigQueryExportsListCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsListCall { +func (c *OrganizationsGetOrganizationSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetOrganizationSettingsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18964,7 +19143,7 @@ func (c *OrganizationsBigQueryExportsListCall) Fields(s ...googleapi.Field) *Org // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsBigQueryExportsListCall) IfNoneMatch(entityTag string) *OrganizationsBigQueryExportsListCall { +func (c *OrganizationsGetOrganizationSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetOrganizationSettingsCall { c.ifNoneMatch_ = entityTag return c } @@ -18972,21 +19151,21 @@ func (c *OrganizationsBigQueryExportsListCall) IfNoneMatch(entityTag string) *Or // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsBigQueryExportsListCall) Context(ctx context.Context) *OrganizationsBigQueryExportsListCall { +func (c *OrganizationsGetOrganizationSettingsCall) Context(ctx context.Context) *OrganizationsGetOrganizationSettingsCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsBigQueryExportsListCall) Header() http.Header { +func (c *OrganizationsGetOrganizationSettingsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsBigQueryExportsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsGetOrganizationSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18999,7 +19178,7 @@ func (c *OrganizationsBigQueryExportsListCall) doRequest(alt string) (*http.Resp var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -19007,19 +19186,19 @@ func (c *OrganizationsBigQueryExportsListCall) doRequest(alt string) (*http.Resp } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.bigQueryExports.list" call. -// Exactly one of *ListBigQueryExportsResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *ListBigQueryExportsResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "securitycenter.organizations.getOrganizationSettings" call. +// Exactly one of *OrganizationSettings or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OrganizationSettings.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*ListBigQueryExportsResponse, error) { +func (c *OrganizationsGetOrganizationSettingsCall) Do(opts ...googleapi.CallOption) (*OrganizationSettings, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19038,7 +19217,7 @@ func (c *OrganizationsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListBigQueryExportsResponse{ + ret := &OrganizationSettings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19050,36 +19229,25 @@ func (c *OrganizationsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Lists BigQuery exports. Note that when requesting BigQuery exports at a given level all exports under that level are also returned e.g. if requesting BigQuery exports under a folder, then all BigQuery exports immediately under the folder plus the ones created under the projects within the folder are returned.", - // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports", + // "description": "Gets the settings for an organization.", + // "flatPath": "v1/organizations/{organizationsId}/organizationSettings", // "httpMethod": "GET", - // "id": "securitycenter.organizations.bigQueryExports.list", + // "id": "securitycenter.organizations.getOrganizationSettings", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of configs to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "A page token, received from a previous `ListBigQueryExports` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListBigQueryExports` must match the call that provided the page token.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent, which owns the collection of BigQuery exports. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", + // "name": { + // "description": "Required. Name of the organization to get organization settings for. Its format is \"organizations/[organization_id]/organizationSettings\".", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/organizationSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/bigQueryExports", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListBigQueryExportsResponse" + // "$ref": "OrganizationSettings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -19088,58 +19256,33 @@ func (c *OrganizationsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *OrganizationsBigQueryExportsListCall) Pages(ctx context.Context, f func(*ListBigQueryExportsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "securitycenter.organizations.bigQueryExports.patch": +// method id "securitycenter.organizations.updateOrganizationSettings": -type OrganizationsBigQueryExportsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsUpdateOrganizationSettingsCall struct { + s *Service + name string + organizationsettings *OrganizationSettings + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a BigQuery export. +// UpdateOrganizationSettings: Updates an organization's settings. // -// - name: The relative resource name of this export. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name. -// Example format: -// "organizations/{organization_id}/bigQueryExports/{export_id}" -// Example format: "folders/{folder_id}/bigQueryExports/{export_id}" -// Example format: "projects/{project_id}/bigQueryExports/{export_id}" -// This field is provided in responses, and is ignored when provided -// in create requests. -func (r *OrganizationsBigQueryExportsService) Patch(name string, googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport) *OrganizationsBigQueryExportsPatchCall { - c := &OrganizationsBigQueryExportsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The relative resource name of the settings. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// Example: "organizations/{organization_id}/organizationSettings". +func (r *OrganizationsService) UpdateOrganizationSettings(name string, organizationsettings *OrganizationSettings) *OrganizationsUpdateOrganizationSettingsCall { + c := &OrganizationsUpdateOrganizationSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googlecloudsecuritycenterv1bigqueryexport = googlecloudsecuritycenterv1bigqueryexport + c.organizationsettings = organizationsettings return c } -// UpdateMask sets the optional parameter "updateMask": The list of -// fields to be updated. If empty all mutable fields will be updated. -func (c *OrganizationsBigQueryExportsPatchCall) UpdateMask(updateMask string) *OrganizationsBigQueryExportsPatchCall { +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the settings resource. If empty all mutable fields +// will be updated. +func (c *OrganizationsUpdateOrganizationSettingsCall) UpdateMask(updateMask string) *OrganizationsUpdateOrganizationSettingsCall { c.urlParams_.Set("updateMask", updateMask) return c } @@ -19147,7 +19290,7 @@ func (c *OrganizationsBigQueryExportsPatchCall) UpdateMask(updateMask string) *O // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsBigQueryExportsPatchCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsPatchCall { +func (c *OrganizationsUpdateOrganizationSettingsCall) Fields(s ...googleapi.Field) *OrganizationsUpdateOrganizationSettingsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -19155,21 +19298,21 @@ func (c *OrganizationsBigQueryExportsPatchCall) Fields(s ...googleapi.Field) *Or // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsBigQueryExportsPatchCall) Context(ctx context.Context) *OrganizationsBigQueryExportsPatchCall { +func (c *OrganizationsUpdateOrganizationSettingsCall) Context(ctx context.Context) *OrganizationsUpdateOrganizationSettingsCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsBigQueryExportsPatchCall) Header() http.Header { +func (c *OrganizationsUpdateOrganizationSettingsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsBigQueryExportsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsUpdateOrganizationSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -19177,7 +19320,7 @@ func (c *OrganizationsBigQueryExportsPatchCall) doRequest(alt string) (*http.Res } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.organizationsettings) if err != nil { return nil, err } @@ -19197,16 +19340,14 @@ func (c *OrganizationsBigQueryExportsPatchCall) doRequest(alt string) (*http.Res return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.bigQueryExports.patch" call. -// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { +// Do executes the "securitycenter.organizations.updateOrganizationSettings" call. +// Exactly one of *OrganizationSettings or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OrganizationSettings.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsUpdateOrganizationSettingsCall) Do(opts ...googleapi.CallOption) (*OrganizationSettings, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19225,7 +19366,7 @@ func (c *OrganizationsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &OrganizationSettings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19237,23 +19378,23 @@ func (c *OrganizationsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Updates a BigQuery export.", - // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", + // "description": "Updates an organization's settings.", + // "flatPath": "v1/organizations/{organizationsId}/organizationSettings", // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.bigQueryExports.patch", + // "id": "securitycenter.organizations.updateOrganizationSettings", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The relative resource name of this export. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name. Example format: \"organizations/{organization_id}/bigQueryExports/{export_id}\" Example format: \"folders/{folder_id}/bigQueryExports/{export_id}\" Example format: \"projects/{project_id}/bigQueryExports/{export_id}\" This field is provided in responses, and is ignored when provided in create requests.", + // "description": "The relative resource name of the settings. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/organizationSettings\".", // "location": "path", - // "pattern": "^organizations/[^/]+/bigQueryExports/[^/]+$", + // "pattern": "^organizations/[^/]+/organizationSettings$", // "required": true, // "type": "string" // }, // "updateMask": { - // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", + // "description": "The FieldMask to use when updating the settings resource. If empty all mutable fields will be updated.", // "format": "google-fieldmask", // "location": "query", // "type": "string" @@ -19261,10 +19402,10 @@ func (c *OrganizationsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) // }, // "path": "v1/{+name}", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "OrganizationSettings" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "OrganizationSettings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -19273,34 +19414,34 @@ func (c *OrganizationsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.organizations.eventThreatDetectionSettings.validateCustomModule": +// method id "securitycenter.organizations.assets.group": -type OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall struct { - s *Service - parent string - validateeventthreatdetectioncustommodulerequest *ValidateEventThreatDetectionCustomModuleRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsAssetsGroupCall struct { + s *Service + parent string + groupassetsrequest *GroupAssetsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// ValidateCustomModule: Validates the given Event Threat Detection -// custom module. +// Group: Filters an organization's assets and groups them by their +// specified properties. // -// - parent: Resource name of the parent to validate the Custom Module -// under. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings". -func (r *OrganizationsEventThreatDetectionSettingsService) ValidateCustomModule(parent string, validateeventthreatdetectioncustommodulerequest *ValidateEventThreatDetectionCustomModuleRequest) *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall { - c := &OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The name of the parent to group the assets by. Its format +// is "organizations/[organization_id]", "folders/[folder_id]", or +// "projects/[project_id]". +func (r *OrganizationsAssetsService) Group(parent string, groupassetsrequest *GroupAssetsRequest) *OrganizationsAssetsGroupCall { + c := &OrganizationsAssetsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.validateeventthreatdetectioncustommodulerequest = validateeventthreatdetectioncustommodulerequest + c.groupassetsrequest = groupassetsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall { +func (c *OrganizationsAssetsGroupCall) Fields(s ...googleapi.Field) *OrganizationsAssetsGroupCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -19308,21 +19449,21 @@ func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Fiel // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall { +func (c *OrganizationsAssetsGroupCall) Context(ctx context.Context) *OrganizationsAssetsGroupCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Header() http.Header { +func (c *OrganizationsAssetsGroupCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsAssetsGroupCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -19330,14 +19471,14 @@ func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) doRe } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.validateeventthreatdetectioncustommodulerequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupassetsrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:validateCustomModule") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets:group") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -19350,16 +19491,14 @@ func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) doRe return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.validateCustomModule" call. -// Exactly one of *ValidateEventThreatDetectionCustomModuleResponse or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *ValidateEventThreatDetectionCustomModuleResponse.ServerResponse.Heade -// r or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Do(opts ...googleapi.CallOption) (*ValidateEventThreatDetectionCustomModuleResponse, error) { +// Do executes the "securitycenter.organizations.assets.group" call. +// Exactly one of *GroupAssetsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GroupAssetsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssetsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19378,7 +19517,7 @@ func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Do(o if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ValidateEventThreatDetectionCustomModuleResponse{ + ret := &GroupAssetsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19390,28 +19529,29 @@ func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Do(o } return ret, nil // { - // "description": "Validates the given Event Threat Detection custom module.", - // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings:validateCustomModule", + // "deprecated": true, + // "description": "Filters an organization's assets and groups them by their specified properties.", + // "flatPath": "v1/organizations/{organizationsId}/assets:group", // "httpMethod": "POST", - // "id": "securitycenter.organizations.eventThreatDetectionSettings.validateCustomModule", + // "id": "securitycenter.organizations.assets.group", // "parameterOrder": [ // "parent" // ], // "parameters": { // "parent": { - // "description": "Required. Resource name of the parent to validate the Custom Module under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\".", + // "description": "Required. The name of the parent to group the assets by. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}:validateCustomModule", + // "path": "v1/{+parent}/assets:group", // "request": { - // "$ref": "ValidateEventThreatDetectionCustomModuleRequest" + // "$ref": "GroupAssetsRequest" // }, // "response": { - // "$ref": "ValidateEventThreatDetectionCustomModuleResponse" + // "$ref": "GroupAssetsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -19420,89 +19560,243 @@ func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Do(o } -// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.create": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsAssetsGroupCall) Pages(ctx context.Context, f func(*GroupAssetsResponse) error) error { + c.ctx_ = ctx + defer func(pt string) { c.groupassetsrequest.PageToken = pt }(c.groupassetsrequest.PageToken) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.groupassetsrequest.PageToken = x.NextPageToken + } +} -type OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall struct { - s *Service - parent string - eventthreatdetectioncustommodule *EventThreatDetectionCustomModule - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.organizations.assets.list": + +type OrganizationsAssetsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates an Event Threat Detection custom module. +// List: Lists an organization's assets. // -// - parent: The new custom module's parent. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings". -func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) Create(parent string, eventthreatdetectioncustommodule *EventThreatDetectionCustomModule) *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall { - c := &OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The name of the parent resource that contains the assets. +// The value that you can specify on parent depends on the method in +// which you specify parent. You can specify one of the following +// values: "organizations/[organization_id]", "folders/[folder_id]", +// or "projects/[project_id]". +func (r *OrganizationsAssetsService) List(parent string) *OrganizationsAssetsListCall { + c := &OrganizationsAssetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.eventthreatdetectioncustommodule = eventthreatdetectioncustommodule return c } -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) +// CompareDuration sets the optional parameter "compareDuration": When +// compare_duration is set, the ListAssetsResult's "state_change" +// attribute is updated to indicate whether the asset was added, +// removed, or remained present during the compare_duration period of +// time that precedes the read_time. This is the time between (read_time +// - compare_duration) and read_time. The state_change value is derived +// based on the presence of the asset at the two points in time. +// Intermediate state changes between the two times don't affect the +// result. For example, the results aren't affected if the asset is +// removed and re-created again. Possible "state_change" values when +// compare_duration is specified: * "ADDED": indicates that the asset +// was not present at the start of compare_duration, but present at +// read_time. * "REMOVED": indicates that the asset was present at the +// start of compare_duration, but not present at read_time. * "ACTIVE": +// indicates that the asset was present at both the start and the end of +// the time period defined by compare_duration and read_time. If +// compare_duration is not specified, then the only possible +// state_change is "UNUSED", which will be the state_change set for all +// assets present at read_time. +func (c *OrganizationsAssetsListCall) CompareDuration(compareDuration string) *OrganizationsAssetsListCall { + c.urlParams_.Set("compareDuration", compareDuration) return c } -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall { - c.ctx_ = ctx +// FieldMask sets the optional parameter "fieldMask": A field mask to +// specify the ListAssetsResult fields to be listed in the response. An +// empty field mask will list all fields. +func (c *OrganizationsAssetsListCall) FieldMask(fieldMask string) *OrganizationsAssetsListCall { + c.urlParams_.Set("fieldMask", fieldMask) return c } -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) +// Filter sets the optional parameter "filter": Expression that defines +// the filter to apply across assets. The expression is a list of zero +// or more restrictions combined via logical operators `AND` and `OR`. +// Parentheses are supported, and `OR` has higher precedence than `AND`. +// Restrictions have the form ` ` and may have a `-` character in front +// of them to indicate negation. The fields map to those defined in the +// Asset resource. Examples include: * name * +// security_center_properties.resource_name * +// resource_properties.a_property * security_marks.marks.marka The +// supported operators are: * `=` for all value types. * `>`, `<`, `>=`, +// `<=` for integer values. * `:`, meaning substring matching, for +// strings. The supported value types are: * string literals in quotes. +// * integer literals without quotes. * boolean literals `true` and +// `false` without quotes. The following are the allowed field and +// operator combinations: * name: `=` * update_time: `=`, `>`, `<`, +// `>=`, `<=` Usage: This should be milliseconds since epoch or an +// RFC3339 string. Examples: `update_time = "2019-06-10T16:07:18-07:00" +// `update_time = 1560208038000` * create_time: `=`, `>`, `<`, `>=`, +// `<=` Usage: This should be milliseconds since epoch or an RFC3339 +// string. Examples: `create_time = "2019-06-10T16:07:18-07:00" +// `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * +// resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * +// security_marks.marks: `=`, `:` * +// security_center_properties.resource_name: `=`, `:` * +// security_center_properties.resource_display_name: `=`, `:` * +// security_center_properties.resource_type: `=`, `:` * +// security_center_properties.resource_parent: `=`, `:` * +// security_center_properties.resource_parent_display_name: `=`, `:` * +// security_center_properties.resource_project: `=`, `:` * +// security_center_properties.resource_project_display_name: `=`, `:` * +// security_center_properties.resource_owners: `=`, `:` For example, +// `resource_properties.size = 100` is a valid filter string. Use a +// partial match on the empty string to filter based on a property +// existing: `resource_properties.my_property : "" Use a negated +// partial match on the empty string to filter based on a property not +// existing: `-resource_properties.my_property : "" +func (c *OrganizationsAssetsListCall) Filter(filter string) *OrganizationsAssetsListCall { + c.urlParams_.Set("filter", filter) + return c } -// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.customModules.create" call. -// Exactly one of *EventThreatDetectionCustomModule or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, error) { +// OrderBy sets the optional parameter "orderBy": Expression that +// defines what fields and order to use for sorting. The string value +// should follow SQL syntax: comma separated list of fields. For +// example: "name,resource_properties.a_property". The default sorting +// order is ascending. To specify descending order for a field, a suffix +// " desc" should be appended to the field name. For example: "name +// desc,resource_properties.a_property". Redundant space characters in +// the syntax are insignificant. "name +// desc,resource_properties.a_property" and " name desc , +// resource_properties.a_property " are equivalent. The following fields +// are supported: name update_time resource_properties +// security_marks.marks security_center_properties.resource_name +// security_center_properties.resource_display_name +// security_center_properties.resource_parent +// security_center_properties.resource_parent_display_name +// security_center_properties.resource_project +// security_center_properties.resource_project_display_name +// security_center_properties.resource_type +func (c *OrganizationsAssetsListCall) OrderBy(orderBy string) *OrganizationsAssetsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *OrganizationsAssetsListCall) PageSize(pageSize int64) *OrganizationsAssetsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListAssetsResponse`; indicates that this is a +// continuation of a prior `ListAssets` call, and that the system should +// return the next page of data. +func (c *OrganizationsAssetsListCall) PageToken(pageToken string) *OrganizationsAssetsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReadTime sets the optional parameter "readTime": Time used as a +// reference point when filtering assets. The filter is limited to +// assets existing at the supplied time and their values are those at +// that specific time. Absence of this field will default to the API's +// version of NOW. +func (c *OrganizationsAssetsListCall) ReadTime(readTime string) *OrganizationsAssetsListCall { + c.urlParams_.Set("readTime", readTime) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsAssetsListCall) Fields(s ...googleapi.Field) *OrganizationsAssetsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsAssetsListCall) IfNoneMatch(entityTag string) *OrganizationsAssetsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsAssetsListCall) Context(ctx context.Context) *OrganizationsAssetsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsAssetsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsAssetsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.assets.list" call. +// Exactly one of *ListAssetsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListAssetsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19521,7 +19815,7 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Do(op if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &EventThreatDetectionCustomModule{ + ret := &ListAssetsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19533,28 +19827,65 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Do(op } return ret, nil // { - // "description": "Creates an Event Threat Detection custom module.", - // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.create", + // "deprecated": true, + // "description": "Lists an organization's assets.", + // "flatPath": "v1/organizations/{organizationsId}/assets", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.assets.list", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "compareDuration": { + // "description": "When compare_duration is set, the ListAssetsResult's \"state_change\" attribute is updated to indicate whether the asset was added, removed, or remained present during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence of the asset at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the asset is removed and re-created again. Possible \"state_change\" values when compare_duration is specified: * \"ADDED\": indicates that the asset was not present at the start of compare_duration, but present at read_time. * \"REMOVED\": indicates that the asset was present at the start of compare_duration, but not present at read_time. * \"ACTIVE\": indicates that the asset was present at both the start and the end of the time period defined by compare_duration and read_time. If compare_duration is not specified, then the only possible state_change is \"UNUSED\", which will be the state_change set for all assets present at read_time.", + // "format": "google-duration", + // "location": "query", + // "type": "string" + // }, + // "fieldMask": { + // "description": "A field mask to specify the ListAssetsResult fields to be listed in the response. An empty field mask will list all fields.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // }, + // "filter": { + // "description": "Expression that defines the filter to apply across assets. The expression is a list of zero or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. The fields map to those defined in the Asset resource. Examples include: * name * security_center_properties.resource_name * resource_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following are the allowed field and operator combinations: * name: `=` * update_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `update_time = \"2019-06-10T16:07:18-07:00\"` `update_time = 1560208038000` * create_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `create_time = \"2019-06-10T16:07:18-07:00\"` `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * resource_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` * security_marks.marks: `=`, `:` * security_center_properties.resource_name: `=`, `:` * security_center_properties.resource_display_name: `=`, `:` * security_center_properties.resource_type: `=`, `:` * security_center_properties.resource_parent: `=`, `:` * security_center_properties.resource_parent_display_name: `=`, `:` * security_center_properties.resource_project: `=`, `:` * security_center_properties.resource_project_display_name: `=`, `:` * security_center_properties.resource_owners: `=`, `:` For example, `resource_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `resource_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-resource_properties.my_property : \"\"`", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,resource_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,resource_properties.a_property\" and \" name desc , resource_properties.a_property \" are equivalent. The following fields are supported: name update_time resource_properties security_marks.marks security_center_properties.resource_name security_center_properties.resource_display_name security_center_properties.resource_parent security_center_properties.resource_parent_display_name security_center_properties.resource_project security_center_properties.resource_project_display_name security_center_properties.resource_type", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListAssetsResponse`; indicates that this is a continuation of a prior `ListAssets` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, // "parent": { - // "description": "Required. The new custom module's parent. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\".", + // "description": "Required. The name of the parent resource that contains the assets. The value that you can specify on parent depends on the method in which you specify parent. You can specify one of the following values: \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" + // }, + // "readTime": { + // "description": "Time used as a reference point when filtering assets. The filter is limited to assets existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.", + // "format": "google-datetime", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules", - // "request": { - // "$ref": "EventThreatDetectionCustomModule" - // }, + // "path": "v1/{+parent}/assets", // "response": { - // "$ref": "EventThreatDetectionCustomModule" + // "$ref": "ListAssetsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -19563,31 +19894,56 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Do(op } -// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.delete": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsAssetsListCall) Pages(ctx context.Context, f func(*ListAssetsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.organizations.assets.runDiscovery": + +type OrganizationsAssetsRunDiscoveryCall struct { + s *Service + parent string + runassetdiscoveryrequest *RunAssetDiscoveryRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an Event Threat Detection custom module. +// RunDiscovery: Runs asset discovery. The discovery is tracked with a +// long-running operation. This API can only be called with limited +// frequency for an organization. If it is called too frequently the +// caller will receive a TOO_MANY_REQUESTS error. // -// - name: Name of the custom module to delete. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings/customMod -// ules/{module}". -func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) Delete(name string) *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall { - c := &OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Name of the organization to run asset discovery for. Its +// format is "organizations/[organization_id]". +func (r *OrganizationsAssetsService) RunDiscovery(parent string, runassetdiscoveryrequest *RunAssetDiscoveryRequest) *OrganizationsAssetsRunDiscoveryCall { + c := &OrganizationsAssetsRunDiscoveryCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.runassetdiscoveryrequest = runassetdiscoveryrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall { +func (c *OrganizationsAssetsRunDiscoveryCall) Fields(s ...googleapi.Field) *OrganizationsAssetsRunDiscoveryCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -19595,21 +19951,21 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Field // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall { +func (c *OrganizationsAssetsRunDiscoveryCall) Context(ctx context.Context) *OrganizationsAssetsRunDiscoveryCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Header() http.Header { +func (c *OrganizationsAssetsRunDiscoveryCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsAssetsRunDiscoveryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -19617,29 +19973,34 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) doReq } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.runassetdiscoveryrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets:runDiscovery") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.customModules.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "securitycenter.organizations.assets.runDiscovery" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OrganizationsAssetsRunDiscoveryCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19658,7 +20019,7 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Do(op if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19670,25 +20031,29 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Do(op } return ret, nil // { - // "description": "Deletes an Event Threat Detection custom module.", - // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.delete", + // "deprecated": true, + // "description": "Runs asset discovery. The discovery is tracked with a long-running operation. This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.", + // "flatPath": "v1/organizations/{organizationsId}/assets:runDiscovery", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.assets.runDiscovery", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Name of the custom module to delete. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\".", + // "parent": { + // "description": "Required. Name of the organization to run asset discovery for. Its format is \"organizations/[organization_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/assets:runDiscovery", + // "request": { + // "$ref": "RunAssetDiscoveryRequest" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -19697,79 +20062,94 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Do(op } -// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.get": +// method id "securitycenter.organizations.assets.updateSecurityMarks": -type OrganizationsEventThreatDetectionSettingsCustomModulesGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsAssetsUpdateSecurityMarksCall struct { + s *Service + name string + securitymarks *SecurityMarks + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets an Event Threat Detection custom module. +// UpdateSecurityMarks: Updates security marks. // -// - name: Name of the custom module to get. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings/customMod -// ules/{module}". -func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) Get(name string) *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall { - c := &OrganizationsEventThreatDetectionSettingsCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The relative resource name of the SecurityMarks. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// Examples: +// "organizations/{organization_id}/assets/{asset_id}/securityMarks" +// "organizations/{organization_id}/sources/{source_id}/findings/{findi +// ng_id}/securityMarks". +func (r *OrganizationsAssetsService) UpdateSecurityMarks(name string, securitymarks *SecurityMarks) *OrganizationsAssetsUpdateSecurityMarksCall { + c := &OrganizationsAssetsUpdateSecurityMarksCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.securitymarks = securitymarks + return c +} + +// StartTime sets the optional parameter "startTime": The time at which +// the updated SecurityMarks take effect. If not set uses current server +// time. Updates will be applied to the SecurityMarks that are active +// immediately preceding this time. Must be earlier or equal to the +// server time. +func (c *OrganizationsAssetsUpdateSecurityMarksCall) StartTime(startTime string) *OrganizationsAssetsUpdateSecurityMarksCall { + c.urlParams_.Set("startTime", startTime) + return c +} + +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the security marks resource. The field mask must +// not contain duplicate fields. If empty or set to "marks", all marks +// will be replaced. Individual marks can be updated using "marks.". +func (c *OrganizationsAssetsUpdateSecurityMarksCall) UpdateMask(updateMask string) *OrganizationsAssetsUpdateSecurityMarksCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall { +func (c *OrganizationsAssetsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *OrganizationsAssetsUpdateSecurityMarksCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) IfNoneMatch(entityTag string) *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall { +func (c *OrganizationsAssetsUpdateSecurityMarksCall) Context(ctx context.Context) *OrganizationsAssetsUpdateSecurityMarksCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Header() http.Header { +func (c *OrganizationsAssetsUpdateSecurityMarksCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsAssetsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -19780,14 +20160,14 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) doReques return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.customModules.get" call. -// Exactly one of *EventThreatDetectionCustomModule or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was +// Do executes the "securitycenter.organizations.assets.updateSecurityMarks" call. +// Exactly one of *SecurityMarks or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SecurityMarks.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, error) { +func (c *OrganizationsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19806,7 +20186,7 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Do(opts if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &EventThreatDetectionCustomModule{ + ret := &SecurityMarks{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19818,25 +20198,40 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Do(opts } return ret, nil // { - // "description": "Gets an Event Threat Detection custom module.", - // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.get", + // "description": "Updates security marks.", + // "flatPath": "v1/organizations/{organizationsId}/assets/{assetsId}/securityMarks", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.assets.updateSecurityMarks", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the custom module to get. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\".", + // "description": "The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", // "location": "path", - // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", + // "pattern": "^organizations/[^/]+/assets/[^/]+/securityMarks$", // "required": true, // "type": "string" + // }, + // "startTime": { + // "description": "The time at which the updated SecurityMarks take effect. If not set uses current server time. Updates will be applied to the SecurityMarks that are active immediately preceding this time. Must be earlier or equal to the server time.", + // "format": "google-datetime", + // "location": "query", + // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the security marks resource. The field mask must not contain duplicate fields. If empty or set to \"marks\", all marks will be replaced. Individual marks can be updated using \"marks.\".", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v1/{+name}", + // "request": { + // "$ref": "SecurityMarks" + // }, // "response": { - // "$ref": "EventThreatDetectionCustomModule" + // "$ref": "SecurityMarks" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -19845,98 +20240,82 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Do(opts } -// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.list": +// method id "securitycenter.organizations.bigQueryExports.create": -type OrganizationsEventThreatDetectionSettingsCustomModulesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsBigQueryExportsCreateCall struct { + s *Service + parent string + googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists Event Threat Detection custom modules. +// Create: Creates a BigQuery export. // -// - parent: Name of the parent to list custom modules under. Its format -// is: * "organizations/{organization}/eventThreatDetectionSettings". -func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) List(parent string) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { - c := &OrganizationsEventThreatDetectionSettingsCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The name of the parent resource of the new BigQuery export. +// Its format is "organizations/[organization_id]", +// "folders/[folder_id]", or "projects/[project_id]". +func (r *OrganizationsBigQueryExportsService) Create(parent string, googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport) *OrganizationsBigQueryExportsCreateCall { + c := &OrganizationsBigQueryExportsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent + c.googlecloudsecuritycenterv1bigqueryexport = googlecloudsecuritycenterv1bigqueryexport return c } -// PageSize sets the optional parameter "pageSize": The maximum number -// of modules to return. The service may return fewer than this value. -// If unspecified, at most 10 configs will be returned. The maximum -// value is 1000; values above 1000 will be coerced to 1000. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) PageSize(pageSize int64) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": A page token, -// received from a previous `ListEventThreatDetectionCustomModules` -// call. Provide this to retrieve the subsequent page. When paginating, -// all other parameters provided to -// `ListEventThreatDetectionCustomModules` must match the call that -// provided the page token. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) PageToken(pageToken string) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { - c.urlParams_.Set("pageToken", pageToken) +// BigQueryExportId sets the optional parameter "bigQueryExportId": +// Required. Unique identifier provided by the client within the parent +// scope. It must consist of only lowercase letters, numbers, and +// hyphens, must start with a letter, must end with either a letter or a +// number, and must be 63 characters or less. +func (c *OrganizationsBigQueryExportsCreateCall) BigQueryExportId(bigQueryExportId string) *OrganizationsBigQueryExportsCreateCall { + c.urlParams_.Set("bigQueryExportId", bigQueryExportId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { +func (c *OrganizationsBigQueryExportsCreateCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) IfNoneMatch(entityTag string) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { +func (c *OrganizationsBigQueryExportsCreateCall) Context(ctx context.Context) *OrganizationsBigQueryExportsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Header() http.Header { +func (c *OrganizationsBigQueryExportsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsBigQueryExportsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -19947,16 +20326,16 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) doReque return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.customModules.list" call. -// Exactly one of *ListEventThreatDetectionCustomModulesResponse or -// error will be non-nil. Any non-2xx status code is an error. Response +// Do executes the "securitycenter.organizations.bigQueryExports.create" call. +// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error +// will be non-nil. Any non-2xx status code is an error. Response // headers are in either -// *ListEventThreatDetectionCustomModulesResponse.ServerResponse.Header -// or (if a response was returned at all) in +// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or +// (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListEventThreatDetectionCustomModulesResponse, error) { +func (c *OrganizationsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19975,7 +20354,7 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Do(opts if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListEventThreatDetectionCustomModulesResponse{ + ret := &GoogleCloudSecuritycenterV1BigQueryExport{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19987,36 +20366,33 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Do(opts } return ret, nil // { - // "description": "Lists Event Threat Detection custom modules.", - // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.list", - // "parameterOrder": [ - // "parent" - // ], + // "description": "Creates a BigQuery export.", + // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.bigQueryExports.create", + // "parameterOrder": [ + // "parent" + // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of modules to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "A page token, received from a previous `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListEventThreatDetectionCustomModules` must match the call that provided the page token.", + // "bigQueryExportId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of only lowercase letters, numbers, and hyphens, must start with a letter, must end with either a letter or a number, and must be 63 characters or less.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. Name of the parent to list custom modules under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\".", + // "description": "Required. The name of the parent resource of the new BigQuery export. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules", + // "path": "v1/{+parent}/bigQueryExports", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // }, // "response": { - // "$ref": "ListEventThreatDetectionCustomModulesResponse" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -20025,66 +20401,32 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Do(opts } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Pages(ctx context.Context, f func(*ListEventThreatDetectionCustomModulesResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.patch": +// method id "securitycenter.organizations.bigQueryExports.delete": -type OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall struct { - s *Service - name string - eventthreatdetectioncustommodule *EventThreatDetectionCustomModule - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsBigQueryExportsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates an Event Threat Detection custom module. +// Delete: Deletes an existing BigQuery export. // -// - name: Immutable. The resource name of the Event Threat Detection -// custom module. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings/customMod -// ules/{module}". * -// "folders/{folder}/eventThreatDetectionSettings/customModules/{module -// }". * -// "projects/{project}/eventThreatDetectionSettings/customModules/{modu -// le}". -func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) Patch(name string, eventthreatdetectioncustommodule *EventThreatDetectionCustomModule) *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall { - c := &OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the BigQuery export to delete. Its format is +// organizations/{organization}/bigQueryExports/{export_id}, +// folders/{folder}/bigQueryExports/{export_id}, or +// projects/{project}/bigQueryExports/{export_id}. +func (r *OrganizationsBigQueryExportsService) Delete(name string) *OrganizationsBigQueryExportsDeleteCall { + c := &OrganizationsBigQueryExportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.eventthreatdetectioncustommodule = eventthreatdetectioncustommodule - return c -} - -// UpdateMask sets the optional parameter "updateMask": The list of -// fields to be updated. If empty all mutable fields will be updated. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) UpdateMask(updateMask string) *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall { - c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall { +func (c *OrganizationsBigQueryExportsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -20092,21 +20434,21 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Fields // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall { +func (c *OrganizationsBigQueryExportsDeleteCall) Context(ctx context.Context) *OrganizationsBigQueryExportsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Header() http.Header { +func (c *OrganizationsBigQueryExportsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsBigQueryExportsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -20114,16 +20456,11 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) doRequ } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -20134,14 +20471,14 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) doRequ return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.customModules.patch" call. -// Exactly one of *EventThreatDetectionCustomModule or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, error) { +// Do executes the "securitycenter.organizations.bigQueryExports.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20160,7 +20497,7 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Do(opt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &EventThreatDetectionCustomModule{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20172,34 +20509,25 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Do(opt } return ret, nil // { - // "description": "Updates an Event Threat Detection custom module.", - // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.patch", + // "description": "Deletes an existing BigQuery export.", + // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.organizations.bigQueryExports.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Immutable. The resource name of the Event Threat Detection custom module. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", + // "description": "Required. The name of the BigQuery export to delete. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}", // "location": "path", - // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", + // "pattern": "^organizations/[^/]+/bigQueryExports/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, // "path": "v1/{+name}", - // "request": { - // "$ref": "EventThreatDetectionCustomModule" - // }, // "response": { - // "$ref": "EventThreatDetectionCustomModule" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -20208,93 +20536,100 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Do(opt } -// method id "securitycenter.organizations.findings.bulkMute": +// method id "securitycenter.organizations.bigQueryExports.get": -type OrganizationsFindingsBulkMuteCall struct { - s *Service - parent string - bulkmutefindingsrequest *BulkMuteFindingsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsBigQueryExportsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// BulkMute: Kicks off an LRO to bulk mute findings for a parent based -// on a filter. The parent can be either an organization, folder or -// project. The findings matched by the filter will be muted after the -// LRO is done. +// Get: Gets a BigQuery export. // -// - parent: The parent, at which bulk action needs to be applied. Its -// format is "organizations/[organization_id]", "folders/[folder_id]", -// "projects/[project_id]". -func (r *OrganizationsFindingsService) BulkMute(parent string, bulkmutefindingsrequest *BulkMuteFindingsRequest) *OrganizationsFindingsBulkMuteCall { - c := &OrganizationsFindingsBulkMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.bulkmutefindingsrequest = bulkmutefindingsrequest +// - name: Name of the BigQuery export to retrieve. Its format is +// organizations/{organization}/bigQueryExports/{export_id}, +// folders/{folder}/bigQueryExports/{export_id}, or +// projects/{project}/bigQueryExports/{export_id}. +func (r *OrganizationsBigQueryExportsService) Get(name string) *OrganizationsBigQueryExportsGetCall { + c := &OrganizationsBigQueryExportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsFindingsBulkMuteCall) Fields(s ...googleapi.Field) *OrganizationsFindingsBulkMuteCall { +func (c *OrganizationsBigQueryExportsGetCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsBigQueryExportsGetCall) IfNoneMatch(entityTag string) *OrganizationsBigQueryExportsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsFindingsBulkMuteCall) Context(ctx context.Context) *OrganizationsFindingsBulkMuteCall { +func (c *OrganizationsBigQueryExportsGetCall) Context(ctx context.Context) *OrganizationsBigQueryExportsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsFindingsBulkMuteCall) Header() http.Header { +func (c *OrganizationsBigQueryExportsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsFindingsBulkMuteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsBigQueryExportsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkmutefindingsrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings:bulkMute") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.findings.bulkMute" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *OrganizationsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "securitycenter.organizations.bigQueryExports.get" call. +// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20313,7 +20648,7 @@ func (c *OrganizationsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*O if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &GoogleCloudSecuritycenterV1BigQueryExport{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20325,28 +20660,25 @@ func (c *OrganizationsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*O } return ret, nil // { - // "description": "Kicks off an LRO to bulk mute findings for a parent based on a filter. The parent can be either an organization, folder or project. The findings matched by the filter will be muted after the LRO is done.", - // "flatPath": "v1/organizations/{organizationsId}/findings:bulkMute", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.findings.bulkMute", + // "description": "Gets a BigQuery export.", + // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.bigQueryExports.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The parent, at which bulk action needs to be applied. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", + // "name": { + // "description": "Required. Name of the BigQuery export to retrieve. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/bigQueryExports/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/findings:bulkMute", - // "request": { - // "$ref": "BulkMuteFindingsRequest" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "Operation" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -20355,87 +20687,120 @@ func (c *OrganizationsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*O } -// method id "securitycenter.organizations.locations.muteConfigs.delete": +// method id "securitycenter.organizations.bigQueryExports.list": -type OrganizationsLocationsMuteConfigsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsBigQueryExportsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an existing mute config. +// List: Lists BigQuery exports. Note that when requesting BigQuery +// exports at a given level all exports under that level are also +// returned e.g. if requesting BigQuery exports under a folder, then all +// BigQuery exports immediately under the folder plus the ones created +// under the projects within the folder are returned. // -// - name: Name of the mute config to delete. Its format is -// organizations/{organization}/muteConfigs/{config_id}, -// folders/{folder}/muteConfigs/{config_id}, -// projects/{project}/muteConfigs/{config_id}, -// organizations/{organization}/locations/global/muteConfigs/{config_id -// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or -// projects/{project}/locations/global/muteConfigs/{config_id}. -func (r *OrganizationsLocationsMuteConfigsService) Delete(name string) *OrganizationsLocationsMuteConfigsDeleteCall { - c := &OrganizationsLocationsMuteConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The parent, which owns the collection of BigQuery exports. +// Its format is "organizations/[organization_id]", +// "folders/[folder_id]", "projects/[project_id]". +func (r *OrganizationsBigQueryExportsService) List(parent string) *OrganizationsBigQueryExportsListCall { + c := &OrganizationsBigQueryExportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of configs to return. The service may return fewer than this value. +// If unspecified, at most 10 configs will be returned. The maximum +// value is 1000; values above 1000 will be coerced to 1000. +func (c *OrganizationsBigQueryExportsListCall) PageSize(pageSize int64) *OrganizationsBigQueryExportsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListBigQueryExports` call. Provide this to +// retrieve the subsequent page. When paginating, all other parameters +// provided to `ListBigQueryExports` must match the call that provided +// the page token. +func (c *OrganizationsBigQueryExportsListCall) PageToken(pageToken string) *OrganizationsBigQueryExportsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsMuteConfigsDeleteCall { +func (c *OrganizationsBigQueryExportsListCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsBigQueryExportsListCall) IfNoneMatch(entityTag string) *OrganizationsBigQueryExportsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsMuteConfigsDeleteCall) Context(ctx context.Context) *OrganizationsLocationsMuteConfigsDeleteCall { +func (c *OrganizationsBigQueryExportsListCall) Context(ctx context.Context) *OrganizationsBigQueryExportsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsMuteConfigsDeleteCall) Header() http.Header { +func (c *OrganizationsBigQueryExportsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsBigQueryExportsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.locations.muteConfigs.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsLocationsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "securitycenter.organizations.bigQueryExports.list" call. +// Exactly one of *ListBigQueryExportsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListBigQueryExportsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*ListBigQueryExportsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20454,7 +20819,7 @@ func (c *OrganizationsLocationsMuteConfigsDeleteCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &ListBigQueryExportsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20466,25 +20831,36 @@ func (c *OrganizationsLocationsMuteConfigsDeleteCall) Do(opts ...googleapi.CallO } return ret, nil // { - // "description": "Deletes an existing mute config.", - // "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.organizations.locations.muteConfigs.delete", + // "description": "Lists BigQuery exports. Note that when requesting BigQuery exports at a given level all exports under that level are also returned e.g. if requesting BigQuery exports under a folder, then all BigQuery exports immediately under the folder plus the ones created under the projects within the folder are returned.", + // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.bigQueryExports.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Name of the mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", + // "pageSize": { + // "description": "The maximum number of configs to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token, received from a previous `ListBigQueryExports` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListBigQueryExports` must match the call that provided the page token.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent, which owns the collection of BigQuery exports. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/bigQueryExports", // "response": { - // "$ref": "Empty" + // "$ref": "ListBigQueryExportsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -20493,83 +20869,105 @@ func (c *OrganizationsLocationsMuteConfigsDeleteCall) Do(opts ...googleapi.CallO } -// method id "securitycenter.organizations.locations.muteConfigs.get": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsBigQueryExportsListCall) Pages(ctx context.Context, f func(*ListBigQueryExportsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type OrganizationsLocationsMuteConfigsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "securitycenter.organizations.bigQueryExports.patch": + +type OrganizationsBigQueryExportsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a mute config. +// Patch: Updates a BigQuery export. // -// - name: Name of the mute config to retrieve. Its format is -// organizations/{organization}/muteConfigs/{config_id}, -// folders/{folder}/muteConfigs/{config_id}, -// projects/{project}/muteConfigs/{config_id}, -// organizations/{organization}/locations/global/muteConfigs/{config_id -// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or -// projects/{project}/locations/global/muteConfigs/{config_id}. -func (r *OrganizationsLocationsMuteConfigsService) Get(name string) *OrganizationsLocationsMuteConfigsGetCall { - c := &OrganizationsLocationsMuteConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The relative resource name of this export. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name. +// Example format: +// "organizations/{organization_id}/bigQueryExports/{export_id}" +// Example format: "folders/{folder_id}/bigQueryExports/{export_id}" +// Example format: "projects/{project_id}/bigQueryExports/{export_id}" +// This field is provided in responses, and is ignored when provided +// in create requests. +func (r *OrganizationsBigQueryExportsService) Patch(name string, googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport) *OrganizationsBigQueryExportsPatchCall { + c := &OrganizationsBigQueryExportsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googlecloudsecuritycenterv1bigqueryexport = googlecloudsecuritycenterv1bigqueryexport + return c +} + +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to be updated. If empty all mutable fields will be updated. +func (c *OrganizationsBigQueryExportsPatchCall) UpdateMask(updateMask string) *OrganizationsBigQueryExportsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsMuteConfigsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsMuteConfigsGetCall { +func (c *OrganizationsBigQueryExportsPatchCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsLocationsMuteConfigsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsMuteConfigsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsMuteConfigsGetCall) Context(ctx context.Context) *OrganizationsLocationsMuteConfigsGetCall { +func (c *OrganizationsBigQueryExportsPatchCall) Context(ctx context.Context) *OrganizationsBigQueryExportsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsMuteConfigsGetCall) Header() http.Header { +func (c *OrganizationsBigQueryExportsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsMuteConfigsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsBigQueryExportsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -20580,15 +20978,16 @@ func (c *OrganizationsLocationsMuteConfigsGetCall) doRequest(alt string) (*http. return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.locations.muteConfigs.get" call. -// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsLocationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { +// Do executes the "securitycenter.organizations.bigQueryExports.patch" call. +// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20607,7 +21006,7 @@ func (c *OrganizationsLocationsMuteConfigsGetCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &GoogleCloudSecuritycenterV1BigQueryExport{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20619,25 +21018,34 @@ func (c *OrganizationsLocationsMuteConfigsGetCall) Do(opts ...googleapi.CallOpti } return ret, nil // { - // "description": "Gets a mute config.", - // "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.locations.muteConfigs.get", + // "description": "Updates a BigQuery export.", + // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.bigQueryExports.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", + // "description": "The relative resource name of this export. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name. Example format: \"organizations/{organization_id}/bigQueryExports/{export_id}\" Example format: \"folders/{folder_id}/bigQueryExports/{export_id}\" Example format: \"projects/{project_id}/bigQueryExports/{export_id}\" This field is provided in responses, and is ignored when provided in create requests.", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^organizations/[^/]+/bigQueryExports/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v1/{+name}", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -20646,44 +21054,36 @@ func (c *OrganizationsLocationsMuteConfigsGetCall) Do(opts ...googleapi.CallOpti } -// method id "securitycenter.organizations.locations.muteConfigs.patch": +// method id "securitycenter.organizations.eventThreatDetectionSettings.validateCustomModule": -type OrganizationsLocationsMuteConfigsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall struct { + s *Service + parent string + validateeventthreatdetectioncustommodulerequest *ValidateEventThreatDetectionCustomModuleRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a mute config. +// ValidateCustomModule: Validates the given Event Threat Detection +// custom module. // -// - name: This field will be ignored if provided on config creation. -// Format "organizations/{organization}/muteConfigs/{mute_config}" -// "folders/{folder}/muteConfigs/{mute_config}" -// "projects/{project}/muteConfigs/{mute_config}" -// "organizations/{organization}/locations/global/muteConfigs/{mute_con -// fig}" "folders/{folder}/locations/global/muteConfigs/{mute_config}" -// "projects/{project}/locations/global/muteConfigs/{mute_config}". -func (r *OrganizationsLocationsMuteConfigsService) Patch(name string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *OrganizationsLocationsMuteConfigsPatchCall { - c := &OrganizationsLocationsMuteConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googlecloudsecuritycenterv1muteconfig = googlecloudsecuritycenterv1muteconfig - return c -} - -// UpdateMask sets the optional parameter "updateMask": The list of -// fields to be updated. If empty all mutable fields will be updated. -func (c *OrganizationsLocationsMuteConfigsPatchCall) UpdateMask(updateMask string) *OrganizationsLocationsMuteConfigsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// - parent: Resource name of the parent to validate the Custom Module +// under. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings". * +// "folders/{folder}/eventThreatDetectionSettings". * +// "projects/{project}/eventThreatDetectionSettings". +func (r *OrganizationsEventThreatDetectionSettingsService) ValidateCustomModule(parent string, validateeventthreatdetectioncustommodulerequest *ValidateEventThreatDetectionCustomModuleRequest) *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall { + c := &OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.validateeventthreatdetectioncustommodulerequest = validateeventthreatdetectioncustommodulerequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsMuteConfigsPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsMuteConfigsPatchCall { +func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -20691,21 +21091,21 @@ func (c *OrganizationsLocationsMuteConfigsPatchCall) Fields(s ...googleapi.Field // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsMuteConfigsPatchCall) Context(ctx context.Context) *OrganizationsLocationsMuteConfigsPatchCall { +func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsMuteConfigsPatchCall) Header() http.Header { +func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsMuteConfigsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -20713,35 +21113,36 @@ func (c *OrganizationsLocationsMuteConfigsPatchCall) doRequest(alt string) (*htt } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.validateeventthreatdetectioncustommodulerequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:validateCustomModule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.locations.muteConfigs.patch" call. -// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsLocationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { +// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.validateCustomModule" call. +// Exactly one of *ValidateEventThreatDetectionCustomModuleResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ValidateEventThreatDetectionCustomModuleResponse.ServerResponse.Heade +// r or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Do(opts ...googleapi.CallOption) (*ValidateEventThreatDetectionCustomModuleResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20760,7 +21161,7 @@ func (c *OrganizationsLocationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &ValidateEventThreatDetectionCustomModuleResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20772,34 +21173,28 @@ func (c *OrganizationsLocationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Updates a mute config.", - // "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.locations.muteConfigs.patch", + // "description": "Validates the given Event Threat Detection custom module.", + // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings:validateCustomModule", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.eventThreatDetectionSettings.validateCustomModule", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "This field will be ignored if provided on config creation. Format \"organizations/{organization}/muteConfigs/{mute_config}\" \"folders/{folder}/muteConfigs/{mute_config}\" \"projects/{project}/muteConfigs/{mute_config}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", + // "parent": { + // "description": "Required. Resource name of the parent to validate the Custom Module under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}:validateCustomModule", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "ValidateEventThreatDetectionCustomModuleRequest" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "ValidateEventThreatDetectionCustomModuleResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -20808,43 +21203,37 @@ func (c *OrganizationsLocationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOp } -// method id "securitycenter.organizations.muteConfigs.create": +// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.create": -type OrganizationsMuteConfigsCreateCall struct { - s *Service - parent string - googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall struct { + s *Service + parent string + eventthreatdetectioncustommodule *EventThreatDetectionCustomModule + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a mute config. +// Create: Creates a resident Event Threat Detection custom module at +// the scope of the given Resource Manager parent, and also creates +// inherited custom modules for all descendants of the given parent. +// These modules are enabled by default. // -// - parent: Resource name of the new mute configs's parent. Its format -// is "organizations/[organization_id]", "folders/[folder_id]", or -// "projects/[project_id]". -func (r *OrganizationsMuteConfigsService) Create(parent string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *OrganizationsMuteConfigsCreateCall { - c := &OrganizationsMuteConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The new custom module's parent. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings". * +// "folders/{folder}/eventThreatDetectionSettings". * +// "projects/{project}/eventThreatDetectionSettings". +func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) Create(parent string, eventthreatdetectioncustommodule *EventThreatDetectionCustomModule) *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall { + c := &OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.googlecloudsecuritycenterv1muteconfig = googlecloudsecuritycenterv1muteconfig - return c -} - -// MuteConfigId sets the optional parameter "muteConfigId": Required. -// Unique identifier provided by the client within the parent scope. It -// must consist of only lowercase letters, numbers, and hyphens, must -// start with a letter, must end with either a letter or a number, and -// must be 63 characters or less. -func (c *OrganizationsMuteConfigsCreateCall) MuteConfigId(muteConfigId string) *OrganizationsMuteConfigsCreateCall { - c.urlParams_.Set("muteConfigId", muteConfigId) + c.eventthreatdetectioncustommodule = eventthreatdetectioncustommodule return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsMuteConfigsCreateCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsCreateCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -20852,21 +21241,21 @@ func (c *OrganizationsMuteConfigsCreateCall) Fields(s ...googleapi.Field) *Organ // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsMuteConfigsCreateCall) Context(ctx context.Context) *OrganizationsMuteConfigsCreateCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsMuteConfigsCreateCall) Header() http.Header { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsMuteConfigsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -20874,14 +21263,14 @@ func (c *OrganizationsMuteConfigsCreateCall) doRequest(alt string) (*http.Respon } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/muteConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -20894,15 +21283,14 @@ func (c *OrganizationsMuteConfigsCreateCall) doRequest(alt string) (*http.Respon return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.muteConfigs.create" call. -// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was +// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.customModules.create" call. +// Exactly one of *EventThreatDetectionCustomModule or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20921,7 +21309,7 @@ func (c *OrganizationsMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &EventThreatDetectionCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20933,33 +21321,28 @@ func (c *OrganizationsMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Creates a mute config.", - // "flatPath": "v1/organizations/{organizationsId}/muteConfigs", + // "description": "Creates a resident Event Threat Detection custom module at the scope of the given Resource Manager parent, and also creates inherited custom modules for all descendants of the given parent. These modules are enabled by default.", + // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules", // "httpMethod": "POST", - // "id": "securitycenter.organizations.muteConfigs.create", + // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.create", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "muteConfigId": { - // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of only lowercase letters, numbers, and hyphens, must start with a letter, must end with either a letter or a number, and must be 63 characters or less.", - // "location": "query", - // "type": "string" - // }, // "parent": { - // "description": "Required. Resource name of the new mute configs's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "description": "Required. The new custom module's parent. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/muteConfigs", + // "path": "v1/{+parent}/customModules", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "EventThreatDetectionCustomModule" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "EventThreatDetectionCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -20968,9 +21351,9 @@ func (c *OrganizationsMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (* } -// method id "securitycenter.organizations.muteConfigs.delete": +// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.delete": -type OrganizationsMuteConfigsDeleteCall struct { +type OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -20978,17 +21361,19 @@ type OrganizationsMuteConfigsDeleteCall struct { header_ http.Header } -// Delete: Deletes an existing mute config. +// Delete: Deletes the specified Event Threat Detection custom module +// and all of its descendants in the Resource Manager hierarchy. This +// method is only supported for resident custom modules. // -// - name: Name of the mute config to delete. Its format is -// organizations/{organization}/muteConfigs/{config_id}, -// folders/{folder}/muteConfigs/{config_id}, -// projects/{project}/muteConfigs/{config_id}, -// organizations/{organization}/locations/global/muteConfigs/{config_id -// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or -// projects/{project}/locations/global/muteConfigs/{config_id}. -func (r *OrganizationsMuteConfigsService) Delete(name string) *OrganizationsMuteConfigsDeleteCall { - c := &OrganizationsMuteConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the custom module to delete. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings/customMod +// ules/{module}". * +// "folders/{folder}/eventThreatDetectionSettings/customModules/{module +// }". * +// "projects/{project}/eventThreatDetectionSettings/customModules/{modu +// le}". +func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) Delete(name string) *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall { + c := &OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -20996,7 +21381,7 @@ func (r *OrganizationsMuteConfigsService) Delete(name string) *OrganizationsMute // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsDeleteCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -21004,21 +21389,21 @@ func (c *OrganizationsMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *Organ // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsMuteConfigsDeleteCall) Context(ctx context.Context) *OrganizationsMuteConfigsDeleteCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsMuteConfigsDeleteCall) Header() http.Header { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -21041,14 +21426,14 @@ func (c *OrganizationsMuteConfigsDeleteCall) doRequest(alt string) (*http.Respon return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.muteConfigs.delete" call. +// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.customModules.delete" call. // Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Empty.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *OrganizationsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21079,18 +21464,18 @@ func (c *OrganizationsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Deletes an existing mute config.", - // "flatPath": "v1/organizations/{organizationsId}/muteConfigs/{muteConfigsId}", + // "description": "Deletes the specified Event Threat Detection custom module and all of its descendants in the Resource Manager hierarchy. This method is only supported for resident custom modules.", + // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", // "httpMethod": "DELETE", - // "id": "securitycenter.organizations.muteConfigs.delete", + // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", + // "description": "Required. Name of the custom module to delete. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", // "location": "path", - // "pattern": "^organizations/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", // "required": true, // "type": "string" // } @@ -21106,9 +21491,9 @@ func (c *OrganizationsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (* } -// method id "securitycenter.organizations.muteConfigs.get": +// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.get": -type OrganizationsMuteConfigsGetCall struct { +type OrganizationsEventThreatDetectionSettingsCustomModulesGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -21117,17 +21502,17 @@ type OrganizationsMuteConfigsGetCall struct { header_ http.Header } -// Get: Gets a mute config. +// Get: Gets an Event Threat Detection custom module. // -// - name: Name of the mute config to retrieve. Its format is -// organizations/{organization}/muteConfigs/{config_id}, -// folders/{folder}/muteConfigs/{config_id}, -// projects/{project}/muteConfigs/{config_id}, -// organizations/{organization}/locations/global/muteConfigs/{config_id -// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or -// projects/{project}/locations/global/muteConfigs/{config_id}. -func (r *OrganizationsMuteConfigsService) Get(name string) *OrganizationsMuteConfigsGetCall { - c := &OrganizationsMuteConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the custom module to get. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings/customMod +// ules/{module}". * +// "folders/{folder}/eventThreatDetectionSettings/customModules/{module +// }". * +// "projects/{project}/eventThreatDetectionSettings/customModules/{modu +// le}". +func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) Get(name string) *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall { + c := &OrganizationsEventThreatDetectionSettingsCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -21135,7 +21520,7 @@ func (r *OrganizationsMuteConfigsService) Get(name string) *OrganizationsMuteCon // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsMuteConfigsGetCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsGetCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -21145,7 +21530,7 @@ func (c *OrganizationsMuteConfigsGetCall) Fields(s ...googleapi.Field) *Organiza // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsMuteConfigsGetCall) IfNoneMatch(entityTag string) *OrganizationsMuteConfigsGetCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) IfNoneMatch(entityTag string) *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall { c.ifNoneMatch_ = entityTag return c } @@ -21153,21 +21538,21 @@ func (c *OrganizationsMuteConfigsGetCall) IfNoneMatch(entityTag string) *Organiz // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsMuteConfigsGetCall) Context(ctx context.Context) *OrganizationsMuteConfigsGetCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsMuteConfigsGetCall) Header() http.Header { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsMuteConfigsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -21193,15 +21578,14 @@ func (c *OrganizationsMuteConfigsGetCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.muteConfigs.get" call. -// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was +// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.customModules.get" call. +// Exactly one of *EventThreatDetectionCustomModule or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21220,7 +21604,7 @@ func (c *OrganizationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*Goo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &EventThreatDetectionCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21232,25 +21616,25 @@ func (c *OrganizationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*Goo } return ret, nil // { - // "description": "Gets a mute config.", - // "flatPath": "v1/organizations/{organizationsId}/muteConfigs/{muteConfigsId}", + // "description": "Gets an Event Threat Detection custom module.", + // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", // "httpMethod": "GET", - // "id": "securitycenter.organizations.muteConfigs.get", + // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", + // "description": "Required. Name of the custom module to get. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", // "location": "path", - // "pattern": "^organizations/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "EventThreatDetectionCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -21259,9 +21643,9 @@ func (c *OrganizationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*Goo } -// method id "securitycenter.organizations.muteConfigs.list": +// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.list": -type OrganizationsMuteConfigsListCall struct { +type OrganizationsEventThreatDetectionSettingsCustomModulesListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -21270,32 +21654,36 @@ type OrganizationsMuteConfigsListCall struct { header_ http.Header } -// List: Lists mute configs. +// List: Lists all Event Threat Detection custom modules for the given +// Resource Manager parent. This includes resident modules defined at +// the scope of the parent along with modules inherited from ancestors. // -// - parent: The parent, which owns the collection of mute configs. Its -// format is "organizations/[organization_id]", "folders/[folder_id]", -// "projects/[project_id]". -func (r *OrganizationsMuteConfigsService) List(parent string) *OrganizationsMuteConfigsListCall { - c := &OrganizationsMuteConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Name of the parent to list custom modules under. Its format +// is: * "organizations/{organization}/eventThreatDetectionSettings". +// - "folders/{folder}/eventThreatDetectionSettings". * +// "projects/{project}/eventThreatDetectionSettings". +func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) List(parent string) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { + c := &OrganizationsEventThreatDetectionSettingsCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } // PageSize sets the optional parameter "pageSize": The maximum number -// of configs to return. The service may return fewer than this value. +// of modules to return. The service may return fewer than this value. // If unspecified, at most 10 configs will be returned. The maximum // value is 1000; values above 1000 will be coerced to 1000. -func (c *OrganizationsMuteConfigsListCall) PageSize(pageSize int64) *OrganizationsMuteConfigsListCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) PageSize(pageSize int64) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": A page token, -// received from a previous `ListMuteConfigs` call. Provide this to -// retrieve the subsequent page. When paginating, all other parameters -// provided to `ListMuteConfigs` must match the call that provided the -// page token. -func (c *OrganizationsMuteConfigsListCall) PageToken(pageToken string) *OrganizationsMuteConfigsListCall { +// received from a previous `ListEventThreatDetectionCustomModules` +// call. Provide this to retrieve the subsequent page. When paginating, +// all other parameters provided to +// `ListEventThreatDetectionCustomModules` must match the call that +// provided the page token. +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) PageToken(pageToken string) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -21303,7 +21691,7 @@ func (c *OrganizationsMuteConfigsListCall) PageToken(pageToken string) *Organiza // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsMuteConfigsListCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsListCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -21313,7 +21701,7 @@ func (c *OrganizationsMuteConfigsListCall) Fields(s ...googleapi.Field) *Organiz // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsMuteConfigsListCall) IfNoneMatch(entityTag string) *OrganizationsMuteConfigsListCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) IfNoneMatch(entityTag string) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { c.ifNoneMatch_ = entityTag return c } @@ -21321,21 +21709,21 @@ func (c *OrganizationsMuteConfigsListCall) IfNoneMatch(entityTag string) *Organi // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsMuteConfigsListCall) Context(ctx context.Context) *OrganizationsMuteConfigsListCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsMuteConfigsListCall) Header() http.Header { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsMuteConfigsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -21348,7 +21736,7 @@ func (c *OrganizationsMuteConfigsListCall) doRequest(alt string) (*http.Response var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/muteConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -21361,14 +21749,16 @@ func (c *OrganizationsMuteConfigsListCall) doRequest(alt string) (*http.Response return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.muteConfigs.list" call. -// Exactly one of *ListMuteConfigsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListMuteConfigsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMuteConfigsResponse, error) { +// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.customModules.list" call. +// Exactly one of *ListEventThreatDetectionCustomModulesResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ListEventThreatDetectionCustomModulesResponse.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListEventThreatDetectionCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21387,7 +21777,7 @@ func (c *OrganizationsMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*Li if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListMuteConfigsResponse{ + ret := &ListEventThreatDetectionCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21399,36 +21789,36 @@ func (c *OrganizationsMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*Li } return ret, nil // { - // "description": "Lists mute configs.", - // "flatPath": "v1/organizations/{organizationsId}/muteConfigs", + // "description": "Lists all Event Threat Detection custom modules for the given Resource Manager parent. This includes resident modules defined at the scope of the parent along with modules inherited from ancestors.", + // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules", // "httpMethod": "GET", - // "id": "securitycenter.organizations.muteConfigs.list", + // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.list", // "parameterOrder": [ // "parent" // ], // "parameters": { // "pageSize": { - // "description": "The maximum number of configs to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "description": "The maximum number of modules to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "A page token, received from a previous `ListMuteConfigs` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListMuteConfigs` must match the call that provided the page token.", + // "description": "A page token, received from a previous `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListEventThreatDetectionCustomModules` must match the call that provided the page token.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The parent, which owns the collection of mute configs. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", + // "description": "Required. Name of the parent to list custom modules under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/muteConfigs", + // "path": "v1/{+parent}/customModules", // "response": { - // "$ref": "ListMuteConfigsResponse" + // "$ref": "ListEventThreatDetectionCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -21440,7 +21830,7 @@ func (c *OrganizationsMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*Li // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *OrganizationsMuteConfigsListCall) Pages(ctx context.Context, f func(*ListMuteConfigsResponse) error) error { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Pages(ctx context.Context, f func(*ListEventThreatDetectionCustomModulesResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -21458,102 +21848,123 @@ func (c *OrganizationsMuteConfigsListCall) Pages(ctx context.Context, f func(*Li } } -// method id "securitycenter.organizations.muteConfigs.patch": +// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.listDescendant": -type OrganizationsMuteConfigsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsEventThreatDetectionSettingsCustomModulesListDescendantCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates a mute config. +// ListDescendant: Lists all resident Event Threat Detection custom +// modules under the given Resource Manager parent and its descendants. // -// - name: This field will be ignored if provided on config creation. -// Format "organizations/{organization}/muteConfigs/{mute_config}" -// "folders/{folder}/muteConfigs/{mute_config}" -// "projects/{project}/muteConfigs/{mute_config}" -// "organizations/{organization}/locations/global/muteConfigs/{mute_con -// fig}" "folders/{folder}/locations/global/muteConfigs/{mute_config}" -// "projects/{project}/locations/global/muteConfigs/{mute_config}". -func (r *OrganizationsMuteConfigsService) Patch(name string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *OrganizationsMuteConfigsPatchCall { - c := &OrganizationsMuteConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googlecloudsecuritycenterv1muteconfig = googlecloudsecuritycenterv1muteconfig +// - parent: Name of the parent to list custom modules under. Its format +// is: * "organizations/{organization}/eventThreatDetectionSettings". +// - "folders/{folder}/eventThreatDetectionSettings". * +// "projects/{project}/eventThreatDetectionSettings". +func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) ListDescendant(parent string) *OrganizationsEventThreatDetectionSettingsCustomModulesListDescendantCall { + c := &OrganizationsEventThreatDetectionSettingsCustomModulesListDescendantCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// UpdateMask sets the optional parameter "updateMask": The list of -// fields to be updated. If empty all mutable fields will be updated. -func (c *OrganizationsMuteConfigsPatchCall) UpdateMask(updateMask string) *OrganizationsMuteConfigsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// PageSize sets the optional parameter "pageSize": The maximum number +// of modules to return. The service may return fewer than this value. +// If unspecified, at most 10 configs will be returned. The maximum +// value is 1000; values above 1000 will be coerced to 1000. +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListDescendantCall) PageSize(pageSize int64) *OrganizationsEventThreatDetectionSettingsCustomModulesListDescendantCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous +// `ListDescendantEventThreatDetectionCustomModules` call. Provide this +// to retrieve the subsequent page. When paginating, all other +// parameters provided to +// `ListDescendantEventThreatDetectionCustomModules` must match the call +// that provided the page token. +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListDescendantCall) PageToken(pageToken string) *OrganizationsEventThreatDetectionSettingsCustomModulesListDescendantCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsMuteConfigsPatchCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsPatchCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListDescendantCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesListDescendantCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListDescendantCall) IfNoneMatch(entityTag string) *OrganizationsEventThreatDetectionSettingsCustomModulesListDescendantCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsMuteConfigsPatchCall) Context(ctx context.Context) *OrganizationsMuteConfigsPatchCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListDescendantCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesListDescendantCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsMuteConfigsPatchCall) Header() http.Header { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListDescendantCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsMuteConfigsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListDescendantCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules:listDescendant") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.muteConfigs.patch" call. -// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { +// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.customModules.listDescendant" call. +// Exactly one of +// *ListDescendantEventThreatDetectionCustomModulesResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ListDescendantEventThreatDetectionCustomModulesResponse.ServerRespons +// e.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListDescendantCall) Do(opts ...googleapi.CallOption) (*ListDescendantEventThreatDetectionCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21572,7 +21983,7 @@ func (c *OrganizationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*G if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &ListDescendantEventThreatDetectionCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21584,34 +21995,36 @@ func (c *OrganizationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*G } return ret, nil // { - // "description": "Updates a mute config.", - // "flatPath": "v1/organizations/{organizationsId}/muteConfigs/{muteConfigsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.muteConfigs.patch", + // "description": "Lists all resident Event Threat Detection custom modules under the given Resource Manager parent and its descendants.", + // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules:listDescendant", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.listDescendant", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "This field will be ignored if provided on config creation. Format \"organizations/{organization}/muteConfigs/{mute_config}\" \"folders/{folder}/muteConfigs/{mute_config}\" \"projects/{project}/muteConfigs/{mute_config}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", - // "location": "path", - // "pattern": "^organizations/[^/]+/muteConfigs/[^/]+$", - // "required": true, - // "type": "string" + // "pageSize": { + // "description": "The maximum number of modules to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" // }, - // "updateMask": { - // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", + // "pageToken": { + // "description": "A page token, received from a previous `ListDescendantEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListDescendantEventThreatDetectionCustomModules` must match the call that provided the page token.", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of the parent to list custom modules under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + // "location": "path", + // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", + // "required": true, + // "type": "string" // } // }, - // "path": "v1/{+name}", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" - // }, + // "path": "v1/{+parent}/customModules:listDescendant", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "ListDescendantEventThreatDetectionCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -21620,190 +22033,71 @@ func (c *OrganizationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*G } -// method id "securitycenter.organizations.notificationConfigs.create": - -type OrganizationsNotificationConfigsCreateCall struct { - s *Service - parent string - notificationconfig *NotificationConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Create: Creates a notification config. -// -// - parent: Resource name of the new notification config's parent. Its -// format is "organizations/[organization_id]", "folders/[folder_id]", -// or "projects/[project_id]". -func (r *OrganizationsNotificationConfigsService) Create(parent string, notificationconfig *NotificationConfig) *OrganizationsNotificationConfigsCreateCall { - c := &OrganizationsNotificationConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.notificationconfig = notificationconfig - return c -} - -// ConfigId sets the optional parameter "configId": Required. Unique -// identifier provided by the client within the parent scope. It must be -// between 1 and 128 characters and contain alphanumeric characters, -// underscores, or hyphens only. -func (c *OrganizationsNotificationConfigsCreateCall) ConfigId(configId string) *OrganizationsNotificationConfigsCreateCall { - c.urlParams_.Set("configId", configId) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *OrganizationsNotificationConfigsCreateCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsCreateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *OrganizationsNotificationConfigsCreateCall) Context(ctx context.Context) *OrganizationsNotificationConfigsCreateCall { +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListDescendantCall) Pages(ctx context.Context, f func(*ListDescendantEventThreatDetectionCustomModulesResponse) error) error { c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *OrganizationsNotificationConfigsCreateCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *OrganizationsNotificationConfigsCreateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notificationConfigs") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "securitycenter.organizations.notificationConfigs.create" call. -// Exactly one of *NotificationConfig or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *NotificationConfig.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &NotificationConfig{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) } - return ret, nil - // { - // "description": "Creates a notification config.", - // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.notificationConfigs.create", - // "parameterOrder": [ - // "parent" - // ], - // "parameters": { - // "configId": { - // "description": "Required. Unique identifier provided by the client within the parent scope. It must be between 1 and 128 characters and contain alphanumeric characters, underscores, or hyphens only.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Resource name of the new notification config's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", - // "location": "path", - // "pattern": "^organizations/[^/]+$", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1/{+parent}/notificationConfigs", - // "request": { - // "$ref": "NotificationConfig" - // }, - // "response": { - // "$ref": "NotificationConfig" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform" - // ] - // } - } -// method id "securitycenter.organizations.notificationConfigs.delete": +// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.patch": -type OrganizationsNotificationConfigsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall struct { + s *Service + name string + eventthreatdetectioncustommodule *EventThreatDetectionCustomModule + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a notification config. +// Patch: Updates the Event Threat Detection custom module with the +// given name based on the given update mask. Updating the enablement +// state is supported for both resident and inherited modules (though +// resident modules cannot have an enablement state of "inherited"). +// Updating the display name or configuration of a module is supported +// for resident modules only. The type of a module cannot be changed. // -// - name: Name of the notification config to delete. Its format is -// "organizations/[organization_id]/notificationConfigs/[config_id]", -// "folders/[folder_id]/notificationConfigs/[config_id]", or -// "projects/[project_id]/notificationConfigs/[config_id]". -func (r *OrganizationsNotificationConfigsService) Delete(name string) *OrganizationsNotificationConfigsDeleteCall { - c := &OrganizationsNotificationConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Immutable. The resource name of the Event Threat Detection +// custom module. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings/customMod +// ules/{module}". * +// "folders/{folder}/eventThreatDetectionSettings/customModules/{module +// }". * +// "projects/{project}/eventThreatDetectionSettings/customModules/{modu +// le}". +func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) Patch(name string, eventthreatdetectioncustommodule *EventThreatDetectionCustomModule) *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall { + c := &OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.eventthreatdetectioncustommodule = eventthreatdetectioncustommodule + return c +} + +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to be updated. If empty all mutable fields will be updated. +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) UpdateMask(updateMask string) *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsNotificationConfigsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsDeleteCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -21811,21 +22105,21 @@ func (c *OrganizationsNotificationConfigsDeleteCall) Fields(s ...googleapi.Field // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsNotificationConfigsDeleteCall) Context(ctx context.Context) *OrganizationsNotificationConfigsDeleteCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsNotificationConfigsDeleteCall) Header() http.Header { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsNotificationConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -21833,11 +22127,16 @@ func (c *OrganizationsNotificationConfigsDeleteCall) doRequest(alt string) (*htt } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -21848,14 +22147,14 @@ func (c *OrganizationsNotificationConfigsDeleteCall) doRequest(alt string) (*htt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.notificationConfigs.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.customModules.patch" call. +// Exactly one of *EventThreatDetectionCustomModule or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21874,7 +22173,7 @@ func (c *OrganizationsNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &EventThreatDetectionCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21886,25 +22185,34 @@ func (c *OrganizationsNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Deletes a notification config.", - // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs/{notificationConfigsId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.organizations.notificationConfigs.delete", + // "description": "Updates the Event Threat Detection custom module with the given name based on the given update mask. Updating the enablement state is supported for both resident and inherited modules (though resident modules cannot have an enablement state of \"inherited\"). Updating the display name or configuration of a module is supported for resident modules only. The type of a module cannot be changed.", + // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the notification config to delete. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\", \"folders/[folder_id]/notificationConfigs/[config_id]\", or \"projects/[project_id]/notificationConfigs/[config_id]\".", + // "description": "Immutable. The resource name of the Event Threat Detection custom module. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", // "location": "path", - // "pattern": "^organizations/[^/]+/notificationConfigs/[^/]+$", + // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v1/{+name}", + // "request": { + // "$ref": "EventThreatDetectionCustomModule" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "EventThreatDetectionCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -21913,9 +22221,9 @@ func (c *OrganizationsNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOp } -// method id "securitycenter.organizations.notificationConfigs.get": +// method id "securitycenter.organizations.eventThreatDetectionSettings.effectiveCustomModules.get": -type OrganizationsNotificationConfigsGetCall struct { +type OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -21924,14 +22232,19 @@ type OrganizationsNotificationConfigsGetCall struct { header_ http.Header } -// Get: Gets a notification config. +// Get: Gets an effective Event Threat Detection custom module at the +// given level. // -// - name: Name of the notification config to get. Its format is -// "organizations/[organization_id]/notificationConfigs/[config_id]", -// "folders/[folder_id]/notificationConfigs/[config_id]", or -// "projects/[project_id]/notificationConfigs/[config_id]". -func (r *OrganizationsNotificationConfigsService) Get(name string) *OrganizationsNotificationConfigsGetCall { - c := &OrganizationsNotificationConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the effective Event Threat Detection +// custom module. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings/effective +// CustomModules/{module}". * +// "folders/{folder}/eventThreatDetectionSettings/effectiveCustomModule +// s/{module}". * +// "projects/{project}/eventThreatDetectionSettings/effectiveCustomModu +// les/{module}". +func (r *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesService) Get(name string) *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesGetCall { + c := &OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -21939,7 +22252,7 @@ func (r *OrganizationsNotificationConfigsService) Get(name string) *Organization // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsNotificationConfigsGetCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsGetCall { +func (c *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesGetCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -21949,7 +22262,7 @@ func (c *OrganizationsNotificationConfigsGetCall) Fields(s ...googleapi.Field) * // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsNotificationConfigsGetCall) IfNoneMatch(entityTag string) *OrganizationsNotificationConfigsGetCall { +func (c *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesGetCall) IfNoneMatch(entityTag string) *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesGetCall { c.ifNoneMatch_ = entityTag return c } @@ -21957,21 +22270,21 @@ func (c *OrganizationsNotificationConfigsGetCall) IfNoneMatch(entityTag string) // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsNotificationConfigsGetCall) Context(ctx context.Context) *OrganizationsNotificationConfigsGetCall { +func (c *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesGetCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsNotificationConfigsGetCall) Header() http.Header { +func (c *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsNotificationConfigsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -21997,14 +22310,16 @@ func (c *OrganizationsNotificationConfigsGetCall) doRequest(alt string) (*http.R return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.notificationConfigs.get" call. -// Exactly one of *NotificationConfig or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *NotificationConfig.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsNotificationConfigsGetCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { +// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.effectiveCustomModules.get" call. +// Exactly one of *EffectiveEventThreatDetectionCustomModule or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *EffectiveEventThreatDetectionCustomModule.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*EffectiveEventThreatDetectionCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22023,7 +22338,7 @@ func (c *OrganizationsNotificationConfigsGetCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NotificationConfig{ + ret := &EffectiveEventThreatDetectionCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22035,25 +22350,25 @@ func (c *OrganizationsNotificationConfigsGetCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Gets a notification config.", - // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs/{notificationConfigsId}", + // "description": "Gets an effective Event Threat Detection custom module at the given level.", + // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/effectiveCustomModules/{effectiveCustomModulesId}", // "httpMethod": "GET", - // "id": "securitycenter.organizations.notificationConfigs.get", + // "id": "securitycenter.organizations.eventThreatDetectionSettings.effectiveCustomModules.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the notification config to get. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\", \"folders/[folder_id]/notificationConfigs/[config_id]\", or \"projects/[project_id]/notificationConfigs/[config_id]\".", + // "description": "Required. The resource name of the effective Event Threat Detection custom module. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}\".", // "location": "path", - // "pattern": "^organizations/[^/]+/notificationConfigs/[^/]+$", + // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings/effectiveCustomModules/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "NotificationConfig" + // "$ref": "EffectiveEventThreatDetectionCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -22062,9 +22377,9 @@ func (c *OrganizationsNotificationConfigsGetCall) Do(opts ...googleapi.CallOptio } -// method id "securitycenter.organizations.notificationConfigs.list": +// method id "securitycenter.organizations.eventThreatDetectionSettings.effectiveCustomModules.list": -type OrganizationsNotificationConfigsListCall struct { +type OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -22073,30 +22388,37 @@ type OrganizationsNotificationConfigsListCall struct { header_ http.Header } -// List: Lists notification configs. +// List: Lists all effective Event Threat Detection custom modules for +// the given parent. This includes resident modules defined at the scope +// of the parent along with modules inherited from its ancestors. // -// - parent: The name of the parent in which to list the notification -// configurations. Its format is "organizations/[organization_id]", -// "folders/[folder_id]", or "projects/[project_id]". -func (r *OrganizationsNotificationConfigsService) List(parent string) *OrganizationsNotificationConfigsListCall { - c := &OrganizationsNotificationConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Name of the parent to list custom modules for. Its format +// is: * "organizations/{organization}/eventThreatDetectionSettings". +// - "folders/{folder}/eventThreatDetectionSettings". * +// "projects/{project}/eventThreatDetectionSettings". +func (r *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesService) List(parent string) *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesListCall { + c := &OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } // PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *OrganizationsNotificationConfigsListCall) PageSize(pageSize int64) *OrganizationsNotificationConfigsListCall { +// of modules to return. The service may return fewer than this value. +// If unspecified, at most 10 configs will be returned. The maximum +// value is 1000; values above 1000 will be coerced to 1000. +func (c *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesListCall) PageSize(pageSize int64) *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListNotificationConfigsResponse`; indicates that this is -// a continuation of a prior `ListNotificationConfigs` call, and that -// the system should return the next page of data. -func (c *OrganizationsNotificationConfigsListCall) PageToken(pageToken string) *OrganizationsNotificationConfigsListCall { +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous +// `ListEffectiveEventThreatDetectionCustomModules` call. Provide this +// to retrieve the subsequent page. When paginating, all other +// parameters provided to +// `ListEffectiveEventThreatDetectionCustomModules` must match the call +// that provided the page token. +func (c *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesListCall) PageToken(pageToken string) *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -22104,7 +22426,7 @@ func (c *OrganizationsNotificationConfigsListCall) PageToken(pageToken string) * // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsNotificationConfigsListCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsListCall { +func (c *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesListCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22114,7 +22436,7 @@ func (c *OrganizationsNotificationConfigsListCall) Fields(s ...googleapi.Field) // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsNotificationConfigsListCall) IfNoneMatch(entityTag string) *OrganizationsNotificationConfigsListCall { +func (c *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesListCall) IfNoneMatch(entityTag string) *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesListCall { c.ifNoneMatch_ = entityTag return c } @@ -22122,21 +22444,21 @@ func (c *OrganizationsNotificationConfigsListCall) IfNoneMatch(entityTag string) // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsNotificationConfigsListCall) Context(ctx context.Context) *OrganizationsNotificationConfigsListCall { +func (c *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesListCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsNotificationConfigsListCall) Header() http.Header { +func (c *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsNotificationConfigsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -22149,7 +22471,7 @@ func (c *OrganizationsNotificationConfigsListCall) doRequest(alt string) (*http. var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notificationConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/effectiveCustomModules") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -22162,14 +22484,17 @@ func (c *OrganizationsNotificationConfigsListCall) doRequest(alt string) (*http. return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.notificationConfigs.list" call. -// Exactly one of *ListNotificationConfigsResponse or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *ListNotificationConfigsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsNotificationConfigsListCall) Do(opts ...googleapi.CallOption) (*ListNotificationConfigsResponse, error) { +// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.effectiveCustomModules.list" call. +// Exactly one of +// *ListEffectiveEventThreatDetectionCustomModulesResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *ListEffectiveEventThreatDetectionCustomModulesResponse.ServerResponse +// .Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListEffectiveEventThreatDetectionCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22188,7 +22513,7 @@ func (c *OrganizationsNotificationConfigsListCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListNotificationConfigsResponse{ + ret := &ListEffectiveEventThreatDetectionCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22200,36 +22525,36 @@ func (c *OrganizationsNotificationConfigsListCall) Do(opts ...googleapi.CallOpti } return ret, nil // { - // "description": "Lists notification configs.", - // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs", + // "description": "Lists all effective Event Threat Detection custom modules for the given parent. This includes resident modules defined at the scope of the parent along with modules inherited from its ancestors.", + // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/effectiveCustomModules", // "httpMethod": "GET", - // "id": "securitycenter.organizations.notificationConfigs.list", + // "id": "securitycenter.organizations.eventThreatDetectionSettings.effectiveCustomModules.list", // "parameterOrder": [ // "parent" // ], // "parameters": { // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "description": "The maximum number of modules to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "The value returned by the last `ListNotificationConfigsResponse`; indicates that this is a continuation of a prior `ListNotificationConfigs` call, and that the system should return the next page of data.", + // "description": "A page token, received from a previous `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListEffectiveEventThreatDetectionCustomModules` must match the call that provided the page token.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The name of the parent in which to list the notification configurations. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "description": "Required. Name of the parent to list custom modules for. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/notificationConfigs", + // "path": "v1/{+parent}/effectiveCustomModules", // "response": { - // "$ref": "ListNotificationConfigsResponse" + // "$ref": "ListEffectiveEventThreatDetectionCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -22241,7 +22566,7 @@ func (c *OrganizationsNotificationConfigsListCall) Do(opts ...googleapi.CallOpti // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *OrganizationsNotificationConfigsListCall) Pages(ctx context.Context, f func(*ListNotificationConfigsResponse) error) error { +func (c *OrganizationsEventThreatDetectionSettingsEffectiveCustomModulesListCall) Pages(ctx context.Context, f func(*ListEffectiveEventThreatDetectionCustomModulesResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -22259,46 +22584,36 @@ func (c *OrganizationsNotificationConfigsListCall) Pages(ctx context.Context, f } } -// method id "securitycenter.organizations.notificationConfigs.patch": +// method id "securitycenter.organizations.findings.bulkMute": -type OrganizationsNotificationConfigsPatchCall struct { - s *Service - name string - notificationconfig *NotificationConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsFindingsBulkMuteCall struct { + s *Service + parent string + bulkmutefindingsrequest *BulkMuteFindingsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a notification config. The following update fields -// are allowed: description, pubsub_topic, streaming_config.filter +// BulkMute: Kicks off an LRO to bulk mute findings for a parent based +// on a filter. The parent can be either an organization, folder or +// project. The findings matched by the filter will be muted after the +// LRO is done. // -// - name: The relative resource name of this notification config. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Example: -// "organizations/{organization_id}/notificationConfigs/notify_public_b -// ucket", -// "folders/{folder_id}/notificationConfigs/notify_public_bucket", or -// "projects/{project_id}/notificationConfigs/notify_public_bucket". -func (r *OrganizationsNotificationConfigsService) Patch(name string, notificationconfig *NotificationConfig) *OrganizationsNotificationConfigsPatchCall { - c := &OrganizationsNotificationConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.notificationconfig = notificationconfig - return c -} - -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the notification config. If empty all mutable -// fields will be updated. -func (c *OrganizationsNotificationConfigsPatchCall) UpdateMask(updateMask string) *OrganizationsNotificationConfigsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// - parent: The parent, at which bulk action needs to be applied. Its +// format is "organizations/[organization_id]", "folders/[folder_id]", +// "projects/[project_id]". +func (r *OrganizationsFindingsService) BulkMute(parent string, bulkmutefindingsrequest *BulkMuteFindingsRequest) *OrganizationsFindingsBulkMuteCall { + c := &OrganizationsFindingsBulkMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.bulkmutefindingsrequest = bulkmutefindingsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsNotificationConfigsPatchCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsPatchCall { +func (c *OrganizationsFindingsBulkMuteCall) Fields(s ...googleapi.Field) *OrganizationsFindingsBulkMuteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22306,21 +22621,21 @@ func (c *OrganizationsNotificationConfigsPatchCall) Fields(s ...googleapi.Field) // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsNotificationConfigsPatchCall) Context(ctx context.Context) *OrganizationsNotificationConfigsPatchCall { +func (c *OrganizationsFindingsBulkMuteCall) Context(ctx context.Context) *OrganizationsFindingsBulkMuteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsNotificationConfigsPatchCall) Header() http.Header { +func (c *OrganizationsFindingsBulkMuteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsNotificationConfigsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsFindingsBulkMuteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -22328,34 +22643,34 @@ func (c *OrganizationsNotificationConfigsPatchCall) doRequest(alt string) (*http } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkmutefindingsrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings:bulkMute") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.notificationConfigs.patch" call. -// Exactly one of *NotificationConfig or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *NotificationConfig.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsNotificationConfigsPatchCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { +// Do executes the "securitycenter.organizations.findings.bulkMute" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OrganizationsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22374,7 +22689,7 @@ func (c *OrganizationsNotificationConfigsPatchCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NotificationConfig{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22386,34 +22701,28 @@ func (c *OrganizationsNotificationConfigsPatchCall) Do(opts ...googleapi.CallOpt } return ret, nil // { - // "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", - // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs/{notificationConfigsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.notificationConfigs.patch", + // "description": "Kicks off an LRO to bulk mute findings for a parent based on a filter. The parent can be either an organization, folder or project. The findings matched by the filter will be muted after the LRO is done.", + // "flatPath": "v1/organizations/{organizationsId}/findings:bulkMute", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.findings.bulkMute", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The relative resource name of this notification config. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/notificationConfigs/notify_public_bucket\", \"folders/{folder_id}/notificationConfigs/notify_public_bucket\", or \"projects/{project_id}/notificationConfigs/notify_public_bucket\".", + // "parent": { + // "description": "Required. The parent, at which bulk action needs to be applied. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/notificationConfigs/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the notification config. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/findings:bulkMute", // "request": { - // "$ref": "NotificationConfig" + // "$ref": "BulkMuteFindingsRequest" // }, // "response": { - // "$ref": "NotificationConfig" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -22422,9 +22731,9 @@ func (c *OrganizationsNotificationConfigsPatchCall) Do(opts ...googleapi.CallOpt } -// method id "securitycenter.organizations.operations.cancel": +// method id "securitycenter.organizations.locations.muteConfigs.delete": -type OrganizationsOperationsCancelCall struct { +type OrganizationsLocationsMuteConfigsDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -22432,20 +22741,17 @@ type OrganizationsOperationsCancelCall struct { header_ http.Header } -// Cancel: Starts asynchronous cancellation on a long-running operation. -// The server makes a best effort to cancel the operation, but success -// is not guaranteed. If the server doesn't support this method, it -// returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use -// Operations.GetOperation or other methods to check whether the -// cancellation succeeded or whether the operation completed despite -// cancellation. On successful cancellation, the operation is not -// deleted; instead, it becomes an operation with an Operation.error -// value with a google.rpc.Status.code of 1, corresponding to -// `Code.CANCELLED`. +// Delete: Deletes an existing mute config. // -// - name: The name of the operation resource to be cancelled. -func (r *OrganizationsOperationsService) Cancel(name string) *OrganizationsOperationsCancelCall { - c := &OrganizationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the mute config to delete. Its format is +// organizations/{organization}/muteConfigs/{config_id}, +// folders/{folder}/muteConfigs/{config_id}, +// projects/{project}/muteConfigs/{config_id}, +// organizations/{organization}/locations/global/muteConfigs/{config_id +// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or +// projects/{project}/locations/global/muteConfigs/{config_id}. +func (r *OrganizationsLocationsMuteConfigsService) Delete(name string) *OrganizationsLocationsMuteConfigsDeleteCall { + c := &OrganizationsLocationsMuteConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -22453,7 +22759,7 @@ func (r *OrganizationsOperationsService) Cancel(name string) *OrganizationsOpera // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsOperationsCancelCall) Fields(s ...googleapi.Field) *OrganizationsOperationsCancelCall { +func (c *OrganizationsLocationsMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsMuteConfigsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22461,21 +22767,21 @@ func (c *OrganizationsOperationsCancelCall) Fields(s ...googleapi.Field) *Organi // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsOperationsCancelCall) Context(ctx context.Context) *OrganizationsOperationsCancelCall { +func (c *OrganizationsLocationsMuteConfigsDeleteCall) Context(ctx context.Context) *OrganizationsLocationsMuteConfigsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsOperationsCancelCall) Header() http.Header { +func (c *OrganizationsLocationsMuteConfigsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -22485,9 +22791,9 @@ func (c *OrganizationsOperationsCancelCall) doRequest(alt string) (*http.Respons var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -22498,14 +22804,14 @@ func (c *OrganizationsOperationsCancelCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.operations.cancel" call. +// Do executes the "securitycenter.organizations.locations.muteConfigs.delete" call. // Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Empty.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *OrganizationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *OrganizationsLocationsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22536,153 +22842,18 @@ func (c *OrganizationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*E } return ret, nil // { - // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", - // "flatPath": "v1/organizations/{organizationsId}/operations/{operationsId}:cancel", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.operations.cancel", - // "parameterOrder": [ - // "name" - // ], - // "parameters": { - // "name": { - // "description": "The name of the operation resource to be cancelled.", - // "location": "path", - // "pattern": "^organizations/[^/]+/operations/[^/]+$", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1/{+name}:cancel", - // "response": { - // "$ref": "Empty" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform" - // ] - // } - -} - -// method id "securitycenter.organizations.operations.delete": - -type OrganizationsOperationsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Delete: Deletes a long-running operation. This method indicates that -// the client is no longer interested in the operation result. It does -// not cancel the operation. If the server doesn't support this method, -// it returns `google.rpc.Code.UNIMPLEMENTED`. -// -// - name: The name of the operation resource to be deleted. -func (r *OrganizationsOperationsService) Delete(name string) *OrganizationsOperationsDeleteCall { - c := &OrganizationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *OrganizationsOperationsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsOperationsDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *OrganizationsOperationsDeleteCall) Context(ctx context.Context) *OrganizationsOperationsDeleteCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *OrganizationsOperationsDeleteCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *OrganizationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "name": c.name, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "securitycenter.organizations.operations.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &Empty{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", - // "flatPath": "v1/organizations/{organizationsId}/operations/{operationsId}", + // "description": "Deletes an existing mute config.", + // "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", // "httpMethod": "DELETE", - // "id": "securitycenter.organizations.operations.delete", + // "id": "securitycenter.organizations.locations.muteConfigs.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The name of the operation resource to be deleted.", + // "description": "Required. Name of the mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", // "location": "path", - // "pattern": "^organizations/[^/]+/operations/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // } @@ -22698,9 +22869,9 @@ func (c *OrganizationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*E } -// method id "securitycenter.organizations.operations.get": +// method id "securitycenter.organizations.locations.muteConfigs.get": -type OrganizationsOperationsGetCall struct { +type OrganizationsLocationsMuteConfigsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -22709,13 +22880,17 @@ type OrganizationsOperationsGetCall struct { header_ http.Header } -// Get: Gets the latest state of a long-running operation. Clients can -// use this method to poll the operation result at intervals as -// recommended by the API service. +// Get: Gets a mute config. // -// - name: The name of the operation resource. -func (r *OrganizationsOperationsService) Get(name string) *OrganizationsOperationsGetCall { - c := &OrganizationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the mute config to retrieve. Its format is +// organizations/{organization}/muteConfigs/{config_id}, +// folders/{folder}/muteConfigs/{config_id}, +// projects/{project}/muteConfigs/{config_id}, +// organizations/{organization}/locations/global/muteConfigs/{config_id +// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or +// projects/{project}/locations/global/muteConfigs/{config_id}. +func (r *OrganizationsLocationsMuteConfigsService) Get(name string) *OrganizationsLocationsMuteConfigsGetCall { + c := &OrganizationsLocationsMuteConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -22723,7 +22898,7 @@ func (r *OrganizationsOperationsService) Get(name string) *OrganizationsOperatio // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsOperationsGetCall) Fields(s ...googleapi.Field) *OrganizationsOperationsGetCall { +func (c *OrganizationsLocationsMuteConfigsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsMuteConfigsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22733,7 +22908,7 @@ func (c *OrganizationsOperationsGetCall) Fields(s ...googleapi.Field) *Organizat // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsOperationsGetCall) IfNoneMatch(entityTag string) *OrganizationsOperationsGetCall { +func (c *OrganizationsLocationsMuteConfigsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsMuteConfigsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -22741,21 +22916,21 @@ func (c *OrganizationsOperationsGetCall) IfNoneMatch(entityTag string) *Organiza // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsOperationsGetCall) Context(ctx context.Context) *OrganizationsOperationsGetCall { +func (c *OrganizationsLocationsMuteConfigsGetCall) Context(ctx context.Context) *OrganizationsLocationsMuteConfigsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsOperationsGetCall) Header() http.Header { +func (c *OrganizationsLocationsMuteConfigsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsMuteConfigsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -22781,14 +22956,15 @@ func (c *OrganizationsOperationsGetCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.operations.get" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *OrganizationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "securitycenter.organizations.locations.muteConfigs.get" call. +// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsLocationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22807,7 +22983,7 @@ func (c *OrganizationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Oper if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22819,25 +22995,25 @@ func (c *OrganizationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Oper } return ret, nil // { - // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - // "flatPath": "v1/organizations/{organizationsId}/operations/{operationsId}", + // "description": "Gets a mute config.", + // "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", // "httpMethod": "GET", - // "id": "securitycenter.organizations.operations.get", + // "id": "securitycenter.organizations.locations.muteConfigs.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The name of the operation resource.", + // "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", // "location": "path", - // "pattern": "^organizations/[^/]+/operations/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "Operation" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -22846,100 +23022,83 @@ func (c *OrganizationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Oper } -// method id "securitycenter.organizations.operations.list": +// method id "securitycenter.organizations.locations.muteConfigs.patch": -type OrganizationsOperationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsMuteConfigsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// `UNIMPLEMENTED`. +// Patch: Updates a mute config. // -// - name: The name of the operation's parent resource. -func (r *OrganizationsOperationsService) List(name string) *OrganizationsOperationsListCall { - c := &OrganizationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: This field will be ignored if provided on config creation. +// Format "organizations/{organization}/muteConfigs/{mute_config}" +// "folders/{folder}/muteConfigs/{mute_config}" +// "projects/{project}/muteConfigs/{mute_config}" +// "organizations/{organization}/locations/global/muteConfigs/{mute_con +// fig}" "folders/{folder}/locations/global/muteConfigs/{mute_config}" +// "projects/{project}/locations/global/muteConfigs/{mute_config}". +func (r *OrganizationsLocationsMuteConfigsService) Patch(name string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *OrganizationsLocationsMuteConfigsPatchCall { + c := &OrganizationsLocationsMuteConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googlecloudsecuritycenterv1muteconfig = googlecloudsecuritycenterv1muteconfig return c } -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *OrganizationsOperationsListCall) Filter(filter string) *OrganizationsOperationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *OrganizationsOperationsListCall) PageSize(pageSize int64) *OrganizationsOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *OrganizationsOperationsListCall) PageToken(pageToken string) *OrganizationsOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to be updated. If empty all mutable fields will be updated. +func (c *OrganizationsLocationsMuteConfigsPatchCall) UpdateMask(updateMask string) *OrganizationsLocationsMuteConfigsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsOperationsListCall) Fields(s ...googleapi.Field) *OrganizationsOperationsListCall { +func (c *OrganizationsLocationsMuteConfigsPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsMuteConfigsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsOperationsListCall) IfNoneMatch(entityTag string) *OrganizationsOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsOperationsListCall) Context(ctx context.Context) *OrganizationsOperationsListCall { +func (c *OrganizationsLocationsMuteConfigsPatchCall) Context(ctx context.Context) *OrganizationsLocationsMuteConfigsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsOperationsListCall) Header() http.Header { +func (c *OrganizationsLocationsMuteConfigsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsMuteConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -22950,14 +23109,15 @@ func (c *OrganizationsOperationsListCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.operations.list" call. -// Exactly one of *ListOperationsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListOperationsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "securitycenter.organizations.locations.muteConfigs.patch" call. +// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { +func (c *OrganizationsLocationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22976,7 +23136,7 @@ func (c *OrganizationsOperationsListCall) Do(opts ...googleapi.CallOption) (*Lis if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListOperationsResponse{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22988,41 +23148,34 @@ func (c *OrganizationsOperationsListCall) Do(opts ...googleapi.CallOption) (*Lis } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1/organizations/{organizationsId}/operations", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.operations.list", + // "description": "Updates a mute config.", + // "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.locations.muteConfigs.patch", // "parameterOrder": [ // "name" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, // "name": { - // "description": "The name of the operation's parent resource.", + // "description": "This field will be ignored if provided on config creation. Format \"organizations/{organization}/muteConfigs/{mute_config}\" \"folders/{folder}/muteConfigs/{mute_config}\" \"projects/{project}/muteConfigs/{mute_config}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", // "location": "path", - // "pattern": "^organizations/[^/]+/operations$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // }, - // "pageSize": { - // "description": "The standard list page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The standard list page token.", + // "updateMask": { + // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", // "location": "query", // "type": "string" // } // }, // "path": "v1/{+name}", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // }, // "response": { - // "$ref": "ListOperationsResponse" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -23031,56 +23184,43 @@ func (c *OrganizationsOperationsListCall) Do(opts ...googleapi.CallOption) (*Lis } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *OrganizationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "securitycenter.organizations.resourceValueConfigs.batchCreate": +// method id "securitycenter.organizations.muteConfigs.create": -type OrganizationsResourceValueConfigsBatchCreateCall struct { - s *Service - parent string - batchcreateresourcevalueconfigsrequest *BatchCreateResourceValueConfigsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsMuteConfigsCreateCall struct { + s *Service + parent string + googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// BatchCreate: Creates a ResourceValueConfig for an organization. Maps -// user's tags to difference resource values for use by the attack path -// simulation. +// Create: Creates a mute config. // -// - parent: Resource name of the new ResourceValueConfig's parent. The -// parent field in the CreateResourceValueConfigRequest messages must -// either be empty or match this field. -func (r *OrganizationsResourceValueConfigsService) BatchCreate(parent string, batchcreateresourcevalueconfigsrequest *BatchCreateResourceValueConfigsRequest) *OrganizationsResourceValueConfigsBatchCreateCall { - c := &OrganizationsResourceValueConfigsBatchCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Resource name of the new mute configs's parent. Its format +// is "organizations/[organization_id]", "folders/[folder_id]", or +// "projects/[project_id]". +func (r *OrganizationsMuteConfigsService) Create(parent string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *OrganizationsMuteConfigsCreateCall { + c := &OrganizationsMuteConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.batchcreateresourcevalueconfigsrequest = batchcreateresourcevalueconfigsrequest + c.googlecloudsecuritycenterv1muteconfig = googlecloudsecuritycenterv1muteconfig + return c +} + +// MuteConfigId sets the optional parameter "muteConfigId": Required. +// Unique identifier provided by the client within the parent scope. It +// must consist of only lowercase letters, numbers, and hyphens, must +// start with a letter, must end with either a letter or a number, and +// must be 63 characters or less. +func (c *OrganizationsMuteConfigsCreateCall) MuteConfigId(muteConfigId string) *OrganizationsMuteConfigsCreateCall { + c.urlParams_.Set("muteConfigId", muteConfigId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsResourceValueConfigsBatchCreateCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsBatchCreateCall { +func (c *OrganizationsMuteConfigsCreateCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -23088,21 +23228,21 @@ func (c *OrganizationsResourceValueConfigsBatchCreateCall) Fields(s ...googleapi // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsResourceValueConfigsBatchCreateCall) Context(ctx context.Context) *OrganizationsResourceValueConfigsBatchCreateCall { +func (c *OrganizationsMuteConfigsCreateCall) Context(ctx context.Context) *OrganizationsMuteConfigsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsResourceValueConfigsBatchCreateCall) Header() http.Header { +func (c *OrganizationsMuteConfigsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsResourceValueConfigsBatchCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsMuteConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -23110,14 +23250,14 @@ func (c *OrganizationsResourceValueConfigsBatchCreateCall) doRequest(alt string) } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreateresourcevalueconfigsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/resourceValueConfigs:batchCreate") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/muteConfigs") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -23130,15 +23270,15 @@ func (c *OrganizationsResourceValueConfigsBatchCreateCall) doRequest(alt string) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.resourceValueConfigs.batchCreate" call. -// Exactly one of *BatchCreateResourceValueConfigsResponse or error will +// Do executes the "securitycenter.organizations.muteConfigs.create" call. +// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will // be non-nil. Any non-2xx status code is an error. Response headers are // in either -// *BatchCreateResourceValueConfigsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was +// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsResourceValueConfigsBatchCreateCall) Do(opts ...googleapi.CallOption) (*BatchCreateResourceValueConfigsResponse, error) { +func (c *OrganizationsMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23157,7 +23297,7 @@ func (c *OrganizationsResourceValueConfigsBatchCreateCall) Do(opts ...googleapi. if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &BatchCreateResourceValueConfigsResponse{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23169,28 +23309,33 @@ func (c *OrganizationsResourceValueConfigsBatchCreateCall) Do(opts ...googleapi. } return ret, nil // { - // "description": "Creates a ResourceValueConfig for an organization. Maps user's tags to difference resource values for use by the attack path simulation.", - // "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs:batchCreate", + // "description": "Creates a mute config.", + // "flatPath": "v1/organizations/{organizationsId}/muteConfigs", // "httpMethod": "POST", - // "id": "securitycenter.organizations.resourceValueConfigs.batchCreate", + // "id": "securitycenter.organizations.muteConfigs.create", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "muteConfigId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of only lowercase letters, numbers, and hyphens, must start with a letter, must end with either a letter or a number, and must be 63 characters or less.", + // "location": "query", + // "type": "string" + // }, // "parent": { - // "description": "Required. Resource name of the new ResourceValueConfig's parent. The parent field in the CreateResourceValueConfigRequest messages must either be empty or match this field.", + // "description": "Required. Resource name of the new mute configs's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/resourceValueConfigs:batchCreate", + // "path": "v1/{+parent}/muteConfigs", // "request": { - // "$ref": "BatchCreateResourceValueConfigsRequest" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "response": { - // "$ref": "BatchCreateResourceValueConfigsResponse" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -23199,9 +23344,9 @@ func (c *OrganizationsResourceValueConfigsBatchCreateCall) Do(opts ...googleapi. } -// method id "securitycenter.organizations.resourceValueConfigs.delete": +// method id "securitycenter.organizations.muteConfigs.delete": -type OrganizationsResourceValueConfigsDeleteCall struct { +type OrganizationsMuteConfigsDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -23209,11 +23354,17 @@ type OrganizationsResourceValueConfigsDeleteCall struct { header_ http.Header } -// Delete: Deletes a ResourceValueConfig. +// Delete: Deletes an existing mute config. // -// - name: Name of the ResourceValueConfig to delete. -func (r *OrganizationsResourceValueConfigsService) Delete(name string) *OrganizationsResourceValueConfigsDeleteCall { - c := &OrganizationsResourceValueConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the mute config to delete. Its format is +// organizations/{organization}/muteConfigs/{config_id}, +// folders/{folder}/muteConfigs/{config_id}, +// projects/{project}/muteConfigs/{config_id}, +// organizations/{organization}/locations/global/muteConfigs/{config_id +// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or +// projects/{project}/locations/global/muteConfigs/{config_id}. +func (r *OrganizationsMuteConfigsService) Delete(name string) *OrganizationsMuteConfigsDeleteCall { + c := &OrganizationsMuteConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -23221,7 +23372,7 @@ func (r *OrganizationsResourceValueConfigsService) Delete(name string) *Organiza // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsResourceValueConfigsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsDeleteCall { +func (c *OrganizationsMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -23229,21 +23380,21 @@ func (c *OrganizationsResourceValueConfigsDeleteCall) Fields(s ...googleapi.Fiel // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsResourceValueConfigsDeleteCall) Context(ctx context.Context) *OrganizationsResourceValueConfigsDeleteCall { +func (c *OrganizationsMuteConfigsDeleteCall) Context(ctx context.Context) *OrganizationsMuteConfigsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsResourceValueConfigsDeleteCall) Header() http.Header { +func (c *OrganizationsMuteConfigsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsResourceValueConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -23266,14 +23417,14 @@ func (c *OrganizationsResourceValueConfigsDeleteCall) doRequest(alt string) (*ht return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.resourceValueConfigs.delete" call. +// Do executes the "securitycenter.organizations.muteConfigs.delete" call. // Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Empty.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *OrganizationsResourceValueConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *OrganizationsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23304,18 +23455,18 @@ func (c *OrganizationsResourceValueConfigsDeleteCall) Do(opts ...googleapi.CallO } return ret, nil // { - // "description": "Deletes a ResourceValueConfig.", - // "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs/{resourceValueConfigsId}", + // "description": "Deletes an existing mute config.", + // "flatPath": "v1/organizations/{organizationsId}/muteConfigs/{muteConfigsId}", // "httpMethod": "DELETE", - // "id": "securitycenter.organizations.resourceValueConfigs.delete", + // "id": "securitycenter.organizations.muteConfigs.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the ResourceValueConfig to delete", + // "description": "Required. Name of the mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", // "location": "path", - // "pattern": "^organizations/[^/]+/resourceValueConfigs/[^/]+$", + // "pattern": "^organizations/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // } @@ -23331,9 +23482,9 @@ func (c *OrganizationsResourceValueConfigsDeleteCall) Do(opts ...googleapi.CallO } -// method id "securitycenter.organizations.resourceValueConfigs.get": +// method id "securitycenter.organizations.muteConfigs.get": -type OrganizationsResourceValueConfigsGetCall struct { +type OrganizationsMuteConfigsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -23342,12 +23493,17 @@ type OrganizationsResourceValueConfigsGetCall struct { header_ http.Header } -// Get: Gets a ResourceValueConfig. +// Get: Gets a mute config. // -// - name: Name of the resource value config to retrieve. Its format is -// organizations/{organization}/resourceValueConfigs/{config_id}. -func (r *OrganizationsResourceValueConfigsService) Get(name string) *OrganizationsResourceValueConfigsGetCall { - c := &OrganizationsResourceValueConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the mute config to retrieve. Its format is +// organizations/{organization}/muteConfigs/{config_id}, +// folders/{folder}/muteConfigs/{config_id}, +// projects/{project}/muteConfigs/{config_id}, +// organizations/{organization}/locations/global/muteConfigs/{config_id +// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or +// projects/{project}/locations/global/muteConfigs/{config_id}. +func (r *OrganizationsMuteConfigsService) Get(name string) *OrganizationsMuteConfigsGetCall { + c := &OrganizationsMuteConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -23355,7 +23511,7 @@ func (r *OrganizationsResourceValueConfigsService) Get(name string) *Organizatio // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsResourceValueConfigsGetCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsGetCall { +func (c *OrganizationsMuteConfigsGetCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -23365,7 +23521,7 @@ func (c *OrganizationsResourceValueConfigsGetCall) Fields(s ...googleapi.Field) // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsResourceValueConfigsGetCall) IfNoneMatch(entityTag string) *OrganizationsResourceValueConfigsGetCall { +func (c *OrganizationsMuteConfigsGetCall) IfNoneMatch(entityTag string) *OrganizationsMuteConfigsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -23373,21 +23529,21 @@ func (c *OrganizationsResourceValueConfigsGetCall) IfNoneMatch(entityTag string) // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsResourceValueConfigsGetCall) Context(ctx context.Context) *OrganizationsResourceValueConfigsGetCall { +func (c *OrganizationsMuteConfigsGetCall) Context(ctx context.Context) *OrganizationsMuteConfigsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsResourceValueConfigsGetCall) Header() http.Header { +func (c *OrganizationsMuteConfigsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsResourceValueConfigsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsMuteConfigsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -23413,16 +23569,15 @@ func (c *OrganizationsResourceValueConfigsGetCall) doRequest(alt string) (*http. return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.resourceValueConfigs.get" call. -// Exactly one of *GoogleCloudSecuritycenterV1ResourceValueConfig or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1ResourceValueConfig.ServerResponse.Header -// or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsResourceValueConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1ResourceValueConfig, error) { +// Do executes the "securitycenter.organizations.muteConfigs.get" call. +// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23441,7 +23596,7 @@ func (c *OrganizationsResourceValueConfigsGetCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1ResourceValueConfig{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23453,25 +23608,25 @@ func (c *OrganizationsResourceValueConfigsGetCall) Do(opts ...googleapi.CallOpti } return ret, nil // { - // "description": "Gets a ResourceValueConfig.", - // "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs/{resourceValueConfigsId}", + // "description": "Gets a mute config.", + // "flatPath": "v1/organizations/{organizationsId}/muteConfigs/{muteConfigsId}", // "httpMethod": "GET", - // "id": "securitycenter.organizations.resourceValueConfigs.get", + // "id": "securitycenter.organizations.muteConfigs.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the resource value config to retrieve. Its format is organizations/{organization}/resourceValueConfigs/{config_id}.", + // "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", // "location": "path", - // "pattern": "^organizations/[^/]+/resourceValueConfigs/[^/]+$", + // "pattern": "^organizations/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1ResourceValueConfig" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -23480,9 +23635,9 @@ func (c *OrganizationsResourceValueConfigsGetCall) Do(opts ...googleapi.CallOpti } -// method id "securitycenter.organizations.resourceValueConfigs.list": +// method id "securitycenter.organizations.muteConfigs.list": -type OrganizationsResourceValueConfigsListCall struct { +type OrganizationsMuteConfigsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -23491,32 +23646,32 @@ type OrganizationsResourceValueConfigsListCall struct { header_ http.Header } -// List: Lists all ResourceValueConfigs. +// List: Lists mute configs. // -// - parent: The parent, which owns the collection of resource value -// configs. Its format is "organizations/[organization_id]". -func (r *OrganizationsResourceValueConfigsService) List(parent string) *OrganizationsResourceValueConfigsListCall { - c := &OrganizationsResourceValueConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent, which owns the collection of mute configs. Its +// format is "organizations/[organization_id]", "folders/[folder_id]", +// "projects/[project_id]". +func (r *OrganizationsMuteConfigsService) List(parent string) *OrganizationsMuteConfigsListCall { + c := &OrganizationsMuteConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } -// PageSize sets the optional parameter "pageSize": The number of -// results to return. The service may return fewer than this value. If -// unspecified, at most 10 configs will be returned. The maximum value -// is 1000; values above 1000 will be coerced to 1000. -func (c *OrganizationsResourceValueConfigsListCall) PageSize(pageSize int64) *OrganizationsResourceValueConfigsListCall { +// PageSize sets the optional parameter "pageSize": The maximum number +// of configs to return. The service may return fewer than this value. +// If unspecified, at most 10 configs will be returned. The maximum +// value is 1000; values above 1000 will be coerced to 1000. +func (c *OrganizationsMuteConfigsListCall) PageSize(pageSize int64) *OrganizationsMuteConfigsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": A page token, -// received from a previous `ListResourceValueConfigs` call. Provide -// this to retrieve the subsequent page. When paginating, all other -// parameters provided to `ListResourceValueConfigs` must match the call -// that provided the page token. page_size can be specified, and the new -// page_size will be used. -func (c *OrganizationsResourceValueConfigsListCall) PageToken(pageToken string) *OrganizationsResourceValueConfigsListCall { +// received from a previous `ListMuteConfigs` call. Provide this to +// retrieve the subsequent page. When paginating, all other parameters +// provided to `ListMuteConfigs` must match the call that provided the +// page token. +func (c *OrganizationsMuteConfigsListCall) PageToken(pageToken string) *OrganizationsMuteConfigsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -23524,7 +23679,7 @@ func (c *OrganizationsResourceValueConfigsListCall) PageToken(pageToken string) // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsResourceValueConfigsListCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsListCall { +func (c *OrganizationsMuteConfigsListCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -23534,7 +23689,7 @@ func (c *OrganizationsResourceValueConfigsListCall) Fields(s ...googleapi.Field) // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsResourceValueConfigsListCall) IfNoneMatch(entityTag string) *OrganizationsResourceValueConfigsListCall { +func (c *OrganizationsMuteConfigsListCall) IfNoneMatch(entityTag string) *OrganizationsMuteConfigsListCall { c.ifNoneMatch_ = entityTag return c } @@ -23542,21 +23697,21 @@ func (c *OrganizationsResourceValueConfigsListCall) IfNoneMatch(entityTag string // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsResourceValueConfigsListCall) Context(ctx context.Context) *OrganizationsResourceValueConfigsListCall { +func (c *OrganizationsMuteConfigsListCall) Context(ctx context.Context) *OrganizationsMuteConfigsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsResourceValueConfigsListCall) Header() http.Header { +func (c *OrganizationsMuteConfigsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsResourceValueConfigsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsMuteConfigsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -23569,7 +23724,7 @@ func (c *OrganizationsResourceValueConfigsListCall) doRequest(alt string) (*http var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/resourceValueConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/muteConfigs") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -23582,14 +23737,14 @@ func (c *OrganizationsResourceValueConfigsListCall) doRequest(alt string) (*http return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.resourceValueConfigs.list" call. -// Exactly one of *ListResourceValueConfigsResponse or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *ListResourceValueConfigsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was +// Do executes the "securitycenter.organizations.muteConfigs.list" call. +// Exactly one of *ListMuteConfigsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListMuteConfigsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsResourceValueConfigsListCall) Do(opts ...googleapi.CallOption) (*ListResourceValueConfigsResponse, error) { +func (c *OrganizationsMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMuteConfigsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23608,7 +23763,7 @@ func (c *OrganizationsResourceValueConfigsListCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListResourceValueConfigsResponse{ + ret := &ListMuteConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23620,36 +23775,36 @@ func (c *OrganizationsResourceValueConfigsListCall) Do(opts ...googleapi.CallOpt } return ret, nil // { - // "description": "Lists all ResourceValueConfigs.", - // "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs", + // "description": "Lists mute configs.", + // "flatPath": "v1/organizations/{organizationsId}/muteConfigs", // "httpMethod": "GET", - // "id": "securitycenter.organizations.resourceValueConfigs.list", + // "id": "securitycenter.organizations.muteConfigs.list", // "parameterOrder": [ // "parent" // ], // "parameters": { // "pageSize": { - // "description": "The number of results to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "description": "The maximum number of configs to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "A page token, received from a previous `ListResourceValueConfigs` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListResourceValueConfigs` must match the call that provided the page token. page_size can be specified, and the new page_size will be used.", + // "description": "A page token, received from a previous `ListMuteConfigs` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListMuteConfigs` must match the call that provided the page token.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The parent, which owns the collection of resource value configs. Its format is \"organizations/[organization_id]\"", + // "description": "Required. The parent, which owns the collection of mute configs. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", // "location": "path", // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/resourceValueConfigs", + // "path": "v1/{+parent}/muteConfigs", // "response": { - // "$ref": "ListResourceValueConfigsResponse" + // "$ref": "ListMuteConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -23661,7 +23816,7 @@ func (c *OrganizationsResourceValueConfigsListCall) Do(opts ...googleapi.CallOpt // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *OrganizationsResourceValueConfigsListCall) Pages(ctx context.Context, f func(*ListResourceValueConfigsResponse) error) error { +func (c *OrganizationsMuteConfigsListCall) Pages(ctx context.Context, f func(*ListMuteConfigsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -23679,30 +23834,36 @@ func (c *OrganizationsResourceValueConfigsListCall) Pages(ctx context.Context, f } } -// method id "securitycenter.organizations.resourceValueConfigs.patch": +// method id "securitycenter.organizations.muteConfigs.patch": -type OrganizationsResourceValueConfigsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1resourcevalueconfig *GoogleCloudSecuritycenterV1ResourceValueConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsMuteConfigsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates an existing ResourceValueConfigs with new rules. +// Patch: Updates a mute config. // -// - name: Name for the resource value config. -func (r *OrganizationsResourceValueConfigsService) Patch(name string, googlecloudsecuritycenterv1resourcevalueconfig *GoogleCloudSecuritycenterV1ResourceValueConfig) *OrganizationsResourceValueConfigsPatchCall { - c := &OrganizationsResourceValueConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: This field will be ignored if provided on config creation. +// Format "organizations/{organization}/muteConfigs/{mute_config}" +// "folders/{folder}/muteConfigs/{mute_config}" +// "projects/{project}/muteConfigs/{mute_config}" +// "organizations/{organization}/locations/global/muteConfigs/{mute_con +// fig}" "folders/{folder}/locations/global/muteConfigs/{mute_config}" +// "projects/{project}/locations/global/muteConfigs/{mute_config}". +func (r *OrganizationsMuteConfigsService) Patch(name string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *OrganizationsMuteConfigsPatchCall { + c := &OrganizationsMuteConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googlecloudsecuritycenterv1resourcevalueconfig = googlecloudsecuritycenterv1resourcevalueconfig + c.googlecloudsecuritycenterv1muteconfig = googlecloudsecuritycenterv1muteconfig return c } // UpdateMask sets the optional parameter "updateMask": The list of // fields to be updated. If empty all mutable fields will be updated. -func (c *OrganizationsResourceValueConfigsPatchCall) UpdateMask(updateMask string) *OrganizationsResourceValueConfigsPatchCall { +func (c *OrganizationsMuteConfigsPatchCall) UpdateMask(updateMask string) *OrganizationsMuteConfigsPatchCall { c.urlParams_.Set("updateMask", updateMask) return c } @@ -23710,7 +23871,7 @@ func (c *OrganizationsResourceValueConfigsPatchCall) UpdateMask(updateMask strin // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsResourceValueConfigsPatchCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsPatchCall { +func (c *OrganizationsMuteConfigsPatchCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -23718,21 +23879,21 @@ func (c *OrganizationsResourceValueConfigsPatchCall) Fields(s ...googleapi.Field // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsResourceValueConfigsPatchCall) Context(ctx context.Context) *OrganizationsResourceValueConfigsPatchCall { +func (c *OrganizationsMuteConfigsPatchCall) Context(ctx context.Context) *OrganizationsMuteConfigsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsResourceValueConfigsPatchCall) Header() http.Header { +func (c *OrganizationsMuteConfigsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsResourceValueConfigsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsMuteConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -23740,7 +23901,7 @@ func (c *OrganizationsResourceValueConfigsPatchCall) doRequest(alt string) (*htt } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1resourcevalueconfig) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) if err != nil { return nil, err } @@ -23760,16 +23921,15 @@ func (c *OrganizationsResourceValueConfigsPatchCall) doRequest(alt string) (*htt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.resourceValueConfigs.patch" call. -// Exactly one of *GoogleCloudSecuritycenterV1ResourceValueConfig or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1ResourceValueConfig.ServerResponse.Header -// or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsResourceValueConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1ResourceValueConfig, error) { +// Do executes the "securitycenter.organizations.muteConfigs.patch" call. +// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23788,7 +23948,7 @@ func (c *OrganizationsResourceValueConfigsPatchCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1ResourceValueConfig{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23800,18 +23960,18 @@ func (c *OrganizationsResourceValueConfigsPatchCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Updates an existing ResourceValueConfigs with new rules.", - // "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs/{resourceValueConfigsId}", + // "description": "Updates a mute config.", + // "flatPath": "v1/organizations/{organizationsId}/muteConfigs/{muteConfigsId}", // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.resourceValueConfigs.patch", + // "id": "securitycenter.organizations.muteConfigs.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Name for the resource value config", + // "description": "This field will be ignored if provided on config creation. Format \"organizations/{organization}/muteConfigs/{mute_config}\" \"folders/{folder}/muteConfigs/{mute_config}\" \"projects/{project}/muteConfigs/{mute_config}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", // "location": "path", - // "pattern": "^organizations/[^/]+/resourceValueConfigs/[^/]+$", + // "pattern": "^organizations/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // }, @@ -23824,10 +23984,10 @@ func (c *OrganizationsResourceValueConfigsPatchCall) Do(opts ...googleapi.CallOp // }, // "path": "v1/{+name}", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1ResourceValueConfig" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1ResourceValueConfig" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -23836,37 +23996,42 @@ func (c *OrganizationsResourceValueConfigsPatchCall) Do(opts ...googleapi.CallOp } -// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.create": +// method id "securitycenter.organizations.notificationConfigs.create": -type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall struct { - s *Service - parent string - googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsNotificationConfigsCreateCall struct { + s *Service + parent string + notificationconfig *NotificationConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a resident SecurityHealthAnalyticsCustomModule at the -// scope of the given CRM parent, and also creates inherited -// SecurityHealthAnalyticsCustomModules for all CRM descendants of the -// given parent. These modules are enabled by default. +// Create: Creates a notification config. // -// - parent: Resource name of the new custom module's parent. Its format -// is "organizations/{organization}/securityHealthAnalyticsSettings", -// "folders/{folder}/securityHealthAnalyticsSettings", or -// "projects/{project}/securityHealthAnalyticsSettings". -func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Create(parent string, googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall { - c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Resource name of the new notification config's parent. Its +// format is "organizations/[organization_id]", "folders/[folder_id]", +// or "projects/[project_id]". +func (r *OrganizationsNotificationConfigsService) Create(parent string, notificationconfig *NotificationConfig) *OrganizationsNotificationConfigsCreateCall { + c := &OrganizationsNotificationConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule = googlecloudsecuritycenterv1securityhealthanalyticscustommodule + c.notificationconfig = notificationconfig + return c +} + +// ConfigId sets the optional parameter "configId": Required. Unique +// identifier provided by the client within the parent scope. It must be +// between 1 and 128 characters and contain alphanumeric characters, +// underscores, or hyphens only. +func (c *OrganizationsNotificationConfigsCreateCall) ConfigId(configId string) *OrganizationsNotificationConfigsCreateCall { + c.urlParams_.Set("configId", configId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall { +func (c *OrganizationsNotificationConfigsCreateCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -23874,21 +24039,21 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Fi // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall { +func (c *OrganizationsNotificationConfigsCreateCall) Context(ctx context.Context) *OrganizationsNotificationConfigsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Header() http.Header { +func (c *OrganizationsNotificationConfigsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsNotificationConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -23896,14 +24061,14 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) do } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notificationConfigs") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -23916,17 +24081,14 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) do return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.create" call. -// Exactly one of -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server -// Response.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { +// Do executes the "securitycenter.organizations.notificationConfigs.create" call. +// Exactly one of *NotificationConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *NotificationConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23945,7 +24107,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23957,28 +24119,33 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do } return ret, nil // { - // "description": "Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the given CRM parent, and also creates inherited SecurityHealthAnalyticsCustomModules for all CRM descendants of the given parent. These modules are enabled by default.", - // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules", + // "description": "Creates a notification config.", + // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs", // "httpMethod": "POST", - // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.create", + // "id": "securitycenter.organizations.notificationConfigs.create", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "configId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must be between 1 and 128 characters and contain alphanumeric characters, underscores, or hyphens only.", + // "location": "query", + // "type": "string" + // }, // "parent": { - // "description": "Required. Resource name of the new custom module's parent. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", + // "description": "Required. Resource name of the new notification config's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules", + // "path": "v1/{+parent}/notificationConfigs", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // "$ref": "NotificationConfig" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -23987,9 +24154,9 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do } -// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.delete": +// method id "securitycenter.organizations.notificationConfigs.delete": -type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall struct { +type OrganizationsNotificationConfigsDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -23997,19 +24164,14 @@ type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall struct header_ http.Header } -// Delete: Deletes the specified SecurityHealthAnalyticsCustomModule and -// all of its descendants in the CRM hierarchy. This method is only -// supported for resident custom modules. +// Delete: Deletes a notification config. // -// - name: Name of the custom module to delete. Its format is -// "organizations/{organization}/securityHealthAnalyticsSettings/custom -// Modules/{customModule}", -// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus -// tomModule}", or -// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c -// ustomModule}". -func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Delete(name string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { - c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the notification config to delete. Its format is +// "organizations/[organization_id]/notificationConfigs/[config_id]", +// "folders/[folder_id]/notificationConfigs/[config_id]", or +// "projects/[project_id]/notificationConfigs/[config_id]". +func (r *OrganizationsNotificationConfigsService) Delete(name string) *OrganizationsNotificationConfigsDeleteCall { + c := &OrganizationsNotificationConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -24017,7 +24179,7 @@ func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Delet // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { +func (c *OrganizationsNotificationConfigsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -24025,21 +24187,21 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Fi // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { +func (c *OrganizationsNotificationConfigsDeleteCall) Context(ctx context.Context) *OrganizationsNotificationConfigsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Header() http.Header { +func (c *OrganizationsNotificationConfigsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsNotificationConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -24062,14 +24224,14 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) do return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.delete" call. +// Do executes the "securitycenter.organizations.notificationConfigs.delete" call. // Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Empty.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *OrganizationsNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24100,18 +24262,18 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do } return ret, nil // { - // "description": "Deletes the specified SecurityHealthAnalyticsCustomModule and all of its descendants in the CRM hierarchy. This method is only supported for resident custom modules.", - // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", + // "description": "Deletes a notification config.", + // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs/{notificationConfigsId}", // "httpMethod": "DELETE", - // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.delete", + // "id": "securitycenter.organizations.notificationConfigs.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the custom module to delete. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", + // "description": "Required. Name of the notification config to delete. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\", \"folders/[folder_id]/notificationConfigs/[config_id]\", or \"projects/[project_id]/notificationConfigs/[config_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", + // "pattern": "^organizations/[^/]+/notificationConfigs/[^/]+$", // "required": true, // "type": "string" // } @@ -24127,9 +24289,9 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do } -// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.get": +// method id "securitycenter.organizations.notificationConfigs.get": -type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall struct { +type OrganizationsNotificationConfigsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -24138,17 +24300,14 @@ type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall struct { header_ http.Header } -// Get: Retrieves a SecurityHealthAnalyticsCustomModule. +// Get: Gets a notification config. // -// - name: Name of the custom module to get. Its format is -// "organizations/{organization}/securityHealthAnalyticsSettings/custom -// Modules/{customModule}", -// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus -// tomModule}", or -// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c -// ustomModule}". -func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Get(name string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall { - c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the notification config to get. Its format is +// "organizations/[organization_id]/notificationConfigs/[config_id]", +// "folders/[folder_id]/notificationConfigs/[config_id]", or +// "projects/[project_id]/notificationConfigs/[config_id]". +func (r *OrganizationsNotificationConfigsService) Get(name string) *OrganizationsNotificationConfigsGetCall { + c := &OrganizationsNotificationConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -24156,7 +24315,7 @@ func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Get(n // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall { +func (c *OrganizationsNotificationConfigsGetCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -24166,7 +24325,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Field // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall { +func (c *OrganizationsNotificationConfigsGetCall) IfNoneMatch(entityTag string) *OrganizationsNotificationConfigsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -24174,21 +24333,21 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) IfNon // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall { +func (c *OrganizationsNotificationConfigsGetCall) Context(ctx context.Context) *OrganizationsNotificationConfigsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Header() http.Header { +func (c *OrganizationsNotificationConfigsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsNotificationConfigsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -24214,17 +24373,14 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) doReq return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.get" call. -// Exactly one of -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server -// Response.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { +// Do executes the "securitycenter.organizations.notificationConfigs.get" call. +// Exactly one of *NotificationConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *NotificationConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsNotificationConfigsGetCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24243,7 +24399,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(op if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24255,25 +24411,25 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(op } return ret, nil // { - // "description": "Retrieves a SecurityHealthAnalyticsCustomModule.", - // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", + // "description": "Gets a notification config.", + // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs/{notificationConfigsId}", // "httpMethod": "GET", - // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.get", + // "id": "securitycenter.organizations.notificationConfigs.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the custom module to get. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", + // "description": "Required. Name of the notification config to get. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\", \"folders/[folder_id]/notificationConfigs/[config_id]\", or \"projects/[project_id]/notificationConfigs/[config_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", + // "pattern": "^organizations/[^/]+/notificationConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -24282,9 +24438,9 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(op } -// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.list": +// method id "securitycenter.organizations.notificationConfigs.list": -type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall struct { +type OrganizationsNotificationConfigsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -24293,16 +24449,13 @@ type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall struct { header_ http.Header } -// List: Returns a list of all SecurityHealthAnalyticsCustomModules for -// the given parent. This includes resident modules defined at the scope -// of the parent, and inherited modules, inherited from CRM ancestors. +// List: Lists notification configs. // -// - parent: Name of parent to list custom modules. Its format is -// "organizations/{organization}/securityHealthAnalyticsSettings", -// "folders/{folder}/securityHealthAnalyticsSettings", or -// "projects/{project}/securityHealthAnalyticsSettings". -func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) List(parent string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { - c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The name of the parent in which to list the notification +// configurations. Its format is "organizations/[organization_id]", +// "folders/[folder_id]", or "projects/[project_id]". +func (r *OrganizationsNotificationConfigsService) List(parent string) *OrganizationsNotificationConfigsListCall { + c := &OrganizationsNotificationConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } @@ -24310,14 +24463,16 @@ func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) List( // PageSize sets the optional parameter "pageSize": The maximum number // of results to return in a single response. Default is 10, minimum is // 1, maximum is 1000. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) PageSize(pageSize int64) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { +func (c *OrganizationsNotificationConfigsListCall) PageSize(pageSize int64) *OrganizationsNotificationConfigsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": The value returned -// by the last call indicating a continuation -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) PageToken(pageToken string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { +// by the last `ListNotificationConfigsResponse`; indicates that this is +// a continuation of a prior `ListNotificationConfigs` call, and that +// the system should return the next page of data. +func (c *OrganizationsNotificationConfigsListCall) PageToken(pageToken string) *OrganizationsNotificationConfigsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -24325,7 +24480,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Page // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { +func (c *OrganizationsNotificationConfigsListCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -24335,7 +24490,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Fiel // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { +func (c *OrganizationsNotificationConfigsListCall) IfNoneMatch(entityTag string) *OrganizationsNotificationConfigsListCall { c.ifNoneMatch_ = entityTag return c } @@ -24343,21 +24498,21 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) IfNo // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { +func (c *OrganizationsNotificationConfigsListCall) Context(ctx context.Context) *OrganizationsNotificationConfigsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Header() http.Header { +func (c *OrganizationsNotificationConfigsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsNotificationConfigsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -24370,7 +24525,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) doRe var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notificationConfigs") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -24383,16 +24538,14 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) doRe return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.list" call. -// Exactly one of *ListSecurityHealthAnalyticsCustomModulesResponse or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *ListSecurityHealthAnalyticsCustomModulesResponse.ServerResponse.Heade -// r or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListSecurityHealthAnalyticsCustomModulesResponse, error) { +// Do executes the "securitycenter.organizations.notificationConfigs.list" call. +// Exactly one of *ListNotificationConfigsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListNotificationConfigsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsNotificationConfigsListCall) Do(opts ...googleapi.CallOption) (*ListNotificationConfigsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24411,7 +24564,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(o if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListSecurityHealthAnalyticsCustomModulesResponse{ + ret := &ListNotificationConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24423,10 +24576,10 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(o } return ret, nil // { - // "description": "Returns a list of all SecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", - // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules", + // "description": "Lists notification configs.", + // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs", // "httpMethod": "GET", - // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.list", + // "id": "securitycenter.organizations.notificationConfigs.list", // "parameterOrder": [ // "parent" // ], @@ -24438,21 +24591,21 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(o // "type": "integer" // }, // "pageToken": { - // "description": "The value returned by the last call indicating a continuation", + // "description": "The value returned by the last `ListNotificationConfigsResponse`; indicates that this is a continuation of a prior `ListNotificationConfigs` call, and that the system should return the next page of data.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. Name of parent to list custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", + // "description": "Required. The name of the parent in which to list the notification configurations. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules", + // "path": "v1/{+parent}/notificationConfigs", // "response": { - // "$ref": "ListSecurityHealthAnalyticsCustomModulesResponse" + // "$ref": "ListNotificationConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -24464,7 +24617,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(o // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Pages(ctx context.Context, f func(*ListSecurityHealthAnalyticsCustomModulesResponse) error) error { +func (c *OrganizationsNotificationConfigsListCall) Pages(ctx context.Context, f func(*ListNotificationConfigsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -24482,119 +24635,103 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Page } } -// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.listDescendant": +// method id "securitycenter.organizations.notificationConfigs.patch": -type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsNotificationConfigsPatchCall struct { + s *Service + name string + notificationconfig *NotificationConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// ListDescendant: Returns a list of all resident -// SecurityHealthAnalyticsCustomModules under the given CRM parent and -// all of the parent’s CRM descendants. +// Patch: Updates a notification config. The following update fields +// are allowed: description, pubsub_topic, streaming_config.filter // -// - parent: Name of parent to list descendant custom modules. Its -// format is -// "organizations/{organization}/securityHealthAnalyticsSettings", -// "folders/{folder}/securityHealthAnalyticsSettings", or -// "projects/{project}/securityHealthAnalyticsSettings". -func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) ListDescendant(parent string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { - c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) PageSize(pageSize int64) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) +// - name: The relative resource name of this notification config. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// Example: +// "organizations/{organization_id}/notificationConfigs/notify_public_b +// ucket", +// "folders/{folder_id}/notificationConfigs/notify_public_bucket", or +// "projects/{project_id}/notificationConfigs/notify_public_bucket". +func (r *OrganizationsNotificationConfigsService) Patch(name string, notificationconfig *NotificationConfig) *OrganizationsNotificationConfigsPatchCall { + c := &OrganizationsNotificationConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.notificationconfig = notificationconfig return c } -// PageToken sets the optional parameter "pageToken": The value returned -// by the last call indicating a continuation -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) PageToken(pageToken string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { - c.urlParams_.Set("pageToken", pageToken) +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the notification config. If empty all mutable +// fields will be updated. +func (c *OrganizationsNotificationConfigsPatchCall) UpdateMask(updateMask string) *OrganizationsNotificationConfigsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { +func (c *OrganizationsNotificationConfigsPatchCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { +func (c *OrganizationsNotificationConfigsPatchCall) Context(ctx context.Context) *OrganizationsNotificationConfigsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Header() http.Header { +func (c *OrganizationsNotificationConfigsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsNotificationConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules:listDescendant") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.listDescendant" call. -// Exactly one of -// *ListDescendantSecurityHealthAnalyticsCustomModulesResponse or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *ListDescendantSecurityHealthAnalyticsCustomModulesResponse.ServerResp -// onse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Do(opts ...googleapi.CallOption) (*ListDescendantSecurityHealthAnalyticsCustomModulesResponse, error) { +// Do executes the "securitycenter.organizations.notificationConfigs.patch" call. +// Exactly one of *NotificationConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *NotificationConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsNotificationConfigsPatchCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24613,7 +24750,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendant if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListDescendantSecurityHealthAnalyticsCustomModulesResponse{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24625,36 +24762,34 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendant } return ret, nil // { - // "description": "Returns a list of all resident SecurityHealthAnalyticsCustomModules under the given CRM parent and all of the parent’s CRM descendants.", - // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules:listDescendant", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.listDescendant", + // "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", + // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs/{notificationConfigsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.notificationConfigs.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last call indicating a continuation", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Name of parent to list descendant custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", + // "name": { + // "description": "The relative resource name of this notification config. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/notificationConfigs/notify_public_bucket\", \"folders/{folder_id}/notificationConfigs/notify_public_bucket\", or \"projects/{project_id}/notificationConfigs/notify_public_bucket\".", // "location": "path", - // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", + // "pattern": "^organizations/[^/]+/notificationConfigs/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the notification config. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules:listDescendant", + // "path": "v1/{+name}", + // "request": { + // "$ref": "NotificationConfig" + // }, // "response": { - // "$ref": "ListDescendantSecurityHealthAnalyticsCustomModulesResponse" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -24663,72 +24798,38 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendant } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Pages(ctx context.Context, f func(*ListDescendantSecurityHealthAnalyticsCustomModulesResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.patch": +// method id "securitycenter.organizations.operations.cancel": -type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsOperationsCancelCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates the SecurityHealthAnalyticsCustomModule under the -// given name based on the given update mask. Updating the enablement -// state is supported on both resident and inherited modules (though -// resident modules cannot have an enablement state of "inherited"). -// Updating the display name and custom config of a module is supported -// on resident modules only. +// Cancel: Starts asynchronous cancellation on a long-running operation. +// The server makes a best effort to cancel the operation, but success +// is not guaranteed. If the server doesn't support this method, it +// returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use +// Operations.GetOperation or other methods to check whether the +// cancellation succeeded or whether the operation completed despite +// cancellation. On successful cancellation, the operation is not +// deleted; instead, it becomes an operation with an Operation.error +// value with a google.rpc.Status.code of 1, corresponding to +// `Code.CANCELLED`. // -// - name: Immutable. The resource name of the custom module. Its format -// is -// "organizations/{organization}/securityHealthAnalyticsSettings/custom -// Modules/{customModule}", or -// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus -// tomModule}", or -// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c -// ustomModule}" The id {customModule} is server-generated and is not -// user settable. It will be a numeric id containing 1-20 digits. -func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Patch(name string, googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall { - c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource to be cancelled. +func (r *OrganizationsOperationsService) Cancel(name string) *OrganizationsOperationsCancelCall { + c := &OrganizationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule = googlecloudsecuritycenterv1securityhealthanalyticscustommodule - return c -} - -// UpdateMask sets the optional parameter "updateMask": The list of -// fields to update. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) UpdateMask(updateMask string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall { - c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall { +func (c *OrganizationsOperationsCancelCall) Fields(s ...googleapi.Field) *OrganizationsOperationsCancelCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -24736,21 +24837,21 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Fie // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall { +func (c *OrganizationsOperationsCancelCall) Context(ctx context.Context) *OrganizationsOperationsCancelCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Header() http.Header { +func (c *OrganizationsOperationsCancelCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -24758,16 +24859,11 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) doR } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -24778,17 +24874,14 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) doR return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.patch" call. -// Exactly one of -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server -// Response.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { +// Do executes the "securitycenter.organizations.operations.cancel" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24807,7 +24900,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24819,34 +24912,25 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do( } return ret, nil // { - // "description": "Updates the SecurityHealthAnalyticsCustomModule under the given name based on the given update mask. Updating the enablement state is supported on both resident and inherited modules (though resident modules cannot have an enablement state of \"inherited\"). Updating the display name and custom config of a module is supported on resident modules only.", - // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.patch", + // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", + // "flatPath": "v1/organizations/{organizationsId}/operations/{operationsId}:cancel", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.operations.cancel", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Immutable. The resource name of the custom module. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\" The id {customModule} is server-generated and is not user settable. It will be a numeric id containing 1-20 digits.", + // "description": "The name of the operation resource to be cancelled.", // "location": "path", - // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", + // "pattern": "^organizations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "The list of fields to update.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1/{+name}", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" - // }, + // "path": "v1/{+name}:cancel", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -24855,36 +24939,32 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do( } -// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.simulate": +// method id "securitycenter.organizations.operations.delete": -type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall struct { - s *Service - parent string - simulatesecurityhealthanalyticscustommodulerequest *SimulateSecurityHealthAnalyticsCustomModuleRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsOperationsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Simulate: Simulates a given SecurityHealthAnalyticsCustomModule and -// Resource. +// Delete: Deletes a long-running operation. This method indicates that +// the client is no longer interested in the operation result. It does +// not cancel the operation. If the server doesn't support this method, +// it returns `google.rpc.Code.UNIMPLEMENTED`. // -// - parent: The relative resource name of the organization, project, or -// folder. For more information about relative resource names, see -// Relative Resource Name -// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) -// Example: `organizations/{organization_id}`. -func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Simulate(parent string, simulatesecurityhealthanalyticscustommodulerequest *SimulateSecurityHealthAnalyticsCustomModuleRequest) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { - c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.simulatesecurityhealthanalyticscustommodulerequest = simulatesecurityhealthanalyticscustommodulerequest +// - name: The name of the operation resource to be deleted. +func (r *OrganizationsOperationsService) Delete(name string) *OrganizationsOperationsDeleteCall { + c := &OrganizationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { +func (c *OrganizationsOperationsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsOperationsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -24892,21 +24972,21 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { +func (c *OrganizationsOperationsDeleteCall) Context(ctx context.Context) *OrganizationsOperationsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Header() http.Header { +func (c *OrganizationsOperationsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -24914,36 +24994,29 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.simulatesecurityhealthanalyticscustommodulerequest) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules:simulate") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.simulate" call. -// Exactly one of *SimulateSecurityHealthAnalyticsCustomModuleResponse -// or error will be non-nil. Any non-2xx status code is an error. -// Response headers are in either -// *SimulateSecurityHealthAnalyticsCustomModuleResponse.ServerResponse.He -// ader or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Do(opts ...googleapi.CallOption) (*SimulateSecurityHealthAnalyticsCustomModuleResponse, error) { +// Do executes the "securitycenter.organizations.operations.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24962,7 +25035,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &SimulateSecurityHealthAnalyticsCustomModuleResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24974,28 +25047,25 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) } return ret, nil // { - // "description": "Simulates a given SecurityHealthAnalyticsCustomModule and Resource.", - // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules:simulate", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.simulate", + // "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", + // "flatPath": "v1/organizations/{organizationsId}/operations/{operationsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.organizations.operations.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The relative resource name of the organization, project, or folder. For more information about relative resource names, see [Relative Resource Name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) Example: `organizations/{organization_id}`", + // "name": { + // "description": "The name of the operation resource to be deleted.", // "location": "path", - // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", + // "pattern": "^organizations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules:simulate", - // "request": { - // "$ref": "SimulateSecurityHealthAnalyticsCustomModuleRequest" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "SimulateSecurityHealthAnalyticsCustomModuleResponse" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -25004,9 +25074,9 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) } -// method id "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.get": +// method id "securitycenter.organizations.operations.get": -type OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall struct { +type OrganizationsOperationsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -25015,17 +25085,13 @@ type OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall s header_ http.Header } -// Get: Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. +// Get: Gets the latest state of a long-running operation. Clients can +// use this method to poll the operation result at intervals as +// recommended by the API service. // -// - name: Name of the effective custom module to get. Its format is -// "organizations/{organization}/securityHealthAnalyticsSettings/effect -// iveCustomModules/{customModule}", -// "folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomMod -// ules/{customModule}", or -// "projects/{project}/securityHealthAnalyticsSettings/effectiveCustomM -// odules/{customModule}". -func (r *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesService) Get(name string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { - c := &OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource. +func (r *OrganizationsOperationsService) Get(name string) *OrganizationsOperationsGetCall { + c := &OrganizationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -25033,7 +25099,7 @@ func (r *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesServi // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { +func (c *OrganizationsOperationsGetCall) Fields(s ...googleapi.Field) *OrganizationsOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -25043,7 +25109,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCa // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { +func (c *OrganizationsOperationsGetCall) IfNoneMatch(entityTag string) *OrganizationsOperationsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -25051,21 +25117,21 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCa // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { +func (c *OrganizationsOperationsGetCall) Context(ctx context.Context) *OrganizationsOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Header() http.Header { +func (c *OrganizationsOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -25091,17 +25157,14 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCa return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.get" call. -// Exactly one of -// *GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModu -// le or error will be non-nil. Any non-2xx status code is an error. -// Response headers are in either -// *GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModu -// le.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule, error) { +// Do executes the "securitycenter.organizations.operations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OrganizationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -25120,7 +25183,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCa if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -25132,25 +25195,25 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCa } return ret, nil // { - // "description": "Retrieves an EffectiveSecurityHealthAnalyticsCustomModule.", - // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/effectiveCustomModules/{effectiveCustomModulesId}", + // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + // "flatPath": "v1/organizations/{organizationsId}/operations/{operationsId}", // "httpMethod": "GET", - // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.get", + // "id": "securitycenter.organizations.operations.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the effective custom module to get. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\"", + // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/effectiveCustomModules/[^/]+$", + // "pattern": "^organizations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -25159,43 +25222,45 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCa } -// method id "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.list": +// method id "securitycenter.organizations.operations.list": -type OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall struct { +type OrganizationsOperationsListCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Returns a list of all -// EffectiveSecurityHealthAnalyticsCustomModules for the given parent. -// This includes resident modules defined at the scope of the parent, -// and inherited modules, inherited from CRM ancestors. +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. // -// - parent: Name of parent to list effective custom modules. Its format -// is "organizations/{organization}/securityHealthAnalyticsSettings", -// "folders/{folder}/securityHealthAnalyticsSettings", or -// "projects/{project}/securityHealthAnalyticsSettings". -func (r *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesService) List(parent string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { - c := &OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - name: The name of the operation's parent resource. +func (r *OrganizationsOperationsService) List(name string) *OrganizationsOperationsListCall { + c := &OrganizationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) PageSize(pageSize int64) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *OrganizationsOperationsListCall) Filter(filter string) *OrganizationsOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *OrganizationsOperationsListCall) PageSize(pageSize int64) *OrganizationsOperationsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": The value returned -// by the last call indicating a continuation -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) PageToken(pageToken string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *OrganizationsOperationsListCall) PageToken(pageToken string) *OrganizationsOperationsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -25203,7 +25268,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { +func (c *OrganizationsOperationsListCall) Fields(s ...googleapi.Field) *OrganizationsOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -25213,7 +25278,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { +func (c *OrganizationsOperationsListCall) IfNoneMatch(entityTag string) *OrganizationsOperationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -25221,21 +25286,21 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { +func (c *OrganizationsOperationsListCall) Context(ctx context.Context) *OrganizationsOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Header() http.Header { +func (c *OrganizationsOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -25248,7 +25313,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/effectiveCustomModules") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -25256,22 +25321,19 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.list" call. -// Exactly one of -// *ListEffectiveSecurityHealthAnalyticsCustomModulesResponse or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.ServerRespo -// nse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListEffectiveSecurityHealthAnalyticsCustomModulesResponse, error) { +// Do executes the "securitycenter.organizations.operations.list" call. +// Exactly one of *ListOperationsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListOperationsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -25290,7 +25352,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListEffectiveSecurityHealthAnalyticsCustomModulesResponse{ + ret := &ListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -25302,36 +25364,41 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC } return ret, nil // { - // "description": "Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", - // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/effectiveCustomModules", + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + // "flatPath": "v1/organizations/{organizationsId}/operations", // "httpMethod": "GET", - // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.list", + // "id": "securitycenter.organizations.operations.list", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation's parent resource.", + // "location": "path", + // "pattern": "^organizations/[^/]+/operations$", + // "required": true, + // "type": "string" + // }, // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "description": "The standard list page size.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "The value returned by the last call indicating a continuation", + // "description": "The standard list page token.", // "location": "query", // "type": "string" - // }, - // "parent": { - // "description": "Required. Name of parent to list effective custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", - // "location": "path", - // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", - // "required": true, - // "type": "string" // } // }, - // "path": "v1/{+parent}/effectiveCustomModules", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListEffectiveSecurityHealthAnalyticsCustomModulesResponse" + // "$ref": "ListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -25343,7 +25410,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Pages(ctx context.Context, f func(*ListEffectiveSecurityHealthAnalyticsCustomModulesResponse) error) error { +func (c *OrganizationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -25361,98 +25428,93 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC } } -// method id "securitycenter.organizations.simulations.get": +// method id "securitycenter.organizations.resourceValueConfigs.batchCreate": -type OrganizationsSimulationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsResourceValueConfigsBatchCreateCall struct { + s *Service + parent string + batchcreateresourcevalueconfigsrequest *BatchCreateResourceValueConfigsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Get the simulation by name or the latest simulation for the -// given organization. +// BatchCreate: Creates a ResourceValueConfig for an organization. Maps +// user's tags to difference resource values for use by the attack path +// simulation. // -// - name: The organization name or simulation name of this simulation -// Valid format: "organizations/{organization}/simulations/latest" -// "organizations/{organization}/simulations/{simulation}". -func (r *OrganizationsSimulationsService) Get(name string) *OrganizationsSimulationsGetCall { - c := &OrganizationsSimulationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Resource name of the new ResourceValueConfig's parent. The +// parent field in the CreateResourceValueConfigRequest messages must +// either be empty or match this field. +func (r *OrganizationsResourceValueConfigsService) BatchCreate(parent string, batchcreateresourcevalueconfigsrequest *BatchCreateResourceValueConfigsRequest) *OrganizationsResourceValueConfigsBatchCreateCall { + c := &OrganizationsResourceValueConfigsBatchCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.batchcreateresourcevalueconfigsrequest = batchcreateresourcevalueconfigsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSimulationsGetCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsGetCall { +func (c *OrganizationsResourceValueConfigsBatchCreateCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsBatchCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsSimulationsGetCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSimulationsGetCall) Context(ctx context.Context) *OrganizationsSimulationsGetCall { +func (c *OrganizationsResourceValueConfigsBatchCreateCall) Context(ctx context.Context) *OrganizationsResourceValueConfigsBatchCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSimulationsGetCall) Header() http.Header { +func (c *OrganizationsResourceValueConfigsBatchCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSimulationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsResourceValueConfigsBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreateresourcevalueconfigsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/resourceValueConfigs:batchCreate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.simulations.get" call. -// Exactly one of *Simulation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Simulation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *OrganizationsSimulationsGetCall) Do(opts ...googleapi.CallOption) (*Simulation, error) { +// Do executes the "securitycenter.organizations.resourceValueConfigs.batchCreate" call. +// Exactly one of *BatchCreateResourceValueConfigsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *BatchCreateResourceValueConfigsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsResourceValueConfigsBatchCreateCall) Do(opts ...googleapi.CallOption) (*BatchCreateResourceValueConfigsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -25471,7 +25533,7 @@ func (c *OrganizationsSimulationsGetCall) Do(opts ...googleapi.CallOption) (*Sim if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Simulation{ + ret := &BatchCreateResourceValueConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -25483,25 +25545,28 @@ func (c *OrganizationsSimulationsGetCall) Do(opts ...googleapi.CallOption) (*Sim } return ret, nil // { - // "description": "Get the simulation by name or the latest simulation for the given organization.", - // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.simulations.get", + // "description": "Creates a ResourceValueConfig for an organization. Maps user's tags to difference resource values for use by the attack path simulation.", + // "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs:batchCreate", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.resourceValueConfigs.batchCreate", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The organization name or simulation name of this simulation Valid format: \"organizations/{organization}/simulations/latest\" \"organizations/{organization}/simulations/{simulation}\"", + // "parent": { + // "description": "Required. Resource name of the new ResourceValueConfig's parent. The parent field in the CreateResourceValueConfigRequest messages must either be empty or match this field.", // "location": "path", - // "pattern": "^organizations/[^/]+/simulations/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/resourceValueConfigs:batchCreate", + // "request": { + // "$ref": "BatchCreateResourceValueConfigsRequest" + // }, // "response": { - // "$ref": "Simulation" + // "$ref": "BatchCreateResourceValueConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -25510,127 +25575,81 @@ func (c *OrganizationsSimulationsGetCall) Do(opts ...googleapi.CallOption) (*Sim } -// method id "securitycenter.organizations.simulations.attackExposureResults.attackPaths.list": +// method id "securitycenter.organizations.resourceValueConfigs.delete": -type OrganizationsSimulationsAttackExposureResultsAttackPathsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsResourceValueConfigsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists the attack paths for a set of simulation results or -// valued resources and filter. +// Delete: Deletes a ResourceValueConfig. // -// - parent: Name of parent to list attack paths. Valid formats: -// "organizations/{organization}", -// "organizations/{organization}/simulations/{simulation}" -// "organizations/{organization}/simulations/{simulation}/attackExposur -// eResults/{attack_exposure_result_v2}" -// "organizations/{organization}/simulations/{simulation}/valuedResourc -// es/{valued_resource}". -func (r *OrganizationsSimulationsAttackExposureResultsAttackPathsService) List(parent string) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { - c := &OrganizationsSimulationsAttackExposureResultsAttackPathsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// Filter sets the optional parameter "filter": The filter expression -// that filters the attack path in the response. Supported fields: * -// `valued_resources` supports = -func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Filter(filter string) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) PageSize(pageSize int64) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListAttackPathsResponse`; indicates that this is a -// continuation of a prior `ListAttackPaths` call, and that the system -// should return the next page of data. -func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) PageToken(pageToken string) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: Name of the ResourceValueConfig to delete. +func (r *OrganizationsResourceValueConfigsService) Delete(name string) *OrganizationsResourceValueConfigsDeleteCall { + c := &OrganizationsResourceValueConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { +func (c *OrganizationsResourceValueConfigsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Context(ctx context.Context) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { +func (c *OrganizationsResourceValueConfigsDeleteCall) Context(ctx context.Context) *OrganizationsResourceValueConfigsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Header() http.Header { +func (c *OrganizationsResourceValueConfigsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsResourceValueConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attackPaths") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.simulations.attackExposureResults.attackPaths.list" call. -// Exactly one of *ListAttackPathsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListAttackPathsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Do(opts ...googleapi.CallOption) (*ListAttackPathsResponse, error) { +// Do executes the "securitycenter.organizations.resourceValueConfigs.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsResourceValueConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -25649,7 +25668,7 @@ func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Do(op if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListAttackPathsResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -25661,41 +25680,25 @@ func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Do(op } return ret, nil // { - // "description": "Lists the attack paths for a set of simulation results or valued resources and filter.", - // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/attackExposureResults/{attackExposureResultsId}/attackPaths", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.simulations.attackExposureResults.attackPaths.list", + // "description": "Deletes a ResourceValueConfig.", + // "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs/{resourceValueConfigsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.organizations.resourceValueConfigs.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "filter": { - // "description": "The filter expression that filters the attack path in the response. Supported fields: * `valued_resources` supports =", - // "location": "query", - // "type": "string" - // }, - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last `ListAttackPathsResponse`; indicates that this is a continuation of a prior `ListAttackPaths` call, and that the system should return the next page of data.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Name of parent to list attack paths. Valid formats: \"organizations/{organization}\", \"organizations/{organization}/simulations/{simulation}\" \"organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}\" \"organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}\"", + // "name": { + // "description": "Required. Name of the ResourceValueConfig to delete", // "location": "path", - // "pattern": "^organizations/[^/]+/simulations/[^/]+/attackExposureResults/[^/]+$", + // "pattern": "^organizations/[^/]+/resourceValueConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/attackPaths", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListAttackPathsResponse" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -25704,82 +25707,32 @@ func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Do(op } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Pages(ctx context.Context, f func(*ListAttackPathsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "securitycenter.organizations.simulations.attackExposureResults.valuedResources.list": +// method id "securitycenter.organizations.resourceValueConfigs.get": -type OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall struct { +type OrganizationsResourceValueConfigsGetCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists the valued resources for a set of simulation results and -// filter. +// Get: Gets a ResourceValueConfig. // -// - parent: Name of parent to list valued resources. Valid formats: -// "organizations/{organization}", -// "organizations/{organization}/simulations/{simulation}" -// "organizations/{organization}/simulations/{simulation}/attackExposur -// eResults/{attack_exposure_result_v2}". -func (r *OrganizationsSimulationsAttackExposureResultsValuedResourcesService) List(parent string) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { - c := &OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// Filter sets the optional parameter "filter": The filter expression -// that filters the valued resources in the response. Supported fields: -// * `resource_value` supports = * `resource_type` supports = -func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Filter(filter string) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { - c.urlParams_.Set("filter", filter) +// - name: Name of the resource value config to retrieve. Its format is +// organizations/{organization}/resourceValueConfigs/{config_id}. +func (r *OrganizationsResourceValueConfigsService) Get(name string) *OrganizationsResourceValueConfigsGetCall { + c := &OrganizationsResourceValueConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) PageSize(pageSize int64) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListValuedResourcesResponse`; indicates that this is a -// continuation of a prior `ListValuedResources` call, and that the -// system should return the next page of data. -func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) PageToken(pageToken string) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsResourceValueConfigsGetCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -25788,7 +25741,7 @@ func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) F // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { +func (c *OrganizationsResourceValueConfigsGetCall) IfNoneMatch(entityTag string) *OrganizationsResourceValueConfigsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -25796,21 +25749,21 @@ func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) I // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Context(ctx context.Context) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { +func (c *OrganizationsResourceValueConfigsGetCall) Context(ctx context.Context) *OrganizationsResourceValueConfigsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Header() http.Header { +func (c *OrganizationsResourceValueConfigsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsResourceValueConfigsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -25823,7 +25776,7 @@ func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) d var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/valuedResources") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -25831,19 +25784,21 @@ func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) d } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.simulations.attackExposureResults.valuedResources.list" call. -// Exactly one of *ListValuedResourcesResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *ListValuedResourcesResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Do(opts ...googleapi.CallOption) (*ListValuedResourcesResponse, error) { +// Do executes the "securitycenter.organizations.resourceValueConfigs.get" call. +// Exactly one of *GoogleCloudSecuritycenterV1ResourceValueConfig or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1ResourceValueConfig.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsResourceValueConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1ResourceValueConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -25862,7 +25817,7 @@ func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) D if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListValuedResourcesResponse{ + ret := &GoogleCloudSecuritycenterV1ResourceValueConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -25874,41 +25829,25 @@ func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) D } return ret, nil // { - // "description": "Lists the valued resources for a set of simulation results and filter.", - // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/attackExposureResults/{attackExposureResultsId}/valuedResources", + // "description": "Gets a ResourceValueConfig.", + // "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs/{resourceValueConfigsId}", // "httpMethod": "GET", - // "id": "securitycenter.organizations.simulations.attackExposureResults.valuedResources.list", + // "id": "securitycenter.organizations.resourceValueConfigs.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "filter": { - // "description": "The filter expression that filters the valued resources in the response. Supported fields: * `resource_value` supports = * `resource_type` supports =", - // "location": "query", - // "type": "string" - // }, - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last `ListValuedResourcesResponse`; indicates that this is a continuation of a prior `ListValuedResources` call, and that the system should return the next page of data.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Name of parent to list valued resources. Valid formats: \"organizations/{organization}\", \"organizations/{organization}/simulations/{simulation}\" \"organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}\"", + // "name": { + // "description": "Required. Name of the resource value config to retrieve. Its format is organizations/{organization}/resourceValueConfigs/{config_id}.", // "location": "path", - // "pattern": "^organizations/[^/]+/simulations/[^/]+/attackExposureResults/[^/]+$", + // "pattern": "^organizations/[^/]+/resourceValueConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/valuedResources", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListValuedResourcesResponse" + // "$ref": "GoogleCloudSecuritycenterV1ResourceValueConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -25917,30 +25856,9 @@ func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) D } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Pages(ctx context.Context, f func(*ListValuedResourcesResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "securitycenter.organizations.simulations.attackPaths.list": +// method id "securitycenter.organizations.resourceValueConfigs.list": -type OrganizationsSimulationsAttackPathsListCall struct { +type OrganizationsResourceValueConfigsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -25949,43 +25867,32 @@ type OrganizationsSimulationsAttackPathsListCall struct { header_ http.Header } -// List: Lists the attack paths for a set of simulation results or -// valued resources and filter. +// List: Lists all ResourceValueConfigs. // -// - parent: Name of parent to list attack paths. Valid formats: -// "organizations/{organization}", -// "organizations/{organization}/simulations/{simulation}" -// "organizations/{organization}/simulations/{simulation}/attackExposur -// eResults/{attack_exposure_result_v2}" -// "organizations/{organization}/simulations/{simulation}/valuedResourc -// es/{valued_resource}". -func (r *OrganizationsSimulationsAttackPathsService) List(parent string) *OrganizationsSimulationsAttackPathsListCall { - c := &OrganizationsSimulationsAttackPathsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent, which owns the collection of resource value +// configs. Its format is "organizations/[organization_id]". +func (r *OrganizationsResourceValueConfigsService) List(parent string) *OrganizationsResourceValueConfigsListCall { + c := &OrganizationsResourceValueConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } -// Filter sets the optional parameter "filter": The filter expression -// that filters the attack path in the response. Supported fields: * -// `valued_resources` supports = -func (c *OrganizationsSimulationsAttackPathsListCall) Filter(filter string) *OrganizationsSimulationsAttackPathsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *OrganizationsSimulationsAttackPathsListCall) PageSize(pageSize int64) *OrganizationsSimulationsAttackPathsListCall { +// PageSize sets the optional parameter "pageSize": The number of +// results to return. The service may return fewer than this value. If +// unspecified, at most 10 configs will be returned. The maximum value +// is 1000; values above 1000 will be coerced to 1000. +func (c *OrganizationsResourceValueConfigsListCall) PageSize(pageSize int64) *OrganizationsResourceValueConfigsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListAttackPathsResponse`; indicates that this is a -// continuation of a prior `ListAttackPaths` call, and that the system -// should return the next page of data. -func (c *OrganizationsSimulationsAttackPathsListCall) PageToken(pageToken string) *OrganizationsSimulationsAttackPathsListCall { +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListResourceValueConfigs` call. Provide +// this to retrieve the subsequent page. When paginating, all other +// parameters provided to `ListResourceValueConfigs` must match the call +// that provided the page token. page_size can be specified, and the new +// page_size will be used. +func (c *OrganizationsResourceValueConfigsListCall) PageToken(pageToken string) *OrganizationsResourceValueConfigsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -25993,7 +25900,7 @@ func (c *OrganizationsSimulationsAttackPathsListCall) PageToken(pageToken string // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSimulationsAttackPathsListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsAttackPathsListCall { +func (c *OrganizationsResourceValueConfigsListCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -26003,7 +25910,7 @@ func (c *OrganizationsSimulationsAttackPathsListCall) Fields(s ...googleapi.Fiel // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsSimulationsAttackPathsListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsAttackPathsListCall { +func (c *OrganizationsResourceValueConfigsListCall) IfNoneMatch(entityTag string) *OrganizationsResourceValueConfigsListCall { c.ifNoneMatch_ = entityTag return c } @@ -26011,21 +25918,21 @@ func (c *OrganizationsSimulationsAttackPathsListCall) IfNoneMatch(entityTag stri // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSimulationsAttackPathsListCall) Context(ctx context.Context) *OrganizationsSimulationsAttackPathsListCall { +func (c *OrganizationsResourceValueConfigsListCall) Context(ctx context.Context) *OrganizationsResourceValueConfigsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSimulationsAttackPathsListCall) Header() http.Header { +func (c *OrganizationsResourceValueConfigsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSimulationsAttackPathsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsResourceValueConfigsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -26038,7 +25945,7 @@ func (c *OrganizationsSimulationsAttackPathsListCall) doRequest(alt string) (*ht var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attackPaths") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/resourceValueConfigs") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -26051,14 +25958,14 @@ func (c *OrganizationsSimulationsAttackPathsListCall) doRequest(alt string) (*ht return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.simulations.attackPaths.list" call. -// Exactly one of *ListAttackPathsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListAttackPathsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was +// Do executes the "securitycenter.organizations.resourceValueConfigs.list" call. +// Exactly one of *ListResourceValueConfigsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListResourceValueConfigsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsSimulationsAttackPathsListCall) Do(opts ...googleapi.CallOption) (*ListAttackPathsResponse, error) { +func (c *OrganizationsResourceValueConfigsListCall) Do(opts ...googleapi.CallOption) (*ListResourceValueConfigsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26077,7 +25984,7 @@ func (c *OrganizationsSimulationsAttackPathsListCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListAttackPathsResponse{ + ret := &ListResourceValueConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -26089,41 +25996,36 @@ func (c *OrganizationsSimulationsAttackPathsListCall) Do(opts ...googleapi.CallO } return ret, nil // { - // "description": "Lists the attack paths for a set of simulation results or valued resources and filter.", - // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/attackPaths", + // "description": "Lists all ResourceValueConfigs.", + // "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs", // "httpMethod": "GET", - // "id": "securitycenter.organizations.simulations.attackPaths.list", + // "id": "securitycenter.organizations.resourceValueConfigs.list", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "filter": { - // "description": "The filter expression that filters the attack path in the response. Supported fields: * `valued_resources` supports =", - // "location": "query", - // "type": "string" - // }, // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "description": "The number of results to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "The value returned by the last `ListAttackPathsResponse`; indicates that this is a continuation of a prior `ListAttackPaths` call, and that the system should return the next page of data.", + // "description": "A page token, received from a previous `ListResourceValueConfigs` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListResourceValueConfigs` must match the call that provided the page token. page_size can be specified, and the new page_size will be used.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. Name of parent to list attack paths. Valid formats: \"organizations/{organization}\", \"organizations/{organization}/simulations/{simulation}\" \"organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}\" \"organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}\"", + // "description": "Required. The parent, which owns the collection of resource value configs. Its format is \"organizations/[organization_id]\"", // "location": "path", - // "pattern": "^organizations/[^/]+/simulations/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/attackPaths", + // "path": "v1/{+parent}/resourceValueConfigs", // "response": { - // "$ref": "ListAttackPathsResponse" + // "$ref": "ListResourceValueConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -26135,7 +26037,7 @@ func (c *OrganizationsSimulationsAttackPathsListCall) Do(opts ...googleapi.CallO // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *OrganizationsSimulationsAttackPathsListCall) Pages(ctx context.Context, f func(*ListAttackPathsResponse) error) error { +func (c *OrganizationsResourceValueConfigsListCall) Pages(ctx context.Context, f func(*ListResourceValueConfigsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -26153,79 +26055,77 @@ func (c *OrganizationsSimulationsAttackPathsListCall) Pages(ctx context.Context, } } -// method id "securitycenter.organizations.simulations.valuedResources.get": +// method id "securitycenter.organizations.resourceValueConfigs.patch": -type OrganizationsSimulationsValuedResourcesGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsResourceValueConfigsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1resourcevalueconfig *GoogleCloudSecuritycenterV1ResourceValueConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Get the valued resource by name +// Patch: Updates an existing ResourceValueConfigs with new rules. // -// - name: The name of this valued resource Valid format: -// "organizations/{organization}/simulations/{simulation}/valuedResourc -// es/{valued_resource}". -func (r *OrganizationsSimulationsValuedResourcesService) Get(name string) *OrganizationsSimulationsValuedResourcesGetCall { - c := &OrganizationsSimulationsValuedResourcesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name for the resource value config. +func (r *OrganizationsResourceValueConfigsService) Patch(name string, googlecloudsecuritycenterv1resourcevalueconfig *GoogleCloudSecuritycenterV1ResourceValueConfig) *OrganizationsResourceValueConfigsPatchCall { + c := &OrganizationsResourceValueConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googlecloudsecuritycenterv1resourcevalueconfig = googlecloudsecuritycenterv1resourcevalueconfig + return c +} + +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to be updated. If empty all mutable fields will be updated. +func (c *OrganizationsResourceValueConfigsPatchCall) UpdateMask(updateMask string) *OrganizationsResourceValueConfigsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSimulationsValuedResourcesGetCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsValuedResourcesGetCall { +func (c *OrganizationsResourceValueConfigsPatchCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsSimulationsValuedResourcesGetCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsValuedResourcesGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSimulationsValuedResourcesGetCall) Context(ctx context.Context) *OrganizationsSimulationsValuedResourcesGetCall { +func (c *OrganizationsResourceValueConfigsPatchCall) Context(ctx context.Context) *OrganizationsResourceValueConfigsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSimulationsValuedResourcesGetCall) Header() http.Header { +func (c *OrganizationsResourceValueConfigsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSimulationsValuedResourcesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsResourceValueConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1resourcevalueconfig) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -26236,14 +26136,16 @@ func (c *OrganizationsSimulationsValuedResourcesGetCall) doRequest(alt string) ( return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.simulations.valuedResources.get" call. -// Exactly one of *ValuedResource or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *ValuedResource.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsSimulationsValuedResourcesGetCall) Do(opts ...googleapi.CallOption) (*ValuedResource, error) { +// Do executes the "securitycenter.organizations.resourceValueConfigs.patch" call. +// Exactly one of *GoogleCloudSecuritycenterV1ResourceValueConfig or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1ResourceValueConfig.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsResourceValueConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1ResourceValueConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26262,7 +26164,7 @@ func (c *OrganizationsSimulationsValuedResourcesGetCall) Do(opts ...googleapi.Ca if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ValuedResource{ + ret := &GoogleCloudSecuritycenterV1ResourceValueConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -26274,25 +26176,34 @@ func (c *OrganizationsSimulationsValuedResourcesGetCall) Do(opts ...googleapi.Ca } return ret, nil // { - // "description": "Get the valued resource by name", - // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/valuedResources/{valuedResourcesId}", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.simulations.valuedResources.get", + // "description": "Updates an existing ResourceValueConfigs with new rules.", + // "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs/{resourceValueConfigsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.resourceValueConfigs.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The name of this valued resource Valid format: \"organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}\"", + // "description": "Name for the resource value config", // "location": "path", - // "pattern": "^organizations/[^/]+/simulations/[^/]+/valuedResources/[^/]+$", + // "pattern": "^organizations/[^/]+/resourceValueConfigs/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v1/{+name}", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1ResourceValueConfig" + // }, // "response": { - // "$ref": "ValuedResource" + // "$ref": "GoogleCloudSecuritycenterV1ResourceValueConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -26301,107 +26212,76 @@ func (c *OrganizationsSimulationsValuedResourcesGetCall) Do(opts ...googleapi.Ca } -// method id "securitycenter.organizations.simulations.valuedResources.list": +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.create": -type OrganizationsSimulationsValuedResourcesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall struct { + s *Service + parent string + googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists the valued resources for a set of simulation results and -// filter. +// Create: Creates a resident SecurityHealthAnalyticsCustomModule at the +// scope of the given CRM parent, and also creates inherited +// SecurityHealthAnalyticsCustomModules for all CRM descendants of the +// given parent. These modules are enabled by default. // -// - parent: Name of parent to list valued resources. Valid formats: -// "organizations/{organization}", -// "organizations/{organization}/simulations/{simulation}" -// "organizations/{organization}/simulations/{simulation}/attackExposur -// eResults/{attack_exposure_result_v2}". -func (r *OrganizationsSimulationsValuedResourcesService) List(parent string) *OrganizationsSimulationsValuedResourcesListCall { - c := &OrganizationsSimulationsValuedResourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Resource name of the new custom module's parent. Its format +// is "organizations/{organization}/securityHealthAnalyticsSettings", +// "folders/{folder}/securityHealthAnalyticsSettings", or +// "projects/{project}/securityHealthAnalyticsSettings". +func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Create(parent string, googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall { + c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - return c -} - -// Filter sets the optional parameter "filter": The filter expression -// that filters the valued resources in the response. Supported fields: -// * `resource_value` supports = * `resource_type` supports = -func (c *OrganizationsSimulationsValuedResourcesListCall) Filter(filter string) *OrganizationsSimulationsValuedResourcesListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *OrganizationsSimulationsValuedResourcesListCall) PageSize(pageSize int64) *OrganizationsSimulationsValuedResourcesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListValuedResourcesResponse`; indicates that this is a -// continuation of a prior `ListValuedResources` call, and that the -// system should return the next page of data. -func (c *OrganizationsSimulationsValuedResourcesListCall) PageToken(pageToken string) *OrganizationsSimulationsValuedResourcesListCall { - c.urlParams_.Set("pageToken", pageToken) + c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule = googlecloudsecuritycenterv1securityhealthanalyticscustommodule return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSimulationsValuedResourcesListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsValuedResourcesListCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsSimulationsValuedResourcesListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsValuedResourcesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSimulationsValuedResourcesListCall) Context(ctx context.Context) *OrganizationsSimulationsValuedResourcesListCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSimulationsValuedResourcesListCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSimulationsValuedResourcesListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/valuedResources") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -26412,14 +26292,17 @@ func (c *OrganizationsSimulationsValuedResourcesListCall) doRequest(alt string) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.simulations.valuedResources.list" call. -// Exactly one of *ListValuedResourcesResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *ListValuedResourcesResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsSimulationsValuedResourcesListCall) Do(opts ...googleapi.CallOption) (*ListValuedResourcesResponse, error) { +// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.create" call. +// Exactly one of +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server +// Response.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26438,7 +26321,7 @@ func (c *OrganizationsSimulationsValuedResourcesListCall) Do(opts ...googleapi.C if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListValuedResourcesResponse{ + ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -26450,41 +26333,28 @@ func (c *OrganizationsSimulationsValuedResourcesListCall) Do(opts ...googleapi.C } return ret, nil // { - // "description": "Lists the valued resources for a set of simulation results and filter.", - // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/valuedResources", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.simulations.valuedResources.list", + // "description": "Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the given CRM parent, and also creates inherited SecurityHealthAnalyticsCustomModules for all CRM descendants of the given parent. These modules are enabled by default.", + // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.create", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "filter": { - // "description": "The filter expression that filters the valued resources in the response. Supported fields: * `resource_value` supports = * `resource_type` supports =", - // "location": "query", - // "type": "string" - // }, - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last `ListValuedResourcesResponse`; indicates that this is a continuation of a prior `ListValuedResources` call, and that the system should return the next page of data.", - // "location": "query", - // "type": "string" - // }, // "parent": { - // "description": "Required. Name of parent to list valued resources. Valid formats: \"organizations/{organization}\", \"organizations/{organization}/simulations/{simulation}\" \"organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}\"", + // "description": "Required. Resource name of the new custom module's parent. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", // "location": "path", - // "pattern": "^organizations/[^/]+/simulations/[^/]+$", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/valuedResources", + // "path": "v1/{+parent}/customModules", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // }, // "response": { - // "$ref": "ListValuedResourcesResponse" + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -26493,148 +26363,89 @@ func (c *OrganizationsSimulationsValuedResourcesListCall) Do(opts ...googleapi.C } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *OrganizationsSimulationsValuedResourcesListCall) Pages(ctx context.Context, f func(*ListValuedResourcesResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "securitycenter.organizations.simulations.valuedResources.attackPaths.list": +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.delete": -type OrganizationsSimulationsValuedResourcesAttackPathsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists the attack paths for a set of simulation results or -// valued resources and filter. +// Delete: Deletes the specified SecurityHealthAnalyticsCustomModule and +// all of its descendants in the CRM hierarchy. This method is only +// supported for resident custom modules. // -// - parent: Name of parent to list attack paths. Valid formats: -// "organizations/{organization}", -// "organizations/{organization}/simulations/{simulation}" -// "organizations/{organization}/simulations/{simulation}/attackExposur -// eResults/{attack_exposure_result_v2}" -// "organizations/{organization}/simulations/{simulation}/valuedResourc -// es/{valued_resource}". -func (r *OrganizationsSimulationsValuedResourcesAttackPathsService) List(parent string) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { - c := &OrganizationsSimulationsValuedResourcesAttackPathsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// Filter sets the optional parameter "filter": The filter expression -// that filters the attack path in the response. Supported fields: * -// `valued_resources` supports = -func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Filter(filter string) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) PageSize(pageSize int64) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListAttackPathsResponse`; indicates that this is a -// continuation of a prior `ListAttackPaths` call, and that the system -// should return the next page of data. -func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) PageToken(pageToken string) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: Name of the custom module to delete. Its format is +// "organizations/{organization}/securityHealthAnalyticsSettings/custom +// Modules/{customModule}", +// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus +// tomModule}", or +// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c +// ustomModule}". +func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Delete(name string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { + c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Context(ctx context.Context) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attackPaths") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.simulations.valuedResources.attackPaths.list" call. -// Exactly one of *ListAttackPathsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListAttackPathsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Do(opts ...googleapi.CallOption) (*ListAttackPathsResponse, error) { +// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26653,7 +26464,7 @@ func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Do(opts ... if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListAttackPathsResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -26665,41 +26476,25 @@ func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Do(opts ... } return ret, nil // { - // "description": "Lists the attack paths for a set of simulation results or valued resources and filter.", - // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/valuedResources/{valuedResourcesId}/attackPaths", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.simulations.valuedResources.attackPaths.list", + // "description": "Deletes the specified SecurityHealthAnalyticsCustomModule and all of its descendants in the CRM hierarchy. This method is only supported for resident custom modules.", + // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "filter": { - // "description": "The filter expression that filters the attack path in the response. Supported fields: * `valued_resources` supports =", - // "location": "query", - // "type": "string" - // }, - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last `ListAttackPathsResponse`; indicates that this is a continuation of a prior `ListAttackPaths` call, and that the system should return the next page of data.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Name of parent to list attack paths. Valid formats: \"organizations/{organization}\", \"organizations/{organization}/simulations/{simulation}\" \"organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}\" \"organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}\"", + // "name": { + // "description": "Required. Name of the custom module to delete. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", // "location": "path", - // "pattern": "^organizations/[^/]+/simulations/[^/]+/valuedResources/[^/]+$", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/attackPaths", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListAttackPathsResponse" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -26708,110 +26503,104 @@ func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Do(opts ... } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Pages(ctx context.Context, f func(*ListAttackPathsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "securitycenter.organizations.sources.create": +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.get": -type OrganizationsSourcesCreateCall struct { - s *Service - parent string - source *Source - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a source. +// Get: Retrieves a SecurityHealthAnalyticsCustomModule. // -// - parent: Resource name of the new source's parent. Its format should -// be "organizations/[organization_id]". -func (r *OrganizationsSourcesService) Create(parent string, source *Source) *OrganizationsSourcesCreateCall { - c := &OrganizationsSourcesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.source = source +// - name: Name of the custom module to get. Its format is +// "organizations/{organization}/securityHealthAnalyticsSettings/custom +// Modules/{customModule}", +// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus +// tomModule}", or +// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c +// ustomModule}". +func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Get(name string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall { + c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSourcesCreateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesCreateCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesCreateCall) Context(ctx context.Context) *OrganizationsSourcesCreateCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSourcesCreateCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sources") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.create" call. -// Exactly one of *Source or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Source.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsSourcesCreateCall) Do(opts ...googleapi.CallOption) (*Source, error) { +// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.get" call. +// Exactly one of +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server +// Response.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26830,7 +26619,7 @@ func (c *OrganizationsSourcesCreateCall) Do(opts ...googleapi.CallOption) (*Sour if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Source{ + ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -26842,28 +26631,25 @@ func (c *OrganizationsSourcesCreateCall) Do(opts ...googleapi.CallOption) (*Sour } return ret, nil // { - // "description": "Creates a source.", - // "flatPath": "v1/organizations/{organizationsId}/sources", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.create", + // "description": "Retrieves a SecurityHealthAnalyticsCustomModule.", + // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. Resource name of the new source's parent. Its format should be \"organizations/[organization_id]\".", + // "name": { + // "description": "Required. Name of the custom module to get. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/sources", - // "request": { - // "$ref": "Source" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "Source" + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -26872,31 +26658,50 @@ func (c *OrganizationsSourcesCreateCall) Do(opts ...googleapi.CallOption) (*Sour } -// method id "securitycenter.organizations.sources.get": +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.list": -type OrganizationsSourcesGetCall struct { +type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets a source. +// List: Returns a list of all SecurityHealthAnalyticsCustomModules for +// the given parent. This includes resident modules defined at the scope +// of the parent, and inherited modules, inherited from CRM ancestors. // -// - name: Relative resource name of the source. Its format is -// "organizations/[organization_id]/source/[source_id]". -func (r *OrganizationsSourcesService) Get(name string) *OrganizationsSourcesGetCall { - c := &OrganizationsSourcesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Name of parent to list custom modules. Its format is +// "organizations/{organization}/securityHealthAnalyticsSettings", +// "folders/{folder}/securityHealthAnalyticsSettings", or +// "projects/{project}/securityHealthAnalyticsSettings". +func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) List(parent string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { + c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) PageSize(pageSize int64) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last call indicating a continuation +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) PageToken(pageToken string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSourcesGetCall) Fields(s ...googleapi.Field) *OrganizationsSourcesGetCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -26906,7 +26711,7 @@ func (c *OrganizationsSourcesGetCall) Fields(s ...googleapi.Field) *Organization // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsSourcesGetCall) IfNoneMatch(entityTag string) *OrganizationsSourcesGetCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { c.ifNoneMatch_ = entityTag return c } @@ -26914,21 +26719,21 @@ func (c *OrganizationsSourcesGetCall) IfNoneMatch(entityTag string) *Organizatio // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesGetCall) Context(ctx context.Context) *OrganizationsSourcesGetCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSourcesGetCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -26941,7 +26746,7 @@ func (c *OrganizationsSourcesGetCall) doRequest(alt string) (*http.Response, err var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -26949,19 +26754,21 @@ func (c *OrganizationsSourcesGetCall) doRequest(alt string) (*http.Response, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.get" call. -// Exactly one of *Source or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Source.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsSourcesGetCall) Do(opts ...googleapi.CallOption) (*Source, error) { +// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.list" call. +// Exactly one of *ListSecurityHealthAnalyticsCustomModulesResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ListSecurityHealthAnalyticsCustomModulesResponse.ServerResponse.Heade +// r or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListSecurityHealthAnalyticsCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26980,7 +26787,7 @@ func (c *OrganizationsSourcesGetCall) Do(opts ...googleapi.CallOption) (*Source, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Source{ + ret := &ListSecurityHealthAnalyticsCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -26992,25 +26799,36 @@ func (c *OrganizationsSourcesGetCall) Do(opts ...googleapi.CallOption) (*Source, } return ret, nil // { - // "description": "Gets a source.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}", + // "description": "Returns a list of all SecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", + // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules", // "httpMethod": "GET", - // "id": "securitycenter.organizations.sources.get", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Relative resource name of the source. Its format is \"organizations/[organization_id]/source/[source_id]\".", + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last call indicating a continuation", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of parent to list custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/customModules", // "response": { - // "$ref": "Source" + // "$ref": "ListSecurityHealthAnalyticsCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -27019,91 +26837,140 @@ func (c *OrganizationsSourcesGetCall) Do(opts ...googleapi.CallOption) (*Source, } -// method id "securitycenter.organizations.sources.getIamPolicy": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Pages(ctx context.Context, f func(*ListSecurityHealthAnalyticsCustomModulesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type OrganizationsSourcesGetIamPolicyCall struct { - s *Service - resource string - getiampolicyrequest *GetIamPolicyRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.listDescendant": + +type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// GetIamPolicy: Gets the access control policy on the specified Source. +// ListDescendant: Returns a list of all resident +// SecurityHealthAnalyticsCustomModules under the given CRM parent and +// all of the parent’s CRM descendants. // -// - resource: REQUIRED: The resource for which the policy is being -// requested. See Resource names -// (https://cloud.google.com/apis/design/resource_names) for the -// appropriate value for this field. -func (r *OrganizationsSourcesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *OrganizationsSourcesGetIamPolicyCall { - c := &OrganizationsSourcesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.resource = resource - c.getiampolicyrequest = getiampolicyrequest +// - parent: Name of parent to list descendant custom modules. Its +// format is +// "organizations/{organization}/securityHealthAnalyticsSettings", +// "folders/{folder}/securityHealthAnalyticsSettings", or +// "projects/{project}/securityHealthAnalyticsSettings". +func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) ListDescendant(parent string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { + c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) PageSize(pageSize int64) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last call indicating a continuation +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) PageToken(pageToken string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSourcesGetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSourcesGetIamPolicyCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesGetIamPolicyCall) Context(ctx context.Context) *OrganizationsSourcesGetIamPolicyCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSourcesGetIamPolicyCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules:listDescendant") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "resource": c.resource, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.getIamPolicy" call. -// Exactly one of *Policy or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsSourcesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.listDescendant" call. +// Exactly one of +// *ListDescendantSecurityHealthAnalyticsCustomModulesResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ListDescendantSecurityHealthAnalyticsCustomModulesResponse.ServerResp +// onse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Do(opts ...googleapi.CallOption) (*ListDescendantSecurityHealthAnalyticsCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27122,7 +26989,7 @@ func (c *OrganizationsSourcesGetIamPolicyCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &ListDescendantSecurityHealthAnalyticsCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27134,28 +27001,36 @@ func (c *OrganizationsSourcesGetIamPolicyCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Gets the access control policy on the specified Source.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}:getIamPolicy", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.getIamPolicy", + // "description": "Returns a list of all resident SecurityHealthAnalyticsCustomModules under the given CRM parent and all of the parent’s CRM descendants.", + // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules:listDescendant", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.listDescendant", // "parameterOrder": [ - // "resource" + // "parent" // ], // "parameters": { - // "resource": { - // "description": "REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last call indicating a continuation", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of parent to list descendant custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+resource}:getIamPolicy", - // "request": { - // "$ref": "GetIamPolicyRequest" - // }, + // "path": "v1/{+parent}/customModules:listDescendant", // "response": { - // "$ref": "Policy" + // "$ref": "ListDescendantSecurityHealthAnalyticsCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -27164,114 +27039,135 @@ func (c *OrganizationsSourcesGetIamPolicyCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.organizations.sources.list": - -type OrganizationsSourcesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Lists all sources belonging to an organization. -// -// - parent: Resource name of the parent of sources to list. Its format -// should be "organizations/[organization_id]", "folders/[folder_id]", -// or "projects/[project_id]". -func (r *OrganizationsSourcesService) List(parent string) *OrganizationsSourcesListCall { - c := &OrganizationsSourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Pages(ctx context.Context, f func(*ListDescendantSecurityHealthAnalyticsCustomModulesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *OrganizationsSourcesListCall) PageSize(pageSize int64) *OrganizationsSourcesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.patch": + +type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates the SecurityHealthAnalyticsCustomModule under the +// given name based on the given update mask. Updating the enablement +// state is supported on both resident and inherited modules (though +// resident modules cannot have an enablement state of "inherited"). +// Updating the display name and custom config of a module is supported +// on resident modules only. +// +// - name: Immutable. The resource name of the custom module. Its format +// is +// "organizations/{organization}/securityHealthAnalyticsSettings/custom +// Modules/{customModule}", or +// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus +// tomModule}", or +// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c +// ustomModule}" The id {customModule} is server-generated and is not +// user settable. It will be a numeric id containing 1-20 digits. +func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Patch(name string, googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall { + c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule = googlecloudsecuritycenterv1securityhealthanalyticscustommodule return c } -// PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListSourcesResponse`; indicates that this is a -// continuation of a prior `ListSources` call, and that the system -// should return the next page of data. -func (c *OrganizationsSourcesListCall) PageToken(pageToken string) *OrganizationsSourcesListCall { - c.urlParams_.Set("pageToken", pageToken) +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to be updated. The only fields that can be updated are +// `enablement_state` and `custom_config`. If empty or set to the +// wildcard value `*`, both `enablement_state` and `custom_config` are +// updated. +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) UpdateMask(updateMask string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSourcesListCall) Fields(s ...googleapi.Field) *OrganizationsSourcesListCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsSourcesListCall) IfNoneMatch(entityTag string) *OrganizationsSourcesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesListCall) Context(ctx context.Context) *OrganizationsSourcesListCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSourcesListCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sources") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.list" call. -// Exactly one of *ListSourcesResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListSourcesResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSourcesResponse, error) { +// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.patch" call. +// Exactly one of +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server +// Response.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27290,7 +27186,7 @@ func (c *OrganizationsSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListSourcesResponse{ + ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27302,36 +27198,34 @@ func (c *OrganizationsSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSo } return ret, nil // { - // "description": "Lists all sources belonging to an organization.", - // "flatPath": "v1/organizations/{organizationsId}/sources", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.sources.list", + // "description": "Updates the SecurityHealthAnalyticsCustomModule under the given name based on the given update mask. Updating the enablement state is supported on both resident and inherited modules (though resident modules cannot have an enablement state of \"inherited\"). Updating the display name and custom config of a module is supported on resident modules only.", + // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last `ListSourcesResponse`; indicates that this is a continuation of a prior `ListSources` call, and that the system should return the next page of data.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "name": { + // "description": "Immutable. The resource name of the custom module. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\" The id {customModule} is server-generated and is not user settable. It will be a numeric id containing 1-20 digits.", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The list of fields to be updated. The only fields that can be updated are `enablement_state` and `custom_config`. If empty or set to the wildcard value `*`, both `enablement_state` and `custom_config` are updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1/{+parent}/sources", + // "path": "v1/{+name}", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // }, // "response": { - // "$ref": "ListSourcesResponse" + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -27340,62 +27234,36 @@ func (c *OrganizationsSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSo } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *OrganizationsSourcesListCall) Pages(ctx context.Context, f func(*ListSourcesResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "securitycenter.organizations.sources.patch": +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.simulate": -type OrganizationsSourcesPatchCall struct { - s *Service - name string - source *Source - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall struct { + s *Service + parent string + simulatesecurityhealthanalyticscustommodulerequest *SimulateSecurityHealthAnalyticsCustomModuleRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a source. +// Simulate: Simulates a given SecurityHealthAnalyticsCustomModule and +// Resource. // -// - name: The relative resource name of this source. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Example: "organizations/{organization_id}/sources/{source_id}". -func (r *OrganizationsSourcesService) Patch(name string, source *Source) *OrganizationsSourcesPatchCall { - c := &OrganizationsSourcesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.source = source - return c -} - -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the source resource. If empty all mutable fields -// will be updated. -func (c *OrganizationsSourcesPatchCall) UpdateMask(updateMask string) *OrganizationsSourcesPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// - parent: The relative resource name of the organization, project, or +// folder. For more information about relative resource names, see +// Relative Resource Name +// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) +// Example: `organizations/{organization_id}`. +func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Simulate(parent string, simulatesecurityhealthanalyticscustommodulerequest *SimulateSecurityHealthAnalyticsCustomModuleRequest) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { + c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.simulatesecurityhealthanalyticscustommodulerequest = simulatesecurityhealthanalyticscustommodulerequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSourcesPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesPatchCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -27403,21 +27271,21 @@ func (c *OrganizationsSourcesPatchCall) Fields(s ...googleapi.Field) *Organizati // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesPatchCall) Context(ctx context.Context) *OrganizationsSourcesPatchCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSourcesPatchCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -27425,34 +27293,36 @@ func (c *OrganizationsSourcesPatchCall) doRequest(alt string) (*http.Response, e } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.simulatesecurityhealthanalyticscustommodulerequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules:simulate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.patch" call. -// Exactly one of *Source or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Source.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsSourcesPatchCall) Do(opts ...googleapi.CallOption) (*Source, error) { +// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.simulate" call. +// Exactly one of *SimulateSecurityHealthAnalyticsCustomModuleResponse +// or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *SimulateSecurityHealthAnalyticsCustomModuleResponse.ServerResponse.He +// ader or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Do(opts ...googleapi.CallOption) (*SimulateSecurityHealthAnalyticsCustomModuleResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27471,7 +27341,7 @@ func (c *OrganizationsSourcesPatchCall) Do(opts ...googleapi.CallOption) (*Sourc if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Source{ + ret := &SimulateSecurityHealthAnalyticsCustomModuleResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27483,34 +27353,28 @@ func (c *OrganizationsSourcesPatchCall) Do(opts ...googleapi.CallOption) (*Sourc } return ret, nil // { - // "description": "Updates a source.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.sources.patch", + // "description": "Simulates a given SecurityHealthAnalyticsCustomModule and Resource.", + // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules:simulate", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.simulate", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The relative resource name of this source. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/sources/{source_id}\"", + // "parent": { + // "description": "Required. The relative resource name of the organization, project, or folder. For more information about relative resource names, see [Relative Resource Name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) Example: `organizations/{organization_id}`", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the source resource. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/customModules:simulate", // "request": { - // "$ref": "Source" + // "$ref": "SimulateSecurityHealthAnalyticsCustomModuleRequest" // }, // "response": { - // "$ref": "Source" + // "$ref": "SimulateSecurityHealthAnalyticsCustomModuleResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -27519,91 +27383,104 @@ func (c *OrganizationsSourcesPatchCall) Do(opts ...googleapi.CallOption) (*Sourc } -// method id "securitycenter.organizations.sources.setIamPolicy": +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.get": -type OrganizationsSourcesSetIamPolicyCall struct { - s *Service - resource string - setiampolicyrequest *SetIamPolicyRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// SetIamPolicy: Sets the access control policy on the specified Source. +// Get: Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. // -// - resource: REQUIRED: The resource for which the policy is being -// specified. See Resource names -// (https://cloud.google.com/apis/design/resource_names) for the -// appropriate value for this field. -func (r *OrganizationsSourcesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *OrganizationsSourcesSetIamPolicyCall { - c := &OrganizationsSourcesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.resource = resource - c.setiampolicyrequest = setiampolicyrequest +// - name: Name of the effective custom module to get. Its format is +// "organizations/{organization}/securityHealthAnalyticsSettings/effect +// iveCustomModules/{customModule}", +// "folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomMod +// ules/{customModule}", or +// "projects/{project}/securityHealthAnalyticsSettings/effectiveCustomM +// odules/{customModule}". +func (r *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesService) Get(name string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { + c := &OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSourcesSetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSourcesSetIamPolicyCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesSetIamPolicyCall) Context(ctx context.Context) *OrganizationsSourcesSetIamPolicyCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSourcesSetIamPolicyCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "resource": c.resource, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.setIamPolicy" call. -// Exactly one of *Policy or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsSourcesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.get" call. +// Exactly one of +// *GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModu +// le or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModu +// le.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27622,7 +27499,7 @@ func (c *OrganizationsSourcesSetIamPolicyCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27634,28 +27511,25 @@ func (c *OrganizationsSourcesSetIamPolicyCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Sets the access control policy on the specified Source.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}:setIamPolicy", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.setIamPolicy", + // "description": "Retrieves an EffectiveSecurityHealthAnalyticsCustomModule.", + // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/effectiveCustomModules/{effectiveCustomModulesId}", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.get", // "parameterOrder": [ - // "resource" + // "name" // ], // "parameters": { - // "resource": { - // "description": "REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + // "name": { + // "description": "Required. Name of the effective custom module to get. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\"", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/effectiveCustomModules/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+resource}:setIamPolicy", - // "request": { - // "$ref": "SetIamPolicyRequest" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "Policy" + // "$ref": "GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -27664,92 +27538,119 @@ func (c *OrganizationsSourcesSetIamPolicyCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.organizations.sources.testIamPermissions": +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.list": -type OrganizationsSourcesTestIamPermissionsCall struct { - s *Service - resource string - testiampermissionsrequest *TestIamPermissionsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// TestIamPermissions: Returns the permissions that a caller has on the -// specified source. +// List: Returns a list of all +// EffectiveSecurityHealthAnalyticsCustomModules for the given parent. +// This includes resident modules defined at the scope of the parent, +// and inherited modules, inherited from CRM ancestors. // -// - resource: REQUIRED: The resource for which the policy detail is -// being requested. See Resource names -// (https://cloud.google.com/apis/design/resource_names) for the -// appropriate value for this field. -func (r *OrganizationsSourcesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *OrganizationsSourcesTestIamPermissionsCall { - c := &OrganizationsSourcesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.resource = resource - c.testiampermissionsrequest = testiampermissionsrequest +// - parent: Name of parent to list effective custom modules. Its format +// is "organizations/{organization}/securityHealthAnalyticsSettings", +// "folders/{folder}/securityHealthAnalyticsSettings", or +// "projects/{project}/securityHealthAnalyticsSettings". +func (r *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesService) List(parent string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { + c := &OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) PageSize(pageSize int64) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last call indicating a continuation +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) PageToken(pageToken string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSourcesTestIamPermissionsCall) Fields(s ...googleapi.Field) *OrganizationsSourcesTestIamPermissionsCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesTestIamPermissionsCall) Context(ctx context.Context) *OrganizationsSourcesTestIamPermissionsCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSourcesTestIamPermissionsCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/effectiveCustomModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "resource": c.resource, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.testIamPermissions" call. -// Exactly one of *TestIamPermissionsResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *TestIamPermissionsResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsSourcesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { +// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.list" call. +// Exactly one of +// *ListEffectiveSecurityHealthAnalyticsCustomModulesResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.ServerRespo +// nse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListEffectiveSecurityHealthAnalyticsCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27768,7 +27669,7 @@ func (c *OrganizationsSourcesTestIamPermissionsCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &TestIamPermissionsResponse{ + ret := &ListEffectiveSecurityHealthAnalyticsCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27780,28 +27681,36 @@ func (c *OrganizationsSourcesTestIamPermissionsCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Returns the permissions that a caller has on the specified source.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}:testIamPermissions", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.testIamPermissions", + // "description": "Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", + // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/effectiveCustomModules", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.list", // "parameterOrder": [ - // "resource" + // "parent" // ], // "parameters": { - // "resource": { - // "description": "REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last call indicating a continuation", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of parent to list effective custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+resource}:testIamPermissions", - // "request": { - // "$ref": "TestIamPermissionsRequest" - // }, + // "path": "v1/{+parent}/effectiveCustomModules", // "response": { - // "$ref": "TestIamPermissionsResponse" + // "$ref": "ListEffectiveSecurityHealthAnalyticsCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -27810,99 +27719,119 @@ func (c *OrganizationsSourcesTestIamPermissionsCall) Do(opts ...googleapi.CallOp } -// method id "securitycenter.organizations.sources.findings.create": - -type OrganizationsSourcesFindingsCreateCall struct { - s *Service - parent string - finding *Finding - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Pages(ctx context.Context, f func(*ListEffectiveSecurityHealthAnalyticsCustomModulesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// Create: Creates a finding. The corresponding source must exist for -// finding creation to succeed. -// -// - parent: Resource name of the new finding's parent. Its format -// should be "organizations/[organization_id]/sources/[source_id]". -func (r *OrganizationsSourcesFindingsService) Create(parent string, finding *Finding) *OrganizationsSourcesFindingsCreateCall { - c := &OrganizationsSourcesFindingsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.finding = finding - return c +// method id "securitycenter.organizations.simulations.get": + +type OrganizationsSimulationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// FindingId sets the optional parameter "findingId": Required. Unique -// identifier provided by the client within the parent scope. It must be -// alphanumeric and less than or equal to 32 characters and greater than -// 0 characters in length. -func (c *OrganizationsSourcesFindingsCreateCall) FindingId(findingId string) *OrganizationsSourcesFindingsCreateCall { - c.urlParams_.Set("findingId", findingId) +// Get: Get the simulation by name or the latest simulation for the +// given organization. +// +// - name: The organization name or simulation name of this simulation +// Valid format: "organizations/{organization}/simulations/latest" +// "organizations/{organization}/simulations/{simulation}". +func (r *OrganizationsSimulationsService) Get(name string) *OrganizationsSimulationsGetCall { + c := &OrganizationsSimulationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSourcesFindingsCreateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsCreateCall { +func (c *OrganizationsSimulationsGetCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsSimulationsGetCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesFindingsCreateCall) Context(ctx context.Context) *OrganizationsSourcesFindingsCreateCall { +func (c *OrganizationsSimulationsGetCall) Context(ctx context.Context) *OrganizationsSimulationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSourcesFindingsCreateCall) Header() http.Header { +func (c *OrganizationsSimulationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesFindingsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSimulationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.finding) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.findings.create" call. -// Exactly one of *Finding or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Finding.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsSourcesFindingsCreateCall) Do(opts ...googleapi.CallOption) (*Finding, error) { +// Do executes the "securitycenter.organizations.simulations.get" call. +// Exactly one of *Simulation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Simulation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OrganizationsSimulationsGetCall) Do(opts ...googleapi.CallOption) (*Simulation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27921,7 +27850,7 @@ func (c *OrganizationsSourcesFindingsCreateCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Finding{ + ret := &Simulation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27933,33 +27862,25 @@ func (c *OrganizationsSourcesFindingsCreateCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Creates a finding. The corresponding source must exist for finding creation to succeed.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.findings.create", + // "description": "Get the simulation by name or the latest simulation for the given organization.", + // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.simulations.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "findingId": { - // "description": "Required. Unique identifier provided by the client within the parent scope. It must be alphanumeric and less than or equal to 32 characters and greater than 0 characters in length.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Resource name of the new finding's parent. Its format should be \"organizations/[organization_id]/sources/[source_id]\".", + // "name": { + // "description": "Required. The organization name or simulation name of this simulation Valid format: \"organizations/{organization}/simulations/latest\" \"organizations/{organization}/simulations/{simulation}\"", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+/simulations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/findings", - // "request": { - // "$ref": "Finding" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "Finding" + // "$ref": "Simulation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -27968,81 +27889,109 @@ func (c *OrganizationsSourcesFindingsCreateCall) Do(opts ...googleapi.CallOption } -// method id "securitycenter.organizations.sources.findings.group": +// method id "securitycenter.organizations.simulations.attackExposureResults.attackPaths.list": -type OrganizationsSourcesFindingsGroupCall struct { - s *Service - parent string - groupfindingsrequest *GroupFindingsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSimulationsAttackExposureResultsAttackPathsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Group: Filters an organization or source's findings and groups them -// by their specified properties. To group across all sources provide a -// `-` as the source id. Example: -// /v1/organizations/{organization_id}/sources/-/findings, -// /v1/folders/{folder_id}/sources/-/findings, -// /v1/projects/{project_id}/sources/-/findings +// List: Lists the attack paths for a set of simulation results or +// valued resources and filter. // -// - parent: Name of the source to groupBy. Its format is -// "organizations/[organization_id]/sources/[source_id]", -// folders/[folder_id]/sources/[source_id], or -// projects/[project_id]/sources/[source_id]. To groupBy across all -// sources provide a source_id of `-`. For example: -// organizations/{organization_id}/sources/-, -// folders/{folder_id}/sources/-, or projects/{project_id}/sources/-. -func (r *OrganizationsSourcesFindingsService) Group(parent string, groupfindingsrequest *GroupFindingsRequest) *OrganizationsSourcesFindingsGroupCall { - c := &OrganizationsSourcesFindingsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Name of parent to list attack paths. Valid formats: +// "organizations/{organization}", +// "organizations/{organization}/simulations/{simulation}" +// "organizations/{organization}/simulations/{simulation}/attackExposur +// eResults/{attack_exposure_result_v2}" +// "organizations/{organization}/simulations/{simulation}/valuedResourc +// es/{valued_resource}". +func (r *OrganizationsSimulationsAttackExposureResultsAttackPathsService) List(parent string) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { + c := &OrganizationsSimulationsAttackExposureResultsAttackPathsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.groupfindingsrequest = groupfindingsrequest + return c +} + +// Filter sets the optional parameter "filter": The filter expression +// that filters the attack path in the response. Supported fields: * +// `valued_resources` supports = +func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Filter(filter string) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) PageSize(pageSize int64) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListAttackPathsResponse`; indicates that this is a +// continuation of a prior `ListAttackPaths` call, and that the system +// should return the next page of data. +func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) PageToken(pageToken string) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSourcesFindingsGroupCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsGroupCall { +func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesFindingsGroupCall) Context(ctx context.Context) *OrganizationsSourcesFindingsGroupCall { +func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Context(ctx context.Context) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSourcesFindingsGroupCall) Header() http.Header { +func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesFindingsGroupCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupfindingsrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings:group") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attackPaths") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -28053,14 +28002,14 @@ func (c *OrganizationsSourcesFindingsGroupCall) doRequest(alt string) (*http.Res return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.findings.group" call. -// Exactly one of *GroupFindingsResponse or error will be non-nil. Any +// Do executes the "securitycenter.organizations.simulations.attackExposureResults.attackPaths.list" call. +// Exactly one of *ListAttackPathsResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *GroupFindingsResponse.ServerResponse.Header or (if a response was +// *ListAttackPathsResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) (*GroupFindingsResponse, error) { +func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Do(opts ...googleapi.CallOption) (*ListAttackPathsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28079,7 +28028,7 @@ func (c *OrganizationsSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GroupFindingsResponse{ + ret := &ListAttackPathsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -28091,28 +28040,41 @@ func (c *OrganizationsSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings:group", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.findings.group", + // "description": "Lists the attack paths for a set of simulation results or valued resources and filter.", + // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/attackExposureResults/{attackExposureResultsId}/attackPaths", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.simulations.attackExposureResults.attackPaths.list", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "filter": { + // "description": "The filter expression that filters the attack path in the response. Supported fields: * `valued_resources` supports =", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListAttackPathsResponse`; indicates that this is a continuation of a prior `ListAttackPaths` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, // "parent": { - // "description": "Required. Name of the source to groupBy. Its format is \"organizations/[organization_id]/sources/[source_id]\", folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]. To groupBy across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, or projects/{project_id}/sources/-", + // "description": "Required. Name of parent to list attack paths. Valid formats: \"organizations/{organization}\", \"organizations/{organization}/simulations/{simulation}\" \"organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}\" \"organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}\"", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+/simulations/[^/]+/attackExposureResults/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/findings:group", - // "request": { - // "$ref": "GroupFindingsRequest" - // }, + // "path": "v1/{+parent}/attackPaths", // "response": { - // "$ref": "GroupFindingsResponse" + // "$ref": "ListAttackPathsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -28124,9 +28086,9 @@ func (c *OrganizationsSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *OrganizationsSourcesFindingsGroupCall) Pages(ctx context.Context, f func(*GroupFindingsResponse) error) error { +func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Pages(ctx context.Context, f func(*ListAttackPathsResponse) error) error { c.ctx_ = ctx - defer func(pt string) { c.groupfindingsrequest.PageToken = pt }(c.groupfindingsrequest.PageToken) // reset paging to original point + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { x, err := c.Do() if err != nil { @@ -28138,13 +28100,13 @@ func (c *OrganizationsSourcesFindingsGroupCall) Pages(ctx context.Context, f fun if x.NextPageToken == "" { return nil } - c.groupfindingsrequest.PageToken = x.NextPageToken + c.PageToken(x.NextPageToken) } } -// method id "securitycenter.organizations.sources.findings.list": +// method id "securitycenter.organizations.simulations.attackExposureResults.valuedResources.list": -type OrganizationsSourcesFindingsListCall struct { +type OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -28153,141 +28115,49 @@ type OrganizationsSourcesFindingsListCall struct { header_ http.Header } -// List: Lists an organization or source's findings. To list across all -// sources provide a `-` as the source id. Example: -// /v1/organizations/{organization_id}/sources/-/findings +// List: Lists the valued resources for a set of simulation results and +// filter. // -// - parent: Name of the source the findings belong to. Its format is -// "organizations/[organization_id]/sources/[source_id], -// folders/[folder_id]/sources/[source_id], or -// projects/[project_id]/sources/[source_id]". To list across all -// sources provide a source_id of `-`. For example: -// organizations/{organization_id}/sources/-, -// folders/{folder_id}/sources/- or projects/{projects_id}/sources/-. -func (r *OrganizationsSourcesFindingsService) List(parent string) *OrganizationsSourcesFindingsListCall { - c := &OrganizationsSourcesFindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Name of parent to list valued resources. Valid formats: +// "organizations/{organization}", +// "organizations/{organization}/simulations/{simulation}" +// "organizations/{organization}/simulations/{simulation}/attackExposur +// eResults/{attack_exposure_result_v2}". +func (r *OrganizationsSimulationsAttackExposureResultsValuedResourcesService) List(parent string) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { + c := &OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } -// CompareDuration sets the optional parameter "compareDuration": When -// compare_duration is set, the ListFindingsResult's "state_change" -// attribute is updated to indicate whether the finding had its state -// changed, the finding's state remained unchanged, or if the finding -// was added in any state during the compare_duration period of time -// that precedes the read_time. This is the time between (read_time - -// compare_duration) and read_time. The state_change value is derived -// based on the presence and state of the finding at the two points in -// time. Intermediate state changes between the two times don't affect -// the result. For example, the results aren't affected if the finding -// is made inactive and then active again. Possible "state_change" -// values when compare_duration is specified: * "CHANGED": indicates -// that the finding was present and matched the given filter at the -// start of compare_duration, but changed its state at read_time. * -// "UNCHANGED": indicates that the finding was present and matched the -// given filter at the start of compare_duration and did not change -// state at read_time. * "ADDED": indicates that the finding did not -// match the given filter or was not present at the start of -// compare_duration, but was present at read_time. * "REMOVED": -// indicates that the finding was present and matched the filter at the -// start of compare_duration, but did not match the filter at read_time. -// If compare_duration is not specified, then the only possible -// state_change is "UNUSED", which will be the state_change set for all -// findings present at read_time. -func (c *OrganizationsSourcesFindingsListCall) CompareDuration(compareDuration string) *OrganizationsSourcesFindingsListCall { - c.urlParams_.Set("compareDuration", compareDuration) - return c -} - -// FieldMask sets the optional parameter "fieldMask": A field mask to -// specify the Finding fields to be listed in the response. An empty -// field mask will list all fields. -func (c *OrganizationsSourcesFindingsListCall) FieldMask(fieldMask string) *OrganizationsSourcesFindingsListCall { - c.urlParams_.Set("fieldMask", fieldMask) - return c -} - -// Filter sets the optional parameter "filter": Expression that defines -// the filter to apply across findings. The expression is a list of one -// or more restrictions combined via logical operators `AND` and `OR`. -// Parentheses are supported, and `OR` has higher precedence than `AND`. -// Restrictions have the form ` ` and may have a `-` character in front -// of them to indicate negation. Examples include: * name * -// source_properties.a_property * security_marks.marks.marka The -// supported operators are: * `=` for all value types. * `>`, `<`, `>=`, -// `<=` for integer values. * `:`, meaning substring matching, for -// strings. The supported value types are: * string literals in quotes. -// * integer literals without quotes. * boolean literals `true` and -// `false` without quotes. The following field and operator combinations -// are supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, -// `:` * state: `=`, `:` * category: `=`, `:` * external_uri: `=`, `:` * -// event_time: `=`, `>`, `<`, `>=`, `<=` Usage: This should be -// milliseconds since epoch or an RFC3339 string. Examples: `event_time -// = "2019-06-10T16:07:18-07:00" `event_time = 1560208038000` * -// severity: `=`, `:` * workflow_state: `=`, `:` * security_marks.marks: -// `=`, `:` * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` For -// example, `source_properties.size = 100` is a valid filter string. Use -// a partial match on the empty string to filter based on a property -// existing: `source_properties.my_property : "" Use a negated partial -// match on the empty string to filter based on a property not existing: -// `-source_properties.my_property : "" * resource: * resource.name: -// `=`, `:` * resource.parent_name: `=`, `:` * -// resource.parent_display_name: `=`, `:` * resource.project_name: `=`, -// `:` * resource.project_display_name: `=`, `:` * resource.type: `=`, -// `:` * resource.folders.resource_folder: `=`, `:` * -// resource.display_name: `=`, `:` -func (c *OrganizationsSourcesFindingsListCall) Filter(filter string) *OrganizationsSourcesFindingsListCall { +// Filter sets the optional parameter "filter": The filter expression +// that filters the valued resources in the response. Supported fields: +// * `resource_value` supports = * `resource_type` supports = +func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Filter(filter string) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { c.urlParams_.Set("filter", filter) return c } -// OrderBy sets the optional parameter "orderBy": Expression that -// defines what fields and order to use for sorting. The string value -// should follow SQL syntax: comma separated list of fields. For -// example: "name,resource_properties.a_property". The default sorting -// order is ascending. To specify descending order for a field, a suffix -// " desc" should be appended to the field name. For example: "name -// desc,source_properties.a_property". Redundant space characters in the -// syntax are insignificant. "name desc,source_properties.a_property" -// and " name desc , source_properties.a_property " are equivalent. The -// following fields are supported: name parent state category -// resource_name event_time source_properties security_marks.marks -func (c *OrganizationsSourcesFindingsListCall) OrderBy(orderBy string) *OrganizationsSourcesFindingsListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - // PageSize sets the optional parameter "pageSize": The maximum number // of results to return in a single response. Default is 10, minimum is // 1, maximum is 1000. -func (c *OrganizationsSourcesFindingsListCall) PageSize(pageSize int64) *OrganizationsSourcesFindingsListCall { +func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) PageSize(pageSize int64) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListFindingsResponse`; indicates that this is a -// continuation of a prior `ListFindings` call, and that the system -// should return the next page of data. -func (c *OrganizationsSourcesFindingsListCall) PageToken(pageToken string) *OrganizationsSourcesFindingsListCall { +// by the last `ListValuedResourcesResponse`; indicates that this is a +// continuation of a prior `ListValuedResources` call, and that the +// system should return the next page of data. +func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) PageToken(pageToken string) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { c.urlParams_.Set("pageToken", pageToken) return c } -// ReadTime sets the optional parameter "readTime": Time used as a -// reference point when filtering findings. The filter is limited to -// findings existing at the supplied time and their values are those at -// that specific time. Absence of this field will default to the API's -// version of NOW. -func (c *OrganizationsSourcesFindingsListCall) ReadTime(readTime string) *OrganizationsSourcesFindingsListCall { - c.urlParams_.Set("readTime", readTime) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSourcesFindingsListCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsListCall { +func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -28297,7 +28167,7 @@ func (c *OrganizationsSourcesFindingsListCall) Fields(s ...googleapi.Field) *Org // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsSourcesFindingsListCall) IfNoneMatch(entityTag string) *OrganizationsSourcesFindingsListCall { +func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { c.ifNoneMatch_ = entityTag return c } @@ -28305,21 +28175,21 @@ func (c *OrganizationsSourcesFindingsListCall) IfNoneMatch(entityTag string) *Or // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesFindingsListCall) Context(ctx context.Context) *OrganizationsSourcesFindingsListCall { +func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Context(ctx context.Context) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSourcesFindingsListCall) Header() http.Header { +func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesFindingsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -28332,7 +28202,7 @@ func (c *OrganizationsSourcesFindingsListCall) doRequest(alt string) (*http.Resp var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/valuedResources") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -28345,14 +28215,14 @@ func (c *OrganizationsSourcesFindingsListCall) doRequest(alt string) (*http.Resp return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.findings.list" call. -// Exactly one of *ListFindingsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListFindingsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "securitycenter.organizations.simulations.attackExposureResults.valuedResources.list" call. +// Exactly one of *ListValuedResourcesResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListValuedResourcesResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*ListFindingsResponse, error) { +func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Do(opts ...googleapi.CallOption) (*ListValuedResourcesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28371,7 +28241,7 @@ func (c *OrganizationsSourcesFindingsListCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListFindingsResponse{ + ret := &ListValuedResourcesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -28383,33 +28253,16 @@ func (c *OrganizationsSourcesFindingsListCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings", + // "description": "Lists the valued resources for a set of simulation results and filter.", + // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/attackExposureResults/{attackExposureResultsId}/valuedResources", // "httpMethod": "GET", - // "id": "securitycenter.organizations.sources.findings.list", + // "id": "securitycenter.organizations.simulations.attackExposureResults.valuedResources.list", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "compareDuration": { - // "description": "When compare_duration is set, the ListFindingsResult's \"state_change\" attribute is updated to indicate whether the finding had its state changed, the finding's state remained unchanged, or if the finding was added in any state during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence and state of the finding at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the finding is made inactive and then active again. Possible \"state_change\" values when compare_duration is specified: * \"CHANGED\": indicates that the finding was present and matched the given filter at the start of compare_duration, but changed its state at read_time. * \"UNCHANGED\": indicates that the finding was present and matched the given filter at the start of compare_duration and did not change state at read_time. * \"ADDED\": indicates that the finding did not match the given filter or was not present at the start of compare_duration, but was present at read_time. * \"REMOVED\": indicates that the finding was present and matched the filter at the start of compare_duration, but did not match the filter at read_time. If compare_duration is not specified, then the only possible state_change is \"UNUSED\", which will be the state_change set for all findings present at read_time.", - // "format": "google-duration", - // "location": "query", - // "type": "string" - // }, - // "fieldMask": { - // "description": "A field mask to specify the Finding fields to be listed in the response. An empty field mask will list all fields.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" - // }, // "filter": { - // "description": "Expression that defines the filter to apply across findings. The expression is a list of one or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. Examples include: * name * source_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following field and operator combinations are supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, `:` * state: `=`, `:` * category: `=`, `:` * external_uri: `=`, `:` * event_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `event_time = \"2019-06-10T16:07:18-07:00\"` `event_time = 1560208038000` * severity: `=`, `:` * workflow_state: `=`, `:` * security_marks.marks: `=`, `:` * source_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` For example, `source_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `source_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-source_properties.my_property : \"\"` * resource: * resource.name: `=`, `:` * resource.parent_name: `=`, `:` * resource.parent_display_name: `=`, `:` * resource.project_name: `=`, `:` * resource.project_display_name: `=`, `:` * resource.type: `=`, `:` * resource.folders.resource_folder: `=`, `:` * resource.display_name: `=`, `:`", - // "location": "query", - // "type": "string" - // }, - // "orderBy": { - // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,source_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,source_properties.a_property\" and \" name desc , source_properties.a_property \" are equivalent. The following fields are supported: name parent state category resource_name event_time source_properties security_marks.marks", + // "description": "The filter expression that filters the valued resources in the response. Supported fields: * `resource_value` supports = * `resource_type` supports =", // "location": "query", // "type": "string" // }, @@ -28420,27 +28273,3856 @@ func (c *OrganizationsSourcesFindingsListCall) Do(opts ...googleapi.CallOption) // "type": "integer" // }, // "pageToken": { - // "description": "The value returned by the last `ListFindingsResponse`; indicates that this is a continuation of a prior `ListFindings` call, and that the system should return the next page of data.", + // "description": "The value returned by the last `ListValuedResourcesResponse`; indicates that this is a continuation of a prior `ListValuedResources` call, and that the system should return the next page of data.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. Name of the source the findings belong to. Its format is \"organizations/[organization_id]/sources/[source_id], folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]\". To list across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or projects/{projects_id}/sources/-", + // "description": "Required. Name of parent to list valued resources. Valid formats: \"organizations/{organization}\", \"organizations/{organization}/simulations/{simulation}\" \"organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}\"", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+/simulations/[^/]+/attackExposureResults/[^/]+$", // "required": true, // "type": "string" - // }, - // "readTime": { + // } + // }, + // "path": "v1/{+parent}/valuedResources", + // "response": { + // "$ref": "ListValuedResourcesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Pages(ctx context.Context, f func(*ListValuedResourcesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "securitycenter.organizations.simulations.attackPaths.list": + +type OrganizationsSimulationsAttackPathsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the attack paths for a set of simulation results or +// valued resources and filter. +// +// - parent: Name of parent to list attack paths. Valid formats: +// "organizations/{organization}", +// "organizations/{organization}/simulations/{simulation}" +// "organizations/{organization}/simulations/{simulation}/attackExposur +// eResults/{attack_exposure_result_v2}" +// "organizations/{organization}/simulations/{simulation}/valuedResourc +// es/{valued_resource}". +func (r *OrganizationsSimulationsAttackPathsService) List(parent string) *OrganizationsSimulationsAttackPathsListCall { + c := &OrganizationsSimulationsAttackPathsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": The filter expression +// that filters the attack path in the response. Supported fields: * +// `valued_resources` supports = +func (c *OrganizationsSimulationsAttackPathsListCall) Filter(filter string) *OrganizationsSimulationsAttackPathsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *OrganizationsSimulationsAttackPathsListCall) PageSize(pageSize int64) *OrganizationsSimulationsAttackPathsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListAttackPathsResponse`; indicates that this is a +// continuation of a prior `ListAttackPaths` call, and that the system +// should return the next page of data. +func (c *OrganizationsSimulationsAttackPathsListCall) PageToken(pageToken string) *OrganizationsSimulationsAttackPathsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsSimulationsAttackPathsListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsAttackPathsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsSimulationsAttackPathsListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsAttackPathsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsSimulationsAttackPathsListCall) Context(ctx context.Context) *OrganizationsSimulationsAttackPathsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsSimulationsAttackPathsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSimulationsAttackPathsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attackPaths") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.simulations.attackPaths.list" call. +// Exactly one of *ListAttackPathsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListAttackPathsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsSimulationsAttackPathsListCall) Do(opts ...googleapi.CallOption) (*ListAttackPathsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListAttackPathsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the attack paths for a set of simulation results or valued resources and filter.", + // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/attackPaths", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.simulations.attackPaths.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "filter": { + // "description": "The filter expression that filters the attack path in the response. Supported fields: * `valued_resources` supports =", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListAttackPathsResponse`; indicates that this is a continuation of a prior `ListAttackPaths` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of parent to list attack paths. Valid formats: \"organizations/{organization}\", \"organizations/{organization}/simulations/{simulation}\" \"organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}\" \"organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}\"", + // "location": "path", + // "pattern": "^organizations/[^/]+/simulations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/attackPaths", + // "response": { + // "$ref": "ListAttackPathsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsSimulationsAttackPathsListCall) Pages(ctx context.Context, f func(*ListAttackPathsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "securitycenter.organizations.simulations.valuedResources.get": + +type OrganizationsSimulationsValuedResourcesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Get the valued resource by name +// +// - name: The name of this valued resource Valid format: +// "organizations/{organization}/simulations/{simulation}/valuedResourc +// es/{valued_resource}". +func (r *OrganizationsSimulationsValuedResourcesService) Get(name string) *OrganizationsSimulationsValuedResourcesGetCall { + c := &OrganizationsSimulationsValuedResourcesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsSimulationsValuedResourcesGetCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsValuedResourcesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsSimulationsValuedResourcesGetCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsValuedResourcesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsSimulationsValuedResourcesGetCall) Context(ctx context.Context) *OrganizationsSimulationsValuedResourcesGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsSimulationsValuedResourcesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSimulationsValuedResourcesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.simulations.valuedResources.get" call. +// Exactly one of *ValuedResource or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ValuedResource.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsSimulationsValuedResourcesGetCall) Do(opts ...googleapi.CallOption) (*ValuedResource, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ValuedResource{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the valued resource by name", + // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/valuedResources/{valuedResourcesId}", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.simulations.valuedResources.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The name of this valued resource Valid format: \"organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}\"", + // "location": "path", + // "pattern": "^organizations/[^/]+/simulations/[^/]+/valuedResources/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "ValuedResource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.simulations.valuedResources.list": + +type OrganizationsSimulationsValuedResourcesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the valued resources for a set of simulation results and +// filter. +// +// - parent: Name of parent to list valued resources. Valid formats: +// "organizations/{organization}", +// "organizations/{organization}/simulations/{simulation}" +// "organizations/{organization}/simulations/{simulation}/attackExposur +// eResults/{attack_exposure_result_v2}". +func (r *OrganizationsSimulationsValuedResourcesService) List(parent string) *OrganizationsSimulationsValuedResourcesListCall { + c := &OrganizationsSimulationsValuedResourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": The filter expression +// that filters the valued resources in the response. Supported fields: +// * `resource_value` supports = * `resource_type` supports = +func (c *OrganizationsSimulationsValuedResourcesListCall) Filter(filter string) *OrganizationsSimulationsValuedResourcesListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *OrganizationsSimulationsValuedResourcesListCall) PageSize(pageSize int64) *OrganizationsSimulationsValuedResourcesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListValuedResourcesResponse`; indicates that this is a +// continuation of a prior `ListValuedResources` call, and that the +// system should return the next page of data. +func (c *OrganizationsSimulationsValuedResourcesListCall) PageToken(pageToken string) *OrganizationsSimulationsValuedResourcesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsSimulationsValuedResourcesListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsValuedResourcesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsSimulationsValuedResourcesListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsValuedResourcesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsSimulationsValuedResourcesListCall) Context(ctx context.Context) *OrganizationsSimulationsValuedResourcesListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsSimulationsValuedResourcesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSimulationsValuedResourcesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/valuedResources") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.simulations.valuedResources.list" call. +// Exactly one of *ListValuedResourcesResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListValuedResourcesResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsSimulationsValuedResourcesListCall) Do(opts ...googleapi.CallOption) (*ListValuedResourcesResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListValuedResourcesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the valued resources for a set of simulation results and filter.", + // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/valuedResources", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.simulations.valuedResources.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "filter": { + // "description": "The filter expression that filters the valued resources in the response. Supported fields: * `resource_value` supports = * `resource_type` supports =", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListValuedResourcesResponse`; indicates that this is a continuation of a prior `ListValuedResources` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of parent to list valued resources. Valid formats: \"organizations/{organization}\", \"organizations/{organization}/simulations/{simulation}\" \"organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}\"", + // "location": "path", + // "pattern": "^organizations/[^/]+/simulations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/valuedResources", + // "response": { + // "$ref": "ListValuedResourcesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsSimulationsValuedResourcesListCall) Pages(ctx context.Context, f func(*ListValuedResourcesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "securitycenter.organizations.simulations.valuedResources.attackPaths.list": + +type OrganizationsSimulationsValuedResourcesAttackPathsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the attack paths for a set of simulation results or +// valued resources and filter. +// +// - parent: Name of parent to list attack paths. Valid formats: +// "organizations/{organization}", +// "organizations/{organization}/simulations/{simulation}" +// "organizations/{organization}/simulations/{simulation}/attackExposur +// eResults/{attack_exposure_result_v2}" +// "organizations/{organization}/simulations/{simulation}/valuedResourc +// es/{valued_resource}". +func (r *OrganizationsSimulationsValuedResourcesAttackPathsService) List(parent string) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { + c := &OrganizationsSimulationsValuedResourcesAttackPathsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": The filter expression +// that filters the attack path in the response. Supported fields: * +// `valued_resources` supports = +func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Filter(filter string) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) PageSize(pageSize int64) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListAttackPathsResponse`; indicates that this is a +// continuation of a prior `ListAttackPaths` call, and that the system +// should return the next page of data. +func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) PageToken(pageToken string) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Context(ctx context.Context) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attackPaths") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.simulations.valuedResources.attackPaths.list" call. +// Exactly one of *ListAttackPathsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListAttackPathsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Do(opts ...googleapi.CallOption) (*ListAttackPathsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListAttackPathsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the attack paths for a set of simulation results or valued resources and filter.", + // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/valuedResources/{valuedResourcesId}/attackPaths", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.simulations.valuedResources.attackPaths.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "filter": { + // "description": "The filter expression that filters the attack path in the response. Supported fields: * `valued_resources` supports =", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListAttackPathsResponse`; indicates that this is a continuation of a prior `ListAttackPaths` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of parent to list attack paths. Valid formats: \"organizations/{organization}\", \"organizations/{organization}/simulations/{simulation}\" \"organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}\" \"organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}\"", + // "location": "path", + // "pattern": "^organizations/[^/]+/simulations/[^/]+/valuedResources/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/attackPaths", + // "response": { + // "$ref": "ListAttackPathsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Pages(ctx context.Context, f func(*ListAttackPathsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "securitycenter.organizations.sources.create": + +type OrganizationsSourcesCreateCall struct { + s *Service + parent string + source *Source + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a source. +// +// - parent: Resource name of the new source's parent. Its format should +// be "organizations/[organization_id]". +func (r *OrganizationsSourcesService) Create(parent string, source *Source) *OrganizationsSourcesCreateCall { + c := &OrganizationsSourcesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.source = source + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsSourcesCreateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsSourcesCreateCall) Context(ctx context.Context) *OrganizationsSourcesCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsSourcesCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sources") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.sources.create" call. +// Exactly one of *Source or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Source.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsSourcesCreateCall) Do(opts ...googleapi.CallOption) (*Source, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Source{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a source.", + // "flatPath": "v1/organizations/{organizationsId}/sources", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.sources.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. Resource name of the new source's parent. Its format should be \"organizations/[organization_id]\".", + // "location": "path", + // "pattern": "^organizations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/sources", + // "request": { + // "$ref": "Source" + // }, + // "response": { + // "$ref": "Source" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.sources.get": + +type OrganizationsSourcesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a source. +// +// - name: Relative resource name of the source. Its format is +// "organizations/[organization_id]/source/[source_id]". +func (r *OrganizationsSourcesService) Get(name string) *OrganizationsSourcesGetCall { + c := &OrganizationsSourcesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsSourcesGetCall) Fields(s ...googleapi.Field) *OrganizationsSourcesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsSourcesGetCall) IfNoneMatch(entityTag string) *OrganizationsSourcesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsSourcesGetCall) Context(ctx context.Context) *OrganizationsSourcesGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsSourcesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.sources.get" call. +// Exactly one of *Source or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Source.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsSourcesGetCall) Do(opts ...googleapi.CallOption) (*Source, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Source{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a source.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.sources.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Relative resource name of the source. Its format is \"organizations/[organization_id]/source/[source_id]\".", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "Source" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.sources.getIamPolicy": + +type OrganizationsSourcesGetIamPolicyCall struct { + s *Service + resource string + getiampolicyrequest *GetIamPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// GetIamPolicy: Gets the access control policy on the specified Source. +// +// - resource: REQUIRED: The resource for which the policy is being +// requested. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. +func (r *OrganizationsSourcesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *OrganizationsSourcesGetIamPolicyCall { + c := &OrganizationsSourcesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + c.getiampolicyrequest = getiampolicyrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsSourcesGetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSourcesGetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsSourcesGetIamPolicyCall) Context(ctx context.Context) *OrganizationsSourcesGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsSourcesGetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.sources.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsSourcesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the access control policy on the specified Source.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}:getIamPolicy", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.sources.getIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:getIamPolicy", + // "request": { + // "$ref": "GetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.sources.list": + +type OrganizationsSourcesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists all sources belonging to an organization. +// +// - parent: Resource name of the parent of sources to list. Its format +// should be "organizations/[organization_id]", "folders/[folder_id]", +// or "projects/[project_id]". +func (r *OrganizationsSourcesService) List(parent string) *OrganizationsSourcesListCall { + c := &OrganizationsSourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *OrganizationsSourcesListCall) PageSize(pageSize int64) *OrganizationsSourcesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListSourcesResponse`; indicates that this is a +// continuation of a prior `ListSources` call, and that the system +// should return the next page of data. +func (c *OrganizationsSourcesListCall) PageToken(pageToken string) *OrganizationsSourcesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsSourcesListCall) Fields(s ...googleapi.Field) *OrganizationsSourcesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsSourcesListCall) IfNoneMatch(entityTag string) *OrganizationsSourcesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsSourcesListCall) Context(ctx context.Context) *OrganizationsSourcesListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsSourcesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sources") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.sources.list" call. +// Exactly one of *ListSourcesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListSourcesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSourcesResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListSourcesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all sources belonging to an organization.", + // "flatPath": "v1/organizations/{organizationsId}/sources", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.sources.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListSourcesResponse`; indicates that this is a continuation of a prior `ListSources` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "location": "path", + // "pattern": "^organizations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/sources", + // "response": { + // "$ref": "ListSourcesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsSourcesListCall) Pages(ctx context.Context, f func(*ListSourcesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "securitycenter.organizations.sources.patch": + +type OrganizationsSourcesPatchCall struct { + s *Service + name string + source *Source + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates a source. +// +// - name: The relative resource name of this source. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// Example: "organizations/{organization_id}/sources/{source_id}". +func (r *OrganizationsSourcesService) Patch(name string, source *Source) *OrganizationsSourcesPatchCall { + c := &OrganizationsSourcesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.source = source + return c +} + +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the source resource. If empty all mutable fields +// will be updated. +func (c *OrganizationsSourcesPatchCall) UpdateMask(updateMask string) *OrganizationsSourcesPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsSourcesPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsSourcesPatchCall) Context(ctx context.Context) *OrganizationsSourcesPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsSourcesPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.sources.patch" call. +// Exactly one of *Source or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Source.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsSourcesPatchCall) Do(opts ...googleapi.CallOption) (*Source, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Source{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a source.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.sources.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The relative resource name of this source. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/sources/{source_id}\"", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the source resource. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "request": { + // "$ref": "Source" + // }, + // "response": { + // "$ref": "Source" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.sources.setIamPolicy": + +type OrganizationsSourcesSetIamPolicyCall struct { + s *Service + resource string + setiampolicyrequest *SetIamPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// SetIamPolicy: Sets the access control policy on the specified Source. +// +// - resource: REQUIRED: The resource for which the policy is being +// specified. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. +func (r *OrganizationsSourcesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *OrganizationsSourcesSetIamPolicyCall { + c := &OrganizationsSourcesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + c.setiampolicyrequest = setiampolicyrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsSourcesSetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSourcesSetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsSourcesSetIamPolicyCall) Context(ctx context.Context) *OrganizationsSourcesSetIamPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsSourcesSetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.sources.setIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsSourcesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the access control policy on the specified Source.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}:setIamPolicy", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.sources.setIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:setIamPolicy", + // "request": { + // "$ref": "SetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.sources.testIamPermissions": + +type OrganizationsSourcesTestIamPermissionsCall struct { + s *Service + resource string + testiampermissionsrequest *TestIamPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// TestIamPermissions: Returns the permissions that a caller has on the +// specified source. +// +// - resource: REQUIRED: The resource for which the policy detail is +// being requested. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. +func (r *OrganizationsSourcesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *OrganizationsSourcesTestIamPermissionsCall { + c := &OrganizationsSourcesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + c.testiampermissionsrequest = testiampermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsSourcesTestIamPermissionsCall) Fields(s ...googleapi.Field) *OrganizationsSourcesTestIamPermissionsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsSourcesTestIamPermissionsCall) Context(ctx context.Context) *OrganizationsSourcesTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsSourcesTestIamPermissionsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.sources.testIamPermissions" call. +// Exactly one of *TestIamPermissionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TestIamPermissionsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsSourcesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &TestIamPermissionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the permissions that a caller has on the specified source.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}:testIamPermissions", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.sources.testIamPermissions", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:testIamPermissions", + // "request": { + // "$ref": "TestIamPermissionsRequest" + // }, + // "response": { + // "$ref": "TestIamPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.sources.findings.create": + +type OrganizationsSourcesFindingsCreateCall struct { + s *Service + parent string + finding *Finding + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a finding. The corresponding source must exist for +// finding creation to succeed. +// +// - parent: Resource name of the new finding's parent. Its format +// should be "organizations/[organization_id]/sources/[source_id]". +func (r *OrganizationsSourcesFindingsService) Create(parent string, finding *Finding) *OrganizationsSourcesFindingsCreateCall { + c := &OrganizationsSourcesFindingsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.finding = finding + return c +} + +// FindingId sets the optional parameter "findingId": Required. Unique +// identifier provided by the client within the parent scope. It must be +// alphanumeric and less than or equal to 32 characters and greater than +// 0 characters in length. +func (c *OrganizationsSourcesFindingsCreateCall) FindingId(findingId string) *OrganizationsSourcesFindingsCreateCall { + c.urlParams_.Set("findingId", findingId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsSourcesFindingsCreateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsSourcesFindingsCreateCall) Context(ctx context.Context) *OrganizationsSourcesFindingsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsSourcesFindingsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesFindingsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.finding) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.sources.findings.create" call. +// Exactly one of *Finding or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Finding.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsSourcesFindingsCreateCall) Do(opts ...googleapi.CallOption) (*Finding, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Finding{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a finding. The corresponding source must exist for finding creation to succeed.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.sources.findings.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "findingId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must be alphanumeric and less than or equal to 32 characters and greater than 0 characters in length.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Resource name of the new finding's parent. Its format should be \"organizations/[organization_id]/sources/[source_id]\".", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/findings", + // "request": { + // "$ref": "Finding" + // }, + // "response": { + // "$ref": "Finding" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.sources.findings.group": + +type OrganizationsSourcesFindingsGroupCall struct { + s *Service + parent string + groupfindingsrequest *GroupFindingsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Group: Filters an organization or source's findings and groups them +// by their specified properties. To group across all sources provide a +// `-` as the source id. Example: +// /v1/organizations/{organization_id}/sources/-/findings, +// /v1/folders/{folder_id}/sources/-/findings, +// /v1/projects/{project_id}/sources/-/findings +// +// - parent: Name of the source to groupBy. Its format is +// "organizations/[organization_id]/sources/[source_id]", +// folders/[folder_id]/sources/[source_id], or +// projects/[project_id]/sources/[source_id]. To groupBy across all +// sources provide a source_id of `-`. For example: +// organizations/{organization_id}/sources/-, +// folders/{folder_id}/sources/-, or projects/{project_id}/sources/-. +func (r *OrganizationsSourcesFindingsService) Group(parent string, groupfindingsrequest *GroupFindingsRequest) *OrganizationsSourcesFindingsGroupCall { + c := &OrganizationsSourcesFindingsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.groupfindingsrequest = groupfindingsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsSourcesFindingsGroupCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsGroupCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsSourcesFindingsGroupCall) Context(ctx context.Context) *OrganizationsSourcesFindingsGroupCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsSourcesFindingsGroupCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesFindingsGroupCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupfindingsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings:group") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.sources.findings.group" call. +// Exactly one of *GroupFindingsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GroupFindingsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) (*GroupFindingsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GroupFindingsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings:group", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.sources.findings.group", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. Name of the source to groupBy. Its format is \"organizations/[organization_id]/sources/[source_id]\", folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]. To groupBy across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, or projects/{project_id}/sources/-", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/findings:group", + // "request": { + // "$ref": "GroupFindingsRequest" + // }, + // "response": { + // "$ref": "GroupFindingsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsSourcesFindingsGroupCall) Pages(ctx context.Context, f func(*GroupFindingsResponse) error) error { + c.ctx_ = ctx + defer func(pt string) { c.groupfindingsrequest.PageToken = pt }(c.groupfindingsrequest.PageToken) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.groupfindingsrequest.PageToken = x.NextPageToken + } +} + +// method id "securitycenter.organizations.sources.findings.list": + +type OrganizationsSourcesFindingsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists an organization or source's findings. To list across all +// sources provide a `-` as the source id. Example: +// /v1/organizations/{organization_id}/sources/-/findings +// +// - parent: Name of the source the findings belong to. Its format is +// "organizations/[organization_id]/sources/[source_id], +// folders/[folder_id]/sources/[source_id], or +// projects/[project_id]/sources/[source_id]". To list across all +// sources provide a source_id of `-`. For example: +// organizations/{organization_id}/sources/-, +// folders/{folder_id}/sources/- or projects/{projects_id}/sources/-. +func (r *OrganizationsSourcesFindingsService) List(parent string) *OrganizationsSourcesFindingsListCall { + c := &OrganizationsSourcesFindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// CompareDuration sets the optional parameter "compareDuration": When +// compare_duration is set, the ListFindingsResult's "state_change" +// attribute is updated to indicate whether the finding had its state +// changed, the finding's state remained unchanged, or if the finding +// was added in any state during the compare_duration period of time +// that precedes the read_time. This is the time between (read_time - +// compare_duration) and read_time. The state_change value is derived +// based on the presence and state of the finding at the two points in +// time. Intermediate state changes between the two times don't affect +// the result. For example, the results aren't affected if the finding +// is made inactive and then active again. Possible "state_change" +// values when compare_duration is specified: * "CHANGED": indicates +// that the finding was present and matched the given filter at the +// start of compare_duration, but changed its state at read_time. * +// "UNCHANGED": indicates that the finding was present and matched the +// given filter at the start of compare_duration and did not change +// state at read_time. * "ADDED": indicates that the finding did not +// match the given filter or was not present at the start of +// compare_duration, but was present at read_time. * "REMOVED": +// indicates that the finding was present and matched the filter at the +// start of compare_duration, but did not match the filter at read_time. +// If compare_duration is not specified, then the only possible +// state_change is "UNUSED", which will be the state_change set for all +// findings present at read_time. +func (c *OrganizationsSourcesFindingsListCall) CompareDuration(compareDuration string) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("compareDuration", compareDuration) + return c +} + +// FieldMask sets the optional parameter "fieldMask": A field mask to +// specify the Finding fields to be listed in the response. An empty +// field mask will list all fields. +func (c *OrganizationsSourcesFindingsListCall) FieldMask(fieldMask string) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("fieldMask", fieldMask) + return c +} + +// Filter sets the optional parameter "filter": Expression that defines +// the filter to apply across findings. The expression is a list of one +// or more restrictions combined via logical operators `AND` and `OR`. +// Parentheses are supported, and `OR` has higher precedence than `AND`. +// Restrictions have the form ` ` and may have a `-` character in front +// of them to indicate negation. Examples include: * name * +// source_properties.a_property * security_marks.marks.marka The +// supported operators are: * `=` for all value types. * `>`, `<`, `>=`, +// `<=` for integer values. * `:`, meaning substring matching, for +// strings. The supported value types are: * string literals in quotes. +// * integer literals without quotes. * boolean literals `true` and +// `false` without quotes. The following field and operator combinations +// are supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, +// `:` * state: `=`, `:` * category: `=`, `:` * external_uri: `=`, `:` * +// event_time: `=`, `>`, `<`, `>=`, `<=` Usage: This should be +// milliseconds since epoch or an RFC3339 string. Examples: `event_time +// = "2019-06-10T16:07:18-07:00" `event_time = 1560208038000` * +// severity: `=`, `:` * workflow_state: `=`, `:` * security_marks.marks: +// `=`, `:` * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` For +// example, `source_properties.size = 100` is a valid filter string. Use +// a partial match on the empty string to filter based on a property +// existing: `source_properties.my_property : "" Use a negated partial +// match on the empty string to filter based on a property not existing: +// `-source_properties.my_property : "" * resource: * resource.name: +// `=`, `:` * resource.parent_name: `=`, `:` * +// resource.parent_display_name: `=`, `:` * resource.project_name: `=`, +// `:` * resource.project_display_name: `=`, `:` * resource.type: `=`, +// `:` * resource.folders.resource_folder: `=`, `:` * +// resource.display_name: `=`, `:` +func (c *OrganizationsSourcesFindingsListCall) Filter(filter string) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// OrderBy sets the optional parameter "orderBy": Expression that +// defines what fields and order to use for sorting. The string value +// should follow SQL syntax: comma separated list of fields. For +// example: "name,resource_properties.a_property". The default sorting +// order is ascending. To specify descending order for a field, a suffix +// " desc" should be appended to the field name. For example: "name +// desc,source_properties.a_property". Redundant space characters in the +// syntax are insignificant. "name desc,source_properties.a_property" +// and " name desc , source_properties.a_property " are equivalent. The +// following fields are supported: name parent state category +// resource_name event_time source_properties security_marks.marks +func (c *OrganizationsSourcesFindingsListCall) OrderBy(orderBy string) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *OrganizationsSourcesFindingsListCall) PageSize(pageSize int64) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListFindingsResponse`; indicates that this is a +// continuation of a prior `ListFindings` call, and that the system +// should return the next page of data. +func (c *OrganizationsSourcesFindingsListCall) PageToken(pageToken string) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReadTime sets the optional parameter "readTime": Time used as a +// reference point when filtering findings. The filter is limited to +// findings existing at the supplied time and their values are those at +// that specific time. Absence of this field will default to the API's +// version of NOW. +func (c *OrganizationsSourcesFindingsListCall) ReadTime(readTime string) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("readTime", readTime) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsSourcesFindingsListCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsSourcesFindingsListCall) IfNoneMatch(entityTag string) *OrganizationsSourcesFindingsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsSourcesFindingsListCall) Context(ctx context.Context) *OrganizationsSourcesFindingsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsSourcesFindingsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesFindingsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.sources.findings.list" call. +// Exactly one of *ListFindingsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListFindingsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*ListFindingsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListFindingsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.sources.findings.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "compareDuration": { + // "description": "When compare_duration is set, the ListFindingsResult's \"state_change\" attribute is updated to indicate whether the finding had its state changed, the finding's state remained unchanged, or if the finding was added in any state during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence and state of the finding at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the finding is made inactive and then active again. Possible \"state_change\" values when compare_duration is specified: * \"CHANGED\": indicates that the finding was present and matched the given filter at the start of compare_duration, but changed its state at read_time. * \"UNCHANGED\": indicates that the finding was present and matched the given filter at the start of compare_duration and did not change state at read_time. * \"ADDED\": indicates that the finding did not match the given filter or was not present at the start of compare_duration, but was present at read_time. * \"REMOVED\": indicates that the finding was present and matched the filter at the start of compare_duration, but did not match the filter at read_time. If compare_duration is not specified, then the only possible state_change is \"UNUSED\", which will be the state_change set for all findings present at read_time.", + // "format": "google-duration", + // "location": "query", + // "type": "string" + // }, + // "fieldMask": { + // "description": "A field mask to specify the Finding fields to be listed in the response. An empty field mask will list all fields.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // }, + // "filter": { + // "description": "Expression that defines the filter to apply across findings. The expression is a list of one or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. Examples include: * name * source_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following field and operator combinations are supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, `:` * state: `=`, `:` * category: `=`, `:` * external_uri: `=`, `:` * event_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `event_time = \"2019-06-10T16:07:18-07:00\"` `event_time = 1560208038000` * severity: `=`, `:` * workflow_state: `=`, `:` * security_marks.marks: `=`, `:` * source_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` For example, `source_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `source_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-source_properties.my_property : \"\"` * resource: * resource.name: `=`, `:` * resource.parent_name: `=`, `:` * resource.parent_display_name: `=`, `:` * resource.project_name: `=`, `:` * resource.project_display_name: `=`, `:` * resource.type: `=`, `:` * resource.folders.resource_folder: `=`, `:` * resource.display_name: `=`, `:`", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,source_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,source_properties.a_property\" and \" name desc , source_properties.a_property \" are equivalent. The following fields are supported: name parent state category resource_name event_time source_properties security_marks.marks", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListFindingsResponse`; indicates that this is a continuation of a prior `ListFindings` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of the source the findings belong to. Its format is \"organizations/[organization_id]/sources/[source_id], folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]\". To list across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or projects/{projects_id}/sources/-", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "readTime": { // "description": "Time used as a reference point when filtering findings. The filter is limited to findings existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.", // "format": "google-datetime", // "location": "query", // "type": "string" // } // }, - // "path": "v1/{+parent}/findings", + // "path": "v1/{+parent}/findings", + // "response": { + // "$ref": "ListFindingsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsSourcesFindingsListCall) Pages(ctx context.Context, f func(*ListFindingsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "securitycenter.organizations.sources.findings.patch": + +type OrganizationsSourcesFindingsPatchCall struct { + s *Service + name string + finding *Finding + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Creates or updates a finding. The corresponding source must +// exist for a finding creation to succeed. +// +// - name: The relative resource name +// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) +// of the finding. Example: +// "organizations/{organization_id}/sources/{source_id}/findings/{findi +// ng_id}", +// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", +// "projects/{project_id}/sources/{source_id}/findings/{finding_id}". +func (r *OrganizationsSourcesFindingsService) Patch(name string, finding *Finding) *OrganizationsSourcesFindingsPatchCall { + c := &OrganizationsSourcesFindingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.finding = finding + return c +} + +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the finding resource. This field should not be +// specified when creating a finding. When updating a finding, an empty +// mask is treated as updating all mutable fields and replacing +// source_properties. Individual source_properties can be added/updated +// by using "source_properties." in the field mask. +func (c *OrganizationsSourcesFindingsPatchCall) UpdateMask(updateMask string) *OrganizationsSourcesFindingsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsSourcesFindingsPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsSourcesFindingsPatchCall) Context(ctx context.Context) *OrganizationsSourcesFindingsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsSourcesFindingsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesFindingsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.finding) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.sources.findings.patch" call. +// Exactly one of *Finding or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Finding.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Finding, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Finding{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.sources.findings.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{finding_id}\".", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the finding resource. This field should not be specified when creating a finding. When updating a finding, an empty mask is treated as updating all mutable fields and replacing source_properties. Individual source_properties can be added/updated by using \"source_properties.\" in the field mask.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "request": { + // "$ref": "Finding" + // }, + // "response": { + // "$ref": "Finding" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.sources.findings.setMute": + +type OrganizationsSourcesFindingsSetMuteCall struct { + s *Service + name string + setmuterequest *SetMuteRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// SetMute: Updates the mute state of a finding. +// +// - name: The relative resource name +// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) +// of the finding. Example: +// "organizations/{organization_id}/sources/{source_id}/findings/{findi +// ng_id}", +// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", +// "projects/{project_id}/sources/{source_id}/findings/{finding_id}". +func (r *OrganizationsSourcesFindingsService) SetMute(name string, setmuterequest *SetMuteRequest) *OrganizationsSourcesFindingsSetMuteCall { + c := &OrganizationsSourcesFindingsSetMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.setmuterequest = setmuterequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsSourcesFindingsSetMuteCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsSetMuteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsSourcesFindingsSetMuteCall) Context(ctx context.Context) *OrganizationsSourcesFindingsSetMuteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsSourcesFindingsSetMuteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesFindingsSetMuteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmuterequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setMute") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.sources.findings.setMute" call. +// Exactly one of *Finding or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Finding.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOption) (*Finding, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Finding{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the mute state of a finding.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}:setMute", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.sources.findings.setMute", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{finding_id}\".", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:setMute", + // "request": { + // "$ref": "SetMuteRequest" + // }, + // "response": { + // "$ref": "Finding" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.sources.findings.setState": + +type OrganizationsSourcesFindingsSetStateCall struct { + s *Service + name string + setfindingstaterequest *SetFindingStateRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// SetState: Updates the state of a finding. +// +// - name: The relative resource name +// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) +// of the finding. Example: +// "organizations/{organization_id}/sources/{source_id}/findings/{findi +// ng_id}", +// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", +// "projects/{project_id}/sources/{source_id}/findings/{finding_id}". +func (r *OrganizationsSourcesFindingsService) SetState(name string, setfindingstaterequest *SetFindingStateRequest) *OrganizationsSourcesFindingsSetStateCall { + c := &OrganizationsSourcesFindingsSetStateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.setfindingstaterequest = setfindingstaterequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsSourcesFindingsSetStateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsSetStateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsSourcesFindingsSetStateCall) Context(ctx context.Context) *OrganizationsSourcesFindingsSetStateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsSourcesFindingsSetStateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesFindingsSetStateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setfindingstaterequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setState") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.sources.findings.setState" call. +// Exactly one of *Finding or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Finding.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOption) (*Finding, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Finding{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the state of a finding.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}:setState", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.sources.findings.setState", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{finding_id}\".", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:setState", + // "request": { + // "$ref": "SetFindingStateRequest" + // }, + // "response": { + // "$ref": "Finding" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.sources.findings.updateSecurityMarks": + +type OrganizationsSourcesFindingsUpdateSecurityMarksCall struct { + s *Service + name string + securitymarks *SecurityMarks + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// UpdateSecurityMarks: Updates security marks. +// +// - name: The relative resource name of the SecurityMarks. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// Examples: +// "organizations/{organization_id}/assets/{asset_id}/securityMarks" +// "organizations/{organization_id}/sources/{source_id}/findings/{findi +// ng_id}/securityMarks". +func (r *OrganizationsSourcesFindingsService) UpdateSecurityMarks(name string, securitymarks *SecurityMarks) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { + c := &OrganizationsSourcesFindingsUpdateSecurityMarksCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.securitymarks = securitymarks + return c +} + +// StartTime sets the optional parameter "startTime": The time at which +// the updated SecurityMarks take effect. If not set uses current server +// time. Updates will be applied to the SecurityMarks that are active +// immediately preceding this time. Must be earlier or equal to the +// server time. +func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) StartTime(startTime string) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { + c.urlParams_.Set("startTime", startTime) + return c +} + +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the security marks resource. The field mask must +// not contain duplicate fields. If empty or set to "marks", all marks +// will be replaced. Individual marks can be updated using "marks.". +func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) UpdateMask(updateMask string) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Context(ctx context.Context) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.sources.findings.updateSecurityMarks" call. +// Exactly one of *SecurityMarks or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SecurityMarks.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &SecurityMarks{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates security marks.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}/securityMarks", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.sources.findings.updateSecurityMarks", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks$", + // "required": true, + // "type": "string" + // }, + // "startTime": { + // "description": "The time at which the updated SecurityMarks take effect. If not set uses current server time. Updates will be applied to the SecurityMarks that are active immediately preceding this time. Must be earlier or equal to the server time.", + // "format": "google-datetime", + // "location": "query", + // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the security marks resource. The field mask must not contain duplicate fields. If empty or set to \"marks\", all marks will be replaced. Individual marks can be updated using \"marks.\".", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "request": { + // "$ref": "SecurityMarks" + // }, + // "response": { + // "$ref": "SecurityMarks" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.sources.findings.externalSystems.patch": + +type OrganizationsSourcesFindingsExternalSystemsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates external system. This is for a given finding. +// +// - name: Full resource name of the external system, for example: +// "organizations/1234/sources/5678/findings/123456/externalSystems/jir +// a", +// "folders/1234/sources/5678/findings/123456/externalSystems/jira", +// "projects/1234/sources/5678/findings/123456/externalSystems/jira". +func (r *OrganizationsSourcesFindingsExternalSystemsService) Patch(name string, googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem) *OrganizationsSourcesFindingsExternalSystemsPatchCall { + c := &OrganizationsSourcesFindingsExternalSystemsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudsecuritycenterv1externalsystem = googlecloudsecuritycenterv1externalsystem + return c +} + +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the external system resource. If empty all mutable +// fields will be updated. +func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) UpdateMask(updateMask string) *OrganizationsSourcesFindingsExternalSystemsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsExternalSystemsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Context(ctx context.Context) *OrganizationsSourcesFindingsExternalSystemsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1externalsystem) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.sources.findings.externalSystems.patch" call. +// Exactly one of *GoogleCloudSecuritycenterV1ExternalSystem or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1ExternalSystem.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1ExternalSystem, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudSecuritycenterV1ExternalSystem{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates external system. This is for a given finding.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}/externalSystems/{externalSystemsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.sources.findings.externalSystems.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Full resource name of the external system, for example: \"organizations/1234/sources/5678/findings/123456/externalSystems/jira\", \"folders/1234/sources/5678/findings/123456/externalSystems/jira\", \"projects/1234/sources/5678/findings/123456/externalSystems/jira\"", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the external system resource. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" + // }, + // "response": { + // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.projects.assets.group": + +type ProjectsAssetsGroupCall struct { + s *Service + parent string + groupassetsrequest *GroupAssetsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Group: Filters an organization's assets and groups them by their +// specified properties. +// +// - parent: The name of the parent to group the assets by. Its format +// is "organizations/[organization_id]", "folders/[folder_id]", or +// "projects/[project_id]". +func (r *ProjectsAssetsService) Group(parent string, groupassetsrequest *GroupAssetsRequest) *ProjectsAssetsGroupCall { + c := &ProjectsAssetsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.groupassetsrequest = groupassetsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsAssetsGroupCall) Fields(s ...googleapi.Field) *ProjectsAssetsGroupCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsAssetsGroupCall) Context(ctx context.Context) *ProjectsAssetsGroupCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsAssetsGroupCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsAssetsGroupCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupassetsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets:group") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.projects.assets.group" call. +// Exactly one of *GroupAssetsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GroupAssetsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssetsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GroupAssetsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "deprecated": true, + // "description": "Filters an organization's assets and groups them by their specified properties.", + // "flatPath": "v1/projects/{projectsId}/assets:group", + // "httpMethod": "POST", + // "id": "securitycenter.projects.assets.group", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The name of the parent to group the assets by. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "location": "path", + // "pattern": "^projects/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/assets:group", + // "request": { + // "$ref": "GroupAssetsRequest" + // }, + // "response": { + // "$ref": "GroupAssetsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsAssetsGroupCall) Pages(ctx context.Context, f func(*GroupAssetsResponse) error) error { + c.ctx_ = ctx + defer func(pt string) { c.groupassetsrequest.PageToken = pt }(c.groupassetsrequest.PageToken) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.groupassetsrequest.PageToken = x.NextPageToken + } +} + +// method id "securitycenter.projects.assets.list": + +type ProjectsAssetsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists an organization's assets. +// +// - parent: The name of the parent resource that contains the assets. +// The value that you can specify on parent depends on the method in +// which you specify parent. You can specify one of the following +// values: "organizations/[organization_id]", "folders/[folder_id]", +// or "projects/[project_id]". +func (r *ProjectsAssetsService) List(parent string) *ProjectsAssetsListCall { + c := &ProjectsAssetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// CompareDuration sets the optional parameter "compareDuration": When +// compare_duration is set, the ListAssetsResult's "state_change" +// attribute is updated to indicate whether the asset was added, +// removed, or remained present during the compare_duration period of +// time that precedes the read_time. This is the time between (read_time +// - compare_duration) and read_time. The state_change value is derived +// based on the presence of the asset at the two points in time. +// Intermediate state changes between the two times don't affect the +// result. For example, the results aren't affected if the asset is +// removed and re-created again. Possible "state_change" values when +// compare_duration is specified: * "ADDED": indicates that the asset +// was not present at the start of compare_duration, but present at +// read_time. * "REMOVED": indicates that the asset was present at the +// start of compare_duration, but not present at read_time. * "ACTIVE": +// indicates that the asset was present at both the start and the end of +// the time period defined by compare_duration and read_time. If +// compare_duration is not specified, then the only possible +// state_change is "UNUSED", which will be the state_change set for all +// assets present at read_time. +func (c *ProjectsAssetsListCall) CompareDuration(compareDuration string) *ProjectsAssetsListCall { + c.urlParams_.Set("compareDuration", compareDuration) + return c +} + +// FieldMask sets the optional parameter "fieldMask": A field mask to +// specify the ListAssetsResult fields to be listed in the response. An +// empty field mask will list all fields. +func (c *ProjectsAssetsListCall) FieldMask(fieldMask string) *ProjectsAssetsListCall { + c.urlParams_.Set("fieldMask", fieldMask) + return c +} + +// Filter sets the optional parameter "filter": Expression that defines +// the filter to apply across assets. The expression is a list of zero +// or more restrictions combined via logical operators `AND` and `OR`. +// Parentheses are supported, and `OR` has higher precedence than `AND`. +// Restrictions have the form ` ` and may have a `-` character in front +// of them to indicate negation. The fields map to those defined in the +// Asset resource. Examples include: * name * +// security_center_properties.resource_name * +// resource_properties.a_property * security_marks.marks.marka The +// supported operators are: * `=` for all value types. * `>`, `<`, `>=`, +// `<=` for integer values. * `:`, meaning substring matching, for +// strings. The supported value types are: * string literals in quotes. +// * integer literals without quotes. * boolean literals `true` and +// `false` without quotes. The following are the allowed field and +// operator combinations: * name: `=` * update_time: `=`, `>`, `<`, +// `>=`, `<=` Usage: This should be milliseconds since epoch or an +// RFC3339 string. Examples: `update_time = "2019-06-10T16:07:18-07:00" +// `update_time = 1560208038000` * create_time: `=`, `>`, `<`, `>=`, +// `<=` Usage: This should be milliseconds since epoch or an RFC3339 +// string. Examples: `create_time = "2019-06-10T16:07:18-07:00" +// `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * +// resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * +// security_marks.marks: `=`, `:` * +// security_center_properties.resource_name: `=`, `:` * +// security_center_properties.resource_display_name: `=`, `:` * +// security_center_properties.resource_type: `=`, `:` * +// security_center_properties.resource_parent: `=`, `:` * +// security_center_properties.resource_parent_display_name: `=`, `:` * +// security_center_properties.resource_project: `=`, `:` * +// security_center_properties.resource_project_display_name: `=`, `:` * +// security_center_properties.resource_owners: `=`, `:` For example, +// `resource_properties.size = 100` is a valid filter string. Use a +// partial match on the empty string to filter based on a property +// existing: `resource_properties.my_property : "" Use a negated +// partial match on the empty string to filter based on a property not +// existing: `-resource_properties.my_property : "" +func (c *ProjectsAssetsListCall) Filter(filter string) *ProjectsAssetsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// OrderBy sets the optional parameter "orderBy": Expression that +// defines what fields and order to use for sorting. The string value +// should follow SQL syntax: comma separated list of fields. For +// example: "name,resource_properties.a_property". The default sorting +// order is ascending. To specify descending order for a field, a suffix +// " desc" should be appended to the field name. For example: "name +// desc,resource_properties.a_property". Redundant space characters in +// the syntax are insignificant. "name +// desc,resource_properties.a_property" and " name desc , +// resource_properties.a_property " are equivalent. The following fields +// are supported: name update_time resource_properties +// security_marks.marks security_center_properties.resource_name +// security_center_properties.resource_display_name +// security_center_properties.resource_parent +// security_center_properties.resource_parent_display_name +// security_center_properties.resource_project +// security_center_properties.resource_project_display_name +// security_center_properties.resource_type +func (c *ProjectsAssetsListCall) OrderBy(orderBy string) *ProjectsAssetsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *ProjectsAssetsListCall) PageSize(pageSize int64) *ProjectsAssetsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListAssetsResponse`; indicates that this is a +// continuation of a prior `ListAssets` call, and that the system should +// return the next page of data. +func (c *ProjectsAssetsListCall) PageToken(pageToken string) *ProjectsAssetsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReadTime sets the optional parameter "readTime": Time used as a +// reference point when filtering assets. The filter is limited to +// assets existing at the supplied time and their values are those at +// that specific time. Absence of this field will default to the API's +// version of NOW. +func (c *ProjectsAssetsListCall) ReadTime(readTime string) *ProjectsAssetsListCall { + c.urlParams_.Set("readTime", readTime) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsAssetsListCall) Fields(s ...googleapi.Field) *ProjectsAssetsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsAssetsListCall) IfNoneMatch(entityTag string) *ProjectsAssetsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsAssetsListCall) Context(ctx context.Context) *ProjectsAssetsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsAssetsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsAssetsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.projects.assets.list" call. +// Exactly one of *ListAssetsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListAssetsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListAssetsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "deprecated": true, + // "description": "Lists an organization's assets.", + // "flatPath": "v1/projects/{projectsId}/assets", + // "httpMethod": "GET", + // "id": "securitycenter.projects.assets.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "compareDuration": { + // "description": "When compare_duration is set, the ListAssetsResult's \"state_change\" attribute is updated to indicate whether the asset was added, removed, or remained present during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence of the asset at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the asset is removed and re-created again. Possible \"state_change\" values when compare_duration is specified: * \"ADDED\": indicates that the asset was not present at the start of compare_duration, but present at read_time. * \"REMOVED\": indicates that the asset was present at the start of compare_duration, but not present at read_time. * \"ACTIVE\": indicates that the asset was present at both the start and the end of the time period defined by compare_duration and read_time. If compare_duration is not specified, then the only possible state_change is \"UNUSED\", which will be the state_change set for all assets present at read_time.", + // "format": "google-duration", + // "location": "query", + // "type": "string" + // }, + // "fieldMask": { + // "description": "A field mask to specify the ListAssetsResult fields to be listed in the response. An empty field mask will list all fields.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // }, + // "filter": { + // "description": "Expression that defines the filter to apply across assets. The expression is a list of zero or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. The fields map to those defined in the Asset resource. Examples include: * name * security_center_properties.resource_name * resource_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following are the allowed field and operator combinations: * name: `=` * update_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `update_time = \"2019-06-10T16:07:18-07:00\"` `update_time = 1560208038000` * create_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `create_time = \"2019-06-10T16:07:18-07:00\"` `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * resource_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` * security_marks.marks: `=`, `:` * security_center_properties.resource_name: `=`, `:` * security_center_properties.resource_display_name: `=`, `:` * security_center_properties.resource_type: `=`, `:` * security_center_properties.resource_parent: `=`, `:` * security_center_properties.resource_parent_display_name: `=`, `:` * security_center_properties.resource_project: `=`, `:` * security_center_properties.resource_project_display_name: `=`, `:` * security_center_properties.resource_owners: `=`, `:` For example, `resource_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `resource_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-resource_properties.my_property : \"\"`", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,resource_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,resource_properties.a_property\" and \" name desc , resource_properties.a_property \" are equivalent. The following fields are supported: name update_time resource_properties security_marks.marks security_center_properties.resource_name security_center_properties.resource_display_name security_center_properties.resource_parent security_center_properties.resource_parent_display_name security_center_properties.resource_project security_center_properties.resource_project_display_name security_center_properties.resource_type", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListAssetsResponse`; indicates that this is a continuation of a prior `ListAssets` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The name of the parent resource that contains the assets. The value that you can specify on parent depends on the method in which you specify parent. You can specify one of the following values: \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "location": "path", + // "pattern": "^projects/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "readTime": { + // "description": "Time used as a reference point when filtering assets. The filter is limited to assets existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.", + // "format": "google-datetime", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/assets", // "response": { - // "$ref": "ListFindingsResponse" + // "$ref": "ListAssetsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -28452,7 +32134,7 @@ func (c *OrganizationsSourcesFindingsListCall) Do(opts ...googleapi.CallOption) // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *OrganizationsSourcesFindingsListCall) Pages(ctx context.Context, f func(*ListFindingsResponse) error) error { +func (c *ProjectsAssetsListCall) Pages(ctx context.Context, f func(*ListAssetsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -28470,88 +32152,554 @@ func (c *OrganizationsSourcesFindingsListCall) Pages(ctx context.Context, f func } } -// method id "securitycenter.organizations.sources.findings.patch": +// method id "securitycenter.projects.assets.updateSecurityMarks": + +type ProjectsAssetsUpdateSecurityMarksCall struct { + s *Service + name string + securitymarks *SecurityMarks + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// UpdateSecurityMarks: Updates security marks. +// +// - name: The relative resource name of the SecurityMarks. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// Examples: +// "organizations/{organization_id}/assets/{asset_id}/securityMarks" +// "organizations/{organization_id}/sources/{source_id}/findings/{findi +// ng_id}/securityMarks". +func (r *ProjectsAssetsService) UpdateSecurityMarks(name string, securitymarks *SecurityMarks) *ProjectsAssetsUpdateSecurityMarksCall { + c := &ProjectsAssetsUpdateSecurityMarksCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.securitymarks = securitymarks + return c +} + +// StartTime sets the optional parameter "startTime": The time at which +// the updated SecurityMarks take effect. If not set uses current server +// time. Updates will be applied to the SecurityMarks that are active +// immediately preceding this time. Must be earlier or equal to the +// server time. +func (c *ProjectsAssetsUpdateSecurityMarksCall) StartTime(startTime string) *ProjectsAssetsUpdateSecurityMarksCall { + c.urlParams_.Set("startTime", startTime) + return c +} + +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the security marks resource. The field mask must +// not contain duplicate fields. If empty or set to "marks", all marks +// will be replaced. Individual marks can be updated using "marks.". +func (c *ProjectsAssetsUpdateSecurityMarksCall) UpdateMask(updateMask string) *ProjectsAssetsUpdateSecurityMarksCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsAssetsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *ProjectsAssetsUpdateSecurityMarksCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsAssetsUpdateSecurityMarksCall) Context(ctx context.Context) *ProjectsAssetsUpdateSecurityMarksCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsAssetsUpdateSecurityMarksCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsAssetsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.projects.assets.updateSecurityMarks" call. +// Exactly one of *SecurityMarks or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SecurityMarks.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &SecurityMarks{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates security marks.", + // "flatPath": "v1/projects/{projectsId}/assets/{assetsId}/securityMarks", + // "httpMethod": "PATCH", + // "id": "securitycenter.projects.assets.updateSecurityMarks", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", + // "location": "path", + // "pattern": "^projects/[^/]+/assets/[^/]+/securityMarks$", + // "required": true, + // "type": "string" + // }, + // "startTime": { + // "description": "The time at which the updated SecurityMarks take effect. If not set uses current server time. Updates will be applied to the SecurityMarks that are active immediately preceding this time. Must be earlier or equal to the server time.", + // "format": "google-datetime", + // "location": "query", + // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the security marks resource. The field mask must not contain duplicate fields. If empty or set to \"marks\", all marks will be replaced. Individual marks can be updated using \"marks.\".", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "request": { + // "$ref": "SecurityMarks" + // }, + // "response": { + // "$ref": "SecurityMarks" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.projects.bigQueryExports.create": + +type ProjectsBigQueryExportsCreateCall struct { + s *Service + parent string + googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a BigQuery export. +// +// - parent: The name of the parent resource of the new BigQuery export. +// Its format is "organizations/[organization_id]", +// "folders/[folder_id]", or "projects/[project_id]". +func (r *ProjectsBigQueryExportsService) Create(parent string, googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport) *ProjectsBigQueryExportsCreateCall { + c := &ProjectsBigQueryExportsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googlecloudsecuritycenterv1bigqueryexport = googlecloudsecuritycenterv1bigqueryexport + return c +} + +// BigQueryExportId sets the optional parameter "bigQueryExportId": +// Required. Unique identifier provided by the client within the parent +// scope. It must consist of only lowercase letters, numbers, and +// hyphens, must start with a letter, must end with either a letter or a +// number, and must be 63 characters or less. +func (c *ProjectsBigQueryExportsCreateCall) BigQueryExportId(bigQueryExportId string) *ProjectsBigQueryExportsCreateCall { + c.urlParams_.Set("bigQueryExportId", bigQueryExportId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsBigQueryExportsCreateCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsBigQueryExportsCreateCall) Context(ctx context.Context) *ProjectsBigQueryExportsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsBigQueryExportsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsBigQueryExportsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.projects.bigQueryExports.create" call. +// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a BigQuery export.", + // "flatPath": "v1/projects/{projectsId}/bigQueryExports", + // "httpMethod": "POST", + // "id": "securitycenter.projects.bigQueryExports.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "bigQueryExportId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of only lowercase letters, numbers, and hyphens, must start with a letter, must end with either a letter or a number, and must be 63 characters or less.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The name of the parent resource of the new BigQuery export. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "location": "path", + // "pattern": "^projects/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/bigQueryExports", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // }, + // "response": { + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.projects.bigQueryExports.delete": + +type ProjectsBigQueryExportsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes an existing BigQuery export. +// +// - name: The name of the BigQuery export to delete. Its format is +// organizations/{organization}/bigQueryExports/{export_id}, +// folders/{folder}/bigQueryExports/{export_id}, or +// projects/{project}/bigQueryExports/{export_id}. +func (r *ProjectsBigQueryExportsService) Delete(name string) *ProjectsBigQueryExportsDeleteCall { + c := &ProjectsBigQueryExportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsBigQueryExportsDeleteCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsBigQueryExportsDeleteCall) Context(ctx context.Context) *ProjectsBigQueryExportsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsBigQueryExportsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsBigQueryExportsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.projects.bigQueryExports.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes an existing BigQuery export.", + // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.projects.bigQueryExports.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The name of the BigQuery export to delete. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}", + // "location": "path", + // "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.projects.bigQueryExports.get": -type OrganizationsSourcesFindingsPatchCall struct { - s *Service - name string - finding *Finding - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsBigQueryExportsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Creates or updates a finding. The corresponding source must -// exist for a finding creation to succeed. +// Get: Gets a BigQuery export. // -// - name: The relative resource name -// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) -// of the finding. Example: -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}", -// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", -// "projects/{project_id}/sources/{source_id}/findings/{finding_id}". -func (r *OrganizationsSourcesFindingsService) Patch(name string, finding *Finding) *OrganizationsSourcesFindingsPatchCall { - c := &OrganizationsSourcesFindingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the BigQuery export to retrieve. Its format is +// organizations/{organization}/bigQueryExports/{export_id}, +// folders/{folder}/bigQueryExports/{export_id}, or +// projects/{project}/bigQueryExports/{export_id}. +func (r *ProjectsBigQueryExportsService) Get(name string) *ProjectsBigQueryExportsGetCall { + c := &ProjectsBigQueryExportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.finding = finding - return c -} - -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the finding resource. This field should not be -// specified when creating a finding. When updating a finding, an empty -// mask is treated as updating all mutable fields and replacing -// source_properties. Individual source_properties can be added/updated -// by using "source_properties." in the field mask. -func (c *OrganizationsSourcesFindingsPatchCall) UpdateMask(updateMask string) *OrganizationsSourcesFindingsPatchCall { - c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSourcesFindingsPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsPatchCall { +func (c *ProjectsBigQueryExportsGetCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsBigQueryExportsGetCall) IfNoneMatch(entityTag string) *ProjectsBigQueryExportsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesFindingsPatchCall) Context(ctx context.Context) *OrganizationsSourcesFindingsPatchCall { +func (c *ProjectsBigQueryExportsGetCall) Context(ctx context.Context) *ProjectsBigQueryExportsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSourcesFindingsPatchCall) Header() http.Header { +func (c *ProjectsBigQueryExportsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesFindingsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsBigQueryExportsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.finding) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -28562,14 +32710,16 @@ func (c *OrganizationsSourcesFindingsPatchCall) doRequest(alt string) (*http.Res return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.findings.patch" call. -// Exactly one of *Finding or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Finding.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Finding, error) { +// Do executes the "securitycenter.projects.bigQueryExports.get" call. +// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28588,7 +32738,7 @@ func (c *OrganizationsSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Finding{ + ret := &GoogleCloudSecuritycenterV1BigQueryExport{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -28600,34 +32750,25 @@ func (c *OrganizationsSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.sources.findings.patch", + // "description": "Gets a BigQuery export.", + // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", + // "httpMethod": "GET", + // "id": "securitycenter.projects.bigQueryExports.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{finding_id}\".", + // "description": "Required. Name of the BigQuery export to retrieve. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+$", + // "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the finding resource. This field should not be specified when creating a finding. When updating a finding, an empty mask is treated as updating all mutable fields and replacing source_properties. Individual source_properties can be added/updated by using \"source_properties.\" in the field mask.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, // "path": "v1/{+name}", - // "request": { - // "$ref": "Finding" - // }, // "response": { - // "$ref": "Finding" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -28636,94 +32777,120 @@ func (c *OrganizationsSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.organizations.sources.findings.setMute": +// method id "securitycenter.projects.bigQueryExports.list": -type OrganizationsSourcesFindingsSetMuteCall struct { - s *Service - name string - setmuterequest *SetMuteRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsBigQueryExportsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// SetMute: Updates the mute state of a finding. +// List: Lists BigQuery exports. Note that when requesting BigQuery +// exports at a given level all exports under that level are also +// returned e.g. if requesting BigQuery exports under a folder, then all +// BigQuery exports immediately under the folder plus the ones created +// under the projects within the folder are returned. // -// - name: The relative resource name -// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) -// of the finding. Example: -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}", -// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", -// "projects/{project_id}/sources/{source_id}/findings/{finding_id}". -func (r *OrganizationsSourcesFindingsService) SetMute(name string, setmuterequest *SetMuteRequest) *OrganizationsSourcesFindingsSetMuteCall { - c := &OrganizationsSourcesFindingsSetMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.setmuterequest = setmuterequest +// - parent: The parent, which owns the collection of BigQuery exports. +// Its format is "organizations/[organization_id]", +// "folders/[folder_id]", "projects/[project_id]". +func (r *ProjectsBigQueryExportsService) List(parent string) *ProjectsBigQueryExportsListCall { + c := &ProjectsBigQueryExportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of configs to return. The service may return fewer than this value. +// If unspecified, at most 10 configs will be returned. The maximum +// value is 1000; values above 1000 will be coerced to 1000. +func (c *ProjectsBigQueryExportsListCall) PageSize(pageSize int64) *ProjectsBigQueryExportsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListBigQueryExports` call. Provide this to +// retrieve the subsequent page. When paginating, all other parameters +// provided to `ListBigQueryExports` must match the call that provided +// the page token. +func (c *ProjectsBigQueryExportsListCall) PageToken(pageToken string) *ProjectsBigQueryExportsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSourcesFindingsSetMuteCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsSetMuteCall { +func (c *ProjectsBigQueryExportsListCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsBigQueryExportsListCall) IfNoneMatch(entityTag string) *ProjectsBigQueryExportsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesFindingsSetMuteCall) Context(ctx context.Context) *OrganizationsSourcesFindingsSetMuteCall { +func (c *ProjectsBigQueryExportsListCall) Context(ctx context.Context) *ProjectsBigQueryExportsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSourcesFindingsSetMuteCall) Header() http.Header { +func (c *ProjectsBigQueryExportsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesFindingsSetMuteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsBigQueryExportsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmuterequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setMute") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.findings.setMute" call. -// Exactly one of *Finding or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Finding.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOption) (*Finding, error) { +// Do executes the "securitycenter.projects.bigQueryExports.list" call. +// Exactly one of *ListBigQueryExportsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListBigQueryExportsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*ListBigQueryExportsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28742,7 +32909,7 @@ func (c *OrganizationsSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Finding{ + ret := &ListBigQueryExportsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -28754,28 +32921,36 @@ func (c *OrganizationsSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Updates the mute state of a finding.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}:setMute", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.findings.setMute", + // "description": "Lists BigQuery exports. Note that when requesting BigQuery exports at a given level all exports under that level are also returned e.g. if requesting BigQuery exports under a folder, then all BigQuery exports immediately under the folder plus the ones created under the projects within the folder are returned.", + // "flatPath": "v1/projects/{projectsId}/bigQueryExports", + // "httpMethod": "GET", + // "id": "securitycenter.projects.bigQueryExports.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{finding_id}\".", + // "pageSize": { + // "description": "The maximum number of configs to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token, received from a previous `ListBigQueryExports` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListBigQueryExports` must match the call that provided the page token.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent, which owns the collection of BigQuery exports. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+$", + // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}:setMute", - // "request": { - // "$ref": "SetMuteRequest" - // }, + // "path": "v1/{+parent}/bigQueryExports", // "response": { - // "$ref": "Finding" + // "$ref": "ListBigQueryExportsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -28784,37 +32959,66 @@ func (c *OrganizationsSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOptio } -// method id "securitycenter.organizations.sources.findings.setState": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsBigQueryExportsListCall) Pages(ctx context.Context, f func(*ListBigQueryExportsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type OrganizationsSourcesFindingsSetStateCall struct { - s *Service - name string - setfindingstaterequest *SetFindingStateRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.projects.bigQueryExports.patch": + +type ProjectsBigQueryExportsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetState: Updates the state of a finding. +// Patch: Updates a BigQuery export. // -// - name: The relative resource name -// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) -// of the finding. Example: -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}", -// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", -// "projects/{project_id}/sources/{source_id}/findings/{finding_id}". -func (r *OrganizationsSourcesFindingsService) SetState(name string, setfindingstaterequest *SetFindingStateRequest) *OrganizationsSourcesFindingsSetStateCall { - c := &OrganizationsSourcesFindingsSetStateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The relative resource name of this export. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name. +// Example format: +// "organizations/{organization_id}/bigQueryExports/{export_id}" +// Example format: "folders/{folder_id}/bigQueryExports/{export_id}" +// Example format: "projects/{project_id}/bigQueryExports/{export_id}" +// This field is provided in responses, and is ignored when provided +// in create requests. +func (r *ProjectsBigQueryExportsService) Patch(name string, googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport) *ProjectsBigQueryExportsPatchCall { + c := &ProjectsBigQueryExportsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.setfindingstaterequest = setfindingstaterequest + c.googlecloudsecuritycenterv1bigqueryexport = googlecloudsecuritycenterv1bigqueryexport + return c +} + +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to be updated. If empty all mutable fields will be updated. +func (c *ProjectsBigQueryExportsPatchCall) UpdateMask(updateMask string) *ProjectsBigQueryExportsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSourcesFindingsSetStateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsSetStateCall { +func (c *ProjectsBigQueryExportsPatchCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -28822,21 +33026,21 @@ func (c *OrganizationsSourcesFindingsSetStateCall) Fields(s ...googleapi.Field) // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesFindingsSetStateCall) Context(ctx context.Context) *OrganizationsSourcesFindingsSetStateCall { +func (c *ProjectsBigQueryExportsPatchCall) Context(ctx context.Context) *ProjectsBigQueryExportsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSourcesFindingsSetStateCall) Header() http.Header { +func (c *ProjectsBigQueryExportsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesFindingsSetStateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsBigQueryExportsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -28844,16 +33048,16 @@ func (c *OrganizationsSourcesFindingsSetStateCall) doRequest(alt string) (*http. } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setfindingstaterequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setState") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -28864,14 +33068,16 @@ func (c *OrganizationsSourcesFindingsSetStateCall) doRequest(alt string) (*http. return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.findings.setState" call. -// Exactly one of *Finding or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Finding.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOption) (*Finding, error) { +// Do executes the "securitycenter.projects.bigQueryExports.patch" call. +// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28890,7 +33096,7 @@ func (c *OrganizationsSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Finding{ + ret := &GoogleCloudSecuritycenterV1BigQueryExport{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -28902,28 +33108,34 @@ func (c *OrganizationsSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOpti } return ret, nil // { - // "description": "Updates the state of a finding.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}:setState", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.findings.setState", + // "description": "Updates a BigQuery export.", + // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.projects.bigQueryExports.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{finding_id}\".", + // "description": "The relative resource name of this export. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name. Example format: \"organizations/{organization_id}/bigQueryExports/{export_id}\" Example format: \"folders/{folder_id}/bigQueryExports/{export_id}\" Example format: \"projects/{project_id}/bigQueryExports/{export_id}\" This field is provided in responses, and is ignored when provided in create requests.", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+$", + // "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1/{+name}:setState", + // "path": "v1/{+name}", // "request": { - // "$ref": "SetFindingStateRequest" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "response": { - // "$ref": "Finding" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -28932,55 +33144,36 @@ func (c *OrganizationsSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOpti } -// method id "securitycenter.organizations.sources.findings.updateSecurityMarks": +// method id "securitycenter.projects.eventThreatDetectionSettings.validateCustomModule": -type OrganizationsSourcesFindingsUpdateSecurityMarksCall struct { - s *Service - name string - securitymarks *SecurityMarks - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsEventThreatDetectionSettingsValidateCustomModuleCall struct { + s *Service + parent string + validateeventthreatdetectioncustommodulerequest *ValidateEventThreatDetectionCustomModuleRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// UpdateSecurityMarks: Updates security marks. +// ValidateCustomModule: Validates the given Event Threat Detection +// custom module. // -// - name: The relative resource name of the SecurityMarks. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Examples: -// "organizations/{organization_id}/assets/{asset_id}/securityMarks" -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}/securityMarks". -func (r *OrganizationsSourcesFindingsService) UpdateSecurityMarks(name string, securitymarks *SecurityMarks) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { - c := &OrganizationsSourcesFindingsUpdateSecurityMarksCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.securitymarks = securitymarks - return c -} - -// StartTime sets the optional parameter "startTime": The time at which -// the updated SecurityMarks take effect. If not set uses current server -// time. Updates will be applied to the SecurityMarks that are active -// immediately preceding this time. Must be earlier or equal to the -// server time. -func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) StartTime(startTime string) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { - c.urlParams_.Set("startTime", startTime) - return c -} - -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the security marks resource. The field mask must -// not contain duplicate fields. If empty or set to "marks", all marks -// will be replaced. Individual marks can be updated using "marks.". -func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) UpdateMask(updateMask string) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { - c.urlParams_.Set("updateMask", updateMask) +// - parent: Resource name of the parent to validate the Custom Module +// under. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings". * +// "folders/{folder}/eventThreatDetectionSettings". * +// "projects/{project}/eventThreatDetectionSettings". +func (r *ProjectsEventThreatDetectionSettingsService) ValidateCustomModule(parent string, validateeventthreatdetectioncustommodulerequest *ValidateEventThreatDetectionCustomModuleRequest) *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall { + c := &ProjectsEventThreatDetectionSettingsValidateCustomModuleCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.validateeventthreatdetectioncustommodulerequest = validateeventthreatdetectioncustommodulerequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { +func (c *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall) Fields(s ...googleapi.Field) *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -28988,21 +33181,21 @@ func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Fields(s ...google // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Context(ctx context.Context) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { +func (c *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall) Context(ctx context.Context) *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Header() http.Header { +func (c *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -29010,34 +33203,36 @@ func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) doRequest(alt stri } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.validateeventthreatdetectioncustommodulerequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:validateCustomModule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.findings.updateSecurityMarks" call. -// Exactly one of *SecurityMarks or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *SecurityMarks.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, error) { +// Do executes the "securitycenter.projects.eventThreatDetectionSettings.validateCustomModule" call. +// Exactly one of *ValidateEventThreatDetectionCustomModuleResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ValidateEventThreatDetectionCustomModuleResponse.ServerResponse.Heade +// r or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall) Do(opts ...googleapi.CallOption) (*ValidateEventThreatDetectionCustomModuleResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29056,7 +33251,7 @@ func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googlea if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &SecurityMarks{ + ret := &ValidateEventThreatDetectionCustomModuleResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -29068,40 +33263,28 @@ func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googlea } return ret, nil // { - // "description": "Updates security marks.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}/securityMarks", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.sources.findings.updateSecurityMarks", + // "description": "Validates the given Event Threat Detection custom module.", + // "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings:validateCustomModule", + // "httpMethod": "POST", + // "id": "securitycenter.projects.eventThreatDetectionSettings.validateCustomModule", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", + // "parent": { + // "description": "Required. Resource name of the parent to validate the Custom Module under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks$", + // "pattern": "^projects/[^/]+/eventThreatDetectionSettings$", // "required": true, // "type": "string" - // }, - // "startTime": { - // "description": "The time at which the updated SecurityMarks take effect. If not set uses current server time. Updates will be applied to the SecurityMarks that are active immediately preceding this time. Must be earlier or equal to the server time.", - // "format": "google-datetime", - // "location": "query", - // "type": "string" - // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the security marks resource. The field mask must not contain duplicate fields. If empty or set to \"marks\", all marks will be replaced. Individual marks can be updated using \"marks.\".", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}:validateCustomModule", // "request": { - // "$ref": "SecurityMarks" + // "$ref": "ValidateEventThreatDetectionCustomModuleRequest" // }, // "response": { - // "$ref": "SecurityMarks" + // "$ref": "ValidateEventThreatDetectionCustomModuleResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -29110,43 +33293,37 @@ func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googlea } -// method id "securitycenter.organizations.sources.findings.externalSystems.patch": +// method id "securitycenter.projects.eventThreatDetectionSettings.customModules.create": -type OrganizationsSourcesFindingsExternalSystemsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsEventThreatDetectionSettingsCustomModulesCreateCall struct { + s *Service + parent string + eventthreatdetectioncustommodule *EventThreatDetectionCustomModule + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates external system. This is for a given finding. +// Create: Creates a resident Event Threat Detection custom module at +// the scope of the given Resource Manager parent, and also creates +// inherited custom modules for all descendants of the given parent. +// These modules are enabled by default. // -// - name: Full resource name of the external system, for example: -// "organizations/1234/sources/5678/findings/123456/externalSystems/jir -// a", -// "folders/1234/sources/5678/findings/123456/externalSystems/jira", -// "projects/1234/sources/5678/findings/123456/externalSystems/jira". -func (r *OrganizationsSourcesFindingsExternalSystemsService) Patch(name string, googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem) *OrganizationsSourcesFindingsExternalSystemsPatchCall { - c := &OrganizationsSourcesFindingsExternalSystemsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googlecloudsecuritycenterv1externalsystem = googlecloudsecuritycenterv1externalsystem - return c -} - -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the external system resource. If empty all mutable -// fields will be updated. -func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) UpdateMask(updateMask string) *OrganizationsSourcesFindingsExternalSystemsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// - parent: The new custom module's parent. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings". * +// "folders/{folder}/eventThreatDetectionSettings". * +// "projects/{project}/eventThreatDetectionSettings". +func (r *ProjectsEventThreatDetectionSettingsCustomModulesService) Create(parent string, eventthreatdetectioncustommodule *EventThreatDetectionCustomModule) *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall { + c := &ProjectsEventThreatDetectionSettingsCustomModulesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.eventthreatdetectioncustommodule = eventthreatdetectioncustommodule return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsExternalSystemsPatchCall { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall) Fields(s ...googleapi.Field) *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -29154,21 +33331,21 @@ func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Fields(s ...googl // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Context(ctx context.Context) *OrganizationsSourcesFindingsExternalSystemsPatchCall { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall) Context(ctx context.Context) *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Header() http.Header { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -29176,36 +33353,34 @@ func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) doRequest(alt str } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1externalsystem) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.findings.externalSystems.patch" call. -// Exactly one of *GoogleCloudSecuritycenterV1ExternalSystem or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1ExternalSystem.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1ExternalSystem, error) { +// Do executes the "securitycenter.projects.eventThreatDetectionSettings.customModules.create" call. +// Exactly one of *EventThreatDetectionCustomModule or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29224,7 +33399,7 @@ func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Do(opts ...google if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1ExternalSystem{ + ret := &EventThreatDetectionCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -29236,34 +33411,28 @@ func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Do(opts ...google } return ret, nil // { - // "description": "Updates external system. This is for a given finding.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}/externalSystems/{externalSystemsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.sources.findings.externalSystems.patch", + // "description": "Creates a resident Event Threat Detection custom module at the scope of the given Resource Manager parent, and also creates inherited custom modules for all descendants of the given parent. These modules are enabled by default.", + // "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules", + // "httpMethod": "POST", + // "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Full resource name of the external system, for example: \"organizations/1234/sources/5678/findings/123456/externalSystems/jira\", \"folders/1234/sources/5678/findings/123456/externalSystems/jira\", \"projects/1234/sources/5678/findings/123456/externalSystems/jira\"", + // "parent": { + // "description": "Required. The new custom module's parent. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+$", + // "pattern": "^projects/[^/]+/eventThreatDetectionSettings$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the external system resource. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/customModules", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" + // "$ref": "EventThreatDetectionCustomModule" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" + // "$ref": "EventThreatDetectionCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -29272,34 +33441,37 @@ func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Do(opts ...google } -// method id "securitycenter.projects.assets.group": +// method id "securitycenter.projects.eventThreatDetectionSettings.customModules.delete": -type ProjectsAssetsGroupCall struct { - s *Service - parent string - groupassetsrequest *GroupAssetsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Group: Filters an organization's assets and groups them by their -// specified properties. +// Delete: Deletes the specified Event Threat Detection custom module +// and all of its descendants in the Resource Manager hierarchy. This +// method is only supported for resident custom modules. // -// - parent: The name of the parent to group the assets by. Its format -// is "organizations/[organization_id]", "folders/[folder_id]", or -// "projects/[project_id]". -func (r *ProjectsAssetsService) Group(parent string, groupassetsrequest *GroupAssetsRequest) *ProjectsAssetsGroupCall { - c := &ProjectsAssetsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.groupassetsrequest = groupassetsrequest +// - name: Name of the custom module to delete. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings/customMod +// ules/{module}". * +// "folders/{folder}/eventThreatDetectionSettings/customModules/{module +// }". * +// "projects/{project}/eventThreatDetectionSettings/customModules/{modu +// le}". +func (r *ProjectsEventThreatDetectionSettingsCustomModulesService) Delete(name string) *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall { + c := &ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsAssetsGroupCall) Fields(s ...googleapi.Field) *ProjectsAssetsGroupCall { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall) Fields(s ...googleapi.Field) *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -29307,21 +33479,21 @@ func (c *ProjectsAssetsGroupCall) Fields(s ...googleapi.Field) *ProjectsAssetsGr // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsAssetsGroupCall) Context(ctx context.Context) *ProjectsAssetsGroupCall { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall) Context(ctx context.Context) *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsAssetsGroupCall) Header() http.Header { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsAssetsGroupCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -29329,34 +33501,29 @@ func (c *ProjectsAssetsGroupCall) doRequest(alt string) (*http.Response, error) } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupassetsrequest) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets:group") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.assets.group" call. -// Exactly one of *GroupAssetsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *GroupAssetsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssetsResponse, error) { +// Do executes the "securitycenter.projects.eventThreatDetectionSettings.customModules.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29375,7 +33542,7 @@ func (c *ProjectsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssets if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GroupAssetsResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -29387,29 +33554,25 @@ func (c *ProjectsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssets } return ret, nil // { - // "deprecated": true, - // "description": "Filters an organization's assets and groups them by their specified properties.", - // "flatPath": "v1/projects/{projectsId}/assets:group", - // "httpMethod": "POST", - // "id": "securitycenter.projects.assets.group", + // "description": "Deletes the specified Event Threat Detection custom module and all of its descendants in the Resource Manager hierarchy. This method is only supported for resident custom modules.", + // "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules/{customModulesId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The name of the parent to group the assets by. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "name": { + // "description": "Required. Name of the custom module to delete. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", // "location": "path", - // "pattern": "^projects/[^/]+$", + // "pattern": "^projects/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/assets:group", - // "request": { - // "$ref": "GroupAssetsRequest" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "GroupAssetsResponse" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -29418,178 +33581,36 @@ func (c *ProjectsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssets } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsAssetsGroupCall) Pages(ctx context.Context, f func(*GroupAssetsResponse) error) error { - c.ctx_ = ctx - defer func(pt string) { c.groupassetsrequest.PageToken = pt }(c.groupassetsrequest.PageToken) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.groupassetsrequest.PageToken = x.NextPageToken - } -} - -// method id "securitycenter.projects.assets.list": +// method id "securitycenter.projects.eventThreatDetectionSettings.customModules.get": -type ProjectsAssetsListCall struct { +type ProjectsEventThreatDetectionSettingsCustomModulesGetCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists an organization's assets. +// Get: Gets an Event Threat Detection custom module. // -// - parent: The name of the parent resource that contains the assets. -// The value that you can specify on parent depends on the method in -// which you specify parent. You can specify one of the following -// values: "organizations/[organization_id]", "folders/[folder_id]", -// or "projects/[project_id]". -func (r *ProjectsAssetsService) List(parent string) *ProjectsAssetsListCall { - c := &ProjectsAssetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// CompareDuration sets the optional parameter "compareDuration": When -// compare_duration is set, the ListAssetsResult's "state_change" -// attribute is updated to indicate whether the asset was added, -// removed, or remained present during the compare_duration period of -// time that precedes the read_time. This is the time between (read_time -// - compare_duration) and read_time. The state_change value is derived -// based on the presence of the asset at the two points in time. -// Intermediate state changes between the two times don't affect the -// result. For example, the results aren't affected if the asset is -// removed and re-created again. Possible "state_change" values when -// compare_duration is specified: * "ADDED": indicates that the asset -// was not present at the start of compare_duration, but present at -// read_time. * "REMOVED": indicates that the asset was present at the -// start of compare_duration, but not present at read_time. * "ACTIVE": -// indicates that the asset was present at both the start and the end of -// the time period defined by compare_duration and read_time. If -// compare_duration is not specified, then the only possible -// state_change is "UNUSED", which will be the state_change set for all -// assets present at read_time. -func (c *ProjectsAssetsListCall) CompareDuration(compareDuration string) *ProjectsAssetsListCall { - c.urlParams_.Set("compareDuration", compareDuration) - return c -} - -// FieldMask sets the optional parameter "fieldMask": A field mask to -// specify the ListAssetsResult fields to be listed in the response. An -// empty field mask will list all fields. -func (c *ProjectsAssetsListCall) FieldMask(fieldMask string) *ProjectsAssetsListCall { - c.urlParams_.Set("fieldMask", fieldMask) - return c -} - -// Filter sets the optional parameter "filter": Expression that defines -// the filter to apply across assets. The expression is a list of zero -// or more restrictions combined via logical operators `AND` and `OR`. -// Parentheses are supported, and `OR` has higher precedence than `AND`. -// Restrictions have the form ` ` and may have a `-` character in front -// of them to indicate negation. The fields map to those defined in the -// Asset resource. Examples include: * name * -// security_center_properties.resource_name * -// resource_properties.a_property * security_marks.marks.marka The -// supported operators are: * `=` for all value types. * `>`, `<`, `>=`, -// `<=` for integer values. * `:`, meaning substring matching, for -// strings. The supported value types are: * string literals in quotes. -// * integer literals without quotes. * boolean literals `true` and -// `false` without quotes. The following are the allowed field and -// operator combinations: * name: `=` * update_time: `=`, `>`, `<`, -// `>=`, `<=` Usage: This should be milliseconds since epoch or an -// RFC3339 string. Examples: `update_time = "2019-06-10T16:07:18-07:00" -// `update_time = 1560208038000` * create_time: `=`, `>`, `<`, `>=`, -// `<=` Usage: This should be milliseconds since epoch or an RFC3339 -// string. Examples: `create_time = "2019-06-10T16:07:18-07:00" -// `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * -// resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * -// security_marks.marks: `=`, `:` * -// security_center_properties.resource_name: `=`, `:` * -// security_center_properties.resource_display_name: `=`, `:` * -// security_center_properties.resource_type: `=`, `:` * -// security_center_properties.resource_parent: `=`, `:` * -// security_center_properties.resource_parent_display_name: `=`, `:` * -// security_center_properties.resource_project: `=`, `:` * -// security_center_properties.resource_project_display_name: `=`, `:` * -// security_center_properties.resource_owners: `=`, `:` For example, -// `resource_properties.size = 100` is a valid filter string. Use a -// partial match on the empty string to filter based on a property -// existing: `resource_properties.my_property : "" Use a negated -// partial match on the empty string to filter based on a property not -// existing: `-resource_properties.my_property : "" -func (c *ProjectsAssetsListCall) Filter(filter string) *ProjectsAssetsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// OrderBy sets the optional parameter "orderBy": Expression that -// defines what fields and order to use for sorting. The string value -// should follow SQL syntax: comma separated list of fields. For -// example: "name,resource_properties.a_property". The default sorting -// order is ascending. To specify descending order for a field, a suffix -// " desc" should be appended to the field name. For example: "name -// desc,resource_properties.a_property". Redundant space characters in -// the syntax are insignificant. "name -// desc,resource_properties.a_property" and " name desc , -// resource_properties.a_property " are equivalent. The following fields -// are supported: name update_time resource_properties -// security_marks.marks security_center_properties.resource_name -// security_center_properties.resource_display_name -// security_center_properties.resource_parent -// security_center_properties.resource_parent_display_name -// security_center_properties.resource_project -// security_center_properties.resource_project_display_name -// security_center_properties.resource_type -func (c *ProjectsAssetsListCall) OrderBy(orderBy string) *ProjectsAssetsListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *ProjectsAssetsListCall) PageSize(pageSize int64) *ProjectsAssetsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListAssetsResponse`; indicates that this is a -// continuation of a prior `ListAssets` call, and that the system should -// return the next page of data. -func (c *ProjectsAssetsListCall) PageToken(pageToken string) *ProjectsAssetsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReadTime sets the optional parameter "readTime": Time used as a -// reference point when filtering assets. The filter is limited to -// assets existing at the supplied time and their values are those at -// that specific time. Absence of this field will default to the API's -// version of NOW. -func (c *ProjectsAssetsListCall) ReadTime(readTime string) *ProjectsAssetsListCall { - c.urlParams_.Set("readTime", readTime) +// - name: Name of the custom module to get. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings/customMod +// ules/{module}". * +// "folders/{folder}/eventThreatDetectionSettings/customModules/{module +// }". * +// "projects/{project}/eventThreatDetectionSettings/customModules/{modu +// le}". +func (r *ProjectsEventThreatDetectionSettingsCustomModulesService) Get(name string) *ProjectsEventThreatDetectionSettingsCustomModulesGetCall { + c := &ProjectsEventThreatDetectionSettingsCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsAssetsListCall) Fields(s ...googleapi.Field) *ProjectsAssetsListCall { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *ProjectsEventThreatDetectionSettingsCustomModulesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -29599,7 +33620,7 @@ func (c *ProjectsAssetsListCall) Fields(s ...googleapi.Field) *ProjectsAssetsLis // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsAssetsListCall) IfNoneMatch(entityTag string) *ProjectsAssetsListCall { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesGetCall) IfNoneMatch(entityTag string) *ProjectsEventThreatDetectionSettingsCustomModulesGetCall { c.ifNoneMatch_ = entityTag return c } @@ -29607,21 +33628,21 @@ func (c *ProjectsAssetsListCall) IfNoneMatch(entityTag string) *ProjectsAssetsLi // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsAssetsListCall) Context(ctx context.Context) *ProjectsAssetsListCall { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesGetCall) Context(ctx context.Context) *ProjectsEventThreatDetectionSettingsCustomModulesGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsAssetsListCall) Header() http.Header { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsAssetsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -29634,7 +33655,7 @@ func (c *ProjectsAssetsListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -29642,19 +33663,19 @@ func (c *ProjectsAssetsListCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.assets.list" call. -// Exactly one of *ListAssetsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListAssetsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was +// Do executes the "securitycenter.projects.eventThreatDetectionSettings.customModules.get" call. +// Exactly one of *EventThreatDetectionCustomModule or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsResponse, error) { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29673,7 +33694,7 @@ func (c *ProjectsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsRe if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListAssetsResponse{ + ret := &EventThreatDetectionCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -29685,65 +33706,25 @@ func (c *ProjectsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsRe } return ret, nil // { - // "deprecated": true, - // "description": "Lists an organization's assets.", - // "flatPath": "v1/projects/{projectsId}/assets", + // "description": "Gets an Event Threat Detection custom module.", + // "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules/{customModulesId}", // "httpMethod": "GET", - // "id": "securitycenter.projects.assets.list", + // "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "compareDuration": { - // "description": "When compare_duration is set, the ListAssetsResult's \"state_change\" attribute is updated to indicate whether the asset was added, removed, or remained present during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence of the asset at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the asset is removed and re-created again. Possible \"state_change\" values when compare_duration is specified: * \"ADDED\": indicates that the asset was not present at the start of compare_duration, but present at read_time. * \"REMOVED\": indicates that the asset was present at the start of compare_duration, but not present at read_time. * \"ACTIVE\": indicates that the asset was present at both the start and the end of the time period defined by compare_duration and read_time. If compare_duration is not specified, then the only possible state_change is \"UNUSED\", which will be the state_change set for all assets present at read_time.", - // "format": "google-duration", - // "location": "query", - // "type": "string" - // }, - // "fieldMask": { - // "description": "A field mask to specify the ListAssetsResult fields to be listed in the response. An empty field mask will list all fields.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" - // }, - // "filter": { - // "description": "Expression that defines the filter to apply across assets. The expression is a list of zero or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. The fields map to those defined in the Asset resource. Examples include: * name * security_center_properties.resource_name * resource_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following are the allowed field and operator combinations: * name: `=` * update_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `update_time = \"2019-06-10T16:07:18-07:00\"` `update_time = 1560208038000` * create_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `create_time = \"2019-06-10T16:07:18-07:00\"` `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * resource_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` * security_marks.marks: `=`, `:` * security_center_properties.resource_name: `=`, `:` * security_center_properties.resource_display_name: `=`, `:` * security_center_properties.resource_type: `=`, `:` * security_center_properties.resource_parent: `=`, `:` * security_center_properties.resource_parent_display_name: `=`, `:` * security_center_properties.resource_project: `=`, `:` * security_center_properties.resource_project_display_name: `=`, `:` * security_center_properties.resource_owners: `=`, `:` For example, `resource_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `resource_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-resource_properties.my_property : \"\"`", - // "location": "query", - // "type": "string" - // }, - // "orderBy": { - // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,resource_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,resource_properties.a_property\" and \" name desc , resource_properties.a_property \" are equivalent. The following fields are supported: name update_time resource_properties security_marks.marks security_center_properties.resource_name security_center_properties.resource_display_name security_center_properties.resource_parent security_center_properties.resource_parent_display_name security_center_properties.resource_project security_center_properties.resource_project_display_name security_center_properties.resource_type", - // "location": "query", - // "type": "string" - // }, - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last `ListAssetsResponse`; indicates that this is a continuation of a prior `ListAssets` call, and that the system should return the next page of data.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The name of the parent resource that contains the assets. The value that you can specify on parent depends on the method in which you specify parent. You can specify one of the following values: \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "name": { + // "description": "Required. Name of the custom module to get. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", // "location": "path", - // "pattern": "^projects/[^/]+$", + // "pattern": "^projects/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", // "required": true, // "type": "string" - // }, - // "readTime": { - // "description": "Time used as a reference point when filtering assets. The filter is limited to assets existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.", - // "format": "google-datetime", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1/{+parent}/assets", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListAssetsResponse" + // "$ref": "EventThreatDetectionCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -29752,133 +33733,122 @@ func (c *ProjectsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsRe } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsAssetsListCall) Pages(ctx context.Context, f func(*ListAssetsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "securitycenter.projects.assets.updateSecurityMarks": +// method id "securitycenter.projects.eventThreatDetectionSettings.customModules.list": -type ProjectsAssetsUpdateSecurityMarksCall struct { - s *Service - name string - securitymarks *SecurityMarks - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsEventThreatDetectionSettingsCustomModulesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// UpdateSecurityMarks: Updates security marks. +// List: Lists all Event Threat Detection custom modules for the given +// Resource Manager parent. This includes resident modules defined at +// the scope of the parent along with modules inherited from ancestors. // -// - name: The relative resource name of the SecurityMarks. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Examples: -// "organizations/{organization_id}/assets/{asset_id}/securityMarks" -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}/securityMarks". -func (r *ProjectsAssetsService) UpdateSecurityMarks(name string, securitymarks *SecurityMarks) *ProjectsAssetsUpdateSecurityMarksCall { - c := &ProjectsAssetsUpdateSecurityMarksCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.securitymarks = securitymarks +// - parent: Name of the parent to list custom modules under. Its format +// is: * "organizations/{organization}/eventThreatDetectionSettings". +// - "folders/{folder}/eventThreatDetectionSettings". * +// "projects/{project}/eventThreatDetectionSettings". +func (r *ProjectsEventThreatDetectionSettingsCustomModulesService) List(parent string) *ProjectsEventThreatDetectionSettingsCustomModulesListCall { + c := &ProjectsEventThreatDetectionSettingsCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// StartTime sets the optional parameter "startTime": The time at which -// the updated SecurityMarks take effect. If not set uses current server -// time. Updates will be applied to the SecurityMarks that are active -// immediately preceding this time. Must be earlier or equal to the -// server time. -func (c *ProjectsAssetsUpdateSecurityMarksCall) StartTime(startTime string) *ProjectsAssetsUpdateSecurityMarksCall { - c.urlParams_.Set("startTime", startTime) +// PageSize sets the optional parameter "pageSize": The maximum number +// of modules to return. The service may return fewer than this value. +// If unspecified, at most 10 configs will be returned. The maximum +// value is 1000; values above 1000 will be coerced to 1000. +func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) PageSize(pageSize int64) *ProjectsEventThreatDetectionSettingsCustomModulesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the security marks resource. The field mask must -// not contain duplicate fields. If empty or set to "marks", all marks -// will be replaced. Individual marks can be updated using "marks.". -func (c *ProjectsAssetsUpdateSecurityMarksCall) UpdateMask(updateMask string) *ProjectsAssetsUpdateSecurityMarksCall { - c.urlParams_.Set("updateMask", updateMask) +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListEventThreatDetectionCustomModules` +// call. Provide this to retrieve the subsequent page. When paginating, +// all other parameters provided to +// `ListEventThreatDetectionCustomModules` must match the call that +// provided the page token. +func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) PageToken(pageToken string) *ProjectsEventThreatDetectionSettingsCustomModulesListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsAssetsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *ProjectsAssetsUpdateSecurityMarksCall { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) Fields(s ...googleapi.Field) *ProjectsEventThreatDetectionSettingsCustomModulesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) IfNoneMatch(entityTag string) *ProjectsEventThreatDetectionSettingsCustomModulesListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsAssetsUpdateSecurityMarksCall) Context(ctx context.Context) *ProjectsAssetsUpdateSecurityMarksCall { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) Context(ctx context.Context) *ProjectsEventThreatDetectionSettingsCustomModulesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsAssetsUpdateSecurityMarksCall) Header() http.Header { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsAssetsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "securitycenter.projects.assets.updateSecurityMarks" call. -// Exactly one of *SecurityMarks or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *SecurityMarks.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, error) { +} + +// Do executes the "securitycenter.projects.eventThreatDetectionSettings.customModules.list" call. +// Exactly one of *ListEventThreatDetectionCustomModulesResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ListEventThreatDetectionCustomModulesResponse.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListEventThreatDetectionCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29897,7 +33867,7 @@ func (c *ProjectsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &SecurityMarks{ + ret := &ListEventThreatDetectionCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -29909,40 +33879,36 @@ func (c *ProjectsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Updates security marks.", - // "flatPath": "v1/projects/{projectsId}/assets/{assetsId}/securityMarks", - // "httpMethod": "PATCH", - // "id": "securitycenter.projects.assets.updateSecurityMarks", + // "description": "Lists all Event Threat Detection custom modules for the given Resource Manager parent. This includes resident modules defined at the scope of the parent along with modules inherited from ancestors.", + // "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules", + // "httpMethod": "GET", + // "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", - // "location": "path", - // "pattern": "^projects/[^/]+/assets/[^/]+/securityMarks$", - // "required": true, - // "type": "string" + // "pageSize": { + // "description": "The maximum number of modules to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" // }, - // "startTime": { - // "description": "The time at which the updated SecurityMarks take effect. If not set uses current server time. Updates will be applied to the SecurityMarks that are active immediately preceding this time. Must be earlier or equal to the server time.", - // "format": "google-datetime", + // "pageToken": { + // "description": "A page token, received from a previous `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListEventThreatDetectionCustomModules` must match the call that provided the page token.", // "location": "query", // "type": "string" // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the security marks resource. The field mask must not contain duplicate fields. If empty or set to \"marks\", all marks will be replaced. Individual marks can be updated using \"marks.\".", - // "format": "google-fieldmask", - // "location": "query", + // "parent": { + // "description": "Required. Name of the parent to list custom modules under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + // "location": "path", + // "pattern": "^projects/[^/]+/eventThreatDetectionSettings$", + // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", - // "request": { - // "$ref": "SecurityMarks" - // }, + // "path": "v1/{+parent}/customModules", // "response": { - // "$ref": "SecurityMarks" + // "$ref": "ListEventThreatDetectionCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -29951,82 +33917,123 @@ func (c *ProjectsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.projects.bigQueryExports.create": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) Pages(ctx context.Context, f func(*ListEventThreatDetectionCustomModulesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsBigQueryExportsCreateCall struct { - s *Service - parent string - googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.projects.eventThreatDetectionSettings.customModules.listDescendant": + +type ProjectsEventThreatDetectionSettingsCustomModulesListDescendantCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a BigQuery export. +// ListDescendant: Lists all resident Event Threat Detection custom +// modules under the given Resource Manager parent and its descendants. // -// - parent: The name of the parent resource of the new BigQuery export. -// Its format is "organizations/[organization_id]", -// "folders/[folder_id]", or "projects/[project_id]". -func (r *ProjectsBigQueryExportsService) Create(parent string, googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport) *ProjectsBigQueryExportsCreateCall { - c := &ProjectsBigQueryExportsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Name of the parent to list custom modules under. Its format +// is: * "organizations/{organization}/eventThreatDetectionSettings". +// - "folders/{folder}/eventThreatDetectionSettings". * +// "projects/{project}/eventThreatDetectionSettings". +func (r *ProjectsEventThreatDetectionSettingsCustomModulesService) ListDescendant(parent string) *ProjectsEventThreatDetectionSettingsCustomModulesListDescendantCall { + c := &ProjectsEventThreatDetectionSettingsCustomModulesListDescendantCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.googlecloudsecuritycenterv1bigqueryexport = googlecloudsecuritycenterv1bigqueryexport return c } -// BigQueryExportId sets the optional parameter "bigQueryExportId": -// Required. Unique identifier provided by the client within the parent -// scope. It must consist of only lowercase letters, numbers, and -// hyphens, must start with a letter, must end with either a letter or a -// number, and must be 63 characters or less. -func (c *ProjectsBigQueryExportsCreateCall) BigQueryExportId(bigQueryExportId string) *ProjectsBigQueryExportsCreateCall { - c.urlParams_.Set("bigQueryExportId", bigQueryExportId) +// PageSize sets the optional parameter "pageSize": The maximum number +// of modules to return. The service may return fewer than this value. +// If unspecified, at most 10 configs will be returned. The maximum +// value is 1000; values above 1000 will be coerced to 1000. +func (c *ProjectsEventThreatDetectionSettingsCustomModulesListDescendantCall) PageSize(pageSize int64) *ProjectsEventThreatDetectionSettingsCustomModulesListDescendantCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous +// `ListDescendantEventThreatDetectionCustomModules` call. Provide this +// to retrieve the subsequent page. When paginating, all other +// parameters provided to +// `ListDescendantEventThreatDetectionCustomModules` must match the call +// that provided the page token. +func (c *ProjectsEventThreatDetectionSettingsCustomModulesListDescendantCall) PageToken(pageToken string) *ProjectsEventThreatDetectionSettingsCustomModulesListDescendantCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsBigQueryExportsCreateCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsCreateCall { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesListDescendantCall) Fields(s ...googleapi.Field) *ProjectsEventThreatDetectionSettingsCustomModulesListDescendantCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsEventThreatDetectionSettingsCustomModulesListDescendantCall) IfNoneMatch(entityTag string) *ProjectsEventThreatDetectionSettingsCustomModulesListDescendantCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsBigQueryExportsCreateCall) Context(ctx context.Context) *ProjectsBigQueryExportsCreateCall { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesListDescendantCall) Context(ctx context.Context) *ProjectsEventThreatDetectionSettingsCustomModulesListDescendantCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsBigQueryExportsCreateCall) Header() http.Header { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesListDescendantCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsBigQueryExportsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesListDescendantCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules:listDescendant") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -30037,16 +34044,17 @@ func (c *ProjectsBigQueryExportsCreateCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.bigQueryExports.create" call. -// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error +// Do executes the "securitycenter.projects.eventThreatDetectionSettings.customModules.listDescendant" call. +// Exactly one of +// *ListDescendantEventThreatDetectionCustomModulesResponse or error // will be non-nil. Any non-2xx status code is an error. Response // headers are in either -// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or -// (if a response was returned at all) in +// *ListDescendantEventThreatDetectionCustomModulesResponse.ServerRespons +// e.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *ProjectsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesListDescendantCall) Do(opts ...googleapi.CallOption) (*ListDescendantEventThreatDetectionCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -30065,7 +34073,7 @@ func (c *ProjectsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*G if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &ListDescendantEventThreatDetectionCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -30077,33 +34085,36 @@ func (c *ProjectsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*G } return ret, nil // { - // "description": "Creates a BigQuery export.", - // "flatPath": "v1/projects/{projectsId}/bigQueryExports", - // "httpMethod": "POST", - // "id": "securitycenter.projects.bigQueryExports.create", + // "description": "Lists all resident Event Threat Detection custom modules under the given Resource Manager parent and its descendants.", + // "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules:listDescendant", + // "httpMethod": "GET", + // "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.listDescendant", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "bigQueryExportId": { - // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of only lowercase letters, numbers, and hyphens, must start with a letter, must end with either a letter or a number, and must be 63 characters or less.", + // "pageSize": { + // "description": "The maximum number of modules to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token, received from a previous `ListDescendantEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListDescendantEventThreatDetectionCustomModules` must match the call that provided the page token.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The name of the parent resource of the new BigQuery export. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "description": "Required. Name of the parent to list custom modules under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", // "location": "path", - // "pattern": "^projects/[^/]+$", + // "pattern": "^projects/[^/]+/eventThreatDetectionSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/bigQueryExports", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" - // }, + // "path": "v1/{+parent}/customModules:listDescendant", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "ListDescendantEventThreatDetectionCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -30112,32 +34123,71 @@ func (c *ProjectsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*G } -// method id "securitycenter.projects.bigQueryExports.delete": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsEventThreatDetectionSettingsCustomModulesListDescendantCall) Pages(ctx context.Context, f func(*ListDescendantEventThreatDetectionCustomModulesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsBigQueryExportsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.projects.eventThreatDetectionSettings.customModules.patch": + +type ProjectsEventThreatDetectionSettingsCustomModulesPatchCall struct { + s *Service + name string + eventthreatdetectioncustommodule *EventThreatDetectionCustomModule + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an existing BigQuery export. +// Patch: Updates the Event Threat Detection custom module with the +// given name based on the given update mask. Updating the enablement +// state is supported for both resident and inherited modules (though +// resident modules cannot have an enablement state of "inherited"). +// Updating the display name or configuration of a module is supported +// for resident modules only. The type of a module cannot be changed. // -// - name: The name of the BigQuery export to delete. Its format is -// organizations/{organization}/bigQueryExports/{export_id}, -// folders/{folder}/bigQueryExports/{export_id}, or -// projects/{project}/bigQueryExports/{export_id}. -func (r *ProjectsBigQueryExportsService) Delete(name string) *ProjectsBigQueryExportsDeleteCall { - c := &ProjectsBigQueryExportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Immutable. The resource name of the Event Threat Detection +// custom module. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings/customMod +// ules/{module}". * +// "folders/{folder}/eventThreatDetectionSettings/customModules/{module +// }". * +// "projects/{project}/eventThreatDetectionSettings/customModules/{modu +// le}". +func (r *ProjectsEventThreatDetectionSettingsCustomModulesService) Patch(name string, eventthreatdetectioncustommodule *EventThreatDetectionCustomModule) *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall { + c := &ProjectsEventThreatDetectionSettingsCustomModulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.eventthreatdetectioncustommodule = eventthreatdetectioncustommodule + return c +} + +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to be updated. If empty all mutable fields will be updated. +func (c *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) UpdateMask(updateMask string) *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsBigQueryExportsDeleteCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsDeleteCall { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) Fields(s ...googleapi.Field) *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -30145,21 +34195,21 @@ func (c *ProjectsBigQueryExportsDeleteCall) Fields(s ...googleapi.Field) *Projec // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsBigQueryExportsDeleteCall) Context(ctx context.Context) *ProjectsBigQueryExportsDeleteCall { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) Context(ctx context.Context) *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsBigQueryExportsDeleteCall) Header() http.Header { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsBigQueryExportsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -30167,11 +34217,16 @@ func (c *ProjectsBigQueryExportsDeleteCall) doRequest(alt string) (*http.Respons } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -30182,14 +34237,14 @@ func (c *ProjectsBigQueryExportsDeleteCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.bigQueryExports.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "securitycenter.projects.eventThreatDetectionSettings.customModules.patch" call. +// Exactly one of *EventThreatDetectionCustomModule or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -30208,7 +34263,7 @@ func (c *ProjectsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*E if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &EventThreatDetectionCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -30220,25 +34275,34 @@ func (c *ProjectsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*E } return ret, nil // { - // "description": "Deletes an existing BigQuery export.", - // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.projects.bigQueryExports.delete", + // "description": "Updates the Event Threat Detection custom module with the given name based on the given update mask. Updating the enablement state is supported for both resident and inherited modules (though resident modules cannot have an enablement state of \"inherited\"). Updating the display name or configuration of a module is supported for resident modules only. The type of a module cannot be changed.", + // "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules/{customModulesId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The name of the BigQuery export to delete. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}", + // "description": "Immutable. The resource name of the Event Threat Detection custom module. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", // "location": "path", - // "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", + // "pattern": "^projects/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v1/{+name}", + // "request": { + // "$ref": "EventThreatDetectionCustomModule" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "EventThreatDetectionCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -30247,9 +34311,9 @@ func (c *ProjectsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*E } -// method id "securitycenter.projects.bigQueryExports.get": +// method id "securitycenter.projects.eventThreatDetectionSettings.effectiveCustomModules.get": -type ProjectsBigQueryExportsGetCall struct { +type ProjectsEventThreatDetectionSettingsEffectiveCustomModulesGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -30258,14 +34322,19 @@ type ProjectsBigQueryExportsGetCall struct { header_ http.Header } -// Get: Gets a BigQuery export. +// Get: Gets an effective Event Threat Detection custom module at the +// given level. // -// - name: Name of the BigQuery export to retrieve. Its format is -// organizations/{organization}/bigQueryExports/{export_id}, -// folders/{folder}/bigQueryExports/{export_id}, or -// projects/{project}/bigQueryExports/{export_id}. -func (r *ProjectsBigQueryExportsService) Get(name string) *ProjectsBigQueryExportsGetCall { - c := &ProjectsBigQueryExportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the effective Event Threat Detection +// custom module. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings/effective +// CustomModules/{module}". * +// "folders/{folder}/eventThreatDetectionSettings/effectiveCustomModule +// s/{module}". * +// "projects/{project}/eventThreatDetectionSettings/effectiveCustomModu +// les/{module}". +func (r *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesService) Get(name string) *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesGetCall { + c := &ProjectsEventThreatDetectionSettingsEffectiveCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -30273,7 +34342,7 @@ func (r *ProjectsBigQueryExportsService) Get(name string) *ProjectsBigQueryExpor // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsBigQueryExportsGetCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsGetCall { +func (c *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesGetCall) Fields(s ...googleapi.Field) *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -30283,7 +34352,7 @@ func (c *ProjectsBigQueryExportsGetCall) Fields(s ...googleapi.Field) *ProjectsB // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsBigQueryExportsGetCall) IfNoneMatch(entityTag string) *ProjectsBigQueryExportsGetCall { +func (c *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesGetCall) IfNoneMatch(entityTag string) *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesGetCall { c.ifNoneMatch_ = entityTag return c } @@ -30291,21 +34360,21 @@ func (c *ProjectsBigQueryExportsGetCall) IfNoneMatch(entityTag string) *Projects // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsBigQueryExportsGetCall) Context(ctx context.Context) *ProjectsBigQueryExportsGetCall { +func (c *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesGetCall) Context(ctx context.Context) *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsBigQueryExportsGetCall) Header() http.Header { +func (c *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsBigQueryExportsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -30331,16 +34400,16 @@ func (c *ProjectsBigQueryExportsGetCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.bigQueryExports.get" call. -// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error +// Do executes the "securitycenter.projects.eventThreatDetectionSettings.effectiveCustomModules.get" call. +// Exactly one of *EffectiveEventThreatDetectionCustomModule or error // will be non-nil. Any non-2xx status code is an error. Response // headers are in either -// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or +// *EffectiveEventThreatDetectionCustomModule.ServerResponse.Header or // (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *ProjectsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { +func (c *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*EffectiveEventThreatDetectionCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -30359,7 +34428,7 @@ func (c *ProjectsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*Goog if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &EffectiveEventThreatDetectionCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -30371,25 +34440,25 @@ func (c *ProjectsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*Goog } return ret, nil // { - // "description": "Gets a BigQuery export.", - // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", + // "description": "Gets an effective Event Threat Detection custom module at the given level.", + // "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/effectiveCustomModules/{effectiveCustomModulesId}", // "httpMethod": "GET", - // "id": "securitycenter.projects.bigQueryExports.get", + // "id": "securitycenter.projects.eventThreatDetectionSettings.effectiveCustomModules.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the BigQuery export to retrieve. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}", + // "description": "Required. The resource name of the effective Event Threat Detection custom module. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}\".", // "location": "path", - // "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", + // "pattern": "^projects/[^/]+/eventThreatDetectionSettings/effectiveCustomModules/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "EffectiveEventThreatDetectionCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -30398,9 +34467,9 @@ func (c *ProjectsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*Goog } -// method id "securitycenter.projects.bigQueryExports.list": +// method id "securitycenter.projects.eventThreatDetectionSettings.effectiveCustomModules.list": -type ProjectsBigQueryExportsListCall struct { +type ProjectsEventThreatDetectionSettingsEffectiveCustomModulesListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -30409,36 +34478,37 @@ type ProjectsBigQueryExportsListCall struct { header_ http.Header } -// List: Lists BigQuery exports. Note that when requesting BigQuery -// exports at a given level all exports under that level are also -// returned e.g. if requesting BigQuery exports under a folder, then all -// BigQuery exports immediately under the folder plus the ones created -// under the projects within the folder are returned. +// List: Lists all effective Event Threat Detection custom modules for +// the given parent. This includes resident modules defined at the scope +// of the parent along with modules inherited from its ancestors. // -// - parent: The parent, which owns the collection of BigQuery exports. -// Its format is "organizations/[organization_id]", -// "folders/[folder_id]", "projects/[project_id]". -func (r *ProjectsBigQueryExportsService) List(parent string) *ProjectsBigQueryExportsListCall { - c := &ProjectsBigQueryExportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Name of the parent to list custom modules for. Its format +// is: * "organizations/{organization}/eventThreatDetectionSettings". +// - "folders/{folder}/eventThreatDetectionSettings". * +// "projects/{project}/eventThreatDetectionSettings". +func (r *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesService) List(parent string) *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesListCall { + c := &ProjectsEventThreatDetectionSettingsEffectiveCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } // PageSize sets the optional parameter "pageSize": The maximum number -// of configs to return. The service may return fewer than this value. +// of modules to return. The service may return fewer than this value. // If unspecified, at most 10 configs will be returned. The maximum // value is 1000; values above 1000 will be coerced to 1000. -func (c *ProjectsBigQueryExportsListCall) PageSize(pageSize int64) *ProjectsBigQueryExportsListCall { +func (c *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesListCall) PageSize(pageSize int64) *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": A page token, -// received from a previous `ListBigQueryExports` call. Provide this to -// retrieve the subsequent page. When paginating, all other parameters -// provided to `ListBigQueryExports` must match the call that provided -// the page token. -func (c *ProjectsBigQueryExportsListCall) PageToken(pageToken string) *ProjectsBigQueryExportsListCall { +// received from a previous +// `ListEffectiveEventThreatDetectionCustomModules` call. Provide this +// to retrieve the subsequent page. When paginating, all other +// parameters provided to +// `ListEffectiveEventThreatDetectionCustomModules` must match the call +// that provided the page token. +func (c *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesListCall) PageToken(pageToken string) *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -30446,7 +34516,7 @@ func (c *ProjectsBigQueryExportsListCall) PageToken(pageToken string) *ProjectsB // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsBigQueryExportsListCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsListCall { +func (c *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesListCall) Fields(s ...googleapi.Field) *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -30456,7 +34526,7 @@ func (c *ProjectsBigQueryExportsListCall) Fields(s ...googleapi.Field) *Projects // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsBigQueryExportsListCall) IfNoneMatch(entityTag string) *ProjectsBigQueryExportsListCall { +func (c *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesListCall) IfNoneMatch(entityTag string) *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesListCall { c.ifNoneMatch_ = entityTag return c } @@ -30464,21 +34534,21 @@ func (c *ProjectsBigQueryExportsListCall) IfNoneMatch(entityTag string) *Project // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsBigQueryExportsListCall) Context(ctx context.Context) *ProjectsBigQueryExportsListCall { +func (c *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesListCall) Context(ctx context.Context) *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsBigQueryExportsListCall) Header() http.Header { +func (c *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsBigQueryExportsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -30491,7 +34561,7 @@ func (c *ProjectsBigQueryExportsListCall) doRequest(alt string) (*http.Response, var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/effectiveCustomModules") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -30504,14 +34574,17 @@ func (c *ProjectsBigQueryExportsListCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.bigQueryExports.list" call. -// Exactly one of *ListBigQueryExportsResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *ListBigQueryExportsResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*ListBigQueryExportsResponse, error) { +// Do executes the "securitycenter.projects.eventThreatDetectionSettings.effectiveCustomModules.list" call. +// Exactly one of +// *ListEffectiveEventThreatDetectionCustomModulesResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *ListEffectiveEventThreatDetectionCustomModulesResponse.ServerResponse +// .Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListEffectiveEventThreatDetectionCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -30530,7 +34603,7 @@ func (c *ProjectsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*Lis if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListBigQueryExportsResponse{ + ret := &ListEffectiveEventThreatDetectionCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -30542,36 +34615,36 @@ func (c *ProjectsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*Lis } return ret, nil // { - // "description": "Lists BigQuery exports. Note that when requesting BigQuery exports at a given level all exports under that level are also returned e.g. if requesting BigQuery exports under a folder, then all BigQuery exports immediately under the folder plus the ones created under the projects within the folder are returned.", - // "flatPath": "v1/projects/{projectsId}/bigQueryExports", + // "description": "Lists all effective Event Threat Detection custom modules for the given parent. This includes resident modules defined at the scope of the parent along with modules inherited from its ancestors.", + // "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/effectiveCustomModules", // "httpMethod": "GET", - // "id": "securitycenter.projects.bigQueryExports.list", + // "id": "securitycenter.projects.eventThreatDetectionSettings.effectiveCustomModules.list", // "parameterOrder": [ // "parent" // ], // "parameters": { // "pageSize": { - // "description": "The maximum number of configs to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "description": "The maximum number of modules to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "A page token, received from a previous `ListBigQueryExports` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListBigQueryExports` must match the call that provided the page token.", + // "description": "A page token, received from a previous `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListEffectiveEventThreatDetectionCustomModules` must match the call that provided the page token.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The parent, which owns the collection of BigQuery exports. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", + // "description": "Required. Name of the parent to list custom modules for. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", // "location": "path", - // "pattern": "^projects/[^/]+$", + // "pattern": "^projects/[^/]+/eventThreatDetectionSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/bigQueryExports", + // "path": "v1/{+parent}/effectiveCustomModules", // "response": { - // "$ref": "ListBigQueryExportsResponse" + // "$ref": "ListEffectiveEventThreatDetectionCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -30583,7 +34656,7 @@ func (c *ProjectsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*Lis // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *ProjectsBigQueryExportsListCall) Pages(ctx context.Context, f func(*ListBigQueryExportsResponse) error) error { +func (c *ProjectsEventThreatDetectionSettingsEffectiveCustomModulesListCall) Pages(ctx context.Context, f func(*ListEffectiveEventThreatDetectionCustomModulesResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -30601,170 +34674,6 @@ func (c *ProjectsBigQueryExportsListCall) Pages(ctx context.Context, f func(*Lis } } -// method id "securitycenter.projects.bigQueryExports.patch": - -type ProjectsBigQueryExportsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Patch: Updates a BigQuery export. -// -// - name: The relative resource name of this export. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name. -// Example format: -// "organizations/{organization_id}/bigQueryExports/{export_id}" -// Example format: "folders/{folder_id}/bigQueryExports/{export_id}" -// Example format: "projects/{project_id}/bigQueryExports/{export_id}" -// This field is provided in responses, and is ignored when provided -// in create requests. -func (r *ProjectsBigQueryExportsService) Patch(name string, googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport) *ProjectsBigQueryExportsPatchCall { - c := &ProjectsBigQueryExportsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googlecloudsecuritycenterv1bigqueryexport = googlecloudsecuritycenterv1bigqueryexport - return c -} - -// UpdateMask sets the optional parameter "updateMask": The list of -// fields to be updated. If empty all mutable fields will be updated. -func (c *ProjectsBigQueryExportsPatchCall) UpdateMask(updateMask string) *ProjectsBigQueryExportsPatchCall { - c.urlParams_.Set("updateMask", updateMask) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsBigQueryExportsPatchCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsPatchCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsBigQueryExportsPatchCall) Context(ctx context.Context) *ProjectsBigQueryExportsPatchCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ProjectsBigQueryExportsPatchCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ProjectsBigQueryExportsPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "name": c.name, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "securitycenter.projects.bigQueryExports.patch" call. -// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Updates a BigQuery export.", - // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.projects.bigQueryExports.patch", - // "parameterOrder": [ - // "name" - // ], - // "parameters": { - // "name": { - // "description": "The relative resource name of this export. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name. Example format: \"organizations/{organization_id}/bigQueryExports/{export_id}\" Example format: \"folders/{folder_id}/bigQueryExports/{export_id}\" Example format: \"projects/{project_id}/bigQueryExports/{export_id}\" This field is provided in responses, and is ignored when provided in create requests.", - // "location": "path", - // "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", - // "required": true, - // "type": "string" - // }, - // "updateMask": { - // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "v1/{+name}", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" - // }, - // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform" - // ] - // } - -} - // method id "securitycenter.projects.findings.bulkMute": type ProjectsFindingsBulkMuteCall struct { @@ -33862,7 +37771,10 @@ func (r *ProjectsSecurityHealthAnalyticsSettingsCustomModulesService) Patch(name } // UpdateMask sets the optional parameter "updateMask": The list of -// fields to update. +// fields to be updated. The only fields that can be updated are +// `enablement_state` and `custom_config`. If empty or set to the +// wildcard value `*`, both `enablement_state` and `custom_config` are +// updated. func (c *ProjectsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) UpdateMask(updateMask string) *ProjectsSecurityHealthAnalyticsSettingsCustomModulesPatchCall { c.urlParams_.Set("updateMask", updateMask) return c @@ -33978,7 +37890,7 @@ func (c *ProjectsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do(opts // "type": "string" // }, // "updateMask": { - // "description": "The list of fields to update.", + // "description": "The list of fields to be updated. The only fields that can be updated are `enablement_state` and `custom_config`. If empty or set to the wildcard value `*`, both `enablement_state` and `custom_config` are updated.", // "format": "google-fieldmask", // "location": "query", // "type": "string" diff --git a/serviceconsumermanagement/v1/serviceconsumermanagement-api.json b/serviceconsumermanagement/v1/serviceconsumermanagement-api.json index 66e902a42cc..c781b722ea1 100644 --- a/serviceconsumermanagement/v1/serviceconsumermanagement-api.json +++ b/serviceconsumermanagement/v1/serviceconsumermanagement-api.json @@ -542,7 +542,7 @@ } } }, - "revision": "20231128", + "revision": "20231210", "rootUrl": "https://serviceconsumermanagement.googleapis.com/", "schemas": { "AddTenantProjectRequest": { @@ -2310,6 +2310,10 @@ "protoReferenceDocumentationUri": { "description": "Optional link to proto reference documentation. Example: https://cloud.google.com/pubsub/lite/docs/reference/rpc", "type": "string" + }, + "restReferenceDocumentationUri": { + "description": "Optional link to REST reference documentation. Example: https://cloud.google.com/pubsub/lite/docs/reference/rest", + "type": "string" } }, "type": "object" diff --git a/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go b/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go index a645c2bb348..3da3a2772b5 100644 --- a/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go +++ b/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go @@ -3564,6 +3564,11 @@ type Publishing struct { // https://cloud.google.com/pubsub/lite/docs/reference/rpc ProtoReferenceDocumentationUri string `json:"protoReferenceDocumentationUri,omitempty"` + // RestReferenceDocumentationUri: Optional link to REST reference + // documentation. Example: + // https://cloud.google.com/pubsub/lite/docs/reference/rest + RestReferenceDocumentationUri string `json:"restReferenceDocumentationUri,omitempty"` + // ForceSendFields is a list of field names (e.g. "ApiShortName") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any diff --git a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-api.json b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-api.json index 4e0f3874383..aa2d3292bec 100644 --- a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-api.json +++ b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-api.json @@ -532,7 +532,7 @@ } } }, - "revision": "20231128", + "revision": "20231210", "rootUrl": "https://serviceconsumermanagement.googleapis.com/", "schemas": { "Api": { @@ -2158,6 +2158,10 @@ "protoReferenceDocumentationUri": { "description": "Optional link to proto reference documentation. Example: https://cloud.google.com/pubsub/lite/docs/reference/rpc", "type": "string" + }, + "restReferenceDocumentationUri": { + "description": "Optional link to REST reference documentation. Example: https://cloud.google.com/pubsub/lite/docs/reference/rest", + "type": "string" } }, "type": "object" diff --git a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go index 9e224e1879c..08883f8d178 100644 --- a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go +++ b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go @@ -3280,6 +3280,11 @@ type Publishing struct { // https://cloud.google.com/pubsub/lite/docs/reference/rpc ProtoReferenceDocumentationUri string `json:"protoReferenceDocumentationUri,omitempty"` + // RestReferenceDocumentationUri: Optional link to REST reference + // documentation. Example: + // https://cloud.google.com/pubsub/lite/docs/reference/rest + RestReferenceDocumentationUri string `json:"restReferenceDocumentationUri,omitempty"` + // ForceSendFields is a list of field names (e.g. "ApiShortName") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any diff --git a/serviceusage/v1/serviceusage-api.json b/serviceusage/v1/serviceusage-api.json index df560729b44..35f34354eea 100644 --- a/serviceusage/v1/serviceusage-api.json +++ b/serviceusage/v1/serviceusage-api.json @@ -426,7 +426,7 @@ } } }, - "revision": "20231128", + "revision": "20231210", "rootUrl": "https://serviceusage.googleapis.com/", "schemas": { "AddEnableRulesMetadata": { @@ -2856,6 +2856,10 @@ "protoReferenceDocumentationUri": { "description": "Optional link to proto reference documentation. Example: https://cloud.google.com/pubsub/lite/docs/reference/rpc", "type": "string" + }, + "restReferenceDocumentationUri": { + "description": "Optional link to REST reference documentation. Example: https://cloud.google.com/pubsub/lite/docs/reference/rest", + "type": "string" } }, "type": "object" diff --git a/serviceusage/v1/serviceusage-gen.go b/serviceusage/v1/serviceusage-gen.go index 21f99c7a16c..1d99b2cf1c3 100644 --- a/serviceusage/v1/serviceusage-gen.go +++ b/serviceusage/v1/serviceusage-gen.go @@ -4519,6 +4519,11 @@ type Publishing struct { // https://cloud.google.com/pubsub/lite/docs/reference/rpc ProtoReferenceDocumentationUri string `json:"protoReferenceDocumentationUri,omitempty"` + // RestReferenceDocumentationUri: Optional link to REST reference + // documentation. Example: + // https://cloud.google.com/pubsub/lite/docs/reference/rest + RestReferenceDocumentationUri string `json:"restReferenceDocumentationUri,omitempty"` + // ForceSendFields is a list of field names (e.g. "ApiShortName") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any diff --git a/serviceusage/v1beta1/serviceusage-api.json b/serviceusage/v1beta1/serviceusage-api.json index 1ae5280e839..1a7d197da66 100644 --- a/serviceusage/v1beta1/serviceusage-api.json +++ b/serviceusage/v1beta1/serviceusage-api.json @@ -964,7 +964,7 @@ } } }, - "revision": "20231128", + "revision": "20231210", "rootUrl": "https://serviceusage.googleapis.com/", "schemas": { "AddEnableRulesMetadata": { @@ -3600,6 +3600,10 @@ "protoReferenceDocumentationUri": { "description": "Optional link to proto reference documentation. Example: https://cloud.google.com/pubsub/lite/docs/reference/rpc", "type": "string" + }, + "restReferenceDocumentationUri": { + "description": "Optional link to REST reference documentation. Example: https://cloud.google.com/pubsub/lite/docs/reference/rest", + "type": "string" } }, "type": "object" diff --git a/serviceusage/v1beta1/serviceusage-gen.go b/serviceusage/v1beta1/serviceusage-gen.go index 4bb013e4204..c496111403b 100644 --- a/serviceusage/v1beta1/serviceusage-gen.go +++ b/serviceusage/v1beta1/serviceusage-gen.go @@ -4917,6 +4917,11 @@ type Publishing struct { // https://cloud.google.com/pubsub/lite/docs/reference/rpc ProtoReferenceDocumentationUri string `json:"protoReferenceDocumentationUri,omitempty"` + // RestReferenceDocumentationUri: Optional link to REST reference + // documentation. Example: + // https://cloud.google.com/pubsub/lite/docs/reference/rest + RestReferenceDocumentationUri string `json:"restReferenceDocumentationUri,omitempty"` + // ForceSendFields is a list of field names (e.g. "ApiShortName") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any