@scaleway/sdk 2.0.0-alpha.13 → 2.0.0-alpha.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/dist/api/account/index.js +4 -0
  2. package/dist/api/account/v2/api.gen.js +147 -0
  3. package/dist/api/account/v2/index.gen.js +4 -0
  4. package/dist/api/account/v2/marshalling.gen.js +39 -0
  5. package/dist/api/account/v3/api.gen.js +129 -0
  6. package/dist/api/account/v3/index.gen.js +6 -0
  7. package/dist/api/account/v3/marshalling.gen.js +39 -0
  8. package/dist/api/account/v3/validation-rules.gen.js +39 -0
  9. package/dist/api/applesilicon/index.js +2 -0
  10. package/dist/api/applesilicon/v1alpha1/api.gen.js +220 -0
  11. package/dist/api/applesilicon/v1alpha1/content.gen.js +7 -0
  12. package/dist/api/applesilicon/v1alpha1/index.gen.js +5 -0
  13. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +113 -0
  14. package/dist/api/baremetal/index.js +2 -0
  15. package/dist/api/baremetal/v1/api.gen.js +523 -0
  16. package/dist/api/baremetal/v1/api.utils.js +27 -0
  17. package/dist/api/baremetal/v1/content.gen.js +13 -0
  18. package/dist/api/baremetal/v1/index.js +5 -0
  19. package/dist/api/baremetal/v1/marshalling.gen.js +406 -0
  20. package/dist/api/baremetal/v1/validation-rules.gen.js +109 -0
  21. package/dist/api/billing/index.js +2 -0
  22. package/dist/api/billing/v2alpha1/api.gen.js +80 -0
  23. package/dist/api/billing/v2alpha1/index.gen.js +4 -0
  24. package/dist/api/billing/v2alpha1/marshalling.gen.js +53 -0
  25. package/dist/api/block/index.js +2 -0
  26. package/dist/api/block/v1alpha1/api.gen.js +249 -0
  27. package/dist/api/block/v1alpha1/content.gen.js +13 -0
  28. package/dist/api/block/v1alpha1/index.gen.js +7 -0
  29. package/dist/api/block/v1alpha1/marshalling.gen.js +182 -0
  30. package/dist/api/block/v1alpha1/validation-rules.gen.js +52 -0
  31. package/dist/api/cockpit/index.js +2 -0
  32. package/dist/api/cockpit/v1beta1/api.gen.js +543 -0
  33. package/dist/api/cockpit/v1beta1/content.gen.js +7 -0
  34. package/dist/api/cockpit/v1beta1/index.gen.js +5 -0
  35. package/dist/api/cockpit/v1beta1/marshalling.gen.js +271 -0
  36. package/dist/api/container/index.js +2 -0
  37. package/dist/api/container/v1beta1/api.gen.js +549 -0
  38. package/dist/api/container/v1beta1/content.gen.js +22 -0
  39. package/dist/api/container/v1beta1/index.gen.js +7 -0
  40. package/dist/api/container/v1beta1/marshalling.gen.js +358 -0
  41. package/dist/api/container/v1beta1/validation-rules.gen.js +44 -0
  42. package/dist/api/document_db/index.js +2 -0
  43. package/dist/api/document_db/v1beta1/api.gen.js +830 -0
  44. package/dist/api/document_db/v1beta1/content.gen.js +19 -0
  45. package/dist/api/document_db/v1beta1/index.gen.js +7 -0
  46. package/dist/api/document_db/v1beta1/marshalling.gen.js +636 -0
  47. package/dist/api/document_db/v1beta1/validation-rules.gen.js +10 -0
  48. package/dist/api/domain/index.js +2 -0
  49. package/dist/api/domain/v2beta1/api.gen.js +867 -0
  50. package/dist/api/domain/v2beta1/content.gen.js +28 -0
  51. package/dist/api/domain/v2beta1/index.gen.js +5 -0
  52. package/dist/api/domain/v2beta1/marshalling.gen.js +1172 -0
  53. package/dist/api/flexibleip/index.js +2 -0
  54. package/dist/api/flexibleip/v1alpha1/api.gen.js +195 -0
  55. package/dist/api/flexibleip/v1alpha1/content.gen.js +10 -0
  56. package/dist/api/flexibleip/v1alpha1/index.gen.js +7 -0
  57. package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +97 -0
  58. package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +14 -0
  59. package/dist/api/function/index.js +2 -0
  60. package/dist/api/function/v1beta1/api.gen.js +560 -0
  61. package/dist/api/function/v1beta1/content.gen.js +22 -0
  62. package/dist/api/function/v1beta1/index.gen.js +7 -0
  63. package/dist/api/function/v1beta1/marshalling.gen.js +396 -0
  64. package/dist/api/function/v1beta1/validation-rules.gen.js +44 -0
  65. package/dist/api/iam/index.js +2 -0
  66. package/dist/api/iam/v1alpha1/api.gen.js +783 -0
  67. package/dist/api/iam/v1alpha1/index.gen.js +6 -0
  68. package/dist/api/iam/v1alpha1/marshalling.gen.js +384 -0
  69. package/dist/api/iam/v1alpha1/validation-rules.gen.js +207 -0
  70. package/dist/api/instance/index.js +2 -0
  71. package/dist/api/instance/v1/api.gen.js +1003 -0
  72. package/dist/api/instance/v1/api.utils.js +369 -0
  73. package/dist/api/instance/v1/content.gen.js +31 -0
  74. package/dist/api/instance/v1/index.js +2 -0
  75. package/dist/api/instance/v1/marshalling.gen.js +1415 -0
  76. package/dist/api/instance/v1/marshalling.utils.js +63 -0
  77. package/dist/api/iot/index.js +2 -0
  78. package/dist/api/iot/v1/api.gen.js +573 -0
  79. package/dist/api/iot/v1/content.gen.js +7 -0
  80. package/dist/api/iot/v1/index.gen.js +5 -0
  81. package/dist/api/iot/v1/marshalling.gen.js +439 -0
  82. package/dist/api/ipam/index.js +2 -0
  83. package/dist/api/ipam/v1/api.gen.js +113 -0
  84. package/dist/api/ipam/v1/index.gen.js +6 -0
  85. package/dist/api/ipam/v1/marshalling.gen.js +77 -0
  86. package/dist/api/ipam/v1/validation-rules.gen.js +11 -0
  87. package/dist/api/ipfs/index.js +2 -0
  88. package/dist/api/ipfs/v1alpha1/api.gen.js +314 -0
  89. package/dist/api/ipfs/v1alpha1/content.gen.js +10 -0
  90. package/dist/api/ipfs/v1alpha1/index.gen.js +5 -0
  91. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +180 -0
  92. package/dist/api/k8s/index.js +2 -0
  93. package/dist/api/k8s/v1/api.gen.js +454 -0
  94. package/dist/api/k8s/v1/api.utils.js +13 -0
  95. package/dist/api/k8s/v1/content.gen.js +13 -0
  96. package/dist/api/k8s/v1/index.js +4 -0
  97. package/dist/api/k8s/v1/marshalling.gen.js +421 -0
  98. package/dist/api/k8s/v1/validation-rules.gen.js +101 -0
  99. package/dist/api/lb/index.js +2 -0
  100. package/dist/api/lb/v1/api.gen.js +1669 -0
  101. package/dist/api/lb/v1/api.utils.js +81 -0
  102. package/dist/api/lb/v1/content.gen.js +16 -0
  103. package/dist/api/lb/v1/index.js +2 -0
  104. package/dist/api/lb/v1/marshalling.gen.js +1039 -0
  105. package/dist/api/marketplace/index.js +4 -0
  106. package/dist/api/marketplace/v1/api.gen.js +60 -0
  107. package/dist/api/marketplace/v1/index.gen.js +4 -0
  108. package/dist/api/marketplace/v1/marshalling.gen.js +92 -0
  109. package/dist/api/marketplace/v2/api.gen.js +162 -0
  110. package/dist/api/marketplace/v2/index.gen.js +4 -0
  111. package/dist/api/marketplace/v2/marshalling.gen.js +94 -0
  112. package/dist/api/mnq/index.js +4 -0
  113. package/dist/api/mnq/v1alpha1/api.gen.js +197 -0
  114. package/dist/api/mnq/v1alpha1/index.gen.js +4 -0
  115. package/dist/api/mnq/v1alpha1/marshalling.gen.js +126 -0
  116. package/dist/api/mnq/v1beta1/api.gen.js +529 -0
  117. package/dist/api/mnq/v1beta1/index.gen.js +6 -0
  118. package/dist/api/mnq/v1beta1/marshalling.gen.js +212 -0
  119. package/dist/api/mnq/v1beta1/validation-rules.gen.js +77 -0
  120. package/dist/api/rdb/index.js +2 -0
  121. package/dist/api/rdb/v1/api.gen.js +972 -0
  122. package/dist/api/rdb/v1/content.gen.js +22 -0
  123. package/dist/api/rdb/v1/index.gen.js +7 -0
  124. package/dist/api/rdb/v1/marshalling.gen.js +694 -0
  125. package/dist/api/rdb/v1/validation-rules.gen.js +10 -0
  126. package/dist/api/redis/index.js +2 -0
  127. package/dist/api/redis/v1/api.gen.js +389 -0
  128. package/dist/api/redis/v1/content.gen.js +7 -0
  129. package/dist/api/redis/v1/index.gen.js +5 -0
  130. package/dist/api/redis/v1/marshalling.gen.js +283 -0
  131. package/dist/api/registry/index.js +2 -0
  132. package/dist/api/registry/v1/api.gen.js +252 -0
  133. package/dist/api/registry/v1/content.gen.js +13 -0
  134. package/dist/api/registry/v1/index.gen.js +5 -0
  135. package/dist/api/registry/v1/marshalling.gen.js +108 -0
  136. package/dist/api/secret/index.js +2 -0
  137. package/dist/api/secret/v1alpha1/api.gen.js +415 -0
  138. package/dist/api/secret/v1alpha1/index.gen.js +4 -0
  139. package/dist/api/secret/v1alpha1/marshalling.gen.js +150 -0
  140. package/dist/api/tem/index.js +2 -0
  141. package/dist/api/tem/v1alpha1/api.gen.js +229 -0
  142. package/dist/api/tem/v1alpha1/content.gen.js +10 -0
  143. package/dist/api/tem/v1alpha1/index.gen.js +5 -0
  144. package/dist/api/tem/v1alpha1/marshalling.gen.js +168 -0
  145. package/dist/api/test/index.js +2 -0
  146. package/dist/api/test/v1/api.gen.js +152 -0
  147. package/dist/api/test/v1/content.gen.js +7 -0
  148. package/dist/api/test/v1/index.gen.js +5 -0
  149. package/dist/api/test/v1/marshalling.gen.js +81 -0
  150. package/dist/api/vpc/index.js +4 -0
  151. package/dist/api/vpc/v1/api.gen.js +110 -0
  152. package/dist/api/vpc/v1/index.gen.js +4 -0
  153. package/dist/api/vpc/v1/marshalling.gen.js +44 -0
  154. package/dist/api/vpc/v2/api.gen.js +276 -0
  155. package/dist/api/vpc/v2/index.gen.js +4 -0
  156. package/dist/api/vpc/v2/marshalling.gen.js +137 -0
  157. package/dist/api/vpcgw/index.js +2 -0
  158. package/dist/api/vpcgw/v1/api.gen.js +669 -0
  159. package/dist/api/vpcgw/v1/content.gen.js +10 -0
  160. package/dist/api/vpcgw/v1/index.gen.js +5 -0
  161. package/dist/api/vpcgw/v1/marshalling.gen.js +359 -0
  162. package/dist/api/webhosting/index.js +2 -0
  163. package/dist/api/webhosting/v1alpha1/api.gen.js +158 -0
  164. package/dist/api/webhosting/v1alpha1/content.gen.js +7 -0
  165. package/dist/api/webhosting/v1alpha1/index.gen.js +7 -0
  166. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +146 -0
  167. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +14 -0
  168. package/dist/helpers/is-browser.js +5 -0
  169. package/dist/helpers/is-response.js +10 -0
  170. package/dist/helpers/json.js +11 -0
  171. package/dist/helpers/marshalling.js +130 -0
  172. package/dist/index.cjs +26484 -0
  173. package/dist/index.d.ts +31184 -0
  174. package/dist/index.js +71 -0
  175. package/dist/internal/async/interval-retrier.js +105 -0
  176. package/dist/internal/async/sleep.js +13 -0
  177. package/dist/internal/interceptors/composer.js +46 -0
  178. package/dist/internal/interceptors/helpers.js +32 -0
  179. package/dist/internal/logger/console-logger.js +38 -0
  180. package/dist/internal/logger/index.js +41 -0
  181. package/dist/internal/logger/level-resolver.js +13 -0
  182. package/dist/internal/validations/string-validation.js +38 -0
  183. package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +13 -0
  184. package/dist/scw/api.js +12 -0
  185. package/dist/scw/auth.js +68 -0
  186. package/dist/scw/client-ini-factory.js +174 -0
  187. package/dist/scw/client-ini-profile.js +54 -0
  188. package/dist/scw/client-settings.js +78 -0
  189. package/dist/scw/client.js +98 -0
  190. package/dist/scw/constants.js +4 -0
  191. package/dist/scw/custom-marshalling.js +131 -0
  192. package/dist/scw/errors/error-parser.js +107 -0
  193. package/dist/scw/errors/non-standard/invalid-request-mapper.js +36 -0
  194. package/dist/scw/errors/non-standard/unknown-resource-mapper.js +27 -0
  195. package/dist/scw/errors/scw-error.js +66 -0
  196. package/dist/scw/errors/standard/already-exists-error.js +26 -0
  197. package/dist/scw/errors/standard/denied-authentication-error.js +52 -0
  198. package/dist/scw/errors/standard/index.js +13 -0
  199. package/dist/scw/errors/standard/invalid-arguments-error.js +67 -0
  200. package/dist/scw/errors/standard/out-of-stock-error.js +22 -0
  201. package/dist/scw/errors/standard/permissions-denied-error.js +48 -0
  202. package/dist/scw/errors/standard/precondition-failed-error.js +42 -0
  203. package/dist/scw/errors/standard/quotas-exceeded-error.js +68 -0
  204. package/dist/scw/errors/standard/resource-expired-error.js +26 -0
  205. package/dist/scw/errors/standard/resource-locked-error.js +25 -0
  206. package/dist/scw/errors/standard/resource-not-found-error.js +25 -0
  207. package/dist/scw/errors/standard/too-many-requests-error.js +70 -0
  208. package/dist/scw/errors/standard/transient-state-error.js +26 -0
  209. package/dist/scw/errors/types.js +23 -0
  210. package/dist/scw/fetch/build-fetcher.js +72 -0
  211. package/dist/scw/fetch/http-dumper.js +54 -0
  212. package/dist/scw/fetch/http-interceptors.js +99 -0
  213. package/dist/scw/fetch/resource-paginator.js +84 -0
  214. package/dist/scw/fetch/response-parser.js +72 -0
  215. package/package.json +2 -2
@@ -0,0 +1,549 @@
1
+ import { waitForResource } from '../../../internal/async/interval-retrier.js';
2
+ import { API as API$1 } from '../../../scw/api.js';
3
+ import { validatePathParam, urlParams, resolveOneOf } from '../../../helpers/marshalling.js';
4
+ import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
+ import { NAMESPACE_TRANSIENT_STATUSES, CONTAINER_TRANSIENT_STATUSES, CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES } from './content.gen.js';
6
+ import { unmarshalListNamespacesResponse, unmarshalNamespace, marshalCreateNamespaceRequest, marshalUpdateNamespaceRequest, unmarshalListContainersResponse, unmarshalContainer, marshalCreateContainerRequest, marshalUpdateContainerRequest, unmarshalListCronsResponse, unmarshalCron, marshalCreateCronRequest, marshalUpdateCronRequest, unmarshalListLogsResponse, unmarshalListDomainsResponse, unmarshalDomain, marshalCreateDomainRequest, unmarshalToken, marshalCreateTokenRequest, unmarshalListTokensResponse, marshalCreateTriggerRequest, unmarshalTrigger, unmarshalListTriggersResponse, marshalUpdateTriggerRequest } from './marshalling.gen.js';
7
+
8
+ // This file was automatically generated. DO NOT EDIT.
9
+ // If you have any remark or suggestion do not hesitate to open an issue.
10
+ const jsonContentHeaders = {
11
+ 'Content-Type': 'application/json; charset=utf-8'
12
+ };
13
+
14
+ /** Serverless Containers API. */
15
+ class API extends API$1 {
16
+ /** Lists the available regions of the API. */
17
+ static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
18
+ pageOfListNamespaces = (() => {
19
+ var _this = this;
20
+ return function (request) {
21
+ if (request === void 0) {
22
+ request = {};
23
+ }
24
+ return _this.client.fetch({
25
+ method: 'GET',
26
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/namespaces`,
27
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId])
28
+ }, unmarshalListNamespacesResponse);
29
+ };
30
+ })();
31
+
32
+ /**
33
+ * List all your namespaces. List all namespaces in a specified region.
34
+ *
35
+ * @param request - The request {@link ListNamespacesRequest}
36
+ * @returns A Promise of ListNamespacesResponse
37
+ */
38
+ listNamespaces = (() => {
39
+ var _this2 = this;
40
+ return function (request) {
41
+ if (request === void 0) {
42
+ request = {};
43
+ }
44
+ return enrichForPagination('namespaces', _this2.pageOfListNamespaces, request);
45
+ };
46
+ })();
47
+
48
+ /**
49
+ * Get a namespace. Get the namespace associated with the specified ID.
50
+ *
51
+ * @param request - The request {@link GetNamespaceRequest}
52
+ * @returns A Promise of Namespace
53
+ */
54
+ getNamespace = request => this.client.fetch({
55
+ method: 'GET',
56
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`
57
+ }, unmarshalNamespace);
58
+
59
+ /**
60
+ * Waits for {@link Namespace} to be in a final state.
61
+ *
62
+ * @param request - The request {@link GetNamespaceRequest}
63
+ * @param options - The waiting options
64
+ * @returns A Promise of Namespace
65
+ */
66
+ waitForNamespace = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES.includes(res.status))), this.getNamespace, request, options);
67
+
68
+ /**
69
+ * Create a new namespace. Create a new namespace in a specified region.
70
+ *
71
+ * @param request - The request {@link CreateNamespaceRequest}
72
+ * @returns A Promise of Namespace
73
+ */
74
+ createNamespace = (() => {
75
+ var _this3 = this;
76
+ return function (request) {
77
+ if (request === void 0) {
78
+ request = {};
79
+ }
80
+ return _this3.client.fetch({
81
+ body: JSON.stringify(marshalCreateNamespaceRequest(request, _this3.client.settings)),
82
+ headers: jsonContentHeaders,
83
+ method: 'POST',
84
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/namespaces`
85
+ }, unmarshalNamespace);
86
+ };
87
+ })();
88
+
89
+ /**
90
+ * Update an existing namespace. Update the space associated with the
91
+ * specified ID.
92
+ *
93
+ * @param request - The request {@link UpdateNamespaceRequest}
94
+ * @returns A Promise of Namespace
95
+ */
96
+ updateNamespace = request => this.client.fetch({
97
+ body: JSON.stringify(marshalUpdateNamespaceRequest(request, this.client.settings)),
98
+ headers: jsonContentHeaders,
99
+ method: 'PATCH',
100
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`
101
+ }, unmarshalNamespace);
102
+
103
+ /**
104
+ * Delete an existing namespace. Delete the namespace associated with the
105
+ * specified ID.
106
+ *
107
+ * @param request - The request {@link DeleteNamespaceRequest}
108
+ * @returns A Promise of Namespace
109
+ */
110
+ deleteNamespace = request => this.client.fetch({
111
+ method: 'DELETE',
112
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`
113
+ }, unmarshalNamespace);
114
+ pageOfListContainers = request => this.client.fetch({
115
+ method: 'GET',
116
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers`,
117
+ urlParams: urlParams(['name', request.name], ['namespace_id', request.namespaceId], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
118
+ }, unmarshalListContainersResponse);
119
+
120
+ /**
121
+ * List all your containers. List all containers for a specified region.
122
+ *
123
+ * @param request - The request {@link ListContainersRequest}
124
+ * @returns A Promise of ListContainersResponse
125
+ */
126
+ listContainers = request => enrichForPagination('containers', this.pageOfListContainers, request);
127
+
128
+ /**
129
+ * Get a container. Get the container associated with the specified ID.
130
+ *
131
+ * @param request - The request {@link GetContainerRequest}
132
+ * @returns A Promise of Container
133
+ */
134
+ getContainer = request => this.client.fetch({
135
+ method: 'GET',
136
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}`
137
+ }, unmarshalContainer);
138
+
139
+ /**
140
+ * Waits for {@link Container} to be in a final state.
141
+ *
142
+ * @param request - The request {@link GetContainerRequest}
143
+ * @param options - The waiting options
144
+ * @returns A Promise of Container
145
+ */
146
+ waitForContainer = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CONTAINER_TRANSIENT_STATUSES.includes(res.status))), this.getContainer, request, options);
147
+
148
+ /**
149
+ * Create a new container. Create a new container in the specified region.
150
+ *
151
+ * @param request - The request {@link CreateContainerRequest}
152
+ * @returns A Promise of Container
153
+ */
154
+ createContainer = request => this.client.fetch({
155
+ body: JSON.stringify(marshalCreateContainerRequest(request, this.client.settings)),
156
+ headers: jsonContentHeaders,
157
+ method: 'POST',
158
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers`
159
+ }, unmarshalContainer);
160
+
161
+ /**
162
+ * Update an existing container. Update the container associated with the
163
+ * specified ID.
164
+ *
165
+ * @param request - The request {@link UpdateContainerRequest}
166
+ * @returns A Promise of Container
167
+ */
168
+ updateContainer = request => this.client.fetch({
169
+ body: JSON.stringify(marshalUpdateContainerRequest(request, this.client.settings)),
170
+ headers: jsonContentHeaders,
171
+ method: 'PATCH',
172
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}`
173
+ }, unmarshalContainer);
174
+
175
+ /**
176
+ * Delete a container. Delete the container associated with the specified ID.
177
+ *
178
+ * @param request - The request {@link DeleteContainerRequest}
179
+ * @returns A Promise of Container
180
+ */
181
+ deleteContainer = request => this.client.fetch({
182
+ method: 'DELETE',
183
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}`
184
+ }, unmarshalContainer);
185
+
186
+ /**
187
+ * Deploy a container. Deploy a container associated with the specified ID.
188
+ *
189
+ * @param request - The request {@link DeployContainerRequest}
190
+ * @returns A Promise of Container
191
+ */
192
+ deployContainer = request => this.client.fetch({
193
+ body: '{}',
194
+ headers: jsonContentHeaders,
195
+ method: 'POST',
196
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}/deploy`
197
+ }, unmarshalContainer);
198
+ pageOfListCrons = request => this.client.fetch({
199
+ method: 'GET',
200
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons`,
201
+ urlParams: urlParams(['container_id', request.containerId], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
202
+ }, unmarshalListCronsResponse);
203
+
204
+ /**
205
+ * List all your crons.
206
+ *
207
+ * @param request - The request {@link ListCronsRequest}
208
+ * @returns A Promise of ListCronsResponse
209
+ */
210
+ listCrons = request => enrichForPagination('crons', this.pageOfListCrons, request);
211
+
212
+ /**
213
+ * Get a cron. Get the cron associated with the specified ID.
214
+ *
215
+ * @param request - The request {@link GetCronRequest}
216
+ * @returns A Promise of Cron
217
+ */
218
+ getCron = request => this.client.fetch({
219
+ method: 'GET',
220
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}`
221
+ }, unmarshalCron);
222
+
223
+ /**
224
+ * Waits for {@link Cron} to be in a final state.
225
+ *
226
+ * @param request - The request {@link GetCronRequest}
227
+ * @param options - The waiting options
228
+ * @returns A Promise of Cron
229
+ */
230
+ waitForCron = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CRON_TRANSIENT_STATUSES.includes(res.status))), this.getCron, request, options);
231
+
232
+ /**
233
+ * Create a new cron.
234
+ *
235
+ * @param request - The request {@link CreateCronRequest}
236
+ * @returns A Promise of Cron
237
+ */
238
+ createCron = request => this.client.fetch({
239
+ body: JSON.stringify(marshalCreateCronRequest(request, this.client.settings)),
240
+ headers: jsonContentHeaders,
241
+ method: 'POST',
242
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons`
243
+ }, unmarshalCron);
244
+
245
+ /**
246
+ * Update an existing cron. Update the cron associated with the specified ID.
247
+ *
248
+ * @param request - The request {@link UpdateCronRequest}
249
+ * @returns A Promise of Cron
250
+ */
251
+ updateCron = request => this.client.fetch({
252
+ body: JSON.stringify(marshalUpdateCronRequest(request, this.client.settings)),
253
+ headers: jsonContentHeaders,
254
+ method: 'PATCH',
255
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}`
256
+ }, unmarshalCron);
257
+
258
+ /**
259
+ * Delete an existing cron. Delete the cron associated with the specified ID.
260
+ *
261
+ * @param request - The request {@link DeleteCronRequest}
262
+ * @returns A Promise of Cron
263
+ */
264
+ deleteCron = request => this.client.fetch({
265
+ method: 'DELETE',
266
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}`
267
+ }, unmarshalCron);
268
+ pageOfListLogs = request => this.client.fetch({
269
+ method: 'GET',
270
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}/logs`,
271
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
272
+ }, unmarshalListLogsResponse);
273
+
274
+ /**
275
+ * List your container logs. List the logs of the container with the specified
276
+ * ID.
277
+ *
278
+ * @param request - The request {@link ListLogsRequest}
279
+ * @returns A Promise of ListLogsResponse
280
+ */
281
+ listLogs = request => enrichForPagination('logs', this.pageOfListLogs, request);
282
+ pageOfListDomains = request => this.client.fetch({
283
+ method: 'GET',
284
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains`,
285
+ urlParams: urlParams(['container_id', request.containerId], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
286
+ }, unmarshalListDomainsResponse);
287
+
288
+ /**
289
+ * List all domain name bindings. List all domain name bindings in a specified
290
+ * region.
291
+ *
292
+ * @param request - The request {@link ListDomainsRequest}
293
+ * @returns A Promise of ListDomainsResponse
294
+ */
295
+ listDomains = request => enrichForPagination('domains', this.pageOfListDomains, request);
296
+
297
+ /**
298
+ * Get a domain name binding. Get a domain name binding for the container with
299
+ * the specified ID.
300
+ *
301
+ * @param request - The request {@link GetDomainRequest}
302
+ * @returns A Promise of Domain
303
+ */
304
+ getDomain = request => this.client.fetch({
305
+ method: 'GET',
306
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}`
307
+ }, unmarshalDomain);
308
+
309
+ /**
310
+ * Waits for {@link Domain} to be in a final state.
311
+ *
312
+ * @param request - The request {@link GetDomainRequest}
313
+ * @param options - The waiting options
314
+ * @returns A Promise of Domain
315
+ */
316
+ waitForDomain = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
317
+
318
+ /**
319
+ * Create a domain name binding. Create a domain name binding for the
320
+ * container with the specified ID.
321
+ *
322
+ * @param request - The request {@link CreateDomainRequest}
323
+ * @returns A Promise of Domain
324
+ */
325
+ createDomain = request => this.client.fetch({
326
+ body: JSON.stringify(marshalCreateDomainRequest(request, this.client.settings)),
327
+ headers: jsonContentHeaders,
328
+ method: 'POST',
329
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains`
330
+ }, unmarshalDomain);
331
+
332
+ /**
333
+ * Delete a domain name binding. Delete the domain name binding with the
334
+ * specific ID.
335
+ *
336
+ * @param request - The request {@link DeleteDomainRequest}
337
+ * @returns A Promise of Domain
338
+ */
339
+ deleteDomain = request => this.client.fetch({
340
+ method: 'DELETE',
341
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}`
342
+ }, unmarshalDomain);
343
+
344
+ /**
345
+ * @deprecated
346
+ * @param request - The request {@link IssueJWTRequest}
347
+ * @returns A Promise of Token
348
+ */
349
+ issueJWT = (() => {
350
+ var _this4 = this;
351
+ return function (request) {
352
+ if (request === void 0) {
353
+ request = {};
354
+ }
355
+ return _this4.client.fetch({
356
+ method: 'GET',
357
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? _this4.client.settings.defaultRegion)}/issue-jwt`,
358
+ urlParams: urlParams(['expires_at', request.expiresAt], ...Object.entries(resolveOneOf([{
359
+ param: 'container_id',
360
+ value: request.containerId
361
+ }, {
362
+ param: 'namespace_id',
363
+ value: request.namespaceId
364
+ }])))
365
+ }, unmarshalToken);
366
+ };
367
+ })();
368
+
369
+ /**
370
+ * Create a new revocable token.
371
+ *
372
+ * @param request - The request {@link CreateTokenRequest}
373
+ * @returns A Promise of Token
374
+ */
375
+ createToken = (() => {
376
+ var _this5 = this;
377
+ return function (request) {
378
+ if (request === void 0) {
379
+ request = {};
380
+ }
381
+ return _this5.client.fetch({
382
+ body: JSON.stringify(marshalCreateTokenRequest(request, _this5.client.settings)),
383
+ headers: jsonContentHeaders,
384
+ method: 'POST',
385
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? _this5.client.settings.defaultRegion)}/tokens`
386
+ }, unmarshalToken);
387
+ };
388
+ })();
389
+
390
+ /**
391
+ * Get a token. Get a token with a specified ID.
392
+ *
393
+ * @param request - The request {@link GetTokenRequest}
394
+ * @returns A Promise of Token
395
+ */
396
+ getToken = request => this.client.fetch({
397
+ method: 'GET',
398
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}`
399
+ }, unmarshalToken);
400
+
401
+ /**
402
+ * Waits for {@link Token} to be in a final state.
403
+ *
404
+ * @param request - The request {@link GetTokenRequest}
405
+ * @param options - The waiting options
406
+ * @returns A Promise of Token
407
+ */
408
+ waitForToken = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!TOKEN_TRANSIENT_STATUSES.includes(res.status))), this.getToken, request, options);
409
+ pageOfListTokens = (() => {
410
+ var _this6 = this;
411
+ return function (request) {
412
+ if (request === void 0) {
413
+ request = {};
414
+ }
415
+ return _this6.client.fetch({
416
+ method: 'GET',
417
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? _this6.client.settings.defaultRegion)}/tokens`,
418
+ urlParams: urlParams(['container_id', request.containerId], ['namespace_id', request.namespaceId], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this6.client.settings.defaultPageSize])
419
+ }, unmarshalListTokensResponse);
420
+ };
421
+ })();
422
+
423
+ /**
424
+ * List all tokens. List all tokens belonging to a specified Organization or
425
+ * Project.
426
+ *
427
+ * @param request - The request {@link ListTokensRequest}
428
+ * @returns A Promise of ListTokensResponse
429
+ */
430
+ listTokens = (() => {
431
+ var _this7 = this;
432
+ return function (request) {
433
+ if (request === void 0) {
434
+ request = {};
435
+ }
436
+ return enrichForPagination('tokens', _this7.pageOfListTokens, request);
437
+ };
438
+ })();
439
+
440
+ /**
441
+ * Delete a token. Delete a token with a specified ID.
442
+ *
443
+ * @param request - The request {@link DeleteTokenRequest}
444
+ * @returns A Promise of Token
445
+ */
446
+ deleteToken = request => this.client.fetch({
447
+ method: 'DELETE',
448
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}`
449
+ }, unmarshalToken);
450
+
451
+ /**
452
+ * Create a trigger. Create a new trigger for a specified container.
453
+ *
454
+ * @param request - The request {@link CreateTriggerRequest}
455
+ * @returns A Promise of Trigger
456
+ */
457
+ createTrigger = request => this.client.fetch({
458
+ body: JSON.stringify(marshalCreateTriggerRequest(request, this.client.settings)),
459
+ headers: jsonContentHeaders,
460
+ method: 'POST',
461
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers`
462
+ }, unmarshalTrigger);
463
+
464
+ /**
465
+ * Get a trigger. Get a trigger with a specified ID.
466
+ *
467
+ * @param request - The request {@link GetTriggerRequest}
468
+ * @returns A Promise of Trigger
469
+ */
470
+ getTrigger = request => this.client.fetch({
471
+ method: 'GET',
472
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}`
473
+ }, unmarshalTrigger);
474
+
475
+ /**
476
+ * Waits for {@link Trigger} to be in a final state.
477
+ *
478
+ * @param request - The request {@link GetTriggerRequest}
479
+ * @param options - The waiting options
480
+ * @returns A Promise of Trigger
481
+ */
482
+ waitForTrigger = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!TRIGGER_TRANSIENT_STATUSES.includes(res.status))), this.getTrigger, request, options);
483
+ pageOfListTriggers = (() => {
484
+ var _this8 = this;
485
+ return function (request) {
486
+ if (request === void 0) {
487
+ request = {};
488
+ }
489
+ return _this8.client.fetch({
490
+ method: 'GET',
491
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? _this8.client.settings.defaultRegion)}/triggers`,
492
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this8.client.settings.defaultPageSize], ...Object.entries(resolveOneOf([{
493
+ param: 'container_id',
494
+ value: request.containerId
495
+ }, {
496
+ param: 'namespace_id',
497
+ value: request.namespaceId
498
+ }, {
499
+ default: _this8.client.settings.defaultProjectId,
500
+ param: 'project_id',
501
+ value: request.projectId
502
+ }])))
503
+ }, unmarshalListTriggersResponse);
504
+ };
505
+ })();
506
+
507
+ /**
508
+ * List all triggers. List all triggers belonging to a specified Organization
509
+ * or Project.
510
+ *
511
+ * @param request - The request {@link ListTriggersRequest}
512
+ * @returns A Promise of ListTriggersResponse
513
+ */
514
+ listTriggers = (() => {
515
+ var _this9 = this;
516
+ return function (request) {
517
+ if (request === void 0) {
518
+ request = {};
519
+ }
520
+ return enrichForPagination('triggers', _this9.pageOfListTriggers, request);
521
+ };
522
+ })();
523
+
524
+ /**
525
+ * Update a trigger. Update a trigger with a specified ID.
526
+ *
527
+ * @param request - The request {@link UpdateTriggerRequest}
528
+ * @returns A Promise of Trigger
529
+ */
530
+ updateTrigger = request => this.client.fetch({
531
+ body: JSON.stringify(marshalUpdateTriggerRequest(request, this.client.settings)),
532
+ headers: jsonContentHeaders,
533
+ method: 'PATCH',
534
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}`
535
+ }, unmarshalTrigger);
536
+
537
+ /**
538
+ * Delete a trigger. Delete a trigger with a specified ID.
539
+ *
540
+ * @param request - The request {@link DeleteTriggerRequest}
541
+ * @returns A Promise of Trigger
542
+ */
543
+ deleteTrigger = request => this.client.fetch({
544
+ method: 'DELETE',
545
+ path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}`
546
+ }, unmarshalTrigger);
547
+ }
548
+
549
+ export { API };
@@ -0,0 +1,22 @@
1
+ // This file was automatically generated. DO NOT EDIT.
2
+ // If you have any remark or suggestion do not hesitate to open an issue.
3
+
4
+ /** Lists transient statutes of the enum {@link ContainerStatus}. */
5
+ const CONTAINER_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
6
+
7
+ /** Lists transient statutes of the enum {@link CronStatus}. */
8
+ const CRON_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
9
+
10
+ /** Lists transient statutes of the enum {@link DomainStatus}. */
11
+ const DOMAIN_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
12
+
13
+ /** Lists transient statutes of the enum {@link NamespaceStatus}. */
14
+ const NAMESPACE_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
15
+
16
+ /** Lists transient statutes of the enum {@link TokenStatus}. */
17
+ const TOKEN_TRANSIENT_STATUSES = ['deleting', 'creating'];
18
+
19
+ /** Lists transient statutes of the enum {@link TriggerStatus}. */
20
+ const TRIGGER_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
21
+
22
+ export { CONTAINER_TRANSIENT_STATUSES, CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES };
@@ -0,0 +1,7 @@
1
+ export { API } from './api.gen.js';
2
+ export { CONTAINER_TRANSIENT_STATUSES, CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES } from './content.gen.js';
3
+ import * as validationRules_gen from './validation-rules.gen.js';
4
+ export { validationRules_gen as ValidationRules };
5
+
6
+ // This file was automatically generated. DO NOT EDIT.
7
+ // If you have any remark or suggestion do not hesitate to open an issue.