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\GoogleCloudApigeeV1AsyncQuery;
|
---|
22 | use Google\Service\Apigee\GoogleCloudApigeeV1GetAsyncQueryResultUrlResponse;
|
---|
23 | use Google\Service\Apigee\GoogleCloudApigeeV1ListAsyncQueriesResponse;
|
---|
24 | use Google\Service\Apigee\GoogleCloudApigeeV1Query;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * The "queries" collection of methods.
|
---|
28 | * Typical usage is:
|
---|
29 | * <code>
|
---|
30 | * $apigeeService = new Google\Service\Apigee(...);
|
---|
31 | * $queries = $apigeeService->organizations_environments_queries;
|
---|
32 | * </code>
|
---|
33 | */
|
---|
34 | class OrganizationsEnvironmentsQueries extends \Google\Service\Resource
|
---|
35 | {
|
---|
36 | /**
|
---|
37 | * Submit a query to be processed in the background. If the submission of the
|
---|
38 | * query succeeds, the API returns a 201 status and an ID that refer to the
|
---|
39 | * query. In addition to the HTTP status 201, the `state` of "enqueued" means
|
---|
40 | * that the request succeeded. (queries.create)
|
---|
41 | *
|
---|
42 | * @param string $parent Required. The parent resource name. Must be of the form
|
---|
43 | * `organizations/{org}/environments/{env}`.
|
---|
44 | * @param GoogleCloudApigeeV1Query $postBody
|
---|
45 | * @param array $optParams Optional parameters.
|
---|
46 | * @return GoogleCloudApigeeV1AsyncQuery
|
---|
47 | * @throws \Google\Service\Exception
|
---|
48 | */
|
---|
49 | public function create($parent, GoogleCloudApigeeV1Query $postBody, $optParams = [])
|
---|
50 | {
|
---|
51 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
52 | $params = array_merge($params, $optParams);
|
---|
53 | return $this->call('create', [$params], GoogleCloudApigeeV1AsyncQuery::class);
|
---|
54 | }
|
---|
55 | /**
|
---|
56 | * Get query status If the query is still in progress, the `state` is set to
|
---|
57 | * "running" After the query has completed successfully, `state` is set to
|
---|
58 | * "completed" (queries.get)
|
---|
59 | *
|
---|
60 | * @param string $name Required. Name of the asynchronous query to get. Must be
|
---|
61 | * of the form `organizations/{org}/environments/{env}/queries/{queryId}`.
|
---|
62 | * @param array $optParams Optional parameters.
|
---|
63 | * @return GoogleCloudApigeeV1AsyncQuery
|
---|
64 | * @throws \Google\Service\Exception
|
---|
65 | */
|
---|
66 | public function get($name, $optParams = [])
|
---|
67 | {
|
---|
68 | $params = ['name' => $name];
|
---|
69 | $params = array_merge($params, $optParams);
|
---|
70 | return $this->call('get', [$params], GoogleCloudApigeeV1AsyncQuery::class);
|
---|
71 | }
|
---|
72 | /**
|
---|
73 | * After the query is completed, use this API to retrieve the results. If the
|
---|
74 | * request succeeds, and there is a non-zero result set, the result is
|
---|
75 | * downloaded to the client as a zipped JSON file. The name of the downloaded
|
---|
76 | * file will be: OfflineQueryResult-.zip Example:
|
---|
77 | * `OfflineQueryResult-9cfc0d85-0f30-46d6-ae6f-318d0cb961bd.zip`
|
---|
78 | * (queries.getResult)
|
---|
79 | *
|
---|
80 | * @param string $name Required. Name of the asynchronous query result to get.
|
---|
81 | * Must be of the form
|
---|
82 | * `organizations/{org}/environments/{env}/queries/{queryId}/result`.
|
---|
83 | * @param array $optParams Optional parameters.
|
---|
84 | * @return GoogleApiHttpBody
|
---|
85 | * @throws \Google\Service\Exception
|
---|
86 | */
|
---|
87 | public function getResult($name, $optParams = [])
|
---|
88 | {
|
---|
89 | $params = ['name' => $name];
|
---|
90 | $params = array_merge($params, $optParams);
|
---|
91 | return $this->call('getResult', [$params], GoogleApiHttpBody::class);
|
---|
92 | }
|
---|
93 | /**
|
---|
94 | * After the query is completed, use this API to retrieve the results. If the
|
---|
95 | * request succeeds, and there is a non-zero result set, the result is sent to
|
---|
96 | * the client as a list of urls to JSON files. (queries.getResulturl)
|
---|
97 | *
|
---|
98 | * @param string $name Required. Name of the asynchronous query result to get.
|
---|
99 | * Must be of the form
|
---|
100 | * `organizations/{org}/environments/{env}/queries/{queryId}/resulturl`.
|
---|
101 | * @param array $optParams Optional parameters.
|
---|
102 | * @return GoogleCloudApigeeV1GetAsyncQueryResultUrlResponse
|
---|
103 | * @throws \Google\Service\Exception
|
---|
104 | */
|
---|
105 | public function getResulturl($name, $optParams = [])
|
---|
106 | {
|
---|
107 | $params = ['name' => $name];
|
---|
108 | $params = array_merge($params, $optParams);
|
---|
109 | return $this->call('getResulturl', [$params], GoogleCloudApigeeV1GetAsyncQueryResultUrlResponse::class);
|
---|
110 | }
|
---|
111 | /**
|
---|
112 | * Return a list of Asynchronous Queries
|
---|
113 | * (queries.listOrganizationsEnvironmentsQueries)
|
---|
114 | *
|
---|
115 | * @param string $parent Required. The parent resource name. Must be of the form
|
---|
116 | * `organizations/{org}/environments/{env}`.
|
---|
117 | * @param array $optParams Optional parameters.
|
---|
118 | *
|
---|
119 | * @opt_param string dataset Filter response list by dataset. Example: `api`,
|
---|
120 | * `mint`
|
---|
121 | * @opt_param string from Filter response list by returning asynchronous queries
|
---|
122 | * that created after this date time. Time must be in ISO date-time format like
|
---|
123 | * '2011-12-03T10:15:30Z'.
|
---|
124 | * @opt_param string inclQueriesWithoutReport Flag to include asynchronous
|
---|
125 | * queries that don't have a report denifition.
|
---|
126 | * @opt_param string status Filter response list by asynchronous query status.
|
---|
127 | * @opt_param string submittedBy Filter response list by user who submitted
|
---|
128 | * queries.
|
---|
129 | * @opt_param string to Filter response list by returning asynchronous queries
|
---|
130 | * that created before this date time. Time must be in ISO date-time format like
|
---|
131 | * '2011-12-03T10:16:30Z'.
|
---|
132 | * @return GoogleCloudApigeeV1ListAsyncQueriesResponse
|
---|
133 | * @throws \Google\Service\Exception
|
---|
134 | */
|
---|
135 | public function listOrganizationsEnvironmentsQueries($parent, $optParams = [])
|
---|
136 | {
|
---|
137 | $params = ['parent' => $parent];
|
---|
138 | $params = array_merge($params, $optParams);
|
---|
139 | return $this->call('list', [$params], GoogleCloudApigeeV1ListAsyncQueriesResponse::class);
|
---|
140 | }
|
---|
141 | }
|
---|
142 |
|
---|
143 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
144 | class_alias(OrganizationsEnvironmentsQueries::class, 'Google_Service_Apigee_Resource_OrganizationsEnvironmentsQueries');
|
---|