1 | <?php
|
---|
2 | /*
|
---|
3 | * Copyright 2014 Google Inc.
|
---|
4 | *
|
---|
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
---|
6 | * use this file except in compliance with the License. You may obtain a copy of
|
---|
7 | * the License at
|
---|
8 | *
|
---|
9 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 | *
|
---|
11 | * Unless required by applicable law or agreed to in writing, software
|
---|
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
---|
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
---|
14 | * License for the specific language governing permissions and limitations under
|
---|
15 | * the License.
|
---|
16 | */
|
---|
17 |
|
---|
18 | namespace Google\Service\Cloudchannel\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Cloudchannel\GoogleCloudChannelV1ChannelPartnerRepricingConfig;
|
---|
21 | use Google\Service\Cloudchannel\GoogleCloudChannelV1ListChannelPartnerRepricingConfigsResponse;
|
---|
22 | use Google\Service\Cloudchannel\GoogleProtobufEmpty;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "channelPartnerRepricingConfigs" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $cloudchannelService = new Google\Service\Cloudchannel(...);
|
---|
29 | * $channelPartnerRepricingConfigs = $cloudchannelService->accounts_channelPartnerLinks_channelPartnerRepricingConfigs;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class AccountsChannelPartnerLinksChannelPartnerRepricingConfigs extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Creates a ChannelPartnerRepricingConfig. Call this method to set
|
---|
36 | * modifications for a specific ChannelPartner's bill. You can only create
|
---|
37 | * configs if the RepricingConfig.effective_invoice_month is a future month. If
|
---|
38 | * needed, you can create a config for the current month, with some
|
---|
39 | * restrictions. When creating a config for a future month, make sure there are
|
---|
40 | * no existing configs for that RepricingConfig.effective_invoice_month. The
|
---|
41 | * following restrictions are for creating configs in the current month. * This
|
---|
42 | * functionality is reserved for recovering from an erroneous config, and should
|
---|
43 | * not be used for regular business cases. * The new config will not modify
|
---|
44 | * exports used with other configs. Changes to the config may be immediate, but
|
---|
45 | * may take up to 24 hours. * There is a limit of ten configs for any
|
---|
46 | * ChannelPartner or RepricingConfig.EntitlementGranularity.entitlement, for any
|
---|
47 | * RepricingConfig.effective_invoice_month. * The contained
|
---|
48 | * ChannelPartnerRepricingConfig.repricing_config value must be different from
|
---|
49 | * the value used in the current config for a ChannelPartner. Possible Error
|
---|
50 | * Codes: * PERMISSION_DENIED: If the account making the request and the account
|
---|
51 | * being queried are different. * INVALID_ARGUMENT: Missing or invalid required
|
---|
52 | * parameters in the request. Also displays if the updated config is for the
|
---|
53 | * current month or past months. * NOT_FOUND: The ChannelPartnerRepricingConfig
|
---|
54 | * specified does not exist or is not associated with the given account. *
|
---|
55 | * INTERNAL: Any non-user error related to technical issues in the backend. In
|
---|
56 | * this case, contact Cloud Channel support. Return Value: If successful, the
|
---|
57 | * updated ChannelPartnerRepricingConfig resource, otherwise returns an error.
|
---|
58 | * (channelPartnerRepricingConfigs.create)
|
---|
59 | *
|
---|
60 | * @param string $parent Required. The resource name of the ChannelPartner that
|
---|
61 | * will receive the repricing config. Parent uses the format:
|
---|
62 | * accounts/{account_id}/channelPartnerLinks/{channel_partner_id}
|
---|
63 | * @param GoogleCloudChannelV1ChannelPartnerRepricingConfig $postBody
|
---|
64 | * @param array $optParams Optional parameters.
|
---|
65 | * @return GoogleCloudChannelV1ChannelPartnerRepricingConfig
|
---|
66 | * @throws \Google\Service\Exception
|
---|
67 | */
|
---|
68 | public function create($parent, GoogleCloudChannelV1ChannelPartnerRepricingConfig $postBody, $optParams = [])
|
---|
69 | {
|
---|
70 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
71 | $params = array_merge($params, $optParams);
|
---|
72 | return $this->call('create', [$params], GoogleCloudChannelV1ChannelPartnerRepricingConfig::class);
|
---|
73 | }
|
---|
74 | /**
|
---|
75 | * Deletes the given ChannelPartnerRepricingConfig permanently. You can only
|
---|
76 | * delete configs if their RepricingConfig.effective_invoice_month is set to a
|
---|
77 | * date after the current month. Possible error codes: * PERMISSION_DENIED: The
|
---|
78 | * account making the request does not own this customer. * INVALID_ARGUMENT:
|
---|
79 | * Required request parameters are missing or invalid. * FAILED_PRECONDITION:
|
---|
80 | * The ChannelPartnerRepricingConfig is active or in the past. * NOT_FOUND: No
|
---|
81 | * ChannelPartnerRepricingConfig found for the name in the request.
|
---|
82 | * (channelPartnerRepricingConfigs.delete)
|
---|
83 | *
|
---|
84 | * @param string $name Required. The resource name of the channel partner
|
---|
85 | * repricing config rule to delete.
|
---|
86 | * @param array $optParams Optional parameters.
|
---|
87 | * @return GoogleProtobufEmpty
|
---|
88 | * @throws \Google\Service\Exception
|
---|
89 | */
|
---|
90 | public function delete($name, $optParams = [])
|
---|
91 | {
|
---|
92 | $params = ['name' => $name];
|
---|
93 | $params = array_merge($params, $optParams);
|
---|
94 | return $this->call('delete', [$params], GoogleProtobufEmpty::class);
|
---|
95 | }
|
---|
96 | /**
|
---|
97 | * Gets information about how a Distributor modifies their bill before sending
|
---|
98 | * it to a ChannelPartner. Possible Error Codes: * PERMISSION_DENIED: If the
|
---|
99 | * account making the request and the account being queried are different. *
|
---|
100 | * NOT_FOUND: The ChannelPartnerRepricingConfig was not found. * INTERNAL: Any
|
---|
101 | * non-user error related to technical issues in the backend. In this case,
|
---|
102 | * contact Cloud Channel support. Return Value: If successful, the
|
---|
103 | * ChannelPartnerRepricingConfig resource, otherwise returns an error.
|
---|
104 | * (channelPartnerRepricingConfigs.get)
|
---|
105 | *
|
---|
106 | * @param string $name Required. The resource name of the
|
---|
107 | * ChannelPartnerRepricingConfig Format: accounts/{account_id}/channelPartnerLin
|
---|
108 | * ks/{channel_partner_id}/channelPartnerRepricingConfigs/{id}.
|
---|
109 | * @param array $optParams Optional parameters.
|
---|
110 | * @return GoogleCloudChannelV1ChannelPartnerRepricingConfig
|
---|
111 | * @throws \Google\Service\Exception
|
---|
112 | */
|
---|
113 | public function get($name, $optParams = [])
|
---|
114 | {
|
---|
115 | $params = ['name' => $name];
|
---|
116 | $params = array_merge($params, $optParams);
|
---|
117 | return $this->call('get', [$params], GoogleCloudChannelV1ChannelPartnerRepricingConfig::class);
|
---|
118 | }
|
---|
119 | /**
|
---|
120 | * Lists information about how a Reseller modifies their bill before sending it
|
---|
121 | * to a ChannelPartner. Possible Error Codes: * PERMISSION_DENIED: If the
|
---|
122 | * account making the request and the account being queried are different. *
|
---|
123 | * NOT_FOUND: The ChannelPartnerRepricingConfig specified does not exist or is
|
---|
124 | * not associated with the given account. * INTERNAL: Any non-user error related
|
---|
125 | * to technical issues in the backend. In this case, contact Cloud Channel
|
---|
126 | * support. Return Value: If successful, the ChannelPartnerRepricingConfig
|
---|
127 | * resources. The data for each resource is displayed in the ascending order of:
|
---|
128 | * * Channel Partner ID * RepricingConfig.effective_invoice_month *
|
---|
129 | * ChannelPartnerRepricingConfig.update_time If unsuccessful, returns an error.
|
---|
130 | * (channelPartnerRepricingConfigs.listAccountsChannelPartnerLinksChannelPartner
|
---|
131 | * RepricingConfigs)
|
---|
132 | *
|
---|
133 | * @param string $parent Required. The resource name of the account's
|
---|
134 | * ChannelPartnerLink. Parent uses the format:
|
---|
135 | * accounts/{account_id}/channelPartnerLinks/{channel_partner_id}. Supports
|
---|
136 | * accounts/{account_id}/channelPartnerLinks/- to retrieve configs for all
|
---|
137 | * channel partners.
|
---|
138 | * @param array $optParams Optional parameters.
|
---|
139 | *
|
---|
140 | * @opt_param string filter Optional. A filter for
|
---|
141 | * [CloudChannelService.ListChannelPartnerRepricingConfigs] results
|
---|
142 | * (channel_partner_link only). You can use this filter when you support a
|
---|
143 | * BatchGet-like query. To use the filter, you must set
|
---|
144 | * `parent=accounts/{account_id}/channelPartnerLinks/-`. Example:
|
---|
145 | * `channel_partner_link = accounts/account_id/channelPartnerLinks/c1` OR
|
---|
146 | * `channel_partner_link = accounts/account_id/channelPartnerLinks/c2`.
|
---|
147 | * @opt_param int pageSize Optional. The maximum number of repricing configs to
|
---|
148 | * return. The service may return fewer than this value. If unspecified, returns
|
---|
149 | * a maximum of 50 rules. The maximum value is 100; values above 100 will be
|
---|
150 | * coerced to 100.
|
---|
151 | * @opt_param string pageToken Optional. A token identifying a page of results
|
---|
152 | * beyond the first page. Obtained through
|
---|
153 | * ListChannelPartnerRepricingConfigsResponse.next_page_token of the previous
|
---|
154 | * CloudChannelService.ListChannelPartnerRepricingConfigs call.
|
---|
155 | * @return GoogleCloudChannelV1ListChannelPartnerRepricingConfigsResponse
|
---|
156 | * @throws \Google\Service\Exception
|
---|
157 | */
|
---|
158 | public function listAccountsChannelPartnerLinksChannelPartnerRepricingConfigs($parent, $optParams = [])
|
---|
159 | {
|
---|
160 | $params = ['parent' => $parent];
|
---|
161 | $params = array_merge($params, $optParams);
|
---|
162 | return $this->call('list', [$params], GoogleCloudChannelV1ListChannelPartnerRepricingConfigsResponse::class);
|
---|
163 | }
|
---|
164 | /**
|
---|
165 | * Updates a ChannelPartnerRepricingConfig. Call this method to set
|
---|
166 | * modifications for a specific ChannelPartner's bill. This method overwrites
|
---|
167 | * the existing CustomerRepricingConfig. You can only update configs if the
|
---|
168 | * RepricingConfig.effective_invoice_month is a future month. To make changes to
|
---|
169 | * configs for the current month, use CreateChannelPartnerRepricingConfig,
|
---|
170 | * taking note of its restrictions. You cannot update the
|
---|
171 | * RepricingConfig.effective_invoice_month. When updating a config in the
|
---|
172 | * future: * This config must already exist. Possible Error Codes: *
|
---|
173 | * PERMISSION_DENIED: If the account making the request and the account being
|
---|
174 | * queried are different. * INVALID_ARGUMENT: Missing or invalid required
|
---|
175 | * parameters in the request. Also displays if the updated config is for the
|
---|
176 | * current month or past months. * NOT_FOUND: The ChannelPartnerRepricingConfig
|
---|
177 | * specified does not exist or is not associated with the given account. *
|
---|
178 | * INTERNAL: Any non-user error related to technical issues in the backend. In
|
---|
179 | * this case, contact Cloud Channel support. Return Value: If successful, the
|
---|
180 | * updated ChannelPartnerRepricingConfig resource, otherwise returns an error.
|
---|
181 | * (channelPartnerRepricingConfigs.patch)
|
---|
182 | *
|
---|
183 | * @param string $name Output only. Resource name of the
|
---|
184 | * ChannelPartnerRepricingConfig. Format: accounts/{account_id}/channelPartnerLi
|
---|
185 | * nks/{channel_partner_id}/channelPartnerRepricingConfigs/{id}.
|
---|
186 | * @param GoogleCloudChannelV1ChannelPartnerRepricingConfig $postBody
|
---|
187 | * @param array $optParams Optional parameters.
|
---|
188 | * @return GoogleCloudChannelV1ChannelPartnerRepricingConfig
|
---|
189 | * @throws \Google\Service\Exception
|
---|
190 | */
|
---|
191 | public function patch($name, GoogleCloudChannelV1ChannelPartnerRepricingConfig $postBody, $optParams = [])
|
---|
192 | {
|
---|
193 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
194 | $params = array_merge($params, $optParams);
|
---|
195 | return $this->call('patch', [$params], GoogleCloudChannelV1ChannelPartnerRepricingConfig::class);
|
---|
196 | }
|
---|
197 | }
|
---|
198 |
|
---|
199 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
200 | class_alias(AccountsChannelPartnerLinksChannelPartnerRepricingConfigs::class, 'Google_Service_Cloudchannel_Resource_AccountsChannelPartnerLinksChannelPartnerRepricingConfigs');
|
---|