OLD | NEW |
(Empty) | |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
| 3 library googleapis.cloudfunctions.v1; |
| 4 |
| 5 import 'dart:core' as core; |
| 6 import 'dart:async' as async; |
| 7 import 'dart:convert' as convert; |
| 8 |
| 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 10 import 'package:http/http.dart' as http; |
| 11 |
| 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
| 13 ApiRequestError, DetailedApiRequestError; |
| 14 |
| 15 const core.String USER_AGENT = 'dart-api-client cloudfunctions/v1'; |
| 16 |
| 17 /** |
| 18 * API for managing lightweight user-provided functions executed in response to |
| 19 * events. |
| 20 */ |
| 21 class CloudfunctionsApi { |
| 22 /** View and manage your data across Google Cloud Platform services */ |
| 23 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; |
| 24 |
| 25 |
| 26 final commons.ApiRequester _requester; |
| 27 |
| 28 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester); |
| 29 |
| 30 CloudfunctionsApi(http.Client client, {core.String rootUrl: "https://cloudfunc
tions.googleapis.com/", core.String servicePath: ""}) : |
| 31 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
| 32 } |
| 33 |
| 34 |
| 35 class ProjectsResourceApi { |
| 36 final commons.ApiRequester _requester; |
| 37 |
| 38 ProjectsLocationsResourceApi get locations => new ProjectsLocationsResourceApi
(_requester); |
| 39 |
| 40 ProjectsResourceApi(commons.ApiRequester client) : |
| 41 _requester = client; |
| 42 } |
| 43 |
| 44 |
| 45 class ProjectsLocationsResourceApi { |
| 46 final commons.ApiRequester _requester; |
| 47 |
| 48 ProjectsLocationsResourceApi(commons.ApiRequester client) : |
| 49 _requester = client; |
| 50 |
| 51 /** |
| 52 * Get information about a location. |
| 53 * |
| 54 * Request parameters: |
| 55 * |
| 56 * [name] - Resource name for the location. |
| 57 * Value must have pattern "^projects/[^/]+/locations/[^/]+$". |
| 58 * |
| 59 * Completes with a [Location]. |
| 60 * |
| 61 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 62 * error. |
| 63 * |
| 64 * If the used [http.Client] completes with an error when making a REST call, |
| 65 * this method will complete with the same error. |
| 66 */ |
| 67 async.Future<Location> get(core.String name) { |
| 68 var _url = null; |
| 69 var _queryParams = new core.Map(); |
| 70 var _uploadMedia = null; |
| 71 var _uploadOptions = null; |
| 72 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 73 var _body = null; |
| 74 |
| 75 if (name == null) { |
| 76 throw new core.ArgumentError("Parameter name is required."); |
| 77 } |
| 78 |
| 79 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
| 80 |
| 81 var _response = _requester.request(_url, |
| 82 "GET", |
| 83 body: _body, |
| 84 queryParams: _queryParams, |
| 85 uploadOptions: _uploadOptions, |
| 86 uploadMedia: _uploadMedia, |
| 87 downloadOptions: _downloadOptions); |
| 88 return _response.then((data) => new Location.fromJson(data)); |
| 89 } |
| 90 |
| 91 } |
| 92 |
| 93 |
| 94 |
| 95 /** A resource that represents Google Cloud Platform location. */ |
| 96 class Location { |
| 97 /** |
| 98 * Cross-service attributes for the location. For example |
| 99 * |
| 100 * {"cloud.googleapis.com/region": "us-east1"} |
| 101 */ |
| 102 core.Map<core.String, core.String> labels; |
| 103 /** The canonical id for this location. For example: `"us-east1"`. */ |
| 104 core.String locationId; |
| 105 /** |
| 106 * Service-specific metadata. For example the available capacity at the given |
| 107 * location. |
| 108 * |
| 109 * The values for Object must be JSON objects. It can consist of `num`, |
| 110 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 111 */ |
| 112 core.Map<core.String, core.Object> metadata; |
| 113 /** |
| 114 * Resource name for the location, which may vary between implementations. |
| 115 * For example: `"projects/example-project/locations/us-east1"` |
| 116 */ |
| 117 core.String name; |
| 118 |
| 119 Location(); |
| 120 |
| 121 Location.fromJson(core.Map _json) { |
| 122 if (_json.containsKey("labels")) { |
| 123 labels = _json["labels"]; |
| 124 } |
| 125 if (_json.containsKey("locationId")) { |
| 126 locationId = _json["locationId"]; |
| 127 } |
| 128 if (_json.containsKey("metadata")) { |
| 129 metadata = _json["metadata"]; |
| 130 } |
| 131 if (_json.containsKey("name")) { |
| 132 name = _json["name"]; |
| 133 } |
| 134 } |
| 135 |
| 136 core.Map toJson() { |
| 137 var _json = new core.Map(); |
| 138 if (labels != null) { |
| 139 _json["labels"] = labels; |
| 140 } |
| 141 if (locationId != null) { |
| 142 _json["locationId"] = locationId; |
| 143 } |
| 144 if (metadata != null) { |
| 145 _json["metadata"] = metadata; |
| 146 } |
| 147 if (name != null) { |
| 148 _json["name"] = name; |
| 149 } |
| 150 return _json; |
| 151 } |
| 152 } |
| 153 |
| 154 /** Metadata describing an Operation */ |
| 155 class OperationMetadataV1Beta2 { |
| 156 /** |
| 157 * The original request that started the operation. |
| 158 * |
| 159 * The values for Object must be JSON objects. It can consist of `num`, |
| 160 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 161 */ |
| 162 core.Map<core.String, core.Object> request; |
| 163 /** |
| 164 * Target of the operation - for example |
| 165 * projects/project-1/locations/region-1/functions/function-1 |
| 166 */ |
| 167 core.String target; |
| 168 /** |
| 169 * Type of operation. |
| 170 * Possible string values are: |
| 171 * - "OPERATION_UNSPECIFIED" : Unknown operation type. |
| 172 * - "CREATE_FUNCTION" : Triggered by CreateFunction call |
| 173 * - "UPDATE_FUNCTION" : Triggered by UpdateFunction call |
| 174 * - "DELETE_FUNCTION" : Triggered by DeleteFunction call. |
| 175 */ |
| 176 core.String type; |
| 177 |
| 178 OperationMetadataV1Beta2(); |
| 179 |
| 180 OperationMetadataV1Beta2.fromJson(core.Map _json) { |
| 181 if (_json.containsKey("request")) { |
| 182 request = _json["request"]; |
| 183 } |
| 184 if (_json.containsKey("target")) { |
| 185 target = _json["target"]; |
| 186 } |
| 187 if (_json.containsKey("type")) { |
| 188 type = _json["type"]; |
| 189 } |
| 190 } |
| 191 |
| 192 core.Map toJson() { |
| 193 var _json = new core.Map(); |
| 194 if (request != null) { |
| 195 _json["request"] = request; |
| 196 } |
| 197 if (target != null) { |
| 198 _json["target"] = target; |
| 199 } |
| 200 if (type != null) { |
| 201 _json["type"] = type; |
| 202 } |
| 203 return _json; |
| 204 } |
| 205 } |
OLD | NEW |