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\Apigee\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Apigee\GoogleApiHttpBody;
|
---|
21 | use Google\Service\Apigee\GoogleCloudApigeeV1Alias;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "aliases" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $apigeeService = new Google\Service\Apigee(...);
|
---|
28 | * $aliases = $apigeeService->organizations_environments_keystores_aliases;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class OrganizationsEnvironmentsKeystoresAliases extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Creates an alias from a key/certificate pair. The structure of the request is
|
---|
35 | * controlled by the `format` query parameter: - `keycertfile` - Separate PEM-
|
---|
36 | * encoded key and certificate files are uploaded. Set `Content-Type:
|
---|
37 | * multipart/form-data` and include the `keyFile`, `certFile`, and `password`
|
---|
38 | * (if keys are encrypted) fields in the request body. If uploading to a
|
---|
39 | * truststore, omit `keyFile`. - `pkcs12` - A PKCS12 file is uploaded. Set
|
---|
40 | * `Content-Type: multipart/form-data`, provide the file in the `file` field,
|
---|
41 | * and include the `password` field if the file is encrypted in the request
|
---|
42 | * body. - `selfsignedcert` - A new private key and certificate are generated.
|
---|
43 | * Set `Content-Type: application/json` and include CertificateGenerationSpec in
|
---|
44 | * the request body. (aliases.create)
|
---|
45 | *
|
---|
46 | * @param string $parent Required. Name of the keystore. Use the following
|
---|
47 | * format in your request:
|
---|
48 | * `organizations/{org}/environments/{env}/keystores/{keystore}`.
|
---|
49 | * @param GoogleApiHttpBody $postBody
|
---|
50 | * @param array $optParams Optional parameters.
|
---|
51 | *
|
---|
52 | * @opt_param string _password DEPRECATED: For improved security, specify the
|
---|
53 | * password in the request body instead of using the query parameter. To specify
|
---|
54 | * the password in the request body, set `Content-type: multipart/form-data`
|
---|
55 | * part with name `password`. Password for the private key file, if required.
|
---|
56 | * @opt_param string alias Alias for the key/certificate pair. Values must match
|
---|
57 | * the regular expression `[\w\s-.]{1,255}`. This must be provided for all
|
---|
58 | * formats except `selfsignedcert`; self-signed certs may specify the alias in
|
---|
59 | * either this parameter or the JSON body.
|
---|
60 | * @opt_param string format Required. Format of the data. Valid values include:
|
---|
61 | * `selfsignedcert`, `keycertfile`, or `pkcs12`
|
---|
62 | * @opt_param bool ignoreExpiryValidation Flag that specifies whether to ignore
|
---|
63 | * expiry validation. If set to `true`, no expiry validation will be performed.
|
---|
64 | * @opt_param bool ignoreNewlineValidation Flag that specifies whether to ignore
|
---|
65 | * newline validation. If set to `true`, no error is thrown when the file
|
---|
66 | * contains a certificate chain with no newline between each certificate.
|
---|
67 | * Defaults to `false`.
|
---|
68 | * @return GoogleCloudApigeeV1Alias
|
---|
69 | * @throws \Google\Service\Exception
|
---|
70 | */
|
---|
71 | public function create($parent, GoogleApiHttpBody $postBody, $optParams = [])
|
---|
72 | {
|
---|
73 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
74 | $params = array_merge($params, $optParams);
|
---|
75 | return $this->call('create', [$params], GoogleCloudApigeeV1Alias::class);
|
---|
76 | }
|
---|
77 | /**
|
---|
78 | * Generates a PKCS #10 Certificate Signing Request for the private key in an
|
---|
79 | * alias. (aliases.csr)
|
---|
80 | *
|
---|
81 | * @param string $name Required. Name of the alias. Use the following format in
|
---|
82 | * your request: `organizations/{org}/environments/{env}/keystores/{keystore}/al
|
---|
83 | * iases/{alias}`.
|
---|
84 | * @param array $optParams Optional parameters.
|
---|
85 | * @return GoogleApiHttpBody
|
---|
86 | * @throws \Google\Service\Exception
|
---|
87 | */
|
---|
88 | public function csr($name, $optParams = [])
|
---|
89 | {
|
---|
90 | $params = ['name' => $name];
|
---|
91 | $params = array_merge($params, $optParams);
|
---|
92 | return $this->call('csr', [$params], GoogleApiHttpBody::class);
|
---|
93 | }
|
---|
94 | /**
|
---|
95 | * Deletes an alias. (aliases.delete)
|
---|
96 | *
|
---|
97 | * @param string $name Required. Name of the alias. Use the following format in
|
---|
98 | * your request: `organizations/{org}/environments/{env}/keystores/{keystore}/al
|
---|
99 | * iases/{alias}`.
|
---|
100 | * @param array $optParams Optional parameters.
|
---|
101 | * @return GoogleCloudApigeeV1Alias
|
---|
102 | * @throws \Google\Service\Exception
|
---|
103 | */
|
---|
104 | public function delete($name, $optParams = [])
|
---|
105 | {
|
---|
106 | $params = ['name' => $name];
|
---|
107 | $params = array_merge($params, $optParams);
|
---|
108 | return $this->call('delete', [$params], GoogleCloudApigeeV1Alias::class);
|
---|
109 | }
|
---|
110 | /**
|
---|
111 | * Gets an alias. (aliases.get)
|
---|
112 | *
|
---|
113 | * @param string $name Required. Name of the alias. Use the following format in
|
---|
114 | * your request: `organizations/{org}/environments/{env}/keystores/{keystore}/al
|
---|
115 | * iases/{alias}`.
|
---|
116 | * @param array $optParams Optional parameters.
|
---|
117 | * @return GoogleCloudApigeeV1Alias
|
---|
118 | * @throws \Google\Service\Exception
|
---|
119 | */
|
---|
120 | public function get($name, $optParams = [])
|
---|
121 | {
|
---|
122 | $params = ['name' => $name];
|
---|
123 | $params = array_merge($params, $optParams);
|
---|
124 | return $this->call('get', [$params], GoogleCloudApigeeV1Alias::class);
|
---|
125 | }
|
---|
126 | /**
|
---|
127 | * Gets the certificate from an alias in PEM-encoded form.
|
---|
128 | * (aliases.getCertificate)
|
---|
129 | *
|
---|
130 | * @param string $name Required. Name of the alias. Use the following format in
|
---|
131 | * your request: `organizations/{org}/environments/{env}/keystores/{keystore}/al
|
---|
132 | * iases/{alias}`.
|
---|
133 | * @param array $optParams Optional parameters.
|
---|
134 | * @return GoogleApiHttpBody
|
---|
135 | * @throws \Google\Service\Exception
|
---|
136 | */
|
---|
137 | public function getCertificate($name, $optParams = [])
|
---|
138 | {
|
---|
139 | $params = ['name' => $name];
|
---|
140 | $params = array_merge($params, $optParams);
|
---|
141 | return $this->call('getCertificate', [$params], GoogleApiHttpBody::class);
|
---|
142 | }
|
---|
143 | /**
|
---|
144 | * Updates the certificate in an alias. (aliases.update)
|
---|
145 | *
|
---|
146 | * @param string $name Required. Name of the alias. Use the following format in
|
---|
147 | * your request:
|
---|
148 | * `organizations/{org}/environments/{env}/keystores/{keystore}/aliases/{alias}`
|
---|
149 | * @param GoogleApiHttpBody $postBody
|
---|
150 | * @param array $optParams Optional parameters.
|
---|
151 | *
|
---|
152 | * @opt_param bool ignoreExpiryValidation Required. Flag that specifies whether
|
---|
153 | * to ignore expiry validation. If set to `true`, no expiry validation will be
|
---|
154 | * performed.
|
---|
155 | * @opt_param bool ignoreNewlineValidation Flag that specifies whether to ignore
|
---|
156 | * newline validation. If set to `true`, no error is thrown when the file
|
---|
157 | * contains a certificate chain with no newline between each certificate.
|
---|
158 | * Defaults to `false`.
|
---|
159 | * @return GoogleCloudApigeeV1Alias
|
---|
160 | * @throws \Google\Service\Exception
|
---|
161 | */
|
---|
162 | public function update($name, GoogleApiHttpBody $postBody, $optParams = [])
|
---|
163 | {
|
---|
164 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
165 | $params = array_merge($params, $optParams);
|
---|
166 | return $this->call('update', [$params], GoogleCloudApigeeV1Alias::class);
|
---|
167 | }
|
---|
168 | }
|
---|
169 |
|
---|
170 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
171 | class_alias(OrganizationsEnvironmentsKeystoresAliases::class, 'Google_Service_Apigee_Resource_OrganizationsEnvironmentsKeystoresAliases');
|
---|