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 18namespace Google\Service\Cloudchannel\Resource; 19 20use Google\Service\Cloudchannel\GoogleCloudChannelV1ChannelPartnerLink; 21use Google\Service\Cloudchannel\GoogleCloudChannelV1ListChannelPartnerLinksResponse; 22use 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->channelPartnerLinks; 30 * </code> 31 */ 32class 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 */ 57 public function create($parent, GoogleCloudChannelV1ChannelPartnerLink $postBody, $optParams = []) 58 { 59 $params = ['parent' => $parent, 'postBody' => $postBody]; 60 $params = array_merge($params, $optParams); 61 return $this->call('create', [$params], GoogleCloudChannelV1ChannelPartnerLink::class); 62 } 63 /** 64 * Returns the requested ChannelPartnerLink resource. You must be a distributor 65 * to call this method. Possible error codes: * PERMISSION_DENIED: The reseller 66 * account making the request is different from the reseller account in the API 67 * request. * INVALID_ARGUMENT: Required request parameters are missing or 68 * invalid. * NOT_FOUND: ChannelPartnerLink resource not found because of an 69 * invalid channel partner link name. Return value: The ChannelPartnerLink 70 * resource. (channelPartnerLinks.get) 71 * 72 * @param string $name Required. The resource name of the channel partner link 73 * to retrieve. Name uses the format: 74 * accounts/{account_id}/channelPartnerLinks/{id} where {id} is the Cloud 75 * Identity ID of the partner. 76 * @param array $optParams Optional parameters. 77 * 78 * @opt_param string view Optional. The level of granularity the 79 * ChannelPartnerLink will display. 80 * @return GoogleCloudChannelV1ChannelPartnerLink 81 */ 82 public function get($name, $optParams = []) 83 { 84 $params = ['name' => $name]; 85 $params = array_merge($params, $optParams); 86 return $this->call('get', [$params], GoogleCloudChannelV1ChannelPartnerLink::class); 87 } 88 /** 89 * List ChannelPartnerLinks belonging to a distributor. You must be a 90 * distributor to call this method. Possible error codes: * PERMISSION_DENIED: 91 * The reseller account making the request is different from the reseller 92 * account in the API request. * INVALID_ARGUMENT: Required request parameters 93 * are missing or invalid. Return value: The list of the distributor account's 94 * ChannelPartnerLink resources. 95 * (channelPartnerLinks.listAccountsChannelPartnerLinks) 96 * 97 * @param string $parent Required. The resource name of the reseller account for 98 * listing channel partner links. Parent uses the format: accounts/{account_id} 99 * @param array $optParams Optional parameters. 100 * 101 * @opt_param int pageSize Optional. Requested page size. Server might return 102 * fewer results than requested. If unspecified, server will pick a default size 103 * (25). The maximum value is 200; the server will coerce values above 200. 104 * @opt_param string pageToken Optional. A token for a page of results other 105 * than the first page. Obtained using 106 * ListChannelPartnerLinksResponse.next_page_token of the previous 107 * CloudChannelService.ListChannelPartnerLinks call. 108 * @opt_param string view Optional. The level of granularity the 109 * ChannelPartnerLink will display. 110 * @return GoogleCloudChannelV1ListChannelPartnerLinksResponse 111 */ 112 public function listAccountsChannelPartnerLinks($parent, $optParams = []) 113 { 114 $params = ['parent' => $parent]; 115 $params = array_merge($params, $optParams); 116 return $this->call('list', [$params], GoogleCloudChannelV1ListChannelPartnerLinksResponse::class); 117 } 118 /** 119 * Updates a channel partner link. Distributors call this method to change a 120 * link's status. For example, to suspend a partner link. You must be a 121 * distributor to call this method. Possible error codes: * PERMISSION_DENIED: 122 * The reseller account making the request is different from the reseller 123 * account in the API request. * INVALID_ARGUMENT: * Required request parameters 124 * are missing or invalid. * Link state cannot change from invited to active or 125 * suspended. * Cannot send reseller_cloud_identity_id, invite_url, or name in 126 * update mask. * NOT_FOUND: ChannelPartnerLink resource not found. * INTERNAL: 127 * Any non-user error related to a technical issue in the backend. Contact Cloud 128 * Channel support. * UNKNOWN: Any non-user error related to a technical issue 129 * in the backend. Contact Cloud Channel support. Return value: The updated 130 * ChannelPartnerLink resource. (channelPartnerLinks.patch) 131 * 132 * @param string $name Required. The resource name of the channel partner link 133 * to cancel. Name uses the format: 134 * accounts/{account_id}/channelPartnerLinks/{id} where {id} is the Cloud 135 * Identity ID of the partner. 136 * @param GoogleCloudChannelV1UpdateChannelPartnerLinkRequest $postBody 137 * @param array $optParams Optional parameters. 138 * @return GoogleCloudChannelV1ChannelPartnerLink 139 */ 140 public function patch($name, GoogleCloudChannelV1UpdateChannelPartnerLinkRequest $postBody, $optParams = []) 141 { 142 $params = ['name' => $name, 'postBody' => $postBody]; 143 $params = array_merge($params, $optParams); 144 return $this->call('patch', [$params], GoogleCloudChannelV1ChannelPartnerLink::class); 145 } 146} 147 148// Adding a class alias for backwards compatibility with the previous class name. 149class_alias(AccountsChannelPartnerLinks::class, 'Google_Service_Cloudchannel_Resource_AccountsChannelPartnerLinks'); 150