instill-sdk 0.0.1

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 (226) hide show
  1. package/README.md +369 -0
  2. package/dist/chunk-2VZRNT6D.mjs +0 -0
  3. package/dist/chunk-3VVR3XHW.mjs +56 -0
  4. package/dist/chunk-42SCMPQP.mjs +0 -0
  5. package/dist/chunk-4KLHN5HK.mjs +0 -0
  6. package/dist/chunk-4TKUHGUZ.mjs +244 -0
  7. package/dist/chunk-4VWYH26Q.mjs +145 -0
  8. package/dist/chunk-6M57XUNI.mjs +64 -0
  9. package/dist/chunk-6NTCWRRC.mjs +0 -0
  10. package/dist/chunk-6ZXT6X3H.mjs +0 -0
  11. package/dist/chunk-73EPIL2R.mjs +0 -0
  12. package/dist/chunk-7KV3Y36U.mjs +17 -0
  13. package/dist/chunk-D5OKZ665.mjs +32 -0
  14. package/dist/chunk-DXEIDDIA.mjs +32 -0
  15. package/dist/chunk-EBWGEVUX.mjs +33 -0
  16. package/dist/chunk-ECC5KF6S.mjs +150 -0
  17. package/dist/chunk-EHG2FVLQ.mjs +0 -0
  18. package/dist/chunk-EXJ4UK7Q.mjs +49 -0
  19. package/dist/chunk-FAXYADOP.mjs +0 -0
  20. package/dist/chunk-FNCXOA62.mjs +0 -0
  21. package/dist/chunk-GPM5FDRS.mjs +154 -0
  22. package/dist/chunk-IB43VC55.mjs +41 -0
  23. package/dist/chunk-IPW3WQCQ.mjs +35 -0
  24. package/dist/chunk-IWAQMUMR.mjs +42 -0
  25. package/dist/chunk-JONZWFL5.mjs +168 -0
  26. package/dist/chunk-JTTE7IZY.mjs +14 -0
  27. package/dist/chunk-JY37AKV6.mjs +0 -0
  28. package/dist/chunk-KCKTAMXW.mjs +0 -0
  29. package/dist/chunk-KHFNAMT4.mjs +160 -0
  30. package/dist/chunk-NRP5M7FG.mjs +128 -0
  31. package/dist/chunk-QLWRKSUE.mjs +104 -0
  32. package/dist/chunk-QV7PYP7E.mjs +0 -0
  33. package/dist/chunk-QZOKJQTL.mjs +102 -0
  34. package/dist/chunk-RVRM4NPL.mjs +29 -0
  35. package/dist/chunk-VASX6R4R.mjs +0 -0
  36. package/dist/chunk-VIPORJ6H.mjs +77 -0
  37. package/dist/chunk-WBQAMGXK.mjs +0 -0
  38. package/dist/chunk-WL54JNC6.mjs +64 -0
  39. package/dist/chunk-WLPBUHMI.mjs +0 -0
  40. package/dist/chunk-YT6ZGA4J.mjs +46 -0
  41. package/dist/chunk-YXNMG2RZ.mjs +98 -0
  42. package/dist/chunk-ZRC43MN3.mjs +111 -0
  43. package/dist/chunk-magic-string.3a794426-OWTMMGNR.mjs +1253 -0
  44. package/dist/connector/ConnectorClient.d.ts +54 -0
  45. package/dist/connector/ConnectorClient.js +457 -0
  46. package/dist/connector/ConnectorClient.mjs +16 -0
  47. package/dist/connector/action.d.ts +13 -0
  48. package/dist/connector/action.js +72 -0
  49. package/dist/connector/action.mjs +11 -0
  50. package/dist/connector/index.d.ts +2 -0
  51. package/dist/connector/index.js +37 -0
  52. package/dist/connector/index.mjs +13 -0
  53. package/dist/connector/mutation.d.ts +19 -0
  54. package/dist/connector/mutation.js +91 -0
  55. package/dist/connector/mutation.mjs +13 -0
  56. package/dist/connector/queries.d.ts +34 -0
  57. package/dist/connector/queries.js +227 -0
  58. package/dist/connector/queries.mjs +23 -0
  59. package/dist/connector/types.d.ts +102 -0
  60. package/dist/connector/types.js +18 -0
  61. package/dist/connector/types.mjs +1 -0
  62. package/dist/helper/axiosInstance.d.ts +3 -0
  63. package/dist/helper/axiosInstance.js +44 -0
  64. package/dist/helper/axiosInstance.mjs +7 -0
  65. package/dist/helper/config.d.ts +1 -0
  66. package/dist/helper/config.js +53 -0
  67. package/dist/helper/config.mjs +7 -0
  68. package/dist/helper/createClient.d.ts +2 -0
  69. package/dist/helper/createClient.js +90 -0
  70. package/dist/helper/createClient.mjs +8 -0
  71. package/dist/helper/getInstillApiErrorMessage.d.ts +2 -0
  72. package/dist/helper/getInstillApiErrorMessage.js +41 -0
  73. package/dist/helper/getInstillApiErrorMessage.mjs +7 -0
  74. package/dist/helper/getQueryString.d.ts +7 -0
  75. package/dist/helper/getQueryString.js +57 -0
  76. package/dist/helper/getQueryString.mjs +7 -0
  77. package/dist/helper/getQueryString.test.d.ts +1 -0
  78. package/dist/helper/getQueryString.test.js +15769 -0
  79. package/dist/helper/getQueryString.test.mjs +14458 -0
  80. package/dist/helper/index.d.ts +5 -0
  81. package/dist/helper/index.js +145 -0
  82. package/dist/helper/index.mjs +21 -0
  83. package/dist/index.d.ts +24 -0
  84. package/dist/index.js +1978 -0
  85. package/dist/index.mjs +87 -0
  86. package/dist/metric/MetricClient.d.ts +21 -0
  87. package/dist/metric/MetricClient.js +215 -0
  88. package/dist/metric/MetricClient.mjs +14 -0
  89. package/dist/metric/index.d.ts +1 -0
  90. package/dist/metric/index.js +18 -0
  91. package/dist/metric/index.mjs +3 -0
  92. package/dist/metric/pipeline/index.d.ts +1 -0
  93. package/dist/metric/pipeline/index.js +18 -0
  94. package/dist/metric/pipeline/index.mjs +2 -0
  95. package/dist/metric/pipeline/queries.d.ts +21 -0
  96. package/dist/metric/pipeline/queries.js +168 -0
  97. package/dist/metric/pipeline/queries.mjs +17 -0
  98. package/dist/metric/pipeline/types.d.ts +63 -0
  99. package/dist/metric/pipeline/types.js +18 -0
  100. package/dist/metric/pipeline/types.mjs +1 -0
  101. package/dist/mgmt/AuthClient.d.ts +35 -0
  102. package/dist/mgmt/AuthClient.js +308 -0
  103. package/dist/mgmt/AuthClient.mjs +16 -0
  104. package/dist/mgmt/action.d.ts +8 -0
  105. package/dist/mgmt/action.js +61 -0
  106. package/dist/mgmt/action.mjs +11 -0
  107. package/dist/mgmt/index.d.ts +2 -0
  108. package/dist/mgmt/index.js +37 -0
  109. package/dist/mgmt/index.mjs +13 -0
  110. package/dist/mgmt/mutation.d.ts +18 -0
  111. package/dist/mgmt/mutation.js +83 -0
  112. package/dist/mgmt/mutation.mjs +13 -0
  113. package/dist/mgmt/queries.d.ts +17 -0
  114. package/dist/mgmt/queries.js +148 -0
  115. package/dist/mgmt/queries.mjs +19 -0
  116. package/dist/mgmt/types.d.ts +62 -0
  117. package/dist/mgmt/types.js +18 -0
  118. package/dist/mgmt/types.mjs +1 -0
  119. package/dist/model/ModelClient.d.ts +48 -0
  120. package/dist/model/ModelClient.js +466 -0
  121. package/dist/model/ModelClient.mjs +16 -0
  122. package/dist/model/action.d.ts +9 -0
  123. package/dist/model/action.js +57 -0
  124. package/dist/model/action.mjs +9 -0
  125. package/dist/model/index.d.ts +2 -0
  126. package/dist/model/index.js +37 -0
  127. package/dist/model/index.mjs +13 -0
  128. package/dist/model/mutation.d.ts +15 -0
  129. package/dist/model/mutation.js +128 -0
  130. package/dist/model/mutation.mjs +11 -0
  131. package/dist/model/queries.d.ts +35 -0
  132. package/dist/model/queries.js +234 -0
  133. package/dist/model/queries.mjs +25 -0
  134. package/dist/model/types.d.ts +141 -0
  135. package/dist/model/types.js +18 -0
  136. package/dist/model/types.mjs +1 -0
  137. package/dist/operation/OperationClient.d.ts +11 -0
  138. package/dist/operation/OperationClient.js +106 -0
  139. package/dist/operation/OperationClient.mjs +8 -0
  140. package/dist/operation/index.d.ts +2 -0
  141. package/dist/operation/index.js +31 -0
  142. package/dist/operation/index.mjs +5 -0
  143. package/dist/operation/queries.d.ts +9 -0
  144. package/dist/operation/queries.js +67 -0
  145. package/dist/operation/queries.mjs +9 -0
  146. package/dist/operation/types.d.ts +9 -0
  147. package/dist/operation/types.js +18 -0
  148. package/dist/operation/types.mjs +1 -0
  149. package/dist/pipeline/PipelineClient.d.ts +80 -0
  150. package/dist/pipeline/PipelineClient.js +639 -0
  151. package/dist/pipeline/PipelineClient.mjs +16 -0
  152. package/dist/pipeline/action.d.ts +34 -0
  153. package/dist/pipeline/action.js +157 -0
  154. package/dist/pipeline/action.mjs +17 -0
  155. package/dist/pipeline/index.d.ts +2 -0
  156. package/dist/pipeline/index.js +37 -0
  157. package/dist/pipeline/index.mjs +13 -0
  158. package/dist/pipeline/mutation.d.ts +33 -0
  159. package/dist/pipeline/mutation.js +134 -0
  160. package/dist/pipeline/mutation.mjs +19 -0
  161. package/dist/pipeline/queries.d.ts +32 -0
  162. package/dist/pipeline/queries.js +223 -0
  163. package/dist/pipeline/queries.mjs +23 -0
  164. package/dist/pipeline/types.d.ts +204 -0
  165. package/dist/pipeline/types.js +18 -0
  166. package/dist/pipeline/types.mjs +1 -0
  167. package/dist/protogen-ts/base/metric/v1alpha/metric.ts +4522 -0
  168. package/dist/protogen-ts/base/metric/v1alpha/metric_service.ts +314 -0
  169. package/dist/protogen-ts/base/mgmt/v1alpha/metric.ts +2486 -0
  170. package/dist/protogen-ts/base/mgmt/v1alpha/mgmt.ts +3787 -0
  171. package/dist/protogen-ts/base/mgmt/v1alpha/mgmt_private_service.ts +107 -0
  172. package/dist/protogen-ts/base/mgmt/v1alpha/mgmt_public_service.ts +326 -0
  173. package/dist/protogen-ts/base/usage/v1alpha/usage.ts +2185 -0
  174. package/dist/protogen-ts/base/usage/v1alpha/usage_service.ts +81 -0
  175. package/dist/protogen-ts/common/healthcheck/v1alpha/healthcheck.ts +188 -0
  176. package/dist/protogen-ts/common/task/v1alpha/task.ts +109 -0
  177. package/dist/protogen-ts/google/api/annotations.ts +3 -0
  178. package/dist/protogen-ts/google/api/client.ts +2073 -0
  179. package/dist/protogen-ts/google/api/field_behavior.ts +119 -0
  180. package/dist/protogen-ts/google/api/http.ts +745 -0
  181. package/dist/protogen-ts/google/api/launch_stage.ts +115 -0
  182. package/dist/protogen-ts/google/api/resource.ts +529 -0
  183. package/dist/protogen-ts/google/longrunning/operations.ts +890 -0
  184. package/dist/protogen-ts/google/protobuf/any.ts +259 -0
  185. package/dist/protogen-ts/google/protobuf/descriptor.ts +4831 -0
  186. package/dist/protogen-ts/google/protobuf/duration.ts +203 -0
  187. package/dist/protogen-ts/google/protobuf/empty.ts +70 -0
  188. package/dist/protogen-ts/google/protobuf/field_mask.ts +289 -0
  189. package/dist/protogen-ts/google/protobuf/struct.ts +543 -0
  190. package/dist/protogen-ts/google/protobuf/timestamp.ts +232 -0
  191. package/dist/protogen-ts/google/rpc/status.ts +138 -0
  192. package/dist/protogen-ts/model/controller/v1alpha/controller.ts +823 -0
  193. package/dist/protogen-ts/model/controller/v1alpha/controller_service.ts +95 -0
  194. package/dist/protogen-ts/model/model/v1alpha/common.ts +135 -0
  195. package/dist/protogen-ts/model/model/v1alpha/model.ts +5682 -0
  196. package/dist/protogen-ts/model/model/v1alpha/model_definition.ts +775 -0
  197. package/dist/protogen-ts/model/model/v1alpha/model_private_service.ts +87 -0
  198. package/dist/protogen-ts/model/model/v1alpha/model_public_service.ts +383 -0
  199. package/dist/protogen-ts/model/model/v1alpha/task_classification.ts +326 -0
  200. package/dist/protogen-ts/model/model/v1alpha/task_detection.ts +411 -0
  201. package/dist/protogen-ts/model/model/v1alpha/task_instance_segmentation.ts +435 -0
  202. package/dist/protogen-ts/model/model/v1alpha/task_keypoint.ts +510 -0
  203. package/dist/protogen-ts/model/model/v1alpha/task_ocr.ts +406 -0
  204. package/dist/protogen-ts/model/model/v1alpha/task_semantic_segmentation.ts +396 -0
  205. package/dist/protogen-ts/model/model/v1alpha/task_text_generation.ts +247 -0
  206. package/dist/protogen-ts/model/model/v1alpha/task_text_to_image.ts +221 -0
  207. package/dist/protogen-ts/model/model/v1alpha/task_unspecified.ts +142 -0
  208. package/dist/protogen-ts/protoc-gen-openapiv2/options/annotations.ts +3 -0
  209. package/dist/protogen-ts/protoc-gen-openapiv2/options/openapiv2.ts +5095 -0
  210. package/dist/protogen-ts/vdp/connector/v1alpha/connector.ts +3637 -0
  211. package/dist/protogen-ts/vdp/connector/v1alpha/connector_definition.ts +1043 -0
  212. package/dist/protogen-ts/vdp/connector/v1alpha/connector_private_service.ts +92 -0
  213. package/dist/protogen-ts/vdp/connector/v1alpha/connector_public_service.ts +310 -0
  214. package/dist/protogen-ts/vdp/connector/v1alpha/spec.ts +126 -0
  215. package/dist/protogen-ts/vdp/controller/v1alpha/controller.ts +853 -0
  216. package/dist/protogen-ts/vdp/controller/v1alpha/controller_service.ts +95 -0
  217. package/dist/protogen-ts/vdp/pipeline/v1alpha/common.ts +498 -0
  218. package/dist/protogen-ts/vdp/pipeline/v1alpha/operator_definition.ts +948 -0
  219. package/dist/protogen-ts/vdp/pipeline/v1alpha/pipeline.ts +6006 -0
  220. package/dist/protogen-ts/vdp/pipeline/v1alpha/pipeline_private_service.ts +83 -0
  221. package/dist/protogen-ts/vdp/pipeline/v1alpha/pipeline_public_service.ts +413 -0
  222. package/dist/tsconfig.tsbuildinfo +1 -0
  223. package/dist/types.d.ts +23 -0
  224. package/dist/types.js +18 -0
  225. package/dist/types.mjs +1 -0
  226. package/package.json +50 -0
@@ -0,0 +1,115 @@
1
+ /* eslint-disable */
2
+
3
+ export const protobufPackage = "google.api";
4
+
5
+ /**
6
+ * The launch stage as defined by [Google Cloud Platform
7
+ * Launch Stages](https://cloud.google.com/terms/launch-stages).
8
+ */
9
+ export enum LaunchStage {
10
+ /** LAUNCH_STAGE_UNSPECIFIED - Do not use this default value. */
11
+ LAUNCH_STAGE_UNSPECIFIED = 0,
12
+ /** UNIMPLEMENTED - The feature is not yet implemented. Users can not use it. */
13
+ UNIMPLEMENTED = 6,
14
+ /** PRELAUNCH - Prelaunch features are hidden from users and are only visible internally. */
15
+ PRELAUNCH = 7,
16
+ /**
17
+ * EARLY_ACCESS - Early Access features are limited to a closed group of testers. To use
18
+ * these features, you must sign up in advance and sign a Trusted Tester
19
+ * agreement (which includes confidentiality provisions). These features may
20
+ * be unstable, changed in backward-incompatible ways, and are not
21
+ * guaranteed to be released.
22
+ */
23
+ EARLY_ACCESS = 1,
24
+ /**
25
+ * ALPHA - Alpha is a limited availability test for releases before they are cleared
26
+ * for widespread use. By Alpha, all significant design issues are resolved
27
+ * and we are in the process of verifying functionality. Alpha customers
28
+ * need to apply for access, agree to applicable terms, and have their
29
+ * projects allowlisted. Alpha releases don't have to be feature complete,
30
+ * no SLAs are provided, and there are no technical support obligations, but
31
+ * they will be far enough along that customers can actually use them in
32
+ * test environments or for limited-use tests -- just like they would in
33
+ * normal production cases.
34
+ */
35
+ ALPHA = 2,
36
+ /**
37
+ * BETA - Beta is the point at which we are ready to open a release for any
38
+ * customer to use. There are no SLA or technical support obligations in a
39
+ * Beta release. Products will be complete from a feature perspective, but
40
+ * may have some open outstanding issues. Beta releases are suitable for
41
+ * limited production use cases.
42
+ */
43
+ BETA = 3,
44
+ /**
45
+ * GA - GA features are open to all developers and are considered stable and
46
+ * fully qualified for production use.
47
+ */
48
+ GA = 4,
49
+ /**
50
+ * DEPRECATED - Deprecated features are scheduled to be shut down and removed. For more
51
+ * information, see the "Deprecation Policy" section of our [Terms of
52
+ * Service](https://cloud.google.com/terms/)
53
+ * and the [Google Cloud Platform Subject to the Deprecation
54
+ * Policy](https://cloud.google.com/terms/deprecation) documentation.
55
+ */
56
+ DEPRECATED = 5,
57
+ UNRECOGNIZED = -1,
58
+ }
59
+
60
+ export function launchStageFromJSON(object: any): LaunchStage {
61
+ switch (object) {
62
+ case 0:
63
+ case "LAUNCH_STAGE_UNSPECIFIED":
64
+ return LaunchStage.LAUNCH_STAGE_UNSPECIFIED;
65
+ case 6:
66
+ case "UNIMPLEMENTED":
67
+ return LaunchStage.UNIMPLEMENTED;
68
+ case 7:
69
+ case "PRELAUNCH":
70
+ return LaunchStage.PRELAUNCH;
71
+ case 1:
72
+ case "EARLY_ACCESS":
73
+ return LaunchStage.EARLY_ACCESS;
74
+ case 2:
75
+ case "ALPHA":
76
+ return LaunchStage.ALPHA;
77
+ case 3:
78
+ case "BETA":
79
+ return LaunchStage.BETA;
80
+ case 4:
81
+ case "GA":
82
+ return LaunchStage.GA;
83
+ case 5:
84
+ case "DEPRECATED":
85
+ return LaunchStage.DEPRECATED;
86
+ case -1:
87
+ case "UNRECOGNIZED":
88
+ default:
89
+ return LaunchStage.UNRECOGNIZED;
90
+ }
91
+ }
92
+
93
+ export function launchStageToJSON(object: LaunchStage): string {
94
+ switch (object) {
95
+ case LaunchStage.LAUNCH_STAGE_UNSPECIFIED:
96
+ return "LAUNCH_STAGE_UNSPECIFIED";
97
+ case LaunchStage.UNIMPLEMENTED:
98
+ return "UNIMPLEMENTED";
99
+ case LaunchStage.PRELAUNCH:
100
+ return "PRELAUNCH";
101
+ case LaunchStage.EARLY_ACCESS:
102
+ return "EARLY_ACCESS";
103
+ case LaunchStage.ALPHA:
104
+ return "ALPHA";
105
+ case LaunchStage.BETA:
106
+ return "BETA";
107
+ case LaunchStage.GA:
108
+ return "GA";
109
+ case LaunchStage.DEPRECATED:
110
+ return "DEPRECATED";
111
+ case LaunchStage.UNRECOGNIZED:
112
+ default:
113
+ return "UNRECOGNIZED";
114
+ }
115
+ }
@@ -0,0 +1,529 @@
1
+ /* eslint-disable */
2
+ import * as _m0 from "protobufjs/minimal";
3
+
4
+ export const protobufPackage = "google.api";
5
+
6
+ /**
7
+ * A simple descriptor of a resource type.
8
+ *
9
+ * ResourceDescriptor annotates a resource message (either by means of a
10
+ * protobuf annotation or use in the service config), and associates the
11
+ * resource's schema, the resource type, and the pattern of the resource name.
12
+ *
13
+ * Example:
14
+ *
15
+ * message Topic {
16
+ * // Indicates this message defines a resource schema.
17
+ * // Declares the resource type in the format of {service}/{kind}.
18
+ * // For Kubernetes resources, the format is {api group}/{kind}.
19
+ * option (google.api.resource) = {
20
+ * type: "pubsub.googleapis.com/Topic"
21
+ * pattern: "projects/{project}/topics/{topic}"
22
+ * };
23
+ * }
24
+ *
25
+ * The ResourceDescriptor Yaml config will look like:
26
+ *
27
+ * resources:
28
+ * - type: "pubsub.googleapis.com/Topic"
29
+ * pattern: "projects/{project}/topics/{topic}"
30
+ *
31
+ * Sometimes, resources have multiple patterns, typically because they can
32
+ * live under multiple parents.
33
+ *
34
+ * Example:
35
+ *
36
+ * message LogEntry {
37
+ * option (google.api.resource) = {
38
+ * type: "logging.googleapis.com/LogEntry"
39
+ * pattern: "projects/{project}/logs/{log}"
40
+ * pattern: "folders/{folder}/logs/{log}"
41
+ * pattern: "organizations/{organization}/logs/{log}"
42
+ * pattern: "billingAccounts/{billing_account}/logs/{log}"
43
+ * };
44
+ * }
45
+ *
46
+ * The ResourceDescriptor Yaml config will look like:
47
+ *
48
+ * resources:
49
+ * - type: 'logging.googleapis.com/LogEntry'
50
+ * pattern: "projects/{project}/logs/{log}"
51
+ * pattern: "folders/{folder}/logs/{log}"
52
+ * pattern: "organizations/{organization}/logs/{log}"
53
+ * pattern: "billingAccounts/{billing_account}/logs/{log}"
54
+ */
55
+ export interface ResourceDescriptor {
56
+ /**
57
+ * The resource type. It must be in the format of
58
+ * {service_name}/{resource_type_kind}. The `resource_type_kind` must be
59
+ * singular and must not include version numbers.
60
+ *
61
+ * Example: `storage.googleapis.com/Bucket`
62
+ *
63
+ * The value of the resource_type_kind must follow the regular expression
64
+ * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
65
+ * should use PascalCase (UpperCamelCase). The maximum number of
66
+ * characters allowed for the `resource_type_kind` is 100.
67
+ */
68
+ type: string;
69
+ /**
70
+ * Optional. The relative resource name pattern associated with this resource
71
+ * type. The DNS prefix of the full resource name shouldn't be specified here.
72
+ *
73
+ * The path pattern must follow the syntax, which aligns with HTTP binding
74
+ * syntax:
75
+ *
76
+ * Template = Segment { "/" Segment } ;
77
+ * Segment = LITERAL | Variable ;
78
+ * Variable = "{" LITERAL "}" ;
79
+ *
80
+ * Examples:
81
+ *
82
+ * - "projects/{project}/topics/{topic}"
83
+ * - "projects/{project}/knowledgeBases/{knowledge_base}"
84
+ *
85
+ * The components in braces correspond to the IDs for each resource in the
86
+ * hierarchy. It is expected that, if multiple patterns are provided,
87
+ * the same component name (e.g. "project") refers to IDs of the same
88
+ * type of resource.
89
+ */
90
+ pattern: string[];
91
+ /**
92
+ * Optional. The field on the resource that designates the resource name
93
+ * field. If omitted, this is assumed to be "name".
94
+ */
95
+ nameField: string;
96
+ /**
97
+ * Optional. The historical or future-looking state of the resource pattern.
98
+ *
99
+ * Example:
100
+ *
101
+ * // The InspectTemplate message originally only supported resource
102
+ * // names with organization, and project was added later.
103
+ * message InspectTemplate {
104
+ * option (google.api.resource) = {
105
+ * type: "dlp.googleapis.com/InspectTemplate"
106
+ * pattern:
107
+ * "organizations/{organization}/inspectTemplates/{inspect_template}"
108
+ * pattern: "projects/{project}/inspectTemplates/{inspect_template}"
109
+ * history: ORIGINALLY_SINGLE_PATTERN
110
+ * };
111
+ * }
112
+ */
113
+ history: ResourceDescriptor_History;
114
+ /**
115
+ * The plural name used in the resource name and permission names, such as
116
+ * 'projects' for the resource name of 'projects/{project}' and the permission
117
+ * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
118
+ * concept of the `plural` field in k8s CRD spec
119
+ * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
120
+ *
121
+ * Note: The plural form is required even for singleton resources. See
122
+ * https://aip.dev/156
123
+ */
124
+ plural: string;
125
+ /**
126
+ * The same concept of the `singular` field in k8s CRD spec
127
+ * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
128
+ * Such as "project" for the `resourcemanager.googleapis.com/Project` type.
129
+ */
130
+ singular: string;
131
+ /**
132
+ * Style flag(s) for this resource.
133
+ * These indicate that a resource is expected to conform to a given
134
+ * style. See the specific style flags for additional information.
135
+ */
136
+ style: ResourceDescriptor_Style[];
137
+ }
138
+
139
+ /**
140
+ * A description of the historical or future-looking state of the
141
+ * resource pattern.
142
+ */
143
+ export enum ResourceDescriptor_History {
144
+ /** HISTORY_UNSPECIFIED - The "unset" value. */
145
+ HISTORY_UNSPECIFIED = 0,
146
+ /**
147
+ * ORIGINALLY_SINGLE_PATTERN - The resource originally had one pattern and launched as such, and
148
+ * additional patterns were added later.
149
+ */
150
+ ORIGINALLY_SINGLE_PATTERN = 1,
151
+ /**
152
+ * FUTURE_MULTI_PATTERN - The resource has one pattern, but the API owner expects to add more
153
+ * later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents
154
+ * that from being necessary once there are multiple patterns.)
155
+ */
156
+ FUTURE_MULTI_PATTERN = 2,
157
+ UNRECOGNIZED = -1,
158
+ }
159
+
160
+ export function resourceDescriptor_HistoryFromJSON(object: any): ResourceDescriptor_History {
161
+ switch (object) {
162
+ case 0:
163
+ case "HISTORY_UNSPECIFIED":
164
+ return ResourceDescriptor_History.HISTORY_UNSPECIFIED;
165
+ case 1:
166
+ case "ORIGINALLY_SINGLE_PATTERN":
167
+ return ResourceDescriptor_History.ORIGINALLY_SINGLE_PATTERN;
168
+ case 2:
169
+ case "FUTURE_MULTI_PATTERN":
170
+ return ResourceDescriptor_History.FUTURE_MULTI_PATTERN;
171
+ case -1:
172
+ case "UNRECOGNIZED":
173
+ default:
174
+ return ResourceDescriptor_History.UNRECOGNIZED;
175
+ }
176
+ }
177
+
178
+ export function resourceDescriptor_HistoryToJSON(object: ResourceDescriptor_History): string {
179
+ switch (object) {
180
+ case ResourceDescriptor_History.HISTORY_UNSPECIFIED:
181
+ return "HISTORY_UNSPECIFIED";
182
+ case ResourceDescriptor_History.ORIGINALLY_SINGLE_PATTERN:
183
+ return "ORIGINALLY_SINGLE_PATTERN";
184
+ case ResourceDescriptor_History.FUTURE_MULTI_PATTERN:
185
+ return "FUTURE_MULTI_PATTERN";
186
+ case ResourceDescriptor_History.UNRECOGNIZED:
187
+ default:
188
+ return "UNRECOGNIZED";
189
+ }
190
+ }
191
+
192
+ /** A flag representing a specific style that a resource claims to conform to. */
193
+ export enum ResourceDescriptor_Style {
194
+ /** STYLE_UNSPECIFIED - The unspecified value. Do not use. */
195
+ STYLE_UNSPECIFIED = 0,
196
+ /**
197
+ * DECLARATIVE_FRIENDLY - This resource is intended to be "declarative-friendly".
198
+ *
199
+ * Declarative-friendly resources must be more strictly consistent, and
200
+ * setting this to true communicates to tools that this resource should
201
+ * adhere to declarative-friendly expectations.
202
+ *
203
+ * Note: This is used by the API linter (linter.aip.dev) to enable
204
+ * additional checks.
205
+ */
206
+ DECLARATIVE_FRIENDLY = 1,
207
+ UNRECOGNIZED = -1,
208
+ }
209
+
210
+ export function resourceDescriptor_StyleFromJSON(object: any): ResourceDescriptor_Style {
211
+ switch (object) {
212
+ case 0:
213
+ case "STYLE_UNSPECIFIED":
214
+ return ResourceDescriptor_Style.STYLE_UNSPECIFIED;
215
+ case 1:
216
+ case "DECLARATIVE_FRIENDLY":
217
+ return ResourceDescriptor_Style.DECLARATIVE_FRIENDLY;
218
+ case -1:
219
+ case "UNRECOGNIZED":
220
+ default:
221
+ return ResourceDescriptor_Style.UNRECOGNIZED;
222
+ }
223
+ }
224
+
225
+ export function resourceDescriptor_StyleToJSON(object: ResourceDescriptor_Style): string {
226
+ switch (object) {
227
+ case ResourceDescriptor_Style.STYLE_UNSPECIFIED:
228
+ return "STYLE_UNSPECIFIED";
229
+ case ResourceDescriptor_Style.DECLARATIVE_FRIENDLY:
230
+ return "DECLARATIVE_FRIENDLY";
231
+ case ResourceDescriptor_Style.UNRECOGNIZED:
232
+ default:
233
+ return "UNRECOGNIZED";
234
+ }
235
+ }
236
+
237
+ /**
238
+ * Defines a proto annotation that describes a string field that refers to
239
+ * an API resource.
240
+ */
241
+ export interface ResourceReference {
242
+ /**
243
+ * The resource type that the annotated field references.
244
+ *
245
+ * Example:
246
+ *
247
+ * message Subscription {
248
+ * string topic = 2 [(google.api.resource_reference) = {
249
+ * type: "pubsub.googleapis.com/Topic"
250
+ * }];
251
+ * }
252
+ *
253
+ * Occasionally, a field may reference an arbitrary resource. In this case,
254
+ * APIs use the special value * in their resource reference.
255
+ *
256
+ * Example:
257
+ *
258
+ * message GetIamPolicyRequest {
259
+ * string resource = 2 [(google.api.resource_reference) = {
260
+ * type: "*"
261
+ * }];
262
+ * }
263
+ */
264
+ type: string;
265
+ /**
266
+ * The resource type of a child collection that the annotated field
267
+ * references. This is useful for annotating the `parent` field that
268
+ * doesn't have a fixed resource type.
269
+ *
270
+ * Example:
271
+ *
272
+ * message ListLogEntriesRequest {
273
+ * string parent = 1 [(google.api.resource_reference) = {
274
+ * child_type: "logging.googleapis.com/LogEntry"
275
+ * };
276
+ * }
277
+ */
278
+ childType: string;
279
+ }
280
+
281
+ function createBaseResourceDescriptor(): ResourceDescriptor {
282
+ return { type: "", pattern: [], nameField: "", history: 0, plural: "", singular: "", style: [] };
283
+ }
284
+
285
+ export const ResourceDescriptor = {
286
+ encode(message: ResourceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
287
+ if (message.type !== "") {
288
+ writer.uint32(10).string(message.type);
289
+ }
290
+ for (const v of message.pattern) {
291
+ writer.uint32(18).string(v!);
292
+ }
293
+ if (message.nameField !== "") {
294
+ writer.uint32(26).string(message.nameField);
295
+ }
296
+ if (message.history !== 0) {
297
+ writer.uint32(32).int32(message.history);
298
+ }
299
+ if (message.plural !== "") {
300
+ writer.uint32(42).string(message.plural);
301
+ }
302
+ if (message.singular !== "") {
303
+ writer.uint32(50).string(message.singular);
304
+ }
305
+ writer.uint32(82).fork();
306
+ for (const v of message.style) {
307
+ writer.int32(v);
308
+ }
309
+ writer.ldelim();
310
+ return writer;
311
+ },
312
+
313
+ decode(input: _m0.Reader | Uint8Array, length?: number): ResourceDescriptor {
314
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
315
+ let end = length === undefined ? reader.len : reader.pos + length;
316
+ const message = createBaseResourceDescriptor();
317
+ while (reader.pos < end) {
318
+ const tag = reader.uint32();
319
+ switch (tag >>> 3) {
320
+ case 1:
321
+ if (tag !== 10) {
322
+ break;
323
+ }
324
+
325
+ message.type = reader.string();
326
+ continue;
327
+ case 2:
328
+ if (tag !== 18) {
329
+ break;
330
+ }
331
+
332
+ message.pattern.push(reader.string());
333
+ continue;
334
+ case 3:
335
+ if (tag !== 26) {
336
+ break;
337
+ }
338
+
339
+ message.nameField = reader.string();
340
+ continue;
341
+ case 4:
342
+ if (tag !== 32) {
343
+ break;
344
+ }
345
+
346
+ message.history = reader.int32() as any;
347
+ continue;
348
+ case 5:
349
+ if (tag !== 42) {
350
+ break;
351
+ }
352
+
353
+ message.plural = reader.string();
354
+ continue;
355
+ case 6:
356
+ if (tag !== 50) {
357
+ break;
358
+ }
359
+
360
+ message.singular = reader.string();
361
+ continue;
362
+ case 10:
363
+ if (tag === 80) {
364
+ message.style.push(reader.int32() as any);
365
+
366
+ continue;
367
+ }
368
+
369
+ if (tag === 82) {
370
+ const end2 = reader.uint32() + reader.pos;
371
+ while (reader.pos < end2) {
372
+ message.style.push(reader.int32() as any);
373
+ }
374
+
375
+ continue;
376
+ }
377
+
378
+ break;
379
+ }
380
+ if ((tag & 7) === 4 || tag === 0) {
381
+ break;
382
+ }
383
+ reader.skipType(tag & 7);
384
+ }
385
+ return message;
386
+ },
387
+
388
+ fromJSON(object: any): ResourceDescriptor {
389
+ return {
390
+ type: isSet(object.type) ? String(object.type) : "",
391
+ pattern: Array.isArray(object?.pattern) ? object.pattern.map((e: any) => String(e)) : [],
392
+ nameField: isSet(object.nameField) ? String(object.nameField) : "",
393
+ history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : 0,
394
+ plural: isSet(object.plural) ? String(object.plural) : "",
395
+ singular: isSet(object.singular) ? String(object.singular) : "",
396
+ style: Array.isArray(object?.style) ? object.style.map((e: any) => resourceDescriptor_StyleFromJSON(e)) : [],
397
+ };
398
+ },
399
+
400
+ toJSON(message: ResourceDescriptor): unknown {
401
+ const obj: any = {};
402
+ if (message.type !== "") {
403
+ obj.type = message.type;
404
+ }
405
+ if (message.pattern?.length) {
406
+ obj.pattern = message.pattern;
407
+ }
408
+ if (message.nameField !== "") {
409
+ obj.nameField = message.nameField;
410
+ }
411
+ if (message.history !== 0) {
412
+ obj.history = resourceDescriptor_HistoryToJSON(message.history);
413
+ }
414
+ if (message.plural !== "") {
415
+ obj.plural = message.plural;
416
+ }
417
+ if (message.singular !== "") {
418
+ obj.singular = message.singular;
419
+ }
420
+ if (message.style?.length) {
421
+ obj.style = message.style.map((e) => resourceDescriptor_StyleToJSON(e));
422
+ }
423
+ return obj;
424
+ },
425
+
426
+ create<I extends Exact<DeepPartial<ResourceDescriptor>, I>>(base?: I): ResourceDescriptor {
427
+ return ResourceDescriptor.fromPartial(base ?? ({} as any));
428
+ },
429
+ fromPartial<I extends Exact<DeepPartial<ResourceDescriptor>, I>>(object: I): ResourceDescriptor {
430
+ const message = createBaseResourceDescriptor();
431
+ message.type = object.type ?? "";
432
+ message.pattern = object.pattern?.map((e) => e) || [];
433
+ message.nameField = object.nameField ?? "";
434
+ message.history = object.history ?? 0;
435
+ message.plural = object.plural ?? "";
436
+ message.singular = object.singular ?? "";
437
+ message.style = object.style?.map((e) => e) || [];
438
+ return message;
439
+ },
440
+ };
441
+
442
+ function createBaseResourceReference(): ResourceReference {
443
+ return { type: "", childType: "" };
444
+ }
445
+
446
+ export const ResourceReference = {
447
+ encode(message: ResourceReference, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
448
+ if (message.type !== "") {
449
+ writer.uint32(10).string(message.type);
450
+ }
451
+ if (message.childType !== "") {
452
+ writer.uint32(18).string(message.childType);
453
+ }
454
+ return writer;
455
+ },
456
+
457
+ decode(input: _m0.Reader | Uint8Array, length?: number): ResourceReference {
458
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
459
+ let end = length === undefined ? reader.len : reader.pos + length;
460
+ const message = createBaseResourceReference();
461
+ while (reader.pos < end) {
462
+ const tag = reader.uint32();
463
+ switch (tag >>> 3) {
464
+ case 1:
465
+ if (tag !== 10) {
466
+ break;
467
+ }
468
+
469
+ message.type = reader.string();
470
+ continue;
471
+ case 2:
472
+ if (tag !== 18) {
473
+ break;
474
+ }
475
+
476
+ message.childType = reader.string();
477
+ continue;
478
+ }
479
+ if ((tag & 7) === 4 || tag === 0) {
480
+ break;
481
+ }
482
+ reader.skipType(tag & 7);
483
+ }
484
+ return message;
485
+ },
486
+
487
+ fromJSON(object: any): ResourceReference {
488
+ return {
489
+ type: isSet(object.type) ? String(object.type) : "",
490
+ childType: isSet(object.childType) ? String(object.childType) : "",
491
+ };
492
+ },
493
+
494
+ toJSON(message: ResourceReference): unknown {
495
+ const obj: any = {};
496
+ if (message.type !== "") {
497
+ obj.type = message.type;
498
+ }
499
+ if (message.childType !== "") {
500
+ obj.childType = message.childType;
501
+ }
502
+ return obj;
503
+ },
504
+
505
+ create<I extends Exact<DeepPartial<ResourceReference>, I>>(base?: I): ResourceReference {
506
+ return ResourceReference.fromPartial(base ?? ({} as any));
507
+ },
508
+ fromPartial<I extends Exact<DeepPartial<ResourceReference>, I>>(object: I): ResourceReference {
509
+ const message = createBaseResourceReference();
510
+ message.type = object.type ?? "";
511
+ message.childType = object.childType ?? "";
512
+ return message;
513
+ },
514
+ };
515
+
516
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
517
+
518
+ export type DeepPartial<T> = T extends Builtin ? T
519
+ : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
520
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
521
+ : Partial<T>;
522
+
523
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
524
+ export type Exact<P, I extends P> = P extends Builtin ? P
525
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
526
+
527
+ function isSet(value: any): boolean {
528
+ return value !== null && value !== undefined;
529
+ }