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\GoogleCloudChannelV1ChannelPartnerLink;
|
---|
21 | use Google\Service\Cloudchannel\GoogleCloudChannelV1ListChannelPartnerLinksResponse;
|
---|
22 | use Google\Service\Cloudchannel\GoogleCloudChannelV1UpdateChannelPartnerLinkRequest;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "channelPartnerLinks" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $cloudchannelService = new Google\Service\Cloudchannel(...);
|
---|
29 | * $channelPartnerLinks = $cloudchannelService->accounts_channelPartnerLinks;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class AccountsChannelPartnerLinks extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Initiates a channel partner link between a distributor and a reseller, or
|
---|
36 | * between resellers in an n-tier reseller channel. Invited partners need to
|
---|
37 | * follow the invite_link_uri provided in the response to accept. After
|
---|
38 | * accepting the invitation, a link is set up between the two parties. You must
|
---|
39 | * be a distributor to call this method. Possible error codes: *
|
---|
40 | * PERMISSION_DENIED: The reseller account making the request is different from
|
---|
41 | * the reseller account in the API request. * INVALID_ARGUMENT: Required request
|
---|
42 | * parameters are missing or invalid. * ALREADY_EXISTS: The ChannelPartnerLink
|
---|
43 | * sent in the request already exists. * NOT_FOUND: No Cloud Identity customer
|
---|
44 | * exists for provided domain. * INTERNAL: Any non-user error related to a
|
---|
45 | * technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any
|
---|
46 | * non-user error related to a technical issue in the backend. Contact Cloud
|
---|
47 | * Channel support. Return value: The new ChannelPartnerLink resource.
|
---|
48 | * (channelPartnerLinks.create)
|
---|
49 | *
|
---|
50 | * @param string $parent Required. Create a channel partner link for the
|
---|
51 | * provided reseller account's resource name. Parent uses the format:
|
---|
52 | * accounts/{account_id}
|
---|
53 | * @param GoogleCloudChannelV1ChannelPartnerLink $postBody
|
---|
54 | * @param array $optParams Optional parameters.
|
---|
55 | * @return GoogleCloudChannelV1ChannelPartnerLink
|
---|
56 | * @throws \Google\Service\Exception
|
---|
57 | */
|
---|
58 | public function create($parent, GoogleCloudChannelV1ChannelPartnerLink $postBody, $optParams = [])
|
---|
59 | {
|
---|
60 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
61 | $params = array_merge($params, $optParams);
|
---|
62 | return $this->call('create', [$params], GoogleCloudChannelV1ChannelPartnerLink::class);
|
---|
63 | }
|
---|
64 | /**
|
---|
65 | * Returns the requested ChannelPartnerLink resource. You must be a distributor
|
---|
66 | * to call this method. Possible error codes: * PERMISSION_DENIED: The reseller
|
---|
67 | * account making the request is different from the reseller account in the API
|
---|
68 | * request. * INVALID_ARGUMENT: Required request parameters are missing or
|
---|
69 | * invalid. * NOT_FOUND: ChannelPartnerLink resource not found because of an
|
---|
70 | * invalid channel partner link name. Return value: The ChannelPartnerLink
|
---|
71 | * resource. (channelPartnerLinks.get)
|
---|
72 | *
|
---|
73 | * @param string $name Required. The resource name of the channel partner link
|
---|
74 | * to retrieve. Name uses the format:
|
---|
75 | * accounts/{account_id}/channelPartnerLinks/{id} where {id} is the Cloud
|
---|
76 | * Identity ID of the partner.
|
---|
77 | * @param array $optParams Optional parameters.
|
---|
78 | *
|
---|
79 | * @opt_param string view Optional. The level of granularity the
|
---|
80 | * ChannelPartnerLink will display.
|
---|
81 | * @return GoogleCloudChannelV1ChannelPartnerLink
|
---|
82 | * @throws \Google\Service\Exception
|
---|
83 | */
|
---|
84 | public function get($name, $optParams = [])
|
---|
85 | {
|
---|
86 | $params = ['name' => $name];
|
---|
87 | $params = array_merge($params, $optParams);
|
---|
88 | return $this->call('get', [$params], GoogleCloudChannelV1ChannelPartnerLink::class);
|
---|
89 | }
|
---|
90 | /**
|
---|
91 | * List ChannelPartnerLinks belonging to a distributor. You must be a
|
---|
92 | * distributor to call this method. Possible error codes: * PERMISSION_DENIED:
|
---|
93 | * The reseller account making the request is different from the reseller
|
---|
94 | * account in the API request. * INVALID_ARGUMENT: Required request parameters
|
---|
95 | * are missing or invalid. Return value: The list of the distributor account's
|
---|
96 | * ChannelPartnerLink resources.
|
---|
97 | * (channelPartnerLinks.listAccountsChannelPartnerLinks)
|
---|
98 | *
|
---|
99 | * @param string $parent Required. The resource name of the reseller account for
|
---|
100 | * listing channel partner links. Parent uses the format: accounts/{account_id}
|
---|
101 | * @param array $optParams Optional parameters.
|
---|
102 | *
|
---|
103 | * @opt_param int pageSize Optional. Requested page size. Server might return
|
---|
104 | * fewer results than requested. If unspecified, server will pick a default size
|
---|
105 | * (25). The maximum value is 200; the server will coerce values above 200.
|
---|
106 | * @opt_param string pageToken Optional. A token for a page of results other
|
---|
107 | * than the first page. Obtained using
|
---|
108 | * ListChannelPartnerLinksResponse.next_page_token of the previous
|
---|
109 | * CloudChannelService.ListChannelPartnerLinks call.
|
---|
110 | * @opt_param string view Optional. The level of granularity the
|
---|
111 | * ChannelPartnerLink will display.
|
---|
112 | * @return GoogleCloudChannelV1ListChannelPartnerLinksResponse
|
---|
113 | * @throws \Google\Service\Exception
|
---|
114 | */
|
---|
115 | public function listAccountsChannelPartnerLinks($parent, $optParams = [])
|
---|
116 | {
|
---|
117 | $params = ['parent' => $parent];
|
---|
118 | $params = array_merge($params, $optParams);
|
---|
119 | return $this->call('list', [$params], GoogleCloudChannelV1ListChannelPartnerLinksResponse::class);
|
---|
120 | }
|
---|
121 | /**
|
---|
122 | * Updates a channel partner link. Distributors call this method to change a
|
---|
123 | * link's status. For example, to suspend a partner link. You must be a
|
---|
124 | * distributor to call this method. Possible error codes: * PERMISSION_DENIED:
|
---|
125 | * The reseller account making the request is different from the reseller
|
---|
126 | * account in the API request. * INVALID_ARGUMENT: * Required request parameters
|
---|
127 | * are missing or invalid. * Link state cannot change from invited to active or
|
---|
128 | * suspended. * Cannot send reseller_cloud_identity_id, invite_url, or name in
|
---|
129 | * update mask. * NOT_FOUND: ChannelPartnerLink resource not found. * INTERNAL:
|
---|
130 | * Any non-user error related to a technical issue in the backend. Contact Cloud
|
---|
131 | * Channel support. * UNKNOWN: Any non-user error related to a technical issue
|
---|
132 | * in the backend. Contact Cloud Channel support. Return value: The updated
|
---|
133 | * ChannelPartnerLink resource. (channelPartnerLinks.patch)
|
---|
134 | *
|
---|
135 | * @param string $name Required. The resource name of the channel partner link
|
---|
136 | * to cancel. Name uses the format:
|
---|
137 | * accounts/{account_id}/channelPartnerLinks/{id} where {id} is the Cloud
|
---|
138 | * Identity ID of the partner.
|
---|
139 | * @param GoogleCloudChannelV1UpdateChannelPartnerLinkRequest $postBody
|
---|
140 | * @param array $optParams Optional parameters.
|
---|
141 | * @return GoogleCloudChannelV1ChannelPartnerLink
|
---|
142 | * @throws \Google\Service\Exception
|
---|
143 | */
|
---|
144 | public function patch($name, GoogleCloudChannelV1UpdateChannelPartnerLinkRequest $postBody, $optParams = [])
|
---|
145 | {
|
---|
146 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
147 | $params = array_merge($params, $optParams);
|
---|
148 | return $this->call('patch', [$params], GoogleCloudChannelV1ChannelPartnerLink::class);
|
---|
149 | }
|
---|
150 | }
|
---|
151 |
|
---|
152 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
153 | class_alias(AccountsChannelPartnerLinks::class, 'Google_Service_Cloudchannel_Resource_AccountsChannelPartnerLinks');
|
---|