diff --git a/generated/connectors/README.md b/generated/connectors/README.md deleted file mode 100644 index e4e3c852d..000000000 --- a/generated/connectors/README.md +++ /dev/null @@ -1,44 +0,0 @@ -[OpenAPI specs](./bundled.yaml) is copied from [Kibana repo](https://raw.githubusercontent.com/elastic/kibana/8.7/x-pack/plugins/actions/docs/openapi/bundled.yaml) with some modifications: - -- added `.gemini` as a possible value for `connector_types`; -- `.slack_api` connector support comes from version 8.8 of the API specification; -- added `.slack_api` as a possible value for `connector_types`; -- added mapping section for discriminator field in `POST` `/s/{spaceId}/api/actions/connector`; -- added explicit object definitions for `400`, `401` and `404` errors (`oapi-codegen` doesn't generate proper code for embedded anonymous objects in some cases) - `bad_request_error`, `authorization_error` and `object_not_found_error`; -- added missing `oneOf` types in `requestBody` for `PUT` `/s/{spaceId}/api/actions/connector/{connectorId}` - the original `bundled.yaml` misses some connector types in the `PUT` `requestBody` defintion: - - `update_connector_request_email`; - - `update_connector_request_pagerduty`; - - `update_connector_request_servicenow_sir`; - - `update_connector_request_slack`; - - `update_connector_request_slack_api`; - - `update_connector_request_teams`; - - `update_connector_request_tines`; - - `update_connector_request_webhook`; - - `update_connector_request_xmatters`. -- response definitions of `/s/{spaceId}/api/actions/connector/{connectorId}/_execute` and `/s/{spaceId}/api/actions/action/{actionId}/_execute` are modified from embedded object definitions to named ones `run_connector_general_response` and `legacy_run_connector_general_response`; -- specified properties for following types. The original `bundled.yaml` defines them as dynamic objects (`additionalProperties: true`): - - `config_propeties_email`; - - `config_properties_pagerduty`; - - `config_properties_tines`; - - `config_properties_webhook`; - - `config_properties_xmatters`; -- `is_deprecated` is marked as optional field (it's required field in the vanilla `bundled.yaml`) in the following objects (Kibana responses may omit it): - - `connector_response_properties_cases_webhook`; - - `connector_response_properties_email`; - - `connector_response_properties_index`; - - `connector_response_properties_jira`; - - `connector_response_properties_opsgenie`; - - `connector_response_properties_pagerduty`; - - `connector_response_properties_resilient`; - - `connector_response_properties_serverlog`; - - `connector_response_properties_servicenow`; - - `connector_response_properties_servicenow_itom`; - - `connector_response_properties_servicenow_sir`; - - `connector_response_properties_slack`; - - `connector_response_properties_slack_api`; - - `connector_response_properties_swimlane`; - - `connector_response_properties_teams`; - - `connector_response_properties_tines`; - - `connector_response_properties_webhook`; - - `connector_response_properties_xmatters`. -- added mapping section for discriminator field in `connector_response_properties`. diff --git a/generated/connectors/bundled.yaml b/generated/connectors/bundled.yaml deleted file mode 100644 index f93c47be6..000000000 --- a/generated/connectors/bundled.yaml +++ /dev/null @@ -1,3632 +0,0 @@ -openapi: 3.0.1 -info: - title: Connectors - description: OpenAPI schema for Connectors endpoints - version: '0.1' - contact: - name: Connectors Team - license: - name: Elastic License 2.0 - url: https://www.elastic.co/licensing/elastic-license -tags: - - name: connectors - description: Connector APIs enable you to create and manage connectors. -servers: - - url: http://localhost:5601 - description: local -paths: - /s/{spaceId}/api/actions/connector: - post: - summary: Creates a connector. - operationId: createConnector - description: | - You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. - tags: - - connectors - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/space_id' - requestBody: - required: true - content: - application/json: - schema: - title: Create connector request body properties - description: The properties vary depending on the connector type. - oneOf: - - $ref: '#/components/schemas/create_connector_request_cases_webhook' - - $ref: '#/components/schemas/create_connector_request_email' - - $ref: '#/components/schemas/create_connector_request_gemini' - - $ref: '#/components/schemas/create_connector_request_index' - - $ref: '#/components/schemas/create_connector_request_jira' - - $ref: '#/components/schemas/create_connector_request_opsgenie' - - $ref: '#/components/schemas/create_connector_request_pagerduty' - - $ref: '#/components/schemas/create_connector_request_resilient' - - $ref: '#/components/schemas/create_connector_request_serverlog' - - $ref: '#/components/schemas/create_connector_request_servicenow' - - $ref: '#/components/schemas/create_connector_request_servicenow_itom' - - $ref: '#/components/schemas/create_connector_request_servicenow_sir' - - $ref: '#/components/schemas/create_connector_request_slack' - - $ref: '#/components/schemas/create_connector_request_slack_api' - - $ref: '#/components/schemas/create_connector_request_swimlane' - - $ref: '#/components/schemas/create_connector_request_teams' - - $ref: '#/components/schemas/create_connector_request_tines' - - $ref: '#/components/schemas/create_connector_request_webhook' - - $ref: '#/components/schemas/create_connector_request_xmatters' - discriminator: - propertyName: connector_type_id - mapping: - .cases-webhook: '#/components/schemas/create_connector_request_cases_webhook' - .email: '#/components/schemas/create_connector_request_email' - .gemini: '#/components/schemas/create_connector_request_gemini' - .index: '#/components/schemas/create_connector_request_index' - .jira: '#/components/schemas/create_connector_request_jira' - .opsgenie: '#/components/schemas/create_connector_request_opsgenie' - .pagerduty: '#/components/schemas/create_connector_request_pagerduty' - .resilient: '#/components/schemas/create_connector_request_resilient' - .server-log: '#/components/schemas/create_connector_request_serverlog' - .servicenow: '#/components/schemas/create_connector_request_servicenow' - .servicenow-itom: '#/components/schemas/create_connector_request_servicenow_itom' - .servicenow-sir: '#/components/schemas/create_connector_request_servicenow_sir' - .slack: '#/components/schemas/create_connector_request_slack' - .slack_api: '#/components/schemas/create_connector_request_slack_api' - .swimlane: '#/components/schemas/create_connector_request_swimlane' - .teams: '#/components/schemas/create_connector_request_teams' - .tines: '#/components/schemas/create_connector_request_tines' - .webhook: '#/components/schemas/create_connector_request_webhook' - .xmatters: '#/components/schemas/create_connector_request_xmatters' - examples: - createIndexConnectorRequest: - $ref: '#/components/examples/create_index_connector_request' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - $ref: '#/components/schemas/connector_response_properties' - examples: - createIndexConnectorResponse: - $ref: '#/components/examples/create_index_connector_response' - '400': - description: Indicates a bad request. - content: - application/json: - schema: - $ref: '#/components/schemas/bad_request_error' - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/authorization_error' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 - /s/{spaceId}/api/actions/connector/{connectorId}: - get: - summary: Retrieves a connector by ID. - operationId: getConnector - description: | - You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. - tags: - - connectors - parameters: - - $ref: '#/components/parameters/connector_id' - - $ref: '#/components/parameters/space_id' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - $ref: '#/components/schemas/connector_response_properties' - examples: - getConnectorResponse: - $ref: '#/components/examples/get_connector_response' - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/authorization_error' - '404': - description: Object is not found. - content: - application/json: - schema: - type: object - properties: - error: - type: string - example: Not Found - message: - type: string - example: Saved object [action/baf33fc0-920c-11ed-b36a-874bd1548a00] not found - statusCode: - type: integer - example: 404 - servers: - - url: https://localhost:5601 - delete: - summary: Deletes a connector. - operationId: deleteConnector - description: | - You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. WARNING: When you delete a connector, it cannot be recovered. - tags: - - connectors - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/connector_id' - - $ref: '#/components/parameters/space_id' - responses: - '204': - description: Indicates a successful call. - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/authorization_error' - '404': - description: Object is not found. - content: - application/json: - schema: - type: object - properties: - error: - type: string - example: Not Found - message: - type: string - example: Saved object [action/baf33fc0-920c-11ed-b36a-874bd1548a00] not found - statusCode: - type: integer - example: 404 - servers: - - url: https://localhost:5601 - put: - summary: Updates the attributes for a connector. - operationId: updateConnector - description: | - You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. - tags: - - connectors - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/connector_id' - - $ref: '#/components/parameters/space_id' - requestBody: - required: true - content: - application/json: - schema: - title: Update connector request body properties - description: The properties vary depending on the connector type. - oneOf: - - $ref: '#/components/schemas/update_connector_request_cases_webhook' - - $ref: '#/components/schemas/update_connector_request_email' - - $ref: '#/components/schemas/update_connector_request_gemini' - - $ref: '#/components/schemas/update_connector_request_index' - - $ref: '#/components/schemas/update_connector_request_jira' - - $ref: '#/components/schemas/update_connector_request_opsgenie' - - $ref: '#/components/schemas/update_connector_request_pagerduty' - - $ref: '#/components/schemas/update_connector_request_resilient' - - $ref: '#/components/schemas/update_connector_request_serverlog' - - $ref: '#/components/schemas/update_connector_request_servicenow' - - $ref: '#/components/schemas/update_connector_request_servicenow_itom' - - $ref: '#/components/schemas/update_connector_request_servicenow_sir' - - $ref: '#/components/schemas/update_connector_request_slack' - - $ref: '#/components/schemas/update_connector_request_slack_api' - - $ref: '#/components/schemas/update_connector_request_swimlane' - - $ref: '#/components/schemas/update_connector_request_teams' - - $ref: '#/components/schemas/update_connector_request_tines' - - $ref: '#/components/schemas/update_connector_request_webhook' - - $ref: '#/components/schemas/update_connector_request_xmatters' - examples: - updateIndexConnectorRequest: - $ref: '#/components/examples/update_index_connector_request' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - $ref: '#/components/schemas/connector_response_properties' - '400': - description: Indicates a bad request. - content: - application/json: - schema: - $ref: '#/components/schemas/bad_request_error' - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/authorization_error' - '404': - description: Object is not found. - content: - application/json: - schema: - $ref: '#/components/schemas/object_not_found_error' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 - /s/{spaceId}/api/actions/connectors: - get: - summary: Retrieves all connectors. - operationId: getConnectors - description: | - You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. - tags: - - connectors - parameters: - - $ref: '#/components/parameters/space_id' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - type: array - items: - title: Get connectors response body properties - description: The properties vary for each connector type. - type: object - required: - - connector_type_id - - id - - is_preconfigured - - name - - referenced_by_count - properties: - connector_type_id: - $ref: '#/components/schemas/connector_types' - config: - type: object - description: The configuration for the connector. Configuration properties vary depending on the connector type. - additionalProperties: true - nullable: true - id: - type: string - description: The identifier for the connector. - example: b0766e10-d190-11ec-b04c-776c77d14fca - is_deprecated: - $ref: '#/components/schemas/is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/is_preconfigured' - name: - type: string - description: The display name for the connector. - example: my-connector - referenced_by_count: - type: integer - description: Indicates the number of saved objects that reference the connector. If `is_preconfigured` is true, this value is not calculated. - example: 2 - default: 0 - examples: - getConnectorsResponse: - $ref: '#/components/examples/get_connectors_response' - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/authorization_error' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 - /s/{spaceId}/api/actions/connector_types: - get: - summary: Retrieves a list of all connector types. - operationId: getConnectorTypes - description: | - You do not need any Kibana feature privileges to run this API. - tags: - - connectors - parameters: - - $ref: '#/components/parameters/space_id' - - in: query - name: feature_id - description: A filter to limit the retrieved connector types to those that support a specific feature (such as alerting or cases). - schema: - $ref: '#/components/schemas/features' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - title: Get connector types response body properties - description: The properties vary for each connector type. - type: array - items: - type: object - properties: - enabled: - type: boolean - description: Indicates whether the connector type is enabled in Kibana. - example: true - enabled_in_config: - type: boolean - description: Indicates whether the connector type is enabled in the Kibana `.yml` file. - example: true - enabled_in_license: - type: boolean - description: Indicates whether the connector is enabled in the license. - example: true - id: - $ref: '#/components/schemas/connector_types' - minimum_license_required: - type: string - description: The license that is required to use the connector type. - example: basic - name: - type: string - description: The name of the connector type. - example: Index - supported_feature_ids: - type: array - description: The Kibana features that are supported by the connector type. - items: - $ref: '#/components/schemas/features' - example: - - alerting - - uptime - - siem - examples: - getConnectorTypesResponse: - $ref: '#/components/examples/get_connector_types_response' - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/authorization_error' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 - /s/{spaceId}/api/actions/connector/{connectorId}/_execute: - post: - summary: Runs a connector. - operationId: runConnector - description: | - You can use this API to test an action that involves interaction with Kibana services or integrations with third-party systems. You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. If you use an index connector, you must also have `all`, `create`, `index`, or `write` indices privileges. - tags: - - connectors - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/connector_id' - - $ref: '#/components/parameters/space_id' - requestBody: - required: true - content: - application/json: - schema: - title: Run connector request body properties - description: The properties vary depending on the connector type. - type: object - required: - - params - properties: - params: - oneOf: - - $ref: '#/components/schemas/run_connector_params_documents' - - $ref: '#/components/schemas/run_connector_params_level_message' - - title: Subaction parameters - description: Test an action that involves a subaction. - oneOf: - - $ref: '#/components/schemas/run_connector_subaction_addevent' - - $ref: '#/components/schemas/run_connector_subaction_closealert' - - $ref: '#/components/schemas/run_connector_subaction_createalert' - - $ref: '#/components/schemas/run_connector_subaction_fieldsbyissuetype' - - $ref: '#/components/schemas/run_connector_subaction_getchoices' - - $ref: '#/components/schemas/run_connector_subaction_getfields' - - $ref: '#/components/schemas/run_connector_subaction_getincident' - - $ref: '#/components/schemas/run_connector_subaction_issue' - - $ref: '#/components/schemas/run_connector_subaction_issues' - - $ref: '#/components/schemas/run_connector_subaction_issuetypes' - - $ref: '#/components/schemas/run_connector_subaction_pushtoservice' - discriminator: - propertyName: subAction - examples: - runIndexConnectorRequest: - $ref: '#/components/examples/run_index_connector_request' - runJiraConnectorRequest: - $ref: '#/components/examples/run_jira_connector_request' - runServerLogConnectorRequest: - $ref: '#/components/examples/run_server_log_connector_request' - runServiceNowITOMConnectorRequest: - $ref: '#/components/examples/run_servicenow_itom_connector_request' - runSwimlaneConnectorRequest: - $ref: '#/components/examples/run_swimlane_connector_request' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - $ref: '#/components/schemas/run_connector_general_response' - examples: - runIndexConnectorResponse: - $ref: '#/components/examples/run_index_connector_response' - runJiraConnectorResponse: - $ref: '#/components/examples/run_jira_connector_response' - runServerLogConnectorResponse: - $ref: '#/components/examples/run_server_log_connector_response' - runServiceNowITOMConnectorResponse: - $ref: '#/components/examples/run_servicenow_itom_connector_response' - runSwimlaneConnectorResponse: - $ref: '#/components/examples/run_swimlane_connector_response' - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/authorization_error' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 - /s/{spaceId}/api/actions/action/{actionId}: - delete: - summary: Deletes a connector. - operationId: legacyDeleteConnector - deprecated: true - description: | - Deprecated in 7.13.0. Use the delete connector API instead. WARNING: When you delete a connector, it cannot be recovered. - tags: - - connectors - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/action_id' - - $ref: '#/components/parameters/space_id' - responses: - '204': - description: Indicates a successful call. - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/authorization_error' - servers: - - url: https://localhost:5601 - get: - summary: Retrieves a connector by ID. - operationId: legacyGetConnector - description: Deprecated in 7.13.0. Use the get connector API instead. - deprecated: true - tags: - - connectors - parameters: - - $ref: '#/components/parameters/action_id' - - $ref: '#/components/parameters/space_id' - responses: - '200': - $ref: '#/components/responses/200_actions' - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/authorization_error' - servers: - - url: https://localhost:5601 - put: - summary: Updates the attributes for a connector. - operationId: legacyUpdateConnector - deprecated: true - description: Deprecated in 7.13.0. Use the update connector API instead. - tags: - - connectors - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/action_id' - - $ref: '#/components/parameters/space_id' - requestBody: - required: true - content: - application/json: - schema: - title: Legacy update connector request body properties - description: The properties vary depending on the connector type. - type: object - properties: - config: - type: object - description: The new connector configuration. Configuration properties vary depending on the connector type. - name: - type: string - description: The new name for the connector. - secrets: - type: object - description: The updated secrets configuration for the connector. Secrets properties vary depending on the connector type. - responses: - '200': - $ref: '#/components/responses/200_actions' - '404': - description: Object is not found. - content: - application/json: - schema: - $ref: '#/components/schemas/object_not_found_error' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 - /s/{spaceId}/api/actions: - get: - summary: Retrieves all connectors. - operationId: legacyGetConnectors - deprecated: true - description: Deprecated in 7.13.0. Use the get all connectors API instead. - tags: - - connectors - parameters: - - $ref: '#/components/parameters/space_id' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/action_response_properties' - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/authorization_error' - servers: - - url: https://localhost:5601 - post: - summary: Creates a connector. - operationId: legacyCreateConnector - deprecated: true - description: Deprecated in 7.13.0. Use the create connector API instead. - tags: - - connectors - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/space_id' - requestBody: - required: true - content: - application/json: - schema: - title: Legacy create connector request properties - type: object - properties: - actionTypeId: - type: string - description: The connector type identifier. - config: - type: object - description: The configuration for the connector. Configuration properties vary depending on the connector type. - name: - type: string - description: The display name for the connector. - secrets: - type: object - description: | - The secrets configuration for the connector. Secrets configuration properties vary depending on the connector type. NOTE: Remember these values. You must provide them each time you update the connector. - responses: - '200': - $ref: '#/components/responses/200_actions' - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/authorization_error' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 - /s/{spaceId}/api/actions/list_action_types: - get: - summary: Retrieves a list of all connector types. - operationId: legacyGetConnectorTypes - deprecated: true - description: Deprecated in 7.13.0. Use the get all connector types API instead. - tags: - - connectors - parameters: - - $ref: '#/components/parameters/space_id' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - title: Legacy get connector types response body properties - description: The properties vary for each connector type. - type: array - items: - type: object - properties: - enabled: - type: boolean - description: Indicates whether the connector type is enabled in Kibana. - enabledInConfig: - type: boolean - description: Indicates whether the connector type is enabled in the Kibana `.yml` file. - enabledInLicense: - type: boolean - description: Indicates whether the connector is enabled in the license. - example: true - id: - type: string - description: The unique identifier for the connector type. - minimumLicenseRequired: - type: string - description: The license that is required to use the connector type. - name: - type: string - description: The name of the connector type. - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/authorization_error' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 - /s/{spaceId}/api/actions/action/{actionId}/_execute: - post: - summary: Runs a connector. - operationId: legacyRunConnector - deprecated: true - description: Deprecated in 7.13.0. Use the run connector API instead. - tags: - - connectors - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/action_id' - - $ref: '#/components/parameters/space_id' - requestBody: - required: true - content: - application/json: - schema: - title: Legacy run connector request body properties - description: The properties vary depending on the connector type. - type: object - required: - - params - properties: - params: - type: object - description: The parameters of the connector. Parameter properties vary depending on the connector type. - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - $ref: '#/components/schemas/legacy_run_connector_general_response' - '401': - description: Authorization information is missing or invalid. - content: - application/json: - schema: - $ref: '#/components/schemas/authorization_error' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 -components: - securitySchemes: - basicAuth: - type: http - scheme: basic - apiKeyAuth: - type: apiKey - in: header - name: ApiKey - parameters: - kbn_xsrf: - schema: - type: string - in: header - name: kbn-xsrf - description: Cross-site request forgery protection - required: true - space_id: - in: path - name: spaceId - description: An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - required: true - schema: - type: string - example: default - connector_id: - in: path - name: connectorId - description: An identifier for the connector. - required: true - schema: - type: string - example: df770e30-8b8b-11ed-a780-3b746c987a81 - action_id: - in: path - name: actionId - description: An identifier for the action. - required: true - schema: - type: string - example: c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad - schemas: - config_properties_cases_webhook: - title: Connector request properties for Webhook - Case Management connector - required: - - createIncidentJson - - createIncidentResponseKey - - createIncidentUrl - - getIncidentResponseExternalTitleKey - - getIncidentUrl - - updateIncidentJson - - updateIncidentUrl - - viewIncidentUrl - description: Defines properties for connectors when type is `.cases-webhook`. - type: object - properties: - createCommentJson: - type: string - description: | - A JSON payload sent to the create comment URL to create a case comment. You can use variables to add Kibana Cases data to the payload. The required variable is `case.comment`. Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated once the Mustache variables have been placed when the REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass. - example: - body: - '[object Object]': null - createCommentMethod: - type: string - description: | - The REST API HTTP request method to create a case comment in the third-party system. Valid values are `patch`, `post`, and `put`. - default: put - enum: - - patch - - post - - put - createCommentUrl: - type: string - description: | - The REST API URL to create a case comment by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts setting`, add the hostname to the allowed hosts. - example: https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}/comment - createIncidentJson: - type: string - description: | - A JSON payload sent to the create case URL to create a case. You can use variables to add case data to the payload. Required variables are `case.title` and `case.description`. Due to Mustache template variables (which is the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid to avoid future validation errors; disregard Mustache variables during your review. - example: - fields: - summary: - '[object Object]': null - description: - '[object Object]': null - labels: - '[object Object]': null - createIncidentMethod: - type: string - description: | - The REST API HTTP request method to create a case in the third-party system. Valid values are `patch`, `post`, and `put`. - enum: - - patch - - post - - put - default: post - createIncidentResponseKey: - type: string - description: The JSON key in the create case response that contains the external case ID. - createIncidentUrl: - type: string - description: | - The REST API URL to create a case in the third-party system. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. - getIncidentResponseExternalTitleKey: - type: string - description: The JSON key in get case response that contains the external case title. - getIncidentUrl: - type: string - description: | - The REST API URL to get the case by ID from the third-party system. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. You can use a variable to add the external system ID to the URL. Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass. - example: https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}} - hasAuth: - type: boolean - description: If true, a username and password for login type authentication must be provided. - default: true - headers: - type: string - description: | - A set of key-value pairs sent as headers with the request URLs for the create case, update case, get case, and create comment methods. - updateIncidentJson: - type: string - description: | - The JSON payload sent to the update case URL to update the case. You can use variables to add Kibana Cases data to the payload. Required variables are `case.title` and `case.description`. Due to Mustache template variables (which is the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid to avoid future validation errors; disregard Mustache variables during your review. - example: - fields: - summary: - '[object Object]': null - description: - '[object Object]': null - labels: - '[object Object]': null - updateIncidentMethod: - type: string - description: | - The REST API HTTP request method to update the case in the third-party system. Valid values are `patch`, `post`, and `put`. - default: put - enum: - - patch - - post - - put - updateIncidentUrl: - type: string - description: | - The REST API URL to update the case by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. - example: https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.ID}}} - viewIncidentUrl: - type: string - description: | - The URL to view the case in the external system. You can use variables to add the external system ID or external system title to the URL. - example: https://testing-jira.atlassian.net/browse/{{{external.system.title}}} - secrets_properties_cases_webhook: - title: Connector secrets properties for Webhook - Case Management connector - type: object - properties: - password: - type: string - description: The password for HTTP basic authentication. If `hasAuth` is set to `true`, this property is required. - user: - type: string - description: The username for HTTP basic authentication. If `hasAuth` is set to `true`, this property is required. - create_connector_request_cases_webhook: - title: Create Webhook - Case Managment connector request - description: | - The Webhook - Case Management connector uses axios to send POST, PUT, and GET requests to a case management RESTful API web service. - type: object - required: - - config - - connector_type_id - - name - properties: - config: - $ref: '#/components/schemas/config_properties_cases_webhook' - connector_type_id: - type: string - description: The type of connector. - enum: - - .cases-webhook - example: .cases-webhook - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_cases_webhook' - config_properties_email: - title: Connector request properties for an email connector - description: Defines properties for connectors when type is `.email`. - type: object - properties: - from: - type: string - host: - type: string - port: - type: integer - clientId: - type: string - nullable: true - default: null - hasAuth: - type: boolean - default: true - oauthTokenUrl: - type: string - nullable: true - default: null - secure: - type: boolean - nullable: true - default: null - service: - type: string - default: other - tenantId: - type: string - nullable: true - default: null - secrets_properties_email: - title: Connector secrets properties for an email connector - description: Defines secrets for connectors when type is `.email`. - type: object - additionalProperties: true - create_connector_request_email: - title: Create email connector request - description: | - The email connector uses the SMTP protocol to send mail messages, using an integration of Nodemailer. An exception is Microsoft Exchange, which uses HTTP protocol for sending emails, Send mail. Email message text is sent as both plain text and html text. - type: object - required: - - config - - connector_type_id - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_email' - connector_type_id: - type: string - description: The type of connector. - enum: - - .email - example: .email - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_email' - config_properties_gemini: - title: Connector request properties for an Google Gemini connector - description: Defines properties for connectors when type is `.gemini`. - required: - - apiUrl - - gcpRegion - - gcpProjectID - type: object - properties: - apiUrl: - type: string - description: The Google Gemini request URL. - defaultModel: - type: string - description: The generative artificial intelligence model for Google Gemini to use. - default: gemini-1.5-pro-001 - gcpRegion: - type: string - description: The GCP region where the Vertex AI endpoint enabled. - gcpProjectID: - type: string - description: The Google ProjectID that has Vertex AI endpoint enabled. - secrets_properties_gemini: - title: Connector secrets properties for a Google Gemini connector - description: Defines secrets for connectors when type is `.gemini`. - type: object - required: - - credentialsJson - properties: - credentialsJson: - type: string - description: The service account credentials JSON file. The service account should have Vertex AI user IAM role assigned to it. - create_connector_request_gemini: - title: Create Google Gemini connector request - description: | - The Google Gemini connector uses axios to send a POST request to Google Gemini. - type: object - required: - - config - - connector_type_id - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_gemini' - connector_type_id: - type: string - description: The type of connector. - enum: - - .gemini - example: .gemini - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_gemini' - config_properties_index: - title: Connector request properties for an index connector - required: - - index - description: Defines properties for connectors when type is `.index`. - type: object - properties: - executionTimeField: - description: Specifies a field that will contain the time the alert condition was detected. - default: null - type: string - nullable: true - index: - description: The Elasticsearch index to be written to. - type: string - refresh: - description: | - The refresh policy for the write request, which affects when changes are made visible to search. Refer to the refresh setting for Elasticsearch document APIs. - default: false - type: boolean - create_connector_request_index: - title: Create index connector request - description: The index connector indexes a document into Elasticsearch. - type: object - required: - - config - - connector_type_id - - name - properties: - config: - $ref: '#/components/schemas/config_properties_index' - connector_type_id: - type: string - description: The type of connector. - enum: - - .index - example: .index - name: - type: string - description: The display name for the connector. - example: my-connector - config_properties_jira: - title: Connector request properties for a Jira connector - required: - - apiUrl - - projectKey - description: Defines properties for connectors when type is `.jira`. - type: object - properties: - apiUrl: - description: The Jira instance URL. - type: string - projectKey: - description: The Jira project key. - type: string - secrets_properties_jira: - title: Connector secrets properties for a Jira connector - required: - - apiToken - - email - description: Defines secrets for connectors when type is `.jira`. - type: object - properties: - apiToken: - description: The Jira API authentication token for HTTP basic authentication. - type: string - email: - description: The account email for HTTP Basic authentication. - type: string - create_connector_request_jira: - title: Create Jira connector request - description: The Jira connector uses the REST API v2 to create Jira issues. - type: object - required: - - config - - connector_type_id - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_jira' - connector_type_id: - type: string - description: The type of connector. - enum: - - .jira - example: .jira - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_jira' - config_properties_opsgenie: - title: Connector request properties for an Opsgenie connector - required: - - apiUrl - description: Defines properties for connectors when type is `.opsgenie`. - type: object - properties: - apiUrl: - description: | - The Opsgenie URL. For example, `https://api.opsgenie.com` or `https://api.eu.opsgenie.com`. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. - type: string - secrets_properties_opsgenie: - title: Connector secrets properties for an Opsgenie connector - required: - - apiKey - description: Defines secrets for connectors when type is `.opsgenie`. - type: object - properties: - apiKey: - description: The Opsgenie API authentication key for HTTP Basic authentication. - type: string - create_connector_request_opsgenie: - title: Create Opsgenie connector request - description: The Opsgenie connector uses the Opsgenie alert API. - type: object - required: - - config - - connector_type_id - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_opsgenie' - connector_type_id: - type: string - description: The type of connector. - enum: - - .opsgenie - example: .opsgenie - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_opsgenie' - config_properties_pagerduty: - title: Connector request properties for a PagerDuty connector - description: Defines properties for connectors when type is `.pagerduty`. - type: object - properties: - apiUrl: - type: string - nullable: true - secrets_properties_pagerduty: - title: Connector secrets properties for a PagerDuty connector - description: Defines secrets for connectors when type is `.pagerduty`. - type: object - additionalProperties: true - create_connector_request_pagerduty: - title: Create PagerDuty connector request - description: | - The PagerDuty connector uses the v2 Events API to trigger, acknowledge, and resolve PagerDuty alerts. - type: object - required: - - config - - connector_type_id - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_pagerduty' - connector_type_id: - type: string - description: The type of connector. - enum: - - .pagerduty - example: .pagerduty - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_pagerduty' - config_properties_resilient: - title: Connector request properties for a IBM Resilient connector - required: - - apiUrl - - orgId - description: Defines properties for connectors when type is `.resilient`. - type: object - properties: - apiUrl: - description: The IBM Resilient instance URL. - type: string - orgId: - description: The IBM Resilient organization ID. - type: string - secrets_properties_resilient: - title: Connector secrets properties for IBM Resilient connector - required: - - apiKeyId - - apiKeySecret - description: Defines secrets for connectors when type is `.resilient`. - type: object - properties: - apiKeyId: - type: string - description: The authentication key ID for HTTP Basic authentication. - apiKeySecret: - type: string - description: The authentication key secret for HTTP Basic authentication. - create_connector_request_resilient: - title: Create IBM Resilient connector request - description: The IBM Resilient connector uses the RESILIENT REST v2 to create IBM Resilient incidents. - type: object - required: - - config - - connector_type_id - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_resilient' - connector_type_id: - description: The type of connector. - type: string - example: .resilient - enum: - - .resilient - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_resilient' - create_connector_request_serverlog: - title: Create server log connector request - description: This connector writes an entry to the Kibana server log. - type: object - required: - - connector_type_id - - name - properties: - connector_type_id: - type: string - description: The type of connector. - enum: - - .server-log - example: .server-log - name: - type: string - description: The display name for the connector. - example: my-connector - config_properties_servicenow: - title: Connector request properties for a ServiceNow ITSM connector - required: - - apiUrl - description: Defines properties for connectors when type is `.servicenow`. - type: object - properties: - apiUrl: - type: string - description: The ServiceNow instance URL. - clientId: - description: | - The client ID assigned to your OAuth application. This property is required when `isOAuth` is `true`. - type: string - isOAuth: - description: | - The type of authentication to use. The default value is false, which means basic authentication is used instead of open authorization (OAuth). - default: false - type: boolean - jwtKeyId: - description: | - The key identifier assigned to the JWT verifier map of your OAuth application. This property is required when `isOAuth` is `true`. - type: string - userIdentifierValue: - description: | - The identifier to use for OAuth authentication. This identifier should be the user field you selected when you created an OAuth JWT API endpoint for external clients in your ServiceNow instance. For example, if the selected user field is `Email`, the user identifier should be the user's email address. This property is required when `isOAuth` is `true`. - type: string - usesTableApi: - description: | - Determines whether the connector uses the Table API or the Import Set API. This property is supported only for ServiceNow ITSM and ServiceNow SecOps connectors. NOTE: If this property is set to `false`, the Elastic application should be installed in ServiceNow. - default: true - type: boolean - secrets_properties_servicenow: - title: Connector secrets properties for ServiceNow ITOM, ServiceNow ITSM, and ServiceNow SecOps connectors - description: Defines secrets for connectors when type is `.servicenow`, `.servicenow-sir`, or `.servicenow-itom`. - type: object - properties: - clientSecret: - type: string - description: The client secret assigned to your OAuth application. This property is required when `isOAuth` is `true`. - password: - type: string - description: The password for HTTP basic authentication. This property is required when `isOAuth` is `false`. - privateKey: - type: string - description: The RSA private key that you created for use in ServiceNow. This property is required when `isOAuth` is `true`. - privateKeyPassword: - type: string - description: The password for the RSA private key. This property is required when `isOAuth` is `true` and you set a password on your private key. - username: - type: string - description: The username for HTTP basic authentication. This property is required when `isOAuth` is `false`. - create_connector_request_servicenow: - title: Create ServiceNow ITSM connector request - description: | - The ServiceNow ITSM connector uses the import set API to create ServiceNow incidents. You can use the connector for rule actions and cases. - type: object - required: - - config - - connector_type_id - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_servicenow' - connector_type_id: - type: string - description: The type of connector. - enum: - - .servicenow - example: .servicenow - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_servicenow' - config_properties_servicenow_itom: - title: Connector request properties for a ServiceNow ITSM connector - required: - - apiUrl - description: Defines properties for connectors when type is `.servicenow`. - type: object - properties: - apiUrl: - type: string - description: The ServiceNow instance URL. - clientId: - description: | - The client ID assigned to your OAuth application. This property is required when `isOAuth` is `true`. - type: string - isOAuth: - description: | - The type of authentication to use. The default value is false, which means basic authentication is used instead of open authorization (OAuth). - default: false - type: boolean - jwtKeyId: - description: | - The key identifier assigned to the JWT verifier map of your OAuth application. This property is required when `isOAuth` is `true`. - type: string - userIdentifierValue: - description: | - The identifier to use for OAuth authentication. This identifier should be the user field you selected when you created an OAuth JWT API endpoint for external clients in your ServiceNow instance. For example, if the selected user field is `Email`, the user identifier should be the user's email address. This property is required when `isOAuth` is `true`. - type: string - create_connector_request_servicenow_itom: - title: Create ServiceNow ITOM connector request - description: | - The ServiceNow ITOM connector uses the event API to create ServiceNow events. You can use the connector for rule actions. - type: object - required: - - config - - connector_type_id - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_servicenow_itom' - connector_type_id: - type: string - description: The type of connector. - enum: - - .servicenow-itom - example: .servicenow-itom - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_servicenow' - create_connector_request_servicenow_sir: - title: Create ServiceNow SecOps connector request - description: | - The ServiceNow SecOps connector uses the import set API to create ServiceNow security incidents. You can use the connector for rule actions and cases. - type: object - required: - - config - - connector_type_id - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_servicenow' - connector_type_id: - type: string - description: The type of connector. - enum: - - .servicenow-sir - example: .servicenow-sir - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_servicenow' - secrets_properties_slack: - title: Connector secrets properties for a Slack connector - description: Defines secrets for connectors when type is `.slack`. - type: object - additionalProperties: true - create_connector_request_slack: - title: Create Slack connector request - description: The Slack connector uses Slack Incoming Webhooks. - type: object - required: - - connector_type_id - - name - - secrets - properties: - connector_type_id: - type: string - description: The type of connector. - enum: - - .slack - example: .slack - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_slack' - secrets_properties_slack_api: - title: Connector secrets properties for a Web API Slack connector - description: Defines secrets for connectors when type is `.slack`. - required: - - token - type: object - properties: - token: - type: string - description: Slack bot user OAuth token. - create_connector_request_slack_api: - title: Create Slack connector request - description: The Slack connector uses Slack Incoming Webhooks. - type: object - required: - - connector_type_id - - name - - secrets - properties: - connector_type_id: - type: string - description: The type of connector. - enum: - - .slack_api - example: .slack_api - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_slack_api' - config_properties_swimlane: - title: Connector request properties for a Swimlane connector - required: - - apiUrl - - appId - - connectorType - description: Defines properties for connectors when type is `.swimlane`. - type: object - properties: - apiUrl: - description: The Swimlane instance URL. - type: string - appId: - description: The Swimlane application ID. - type: string - connectorType: - description: The type of connector. Valid values are `all`, `alerts`, and `cases`. - type: string - enum: - - all - - alerts - - cases - mappings: - $ref: '#/components/schemas/config_properties_swimlane_mappings' - config_properties_swimlane_mappings: - title: Connector mappings properties for a Swimlane connector - description: The field mapping. - type: object - properties: - alertIdConfig: - title: Alert identifier mapping - description: Mapping for the alert ID. - type: object - required: - - fieldType - - id - - key - - name - properties: - fieldType: - type: string - description: The type of field in Swimlane. - id: - type: string - description: The identifier for the field in Swimlane. - key: - type: string - description: The key for the field in Swimlane. - name: - type: string - description: The name of the field in Swimlane. - caseIdConfig: - title: Case identifier mapping - description: Mapping for the case ID. - type: object - required: - - fieldType - - id - - key - - name - properties: - fieldType: - type: string - description: The type of field in Swimlane. - id: - type: string - description: The identifier for the field in Swimlane. - key: - type: string - description: The key for the field in Swimlane. - name: - type: string - description: The name of the field in Swimlane. - caseNameConfig: - title: Case name mapping - description: Mapping for the case name. - type: object - required: - - fieldType - - id - - key - - name - properties: - fieldType: - type: string - description: The type of field in Swimlane. - id: - type: string - description: The identifier for the field in Swimlane. - key: - type: string - description: The key for the field in Swimlane. - name: - type: string - description: The name of the field in Swimlane. - commentsConfig: - title: Case comment mapping - description: Mapping for the case comments. - type: object - required: - - fieldType - - id - - key - - name - properties: - fieldType: - type: string - description: The type of field in Swimlane. - id: - type: string - description: The identifier for the field in Swimlane. - key: - type: string - description: The key for the field in Swimlane. - name: - type: string - description: The name of the field in Swimlane. - descriptionConfig: - title: Case description mapping - description: Mapping for the case description. - type: object - required: - - fieldType - - id - - key - - name - properties: - fieldType: - type: string - description: The type of field in Swimlane. - id: - type: string - description: The identifier for the field in Swimlane. - key: - type: string - description: The key for the field in Swimlane. - name: - type: string - description: The name of the field in Swimlane. - ruleNameConfig: - title: Rule name mapping - description: Mapping for the name of the alert's rule. - type: object - required: - - fieldType - - id - - key - - name - properties: - fieldType: - type: string - description: The type of field in Swimlane. - id: - type: string - description: The identifier for the field in Swimlane. - key: - type: string - description: The key for the field in Swimlane. - name: - type: string - description: The name of the field in Swimlane. - severityConfig: - title: Severity mapping - description: Mapping for the severity. - type: object - required: - - fieldType - - id - - key - - name - properties: - fieldType: - type: string - description: The type of field in Swimlane. - id: - type: string - description: The identifier for the field in Swimlane. - key: - type: string - description: The key for the field in Swimlane. - name: - type: string - description: The name of the field in Swimlane. - secrets_properties_swimlane: - title: Connector secrets properties for a Swimlane connector - description: Defines secrets for connectors when type is `.swimlane`. - type: object - properties: - apiToken: - description: Swimlane API authentication token. - type: string - create_connector_request_swimlane: - title: Create Swimlane connector request - description: The Swimlane connector uses the Swimlane REST API to create Swimlane records. - type: object - required: - - config - - connector_type_id - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_swimlane' - connector_type_id: - type: string - description: The type of connector. - enum: - - .swimlane - example: .swimlane - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_swimlane' - secrets_properties_teams: - title: Connector secrets properties for a Microsoft Teams connector - description: Defines secrets for connectors when type is `.teams`. - type: object - additionalProperties: true - create_connector_request_teams: - title: Create Microsoft Teams connector request - description: The Microsoft Teams connector uses Incoming Webhooks. - type: object - required: - - connector_type_id - - name - - secrets - properties: - connector_type_id: - type: string - description: The type of connector. - enum: - - .teams - example: .teams - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_teams' - config_properties_tines: - title: Connector request properties for a Tines connector - description: Defines properties for connectors when type is `.tines`. - type: object - required: - - url - properties: - url: - type: string - secrets_properties_tines: - title: Connector secrets properties for a Tines connector - description: Defines secrets for connectors when type is `.tines`. - type: object - additionalProperties: true - create_connector_request_tines: - title: Create Tines connector request - description: | - The Tines connector uses Tines Webhook actions to send events via POST request. - type: object - required: - - config - - connector_type_id - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_tines' - connector_type_id: - type: string - description: The type of connector. - enum: - - .tines - example: .tines - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_tines' - config_properties_webhook: - title: Connector request properties for a Webhook connector - description: Defines properties for connectors when type is `.webhook`. - type: object - required: - - url - properties: - url: - type: string - method: - type: string - default: post - enum: - - patch - - post - - put - headers: - type: object - additionalProperties: true - hasAuth: - type: boolean - default: true - secrets_properties_webhook: - title: Connector secrets properties for a Webhook connector - description: Defines secrets for connectors when type is `.webhook`. - type: object - additionalProperties: true - create_connector_request_webhook: - title: Create Webhook connector request - description: | - The Webhook connector uses axios to send a POST or PUT request to a web service. - type: object - required: - - config - - connector_type_id - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_webhook' - connector_type_id: - type: string - description: The type of connector. - enum: - - .webhook - example: .webhook - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_webhook' - config_properties_xmatters: - title: Connector request properties for a xMatters connector - description: Defines properties for connectors when type is `.xmatters`. - type: object - properties: - configUrl: - type: string - nullable: true - usesBasic: - type: boolean - default: true - secrets_properties_xmatters: - title: Connector secrets properties for an xMatters connector - description: Defines secrets for connectors when type is `.xmatters`. - type: object - additionalProperties: true - create_connector_request_xmatters: - title: Create xMatters connector request - description: | - The xMatters connector uses the xMatters Workflow for Elastic to send actionable alerts to on-call xMatters resources. - type: object - required: - - config - - connector_type_id - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_xmatters' - connector_type_id: - type: string - description: The type of connector. - enum: - - .xmatters - example: .xmatters - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_xmatters' - is_deprecated: - type: boolean - description: Indicates whether the connector type is deprecated. - example: false - is_missing_secrets: - type: boolean - description: Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - example: false - is_preconfigured: - type: boolean - description: Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - example: false - connector_response_properties_cases_webhook: - title: Connector request properties for a Webhook - Case Management connector - type: object - required: - - config - - connector_type_id - - id - - is_preconfigured - - name - properties: - config: - $ref: '#/components/schemas/config_properties_cases_webhook' - connector_type_id: - description: The type of connector. - type: string - enum: - - .cases-webhook - id: - type: string - description: The identifier for the connector. - is_deprecated: - $ref: '#/components/schemas/is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/is_preconfigured' - name: - type: string - description: The display name for the connector. - connector_response_properties_email: - title: Connector response properties for an email connector - type: object - required: - - config - - connector_type_id - - id - - is_preconfigured - - name - properties: - config: - $ref: '#/components/schemas/config_properties_email' - connector_type_id: - type: string - description: The type of connector. - enum: - - .email - id: - type: string - description: The identifier for the connector. - is_deprecated: - $ref: '#/components/schemas/is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/is_preconfigured' - name: - type: string - description: The display name for the connector. - connector_response_properties_gemini: - title: Connector response properties for a Google Gemini connector - type: object - required: - - config - - connector_type_id - - id - - is_preconfigured - - name - properties: - config: - $ref: '#/components/schemas/config_properties_gemini' - connector_type_id: - type: string - description: The type of connector. - enum: - - .gemini - id: - type: string - description: The identifier for the connector. - is_deprecated: - $ref: '#/components/schemas/is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/is_preconfigured' - name: - type: string - description: The display name for the connector. - connector_response_properties_index: - title: Connector response properties for an index connector - type: object - required: - - config - - connector_type_id - - id - - is_preconfigured - - name - properties: - config: - $ref: '#/components/schemas/config_properties_index' - connector_type_id: - type: string - description: The type of connector. - enum: - - .index - id: - type: string - description: The identifier for the connector. - is_deprecated: - $ref: '#/components/schemas/is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/is_preconfigured' - name: - type: string - description: The display name for the connector. - connector_response_properties_jira: - title: Connector response properties for a Jira connector - type: object - required: - - config - - connector_type_id - - id - - is_preconfigured - - name - properties: - config: - $ref: '#/components/schemas/config_properties_jira' - connector_type_id: - type: string - description: The type of connector. - enum: - - .jira - id: - type: string - description: The identifier for the connector. - is_deprecated: - $ref: '#/components/schemas/is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/is_preconfigured' - name: - type: string - description: The display name for the connector. - connector_response_properties_opsgenie: - title: Connector response properties for an Opsgenie connector - type: object - required: - - config - - connector_type_id - - id - - is_preconfigured - - name - properties: - config: - $ref: '#/components/schemas/config_properties_opsgenie' - connector_type_id: - type: string - description: The type of connector. - enum: - - .opsgenie - id: - type: string - description: The identifier for the connector. - is_deprecated: - $ref: '#/components/schemas/is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/is_preconfigured' - name: - type: string - description: The display name for the connector. - connector_response_properties_pagerduty: - title: Connector response properties for a PagerDuty connector - type: object - required: - - config - - connector_type_id - - id - - is_preconfigured - - name - properties: - config: - $ref: '#/components/schemas/config_properties_pagerduty' - connector_type_id: - type: string - description: The type of connector. - enum: - - .pagerduty - id: - type: string - description: The identifier for the connector. - is_deprecated: - $ref: '#/components/schemas/is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/is_preconfigured' - name: - type: string - description: The display name for the connector. - connector_response_properties_resilient: - title: Connector response properties for a IBM Resilient connector - type: object - required: - - config - - connector_type_id - - id - - is_preconfigured - - name - properties: - config: - $ref: '#/components/schemas/config_properties_resilient' - connector_type_id: - type: string - description: The type of connector. - enum: - - .resilient - id: - type: string - description: The identifier for the connector. - is_deprecated: - $ref: '#/components/schemas/is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/is_preconfigured' - name: - type: string - description: The display name for the connector. - connector_response_properties_serverlog: - title: Connector response properties for a server log connector - type: object - required: - - config - - connector_type_id - - id - - is_preconfigured - - name - properties: - config: - type: object - nullable: true - connector_type_id: - type: string - description: The type of connector. - enum: - - .server-log - id: - type: string - description: The identifier for the connector. - is_deprecated: - $ref: '#/components/schemas/is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/is_preconfigured' - name: - type: string - description: The display name for the connector. - connector_response_properties_servicenow: - title: Connector response properties for a ServiceNow ITSM connector - type: object - required: - - config - - connector_type_id - - id - - is_preconfigured - - name - properties: - config: - $ref: '#/components/schemas/config_properties_servicenow' - connector_type_id: - type: string - description: The type of connector. - enum: - - .servicenow - id: - type: string - description: The identifier for the connector. - is_deprecated: - $ref: '#/components/schemas/is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/is_preconfigured' - name: - type: string - description: The display name for the connector. - connector_response_properties_servicenow_itom: - title: Connector response properties for a ServiceNow ITOM connector - type: object - required: - - config - - connector_type_id - - id - - is_preconfigured - - name - properties: - config: - $ref: '#/components/schemas/config_properties_servicenow_itom' - connector_type_id: - type: string - description: The type of connector. - enum: - - .servicenow-itom - id: - type: string - description: The identifier for the connector. - is_deprecated: - $ref: '#/components/schemas/is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/is_preconfigured' - name: - type: string - description: The display name for the connector. - connector_response_properties_servicenow_sir: - title: Connector response properties for a ServiceNow SecOps connector - type: object - required: - - config - - connector_type_id - - id - - is_preconfigured - - name - properties: - config: - $ref: '#/components/schemas/config_properties_servicenow' - connector_type_id: - type: string - description: The type of connector. - enum: - - .servicenow-sir - id: - type: string - description: The identifier for the connector. - is_deprecated: - $ref: '#/components/schemas/is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/is_preconfigured' - name: - type: string - description: The display name for the connector. - connector_response_properties_slack: - title: Connector response properties for a Slack connector - type: object - required: - - connector_type_id - - id - - is_preconfigured - - name - properties: - connector_type_id: - type: string - description: The type of connector. - enum: - - .slack - id: - type: string - description: The identifier for the connector. - is_deprecated: - $ref: '#/components/schemas/is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/is_preconfigured' - name: - type: string - description: The display name for the connector. - connector_response_properties_slack_api: - title: Connector response properties for a Slack connector - type: object - required: - - connector_type_id - - id - - is_preconfigured - - name - properties: - connector_type_id: - type: string - description: The type of connector. - enum: - - .slack_api - id: - type: string - description: The identifier for the connector. - is_deprecated: - $ref: '#/components/schemas/is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/is_preconfigured' - name: - type: string - description: The display name for the connector. - connector_response_properties_swimlane: - title: Connector response properties for a Swimlane connector - type: object - required: - - config - - connector_type_id - - id - - is_preconfigured - - name - properties: - config: - $ref: '#/components/schemas/config_properties_swimlane' - connector_type_id: - type: string - description: The type of connector. - enum: - - .swimlane - id: - type: string - description: The identifier for the connector. - is_deprecated: - $ref: '#/components/schemas/is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/is_preconfigured' - name: - type: string - description: The display name for the connector. - connector_response_properties_teams: - title: Connector response properties for a Microsoft Teams connector - type: object - required: - - connector_type_id - - id - - is_preconfigured - - name - properties: - connector_type_id: - type: string - description: The type of connector. - enum: - - .teams - id: - type: string - description: The identifier for the connector. - is_deprecated: - $ref: '#/components/schemas/is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/is_preconfigured' - name: - type: string - description: The display name for the connector. - connector_response_properties_tines: - title: Connector response properties for a Tines connector - type: object - required: - - config - - connector_type_id - - id - - is_preconfigured - - name - properties: - config: - $ref: '#/components/schemas/config_properties_tines' - connector_type_id: - type: string - description: The type of connector. - enum: - - .tines - id: - type: string - description: The identifier for the connector. - is_deprecated: - $ref: '#/components/schemas/is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/is_preconfigured' - name: - type: string - description: The display name for the connector. - connector_response_properties_webhook: - title: Connector response properties for a Webhook connector - type: object - required: - - config - - connector_type_id - - id - - is_preconfigured - - name - properties: - config: - $ref: '#/components/schemas/config_properties_webhook' - connector_type_id: - type: string - description: The type of connector. - enum: - - .webhook - id: - type: string - description: The identifier for the connector. - is_deprecated: - $ref: '#/components/schemas/is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/is_preconfigured' - name: - type: string - description: The display name for the connector. - connector_response_properties_xmatters: - title: Connector response properties for an xMatters connector - type: object - required: - - config - - connector_type_id - - id - - is_preconfigured - - name - properties: - config: - $ref: '#/components/schemas/config_properties_xmatters' - connector_type_id: - type: string - description: The type of connector. - enum: - - .xmatters - id: - type: string - description: The identifier for the connector. - is_deprecated: - $ref: '#/components/schemas/is_deprecated' - is_missing_secrets: - $ref: '#/components/schemas/is_missing_secrets' - is_preconfigured: - $ref: '#/components/schemas/is_preconfigured' - name: - type: string - description: The display name for the connector. - connector_response_properties: - title: Connector response properties - description: The properties vary depending on the connector type. - oneOf: - - $ref: '#/components/schemas/connector_response_properties_cases_webhook' - - $ref: '#/components/schemas/connector_response_properties_email' - - $ref: '#/components/schemas/connector_response_properties_gemini' - - $ref: '#/components/schemas/connector_response_properties_index' - - $ref: '#/components/schemas/connector_response_properties_jira' - - $ref: '#/components/schemas/connector_response_properties_opsgenie' - - $ref: '#/components/schemas/connector_response_properties_pagerduty' - - $ref: '#/components/schemas/connector_response_properties_resilient' - - $ref: '#/components/schemas/connector_response_properties_serverlog' - - $ref: '#/components/schemas/connector_response_properties_servicenow' - - $ref: '#/components/schemas/connector_response_properties_servicenow_itom' - - $ref: '#/components/schemas/connector_response_properties_servicenow_sir' - - $ref: '#/components/schemas/connector_response_properties_slack' - - $ref: '#/components/schemas/connector_response_properties_slack_api' - - $ref: '#/components/schemas/connector_response_properties_swimlane' - - $ref: '#/components/schemas/connector_response_properties_teams' - - $ref: '#/components/schemas/connector_response_properties_tines' - - $ref: '#/components/schemas/connector_response_properties_webhook' - - $ref: '#/components/schemas/connector_response_properties_xmatters' - discriminator: - propertyName: connector_type_id - mapping: - .cases-webhook: '#/components/schemas/connector_response_properties_cases_webhook' - .email: '#/components/schemas/connector_response_properties_email' - .gemini: '#/components/schemas/connector_response_properties_gemini' - .index: '#/components/schemas/connector_response_properties_index' - .jira: '#/components/schemas/connector_response_properties_jira' - .opsgenie: '#/components/schemas/connector_response_properties_opsgenie' - .pagerduty: '#/components/schemas/connector_response_properties_pagerduty' - .resilient: '#/components/schemas/connector_response_properties_resilient' - .server-log: '#/components/schemas/connector_response_properties_serverlog' - .servicenow: '#/components/schemas/connector_response_properties_servicenow' - .servicenow-itom: '#/components/schemas/connector_response_properties_servicenow_itom' - .servicenow-sir: '#/components/schemas/connector_response_properties_servicenow_sir' - .slack: '#/components/schemas/connector_response_properties_slack' - .slack_api: '#/components/schemas/connector_response_properties_slack_api' - .swimlane: '#/components/schemas/connector_response_properties_swimlane' - .teams: '#/components/schemas/connector_response_properties_teams' - .tines: '#/components/schemas/connector_response_properties_tines' - .webhook: '#/components/schemas/connector_response_properties_webhook' - .xmatters: '#/components/schemas/connector_response_properties_xmatters' - update_connector_request_cases_webhook: - title: Update Webhook - Case Managment connector request - type: object - required: - - config - - name - properties: - config: - $ref: '#/components/schemas/config_properties_cases_webhook' - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_cases_webhook' - update_connector_request_email: - title: Update email connector request - type: object - required: - - config - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_email' - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_email' - update_connector_request_gemini: - title: Update Google Gemini connector request - type: object - required: - - config - - name - properties: - config: - $ref: '#/components/schemas/config_properties_gemini' - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_gemini' - update_connector_request_index: - title: Update index connector request - type: object - required: - - config - - name - properties: - config: - $ref: '#/components/schemas/config_properties_index' - name: - type: string - description: The display name for the connector. - update_connector_request_jira: - title: Update Jira connector request - type: object - required: - - config - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_jira' - name: - type: string - description: The display name for the connector. - secrets: - $ref: '#/components/schemas/secrets_properties_jira' - update_connector_request_opsgenie: - title: Update Opsgenie connector request - type: object - required: - - config - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_opsgenie' - name: - type: string - description: The display name for the connector. - secrets: - $ref: '#/components/schemas/secrets_properties_opsgenie' - update_connector_request_pagerduty: - title: Update PagerDuty connector request - description: | - The PagerDuty connector uses the v2 Events API to trigger, acknowledge, and resolve PagerDuty alerts. - type: object - required: - - config - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_pagerduty' - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_pagerduty' - update_connector_request_resilient: - title: Update IBM Resilient connector request - type: object - required: - - config - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_resilient' - name: - type: string - description: The display name for the connector. - secrets: - $ref: '#/components/schemas/secrets_properties_resilient' - update_connector_request_serverlog: - title: Update server log connector request - type: object - required: - - name - properties: - name: - type: string - description: The display name for the connector. - update_connector_request_servicenow: - title: Update ServiceNow ITSM connector or ServiceNow SecOps request - type: object - required: - - config - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_servicenow' - name: - type: string - description: The display name for the connector. - secrets: - $ref: '#/components/schemas/secrets_properties_servicenow' - update_connector_request_servicenow_itom: - title: Update ServiceNow ITOM connector request - type: object - required: - - config - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_servicenow_itom' - name: - type: string - description: The display name for the connector. - secrets: - $ref: '#/components/schemas/secrets_properties_servicenow' - update_connector_request_servicenow_sir: - title: Update ServiceNow SecOps connector request - description: | - The ServiceNow SecOps connector uses the import set API to create ServiceNow security incidents. You can use the connector for rule actions and cases. - type: object - required: - - config - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_servicenow' - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_servicenow' - update_connector_request_slack: - title: Update Slack connector request - description: The Slack connector uses Slack Incoming Webhooks. - type: object - required: - - name - - secrets - properties: - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_slack' - update_connector_request_slack_api: - title: Update Slack connector request - type: object - required: - - name - - secrets - properties: - name: - type: string - description: The display name for the connector. - secrets: - $ref: '#/components/schemas/secrets_properties_slack_api' - update_connector_request_swimlane: - title: Update Swimlane connector request - type: object - required: - - config - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_swimlane' - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_swimlane' - update_connector_request_teams: - title: Update Microsoft Teams connector request - description: The Microsoft Teams connector uses Incoming Webhooks. - type: object - required: - - name - - secrets - properties: - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_teams' - update_connector_request_tines: - title: Update Tines connector request - description: | - The Tines connector uses Tines Webhook actions to send events via POST request. - type: object - required: - - config - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_tines' - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_tines' - update_connector_request_webhook: - title: Update Webhook connector request - description: | - The Webhook connector uses axios to send a POST or PUT request to a web service. - type: object - required: - - config - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_webhook' - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_webhook' - update_connector_request_xmatters: - title: Update xMatters connector request - description: | - The xMatters connector uses the xMatters Workflow for Elastic to send actionable alerts to on-call xMatters resources. - type: object - required: - - config - - name - - secrets - properties: - config: - $ref: '#/components/schemas/config_properties_xmatters' - name: - type: string - description: The display name for the connector. - example: my-connector - secrets: - $ref: '#/components/schemas/secrets_properties_xmatters' - connector_types: - title: Connector types - type: string - description: The type of connector. For example, `.email`, `.index`, `.jira`, `.opsgenie`, or `.server-log`. - enum: - - .cases-webhook - - .email - - .gemini - - .index - - .jira - - .opsgenie - - .pagerduty - - .resilient - - .servicenow - - .servicenow-itom - - .servicenow-sir - - .server-log - - .slack - - .slack_api - - .swimlane - - .teams - - .tines - - .webhook - - .xmatters - example: .server-log - features: - type: string - description: | - The feature that uses the connector. Valid values are `alerting`, `cases`, `uptime`, and `siem`. - enum: - - alerting - - cases - - uptime - - siem - run_connector_params_documents: - title: Index connector parameters - description: Test an action that indexes a document into Elasticsearch. - type: object - required: - - documents - properties: - documents: - type: array - description: The documents in JSON format for index connectors. - items: - type: object - additionalProperties: true - run_connector_params_level_message: - title: Server log connector parameters - description: Test an action that writes an entry to the Kibana server log. - type: object - required: - - message - properties: - level: - type: string - description: The log level of the message for server log connectors. - enum: - - debug - - error - - fatal - - info - - trace - - warn - default: info - message: - type: string - description: The message for server log connectors. - run_connector_subaction_addevent: - title: The addEvent subaction - type: object - required: - - subAction - description: The `addEvent` subaction for ServiceNow ITOM connectors. - properties: - subAction: - type: string - description: The action to test. - enum: - - addEvent - subActionParams: - type: object - description: The set of configuration properties for the action. - properties: - additional_info: - type: string - description: Additional information about the event. - description: - type: string - description: The details about the event. - event_class: - type: string - description: A specific instance of the source. - message_key: - type: string - description: All actions sharing this key are associated with the same ServiceNow alert. The default value is `:`. - metric_name: - type: string - description: The name of the metric. - node: - type: string - description: The host that the event was triggered for. - resource: - type: string - description: The name of the resource. - severity: - type: string - description: The severity of the event. - source: - type: string - description: The name of the event source type. - time_of_event: - type: string - description: The time of the event. - type: - type: string - description: The type of event. - run_connector_subaction_closealert: - title: The closeAlert subaction - type: object - required: - - subAction - - subActionParams - description: The `closeAlert` subaction for Opsgenie connectors. - properties: - subAction: - type: string - description: The action to test. - enum: - - closeAlert - subActionParams: - type: object - required: - - alias - properties: - alias: - type: string - description: The unique identifier used for alert deduplication in Opsgenie. The alias must match the value used when creating the alert. - note: - type: string - description: Additional information for the alert. - source: - type: string - description: The display name for the source of the alert. - user: - type: string - description: The display name for the owner. - run_connector_subaction_createalert: - title: The createAlert subaction - type: object - required: - - subAction - - subActionParams - description: The `createAlert` subaction for Opsgenie connectors. - properties: - subAction: - type: string - description: The action to test. - enum: - - createAlert - subActionParams: - type: object - required: - - message - properties: - actions: - type: array - description: The custom actions available to the alert. - items: - type: string - alias: - type: string - description: The unique identifier used for alert deduplication in Opsgenie. - description: - type: string - description: A description that provides detailed information about the alert. - details: - type: object - description: The custom properties of the alert. - additionalProperties: true - example: - key1: value1 - key2: value2 - entity: - type: string - description: The domain of the alert. For example, the application or server name. - message: - type: string - description: The alert message. - note: - type: string - description: Additional information for the alert. - priority: - type: string - description: The priority level for the alert. - enum: - - P1 - - P2 - - P3 - - P4 - - P5 - responders: - type: array - description: | - The entities to receive notifications about the alert. If `type` is `user`, either `id` or `username` is required. If `type` is `team`, either `id` or `name` is required. - items: - type: object - properties: - id: - type: string - description: The identifier for the entity. - name: - type: string - description: The name of the entity. - type: - type: string - description: The type of responders, in this case `escalation`. - enum: - - escalation - - schedule - - team - - user - username: - type: string - description: A valid email address for the user. - source: - type: string - description: The display name for the source of the alert. - tags: - type: array - description: The tags for the alert. - items: - type: string - user: - type: string - description: The display name for the owner. - visibleTo: - type: array - description: The teams and users that the alert will be visible to without sending a notification. Only one of `id`, `name`, or `username` is required. - items: - type: object - required: - - type - properties: - id: - type: string - description: The identifier for the entity. - name: - type: string - description: The name of the entity. - type: - type: string - description: Valid values are `team` and `user`. - enum: - - team - - user - username: - type: string - description: The user name. This property is required only when the `type` is `user`. - run_connector_subaction_fieldsbyissuetype: - title: The fieldsByIssueType subaction - type: object - required: - - subAction - - subActionParams - description: The `fieldsByIssueType` subaction for Jira connectors. - properties: - subAction: - type: string - description: The action to test. - enum: - - fieldsByIssueType - subActionParams: - type: object - required: - - id - properties: - id: - type: string - description: The Jira issue type identifier. - example: 10024 - run_connector_subaction_getchoices: - title: The getChoices subaction - type: object - required: - - subAction - - subActionParams - description: The `getChoices` subaction for ServiceNow ITOM, ServiceNow ITSM, and ServiceNow SecOps connectors. - properties: - subAction: - type: string - description: The action to test. - enum: - - getChoices - subActionParams: - type: object - description: The set of configuration properties for the action. - required: - - fields - properties: - fields: - type: array - description: An array of fields. - items: - type: string - run_connector_subaction_getfields: - title: The getFields subaction - type: object - required: - - subAction - description: The `getFields` subaction for Jira, ServiceNow ITSM, and ServiceNow SecOps connectors. - properties: - subAction: - type: string - description: The action to test. - enum: - - getFields - run_connector_subaction_getincident: - title: The getIncident subaction - type: object - description: The `getIncident` subaction for Jira, ServiceNow ITSM, and ServiceNow SecOps connectors. - required: - - subAction - - subActionParams - properties: - subAction: - type: string - description: The action to test. - enum: - - getIncident - subActionParams: - type: object - required: - - externalId - properties: - externalId: - type: string - description: The Jira, ServiceNow ITSM, or ServiceNow SecOps issue identifier. - example: 71778 - run_connector_subaction_issue: - title: The issue subaction - type: object - required: - - subAction - description: The `issue` subaction for Jira connectors. - properties: - subAction: - type: string - description: The action to test. - enum: - - issue - subActionParams: - type: object - required: - - id - properties: - id: - type: string - description: The Jira issue identifier. - example: 71778 - run_connector_subaction_issues: - title: The issues subaction - type: object - required: - - subAction - - subActionParams - description: The `issues` subaction for Jira connectors. - properties: - subAction: - type: string - description: The action to test. - enum: - - issues - subActionParams: - type: object - required: - - title - properties: - title: - type: string - description: The title of the Jira issue. - run_connector_subaction_issuetypes: - title: The issueTypes subaction - type: object - required: - - subAction - description: The `issueTypes` subaction for Jira connectors. - properties: - subAction: - type: string - description: The action to test. - enum: - - issueTypes - run_connector_subaction_pushtoservice: - title: The pushToService subaction - type: object - required: - - subAction - - subActionParams - description: The `pushToService` subaction for Jira, ServiceNow ITSM, ServiceNow SecOps, and Swimlane connectors. - properties: - subAction: - type: string - description: The action to test. - enum: - - pushToService - subActionParams: - type: object - description: The set of configuration properties for the action. - properties: - comments: - type: array - description: Additional information that is sent to Jira, ServiceNow ITSM, ServiceNow SecOps, or Swimlane. - items: - type: object - properties: - comment: - type: string - description: A comment related to the incident. For example, describe how to troubleshoot the issue. - commentId: - type: integer - description: A unique identifier for the comment. - incident: - type: object - description: Information necessary to create or update a Jira, ServiceNow ITSM, ServiveNow SecOps, or Swimlane incident. - properties: - alertId: - type: string - description: The alert identifier for Swimlane connectors. - caseId: - type: string - description: The case identifier for the incident for Swimlane connectors. - caseName: - type: string - description: The case name for the incident for Swimlane connectors. - category: - type: string - description: The category of the incident for ServiceNow ITSM and ServiceNow SecOps connectors. - correlation_display: - type: string - description: A descriptive label of the alert for correlation purposes for ServiceNow ITSM and ServiceNow SecOps connectors. - correlation_id: - type: string - description: | - The correlation identifier for the security incident for ServiceNow ITSM and ServiveNow SecOps connectors. Connectors using the same correlation ID are associated with the same ServiceNow incident. This value determines whether a new ServiceNow incident is created or an existing one is updated. Modifying this value is optional; if not modified, the rule ID and alert ID are combined as `{{ruleID}}:{{alert ID}}` to form the correlation ID value in ServiceNow. The maximum character length for this value is 100 characters. NOTE: Using the default configuration of `{{ruleID}}:{{alert ID}}` ensures that ServiceNow creates a separate incident record for every generated alert that uses a unique alert ID. If the rule generates multiple alerts that use the same alert IDs, ServiceNow creates and continually updates a single incident record for the alert. - description: - type: string - description: The description of the incident for Jira, ServiceNow ITSM, ServiceNow SecOps, and Swimlane connectors. - dest_ip: - description: | - A list of destination IP addresses related to the security incident for ServiceNow SecOps connectors. The IPs are added as observables to the security incident. - oneOf: - - type: string - - type: array - items: - type: string - externalId: - type: string - description: | - The Jira, ServiceNow ITSM, or ServiceNow SecOps issue identifier. If present, the incident is updated. Otherwise, a new incident is created. - impact: - type: string - description: The impact of the incident for ServiceNow ITSM connectors. - issueType: - type: integer - description: The type of incident for Jira connectors. For example, 10006. To obtain the list of valid values, set `subAction` to `issueTypes`. - labels: - type: array - items: - type: string - description: | - The labels for the incident for Jira connectors. NOTE: Labels cannot contain spaces. - malware_hash: - description: A list of malware hashes related to the security incident for ServiceNow SecOps connectors. The hashes are added as observables to the security incident. - oneOf: - - type: string - - type: array - items: - type: string - malware_url: - type: string - description: A list of malware URLs related to the security incident for ServiceNow SecOps connectors. The URLs are added as observables to the security incident. - oneOf: - - type: string - - type: array - items: - type: string - parent: - type: string - description: The ID or key of the parent issue for Jira connectors. Applies only to `Sub-task` types of issues. - priority: - type: string - description: The priority of the incident in Jira and ServiceNow SecOps connectors. - ruleName: - type: string - description: The rule name for Swimlane connectors. - severity: - type: string - description: The severity of the incident for ServiceNow ITSM and Swimlane connectors. - short_description: - type: string - description: | - A short description of the incident for ServiceNow ITSM and ServiceNow SecOps connectors. It is used for searching the contents of the knowledge base. - source_ip: - description: A list of source IP addresses related to the security incident for ServiceNow SecOps connectors. The IPs are added as observables to the security incident. - oneOf: - - type: string - - type: array - items: - type: string - subcategory: - type: string - description: The subcategory of the incident for ServiceNow ITSM and ServiceNow SecOps connectors. - summary: - type: string - description: A summary of the incident for Jira connectors. - title: - type: string - description: | - A title for the incident for Jira connectors. It is used for searching the contents of the knowledge base. - urgency: - type: string - description: The urgency of the incident for ServiceNow ITSM connectors. - action_response_properties: - title: Action response properties - description: The properties vary depending on the action type. - type: object - properties: - actionTypeId: - type: string - config: - type: object - id: - type: string - isDeprecated: - type: boolean - description: Indicates whether the action type is deprecated. - isMissingSecrets: - type: boolean - description: Indicates whether secrets are missing for the action. - isPreconfigured: - type: boolean - description: Indicates whether it is a preconfigured action. - name: - type: string - run_connector_general_response: - title: Response from running a connector. - type: object - required: - - connector_id - - status - properties: - connector_id: - type: string - description: The identifier for the connector. - data: - oneOf: - - type: object - description: Information returned from the action. - additionalProperties: true - - type: array - description: An array of information returned from the action. - items: - type: object - status: - type: string - description: The status of the action. - enum: - - error - - ok - legacy_run_connector_general_response: - title: Response from legacy endpoint for running a connector. - type: object - properties: - actionId: - type: string - data: - oneOf: - - type: object - description: Information returned from the action. - additionalProperties: true - - type: array - description: An array of information returned from the action. - items: - type: object - status: - type: string - description: The status of the action. - bad_request_error: - title: Bad request - type: object - properties: - error: - type: string - example: Bad Request - enum: - - Bad Request - message: - type: string - example: 'error validating action type config: [index]: expected value of type [string] but got [undefined]' - statusCode: - type: integer - example: 400 - enum: - - 400 - authorization_error: - type: object - title: Unauthorized response - properties: - error: - type: string - example: Unauthorized - enum: - - Unauthorized - message: - type: string - statusCode: - type: integer - example: 401 - enum: - - 401 - object_not_found_error: - type: object - title: Not found response - properties: - error: - type: string - example: Not Found - enum: - - Not Found - message: - type: string - example: Saved object [action/baf33fc0-920c-11ed-b36a-874bd1548a00] not found - statusCode: - type: integer - example: 404 - enum: - - 404 - examples: - create_index_connector_request: - summary: Create an index connector. - value: - name: my-connector - connector_type_id: .index - config: - index: test-index - create_index_connector_response: - summary: A new index connector. - value: - id: c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad - connector_type_id: .index - name: my-connector - config: - index: test-index - refresh: false - executionTimeField: null - is_preconfigured: false - is_deprecated: false - is_missing_secrets: false - get_connector_response: - summary: A list of connector types - value: - id: df770e30-8b8b-11ed-a780-3b746c987a81 - name: my_server_log_connector - config: {} - connector_type_id: .server-log - is_preconfigured: false - is_deprecated: false - is_missing_secrets: false - update_index_connector_request: - summary: Update an index connector. - value: - name: updated-connector - config: - index: updated-index - get_connectors_response: - summary: A list of connectors - value: - - id: preconfigured-email-connector - name: my-preconfigured-email-notification - connector_type_id: .email - is_preconfigured: true - is_deprecated: false - referenced_by_count: 0 - - id: e07d0c80-8b8b-11ed-a780-3b746c987a81 - name: my-index-connector - config: - index: test-index - refresh: false - executionTimeField: null - connector_type_id: .index - is_preconfigured: false - is_deprecated: false - referenced_by_count: 2 - is_missing_secrets: false - get_connector_types_response: - summary: A list of connector types - value: - - id: .swimlane - name: Swimlane - enabled: true - enabled_in_config: true - enabled_in_license: true - minimum_license_required: gold - supported_feature_ids: - - alerting - - cases - - siem - - id: .index - name: Index - enabled: true - enabled_in_config: true - enabled_in_license: true - minimum_license_required: basic - supported_feature_ids: - - alerting - - uptime - - siem - - id: .server-log - name: Server log - enabled: true - enabled_in_config: true - enabled_in_license: true - minimum_license_required: basic - supported_feature_ids: - - alerting - - uptime - run_index_connector_request: - summary: Run an index connector. - value: - params: - documents: - - id: my_doc_id - name: my_doc_name - message: hello, world - run_jira_connector_request: - summary: Run a Jira connector to retrieve the list of issue types. - value: - params: - subAction: issueTypes - run_server_log_connector_request: - summary: Run a server log connector. - value: - params: - level: warn - message: Test warning message. - run_servicenow_itom_connector_request: - summary: Run a ServiceNow ITOM connector to retrieve the list of choices. - value: - params: - subAction: getChoices - subActionParams: - fields: - - severity - - urgency - run_swimlane_connector_request: - summary: Run a Swimlane connector to create an incident. - value: - params: - subAction: pushToService - subActionParams: - comments: - - commentId: 1 - comment: A comment about the incident. - incident: - caseId: '1000' - caseName: Case name - description: Description of the incident. - run_index_connector_response: - summary: Response from running an index connector. - value: - connector_id: fd38c600-96a5-11ed-bb79-353b74189cba - data: - errors: false - items: - - create: - _id: 4JtvwYUBrcyxt2NnfW3y - _index: my-index - _primary_term: 1 - _seq_no: 0 - _shards: - failed: 0 - successful: 1 - total: 2 - _version: 1 - result: created - status: 201 - took: 135 - status: ok - run_jira_connector_response: - summary: Response from retrieving the list of issue types for a Jira connector. - value: - connector_id: b3aad810-edbe-11ec-82d1-11348ecbf4a6 - data: - - id: 10024 - name: Improvement - - id: 10006 - name: Task - - id: 10007 - name: Sub-task - - id: 10025 - name: New Feature - - id: 10023 - name: Bug - - id: 10000 - name: Epic - status: ok - run_server_log_connector_response: - summary: Response from running a server log connector. - value: - connector_id: 7fc7b9a0-ecc9-11ec-8736-e7d63118c907 - status: ok - run_servicenow_itom_connector_response: - summary: Response from retrieving the list of choices for a ServiceNow ITOM connector. - value: - connector_id: 9d9be270-2fd2-11ed-b0e0-87533c532698 - data: - - dependent_value: '' - element: severity - label: Critical - value: 1 - - dependent_value: '' - element: severity - label: Major - value: 2 - - dependent_value: '' - element: severity - label: Minor - value: 3 - - dependent_value: '' - element: severity - label: Warning - value: 4 - - dependent_value: '' - element: severity - label: OK - value: 5 - - dependent_value: '' - element: severity - label: Clear - value: 0 - - dependent_value: '' - element: urgency - label: 1 - High - value: 1 - - dependent_value: '' - element: urgency - label: 2 - Medium - value: 2 - - dependent_value: '' - element: urgency - label: 3 - Low - value: 3 - status: ok - run_swimlane_connector_response: - summary: Response from creating a Swimlane incident. - value: - connector_id: a4746470-2f94-11ed-b0e0-87533c532698 - data: - id: aKPmBHWzmdRQtx6Mx - title: TEST-457 - url: https://elastic.swimlane.url.us/record/aNcL2xniGHGpa2AHb/aKPmBHWzmdRQtx6Mx - pushedDate: '2022-09-08T16:52:27.866Z' - comments: - - commentId: 1 - pushedDate: '2022-09-08T16:52:27.865Z' - status: ok - responses: - 200_actions: - description: Indicates a successful call. - content: - application/json: - schema: - $ref: '#/components/schemas/action_response_properties' -security: - - basicAuth: [] - - apiKeyAuth: [] diff --git a/generated/connectors/connectors.gen.go b/generated/connectors/connectors.gen.go deleted file mode 100644 index b059ea87e..000000000 --- a/generated/connectors/connectors.gen.go +++ /dev/null @@ -1,5720 +0,0 @@ -// Package connectors provides primitives to interact with the openapi HTTP API. -// -// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT. -package connectors - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "net/http" - "net/url" - "strings" - - "github.com/oapi-codegen/runtime" -) - -const ( - ApiKeyAuthScopes = "apiKeyAuth.Scopes" - BasicAuthScopes = "basicAuth.Scopes" -) - -// Defines values for AuthorizationErrorError. -const ( - Unauthorized AuthorizationErrorError = "Unauthorized" -) - -// Defines values for AuthorizationErrorStatusCode. -const ( - N401 AuthorizationErrorStatusCode = 401 -) - -// Defines values for BadRequestErrorError. -const ( - BadRequest BadRequestErrorError = "Bad Request" -) - -// Defines values for BadRequestErrorStatusCode. -const ( - N400 BadRequestErrorStatusCode = 400 -) - -// Defines values for ConfigPropertiesCasesWebhookCreateCommentMethod. -const ( - ConfigPropertiesCasesWebhookCreateCommentMethodPatch ConfigPropertiesCasesWebhookCreateCommentMethod = "patch" - ConfigPropertiesCasesWebhookCreateCommentMethodPost ConfigPropertiesCasesWebhookCreateCommentMethod = "post" - ConfigPropertiesCasesWebhookCreateCommentMethodPut ConfigPropertiesCasesWebhookCreateCommentMethod = "put" -) - -// Defines values for ConfigPropertiesCasesWebhookCreateIncidentMethod. -const ( - ConfigPropertiesCasesWebhookCreateIncidentMethodPatch ConfigPropertiesCasesWebhookCreateIncidentMethod = "patch" - ConfigPropertiesCasesWebhookCreateIncidentMethodPost ConfigPropertiesCasesWebhookCreateIncidentMethod = "post" - ConfigPropertiesCasesWebhookCreateIncidentMethodPut ConfigPropertiesCasesWebhookCreateIncidentMethod = "put" -) - -// Defines values for ConfigPropertiesCasesWebhookUpdateIncidentMethod. -const ( - ConfigPropertiesCasesWebhookUpdateIncidentMethodPatch ConfigPropertiesCasesWebhookUpdateIncidentMethod = "patch" - ConfigPropertiesCasesWebhookUpdateIncidentMethodPost ConfigPropertiesCasesWebhookUpdateIncidentMethod = "post" - ConfigPropertiesCasesWebhookUpdateIncidentMethodPut ConfigPropertiesCasesWebhookUpdateIncidentMethod = "put" -) - -// Defines values for ConfigPropertiesSwimlaneConnectorType. -const ( - ConfigPropertiesSwimlaneConnectorTypeAlerts ConfigPropertiesSwimlaneConnectorType = "alerts" - ConfigPropertiesSwimlaneConnectorTypeAll ConfigPropertiesSwimlaneConnectorType = "all" - ConfigPropertiesSwimlaneConnectorTypeCases ConfigPropertiesSwimlaneConnectorType = "cases" -) - -// Defines values for ConfigPropertiesWebhookMethod. -const ( - ConfigPropertiesWebhookMethodPatch ConfigPropertiesWebhookMethod = "patch" - ConfigPropertiesWebhookMethodPost ConfigPropertiesWebhookMethod = "post" - ConfigPropertiesWebhookMethodPut ConfigPropertiesWebhookMethod = "put" -) - -// Defines values for ConnectorResponsePropertiesCasesWebhookConnectorTypeId. -const ( - ConnectorResponsePropertiesCasesWebhookConnectorTypeIdDotCasesWebhook ConnectorResponsePropertiesCasesWebhookConnectorTypeId = ".cases-webhook" -) - -// Defines values for ConnectorResponsePropertiesEmailConnectorTypeId. -const ( - ConnectorResponsePropertiesEmailConnectorTypeIdDotEmail ConnectorResponsePropertiesEmailConnectorTypeId = ".email" -) - -// Defines values for ConnectorResponsePropertiesGeminiConnectorTypeId. -const ( - ConnectorResponsePropertiesGeminiConnectorTypeIdDotGemini ConnectorResponsePropertiesGeminiConnectorTypeId = ".gemini" -) - -// Defines values for ConnectorResponsePropertiesIndexConnectorTypeId. -const ( - ConnectorResponsePropertiesIndexConnectorTypeIdDotIndex ConnectorResponsePropertiesIndexConnectorTypeId = ".index" -) - -// Defines values for ConnectorResponsePropertiesJiraConnectorTypeId. -const ( - ConnectorResponsePropertiesJiraConnectorTypeIdDotJira ConnectorResponsePropertiesJiraConnectorTypeId = ".jira" -) - -// Defines values for ConnectorResponsePropertiesOpsgenieConnectorTypeId. -const ( - ConnectorResponsePropertiesOpsgenieConnectorTypeIdDotOpsgenie ConnectorResponsePropertiesOpsgenieConnectorTypeId = ".opsgenie" -) - -// Defines values for ConnectorResponsePropertiesPagerdutyConnectorTypeId. -const ( - ConnectorResponsePropertiesPagerdutyConnectorTypeIdDotPagerduty ConnectorResponsePropertiesPagerdutyConnectorTypeId = ".pagerduty" -) - -// Defines values for ConnectorResponsePropertiesResilientConnectorTypeId. -const ( - ConnectorResponsePropertiesResilientConnectorTypeIdDotResilient ConnectorResponsePropertiesResilientConnectorTypeId = ".resilient" -) - -// Defines values for ConnectorResponsePropertiesServerlogConnectorTypeId. -const ( - ConnectorResponsePropertiesServerlogConnectorTypeIdDotServerLog ConnectorResponsePropertiesServerlogConnectorTypeId = ".server-log" -) - -// Defines values for ConnectorResponsePropertiesServicenowConnectorTypeId. -const ( - ConnectorResponsePropertiesServicenowConnectorTypeIdDotServicenow ConnectorResponsePropertiesServicenowConnectorTypeId = ".servicenow" -) - -// Defines values for ConnectorResponsePropertiesServicenowItomConnectorTypeId. -const ( - ConnectorResponsePropertiesServicenowItomConnectorTypeIdDotServicenowItom ConnectorResponsePropertiesServicenowItomConnectorTypeId = ".servicenow-itom" -) - -// Defines values for ConnectorResponsePropertiesServicenowSirConnectorTypeId. -const ( - ConnectorResponsePropertiesServicenowSirConnectorTypeIdDotServicenowSir ConnectorResponsePropertiesServicenowSirConnectorTypeId = ".servicenow-sir" -) - -// Defines values for ConnectorResponsePropertiesSlackConnectorTypeId. -const ( - ConnectorResponsePropertiesSlackConnectorTypeIdDotSlack ConnectorResponsePropertiesSlackConnectorTypeId = ".slack" -) - -// Defines values for ConnectorResponsePropertiesSlackApiConnectorTypeId. -const ( - ConnectorResponsePropertiesSlackApiConnectorTypeIdDotSlackApi ConnectorResponsePropertiesSlackApiConnectorTypeId = ".slack_api" -) - -// Defines values for ConnectorResponsePropertiesSwimlaneConnectorTypeId. -const ( - ConnectorResponsePropertiesSwimlaneConnectorTypeIdDotSwimlane ConnectorResponsePropertiesSwimlaneConnectorTypeId = ".swimlane" -) - -// Defines values for ConnectorResponsePropertiesTeamsConnectorTypeId. -const ( - ConnectorResponsePropertiesTeamsConnectorTypeIdDotTeams ConnectorResponsePropertiesTeamsConnectorTypeId = ".teams" -) - -// Defines values for ConnectorResponsePropertiesTinesConnectorTypeId. -const ( - ConnectorResponsePropertiesTinesConnectorTypeIdDotTines ConnectorResponsePropertiesTinesConnectorTypeId = ".tines" -) - -// Defines values for ConnectorResponsePropertiesWebhookConnectorTypeId. -const ( - ConnectorResponsePropertiesWebhookConnectorTypeIdDotWebhook ConnectorResponsePropertiesWebhookConnectorTypeId = ".webhook" -) - -// Defines values for ConnectorResponsePropertiesXmattersConnectorTypeId. -const ( - ConnectorResponsePropertiesXmattersConnectorTypeIdDotXmatters ConnectorResponsePropertiesXmattersConnectorTypeId = ".xmatters" -) - -// Defines values for ConnectorTypes. -const ( - ConnectorTypesDotCasesWebhook ConnectorTypes = ".cases-webhook" - ConnectorTypesDotEmail ConnectorTypes = ".email" - ConnectorTypesDotGemini ConnectorTypes = ".gemini" - ConnectorTypesDotIndex ConnectorTypes = ".index" - ConnectorTypesDotJira ConnectorTypes = ".jira" - ConnectorTypesDotOpsgenie ConnectorTypes = ".opsgenie" - ConnectorTypesDotPagerduty ConnectorTypes = ".pagerduty" - ConnectorTypesDotResilient ConnectorTypes = ".resilient" - ConnectorTypesDotServerLog ConnectorTypes = ".server-log" - ConnectorTypesDotServicenow ConnectorTypes = ".servicenow" - ConnectorTypesDotServicenowItom ConnectorTypes = ".servicenow-itom" - ConnectorTypesDotServicenowSir ConnectorTypes = ".servicenow-sir" - ConnectorTypesDotSlack ConnectorTypes = ".slack" - ConnectorTypesDotSlackApi ConnectorTypes = ".slack_api" - ConnectorTypesDotSwimlane ConnectorTypes = ".swimlane" - ConnectorTypesDotTeams ConnectorTypes = ".teams" - ConnectorTypesDotTines ConnectorTypes = ".tines" - ConnectorTypesDotWebhook ConnectorTypes = ".webhook" - ConnectorTypesDotXmatters ConnectorTypes = ".xmatters" -) - -// Defines values for CreateConnectorRequestCasesWebhookConnectorTypeId. -const ( - DotCasesWebhook CreateConnectorRequestCasesWebhookConnectorTypeId = ".cases-webhook" -) - -// Defines values for CreateConnectorRequestEmailConnectorTypeId. -const ( - CreateConnectorRequestEmailConnectorTypeIdDotEmail CreateConnectorRequestEmailConnectorTypeId = ".email" -) - -// Defines values for CreateConnectorRequestGeminiConnectorTypeId. -const ( - CreateConnectorRequestGeminiConnectorTypeIdDotGemini CreateConnectorRequestGeminiConnectorTypeId = ".gemini" -) - -// Defines values for CreateConnectorRequestIndexConnectorTypeId. -const ( - CreateConnectorRequestIndexConnectorTypeIdDotIndex CreateConnectorRequestIndexConnectorTypeId = ".index" -) - -// Defines values for CreateConnectorRequestJiraConnectorTypeId. -const ( - CreateConnectorRequestJiraConnectorTypeIdDotJira CreateConnectorRequestJiraConnectorTypeId = ".jira" -) - -// Defines values for CreateConnectorRequestOpsgenieConnectorTypeId. -const ( - CreateConnectorRequestOpsgenieConnectorTypeIdDotOpsgenie CreateConnectorRequestOpsgenieConnectorTypeId = ".opsgenie" -) - -// Defines values for CreateConnectorRequestPagerdutyConnectorTypeId. -const ( - CreateConnectorRequestPagerdutyConnectorTypeIdDotPagerduty CreateConnectorRequestPagerdutyConnectorTypeId = ".pagerduty" -) - -// Defines values for CreateConnectorRequestResilientConnectorTypeId. -const ( - CreateConnectorRequestResilientConnectorTypeIdDotResilient CreateConnectorRequestResilientConnectorTypeId = ".resilient" -) - -// Defines values for CreateConnectorRequestServerlogConnectorTypeId. -const ( - CreateConnectorRequestServerlogConnectorTypeIdDotServerLog CreateConnectorRequestServerlogConnectorTypeId = ".server-log" -) - -// Defines values for CreateConnectorRequestServicenowConnectorTypeId. -const ( - CreateConnectorRequestServicenowConnectorTypeIdDotServicenow CreateConnectorRequestServicenowConnectorTypeId = ".servicenow" -) - -// Defines values for CreateConnectorRequestServicenowItomConnectorTypeId. -const ( - CreateConnectorRequestServicenowItomConnectorTypeIdDotServicenowItom CreateConnectorRequestServicenowItomConnectorTypeId = ".servicenow-itom" -) - -// Defines values for CreateConnectorRequestServicenowSirConnectorTypeId. -const ( - CreateConnectorRequestServicenowSirConnectorTypeIdDotServicenowSir CreateConnectorRequestServicenowSirConnectorTypeId = ".servicenow-sir" -) - -// Defines values for CreateConnectorRequestSlackConnectorTypeId. -const ( - CreateConnectorRequestSlackConnectorTypeIdDotSlack CreateConnectorRequestSlackConnectorTypeId = ".slack" -) - -// Defines values for CreateConnectorRequestSlackApiConnectorTypeId. -const ( - CreateConnectorRequestSlackApiConnectorTypeIdDotSlackApi CreateConnectorRequestSlackApiConnectorTypeId = ".slack_api" -) - -// Defines values for CreateConnectorRequestSwimlaneConnectorTypeId. -const ( - CreateConnectorRequestSwimlaneConnectorTypeIdDotSwimlane CreateConnectorRequestSwimlaneConnectorTypeId = ".swimlane" -) - -// Defines values for CreateConnectorRequestTeamsConnectorTypeId. -const ( - CreateConnectorRequestTeamsConnectorTypeIdDotTeams CreateConnectorRequestTeamsConnectorTypeId = ".teams" -) - -// Defines values for CreateConnectorRequestTinesConnectorTypeId. -const ( - CreateConnectorRequestTinesConnectorTypeIdDotTines CreateConnectorRequestTinesConnectorTypeId = ".tines" -) - -// Defines values for CreateConnectorRequestWebhookConnectorTypeId. -const ( - CreateConnectorRequestWebhookConnectorTypeIdDotWebhook CreateConnectorRequestWebhookConnectorTypeId = ".webhook" -) - -// Defines values for CreateConnectorRequestXmattersConnectorTypeId. -const ( - CreateConnectorRequestXmattersConnectorTypeIdDotXmatters CreateConnectorRequestXmattersConnectorTypeId = ".xmatters" -) - -// Defines values for Features. -const ( - FeaturesAlerting Features = "alerting" - FeaturesCases Features = "cases" - FeaturesSiem Features = "siem" - FeaturesUptime Features = "uptime" -) - -// Defines values for ObjectNotFoundErrorError. -const ( - NotFound ObjectNotFoundErrorError = "Not Found" -) - -// Defines values for ObjectNotFoundErrorStatusCode. -const ( - N404 ObjectNotFoundErrorStatusCode = 404 -) - -// Defines values for RunConnectorGeneralResponseStatus. -const ( - RunConnectorGeneralResponseStatusError RunConnectorGeneralResponseStatus = "error" - RunConnectorGeneralResponseStatusOk RunConnectorGeneralResponseStatus = "ok" -) - -// Defines values for RunConnectorParamsLevelMessageLevel. -const ( - RunConnectorParamsLevelMessageLevelDebug RunConnectorParamsLevelMessageLevel = "debug" - RunConnectorParamsLevelMessageLevelError RunConnectorParamsLevelMessageLevel = "error" - RunConnectorParamsLevelMessageLevelFatal RunConnectorParamsLevelMessageLevel = "fatal" - RunConnectorParamsLevelMessageLevelInfo RunConnectorParamsLevelMessageLevel = "info" - RunConnectorParamsLevelMessageLevelTrace RunConnectorParamsLevelMessageLevel = "trace" - RunConnectorParamsLevelMessageLevelWarn RunConnectorParamsLevelMessageLevel = "warn" -) - -// Defines values for RunConnectorSubactionAddeventSubAction. -const ( - AddEvent RunConnectorSubactionAddeventSubAction = "addEvent" -) - -// Defines values for RunConnectorSubactionClosealertSubAction. -const ( - CloseAlert RunConnectorSubactionClosealertSubAction = "closeAlert" -) - -// Defines values for RunConnectorSubactionCreatealertSubAction. -const ( - CreateAlert RunConnectorSubactionCreatealertSubAction = "createAlert" -) - -// Defines values for RunConnectorSubactionCreatealertSubActionParamsPriority. -const ( - P1 RunConnectorSubactionCreatealertSubActionParamsPriority = "P1" - P2 RunConnectorSubactionCreatealertSubActionParamsPriority = "P2" - P3 RunConnectorSubactionCreatealertSubActionParamsPriority = "P3" - P4 RunConnectorSubactionCreatealertSubActionParamsPriority = "P4" - P5 RunConnectorSubactionCreatealertSubActionParamsPriority = "P5" -) - -// Defines values for RunConnectorSubactionCreatealertSubActionParamsRespondersType. -const ( - RunConnectorSubactionCreatealertSubActionParamsRespondersTypeEscalation RunConnectorSubactionCreatealertSubActionParamsRespondersType = "escalation" - RunConnectorSubactionCreatealertSubActionParamsRespondersTypeSchedule RunConnectorSubactionCreatealertSubActionParamsRespondersType = "schedule" - RunConnectorSubactionCreatealertSubActionParamsRespondersTypeTeam RunConnectorSubactionCreatealertSubActionParamsRespondersType = "team" - RunConnectorSubactionCreatealertSubActionParamsRespondersTypeUser RunConnectorSubactionCreatealertSubActionParamsRespondersType = "user" -) - -// Defines values for RunConnectorSubactionCreatealertSubActionParamsVisibleToType. -const ( - RunConnectorSubactionCreatealertSubActionParamsVisibleToTypeTeam RunConnectorSubactionCreatealertSubActionParamsVisibleToType = "team" - RunConnectorSubactionCreatealertSubActionParamsVisibleToTypeUser RunConnectorSubactionCreatealertSubActionParamsVisibleToType = "user" -) - -// Defines values for RunConnectorSubactionFieldsbyissuetypeSubAction. -const ( - FieldsByIssueType RunConnectorSubactionFieldsbyissuetypeSubAction = "fieldsByIssueType" -) - -// Defines values for RunConnectorSubactionGetchoicesSubAction. -const ( - GetChoices RunConnectorSubactionGetchoicesSubAction = "getChoices" -) - -// Defines values for RunConnectorSubactionGetfieldsSubAction. -const ( - GetFields RunConnectorSubactionGetfieldsSubAction = "getFields" -) - -// Defines values for RunConnectorSubactionGetincidentSubAction. -const ( - GetIncident RunConnectorSubactionGetincidentSubAction = "getIncident" -) - -// Defines values for RunConnectorSubactionIssueSubAction. -const ( - Issue RunConnectorSubactionIssueSubAction = "issue" -) - -// Defines values for RunConnectorSubactionIssuesSubAction. -const ( - Issues RunConnectorSubactionIssuesSubAction = "issues" -) - -// Defines values for RunConnectorSubactionIssuetypesSubAction. -const ( - IssueTypes RunConnectorSubactionIssuetypesSubAction = "issueTypes" -) - -// Defines values for RunConnectorSubactionPushtoserviceSubAction. -const ( - PushToService RunConnectorSubactionPushtoserviceSubAction = "pushToService" -) - -// ActionResponseProperties The properties vary depending on the action type. -type ActionResponseProperties struct { - ActionTypeId *string `json:"actionTypeId,omitempty"` - Config *map[string]interface{} `json:"config,omitempty"` - Id *string `json:"id,omitempty"` - - // IsDeprecated Indicates whether the action type is deprecated. - IsDeprecated *bool `json:"isDeprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the action. - IsMissingSecrets *bool `json:"isMissingSecrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured action. - IsPreconfigured *bool `json:"isPreconfigured,omitempty"` - Name *string `json:"name,omitempty"` -} - -// AuthorizationError defines model for authorization_error. -type AuthorizationError struct { - Error *AuthorizationErrorError `json:"error,omitempty"` - Message *string `json:"message,omitempty"` - StatusCode *AuthorizationErrorStatusCode `json:"statusCode,omitempty"` -} - -// AuthorizationErrorError defines model for AuthorizationError.Error. -type AuthorizationErrorError string - -// AuthorizationErrorStatusCode defines model for AuthorizationError.StatusCode. -type AuthorizationErrorStatusCode int - -// BadRequestError defines model for bad_request_error. -type BadRequestError struct { - Error *BadRequestErrorError `json:"error,omitempty"` - Message *string `json:"message,omitempty"` - StatusCode *BadRequestErrorStatusCode `json:"statusCode,omitempty"` -} - -// BadRequestErrorError defines model for BadRequestError.Error. -type BadRequestErrorError string - -// BadRequestErrorStatusCode defines model for BadRequestError.StatusCode. -type BadRequestErrorStatusCode int - -// ConfigPropertiesCasesWebhook Defines properties for connectors when type is `.cases-webhook`. -type ConfigPropertiesCasesWebhook struct { - // CreateCommentJson A JSON payload sent to the create comment URL to create a case comment. You can use variables to add Kibana Cases data to the payload. The required variable is `case.comment`. Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated once the Mustache variables have been placed when the REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass. - CreateCommentJson *string `json:"createCommentJson,omitempty"` - - // CreateCommentMethod The REST API HTTP request method to create a case comment in the third-party system. Valid values are `patch`, `post`, and `put`. - CreateCommentMethod *ConfigPropertiesCasesWebhookCreateCommentMethod `json:"createCommentMethod,omitempty"` - - // CreateCommentUrl The REST API URL to create a case comment by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts setting`, add the hostname to the allowed hosts. - CreateCommentUrl *string `json:"createCommentUrl,omitempty"` - - // CreateIncidentJson A JSON payload sent to the create case URL to create a case. You can use variables to add case data to the payload. Required variables are `case.title` and `case.description`. Due to Mustache template variables (which is the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid to avoid future validation errors; disregard Mustache variables during your review. - CreateIncidentJson string `json:"createIncidentJson"` - - // CreateIncidentMethod The REST API HTTP request method to create a case in the third-party system. Valid values are `patch`, `post`, and `put`. - CreateIncidentMethod *ConfigPropertiesCasesWebhookCreateIncidentMethod `json:"createIncidentMethod,omitempty"` - - // CreateIncidentResponseKey The JSON key in the create case response that contains the external case ID. - CreateIncidentResponseKey string `json:"createIncidentResponseKey"` - - // CreateIncidentUrl The REST API URL to create a case in the third-party system. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. - CreateIncidentUrl string `json:"createIncidentUrl"` - - // GetIncidentResponseExternalTitleKey The JSON key in get case response that contains the external case title. - GetIncidentResponseExternalTitleKey string `json:"getIncidentResponseExternalTitleKey"` - - // GetIncidentUrl The REST API URL to get the case by ID from the third-party system. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. You can use a variable to add the external system ID to the URL. Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass. - GetIncidentUrl string `json:"getIncidentUrl"` - - // HasAuth If true, a username and password for login type authentication must be provided. - HasAuth *bool `json:"hasAuth,omitempty"` - - // Headers A set of key-value pairs sent as headers with the request URLs for the create case, update case, get case, and create comment methods. - Headers *string `json:"headers,omitempty"` - - // UpdateIncidentJson The JSON payload sent to the update case URL to update the case. You can use variables to add Kibana Cases data to the payload. Required variables are `case.title` and `case.description`. Due to Mustache template variables (which is the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid to avoid future validation errors; disregard Mustache variables during your review. - UpdateIncidentJson string `json:"updateIncidentJson"` - - // UpdateIncidentMethod The REST API HTTP request method to update the case in the third-party system. Valid values are `patch`, `post`, and `put`. - UpdateIncidentMethod *ConfigPropertiesCasesWebhookUpdateIncidentMethod `json:"updateIncidentMethod,omitempty"` - - // UpdateIncidentUrl The REST API URL to update the case by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. - UpdateIncidentUrl string `json:"updateIncidentUrl"` - - // ViewIncidentUrl The URL to view the case in the external system. You can use variables to add the external system ID or external system title to the URL. - ViewIncidentUrl string `json:"viewIncidentUrl"` -} - -// ConfigPropertiesCasesWebhookCreateCommentMethod The REST API HTTP request method to create a case comment in the third-party system. Valid values are `patch`, `post`, and `put`. -type ConfigPropertiesCasesWebhookCreateCommentMethod string - -// ConfigPropertiesCasesWebhookCreateIncidentMethod The REST API HTTP request method to create a case in the third-party system. Valid values are `patch`, `post`, and `put`. -type ConfigPropertiesCasesWebhookCreateIncidentMethod string - -// ConfigPropertiesCasesWebhookUpdateIncidentMethod The REST API HTTP request method to update the case in the third-party system. Valid values are `patch`, `post`, and `put`. -type ConfigPropertiesCasesWebhookUpdateIncidentMethod string - -// ConfigPropertiesEmail Defines properties for connectors when type is `.email`. -type ConfigPropertiesEmail struct { - ClientId *string `json:"clientId"` - From *string `json:"from,omitempty"` - HasAuth *bool `json:"hasAuth,omitempty"` - Host *string `json:"host,omitempty"` - OauthTokenUrl *string `json:"oauthTokenUrl"` - Port *int `json:"port,omitempty"` - Secure *bool `json:"secure"` - Service *string `json:"service,omitempty"` - TenantId *string `json:"tenantId"` -} - -// ConfigPropertiesGemini Defines properties for connectors when type is `.gemini`. -type ConfigPropertiesGemini struct { - // ApiUrl The Google Gemini request URL. - ApiUrl string `json:"apiUrl"` - - // DefaultModel The generative artificial intelligence model for Google Gemini to use. - DefaultModel *string `json:"defaultModel,omitempty"` - - // GcpProjectID The Google ProjectID that has Vertex AI endpoint enabled. - GcpProjectID string `json:"gcpProjectID"` - - // GcpRegion The GCP region where the Vertex AI endpoint enabled. - GcpRegion string `json:"gcpRegion"` -} - -// ConfigPropertiesIndex Defines properties for connectors when type is `.index`. -type ConfigPropertiesIndex struct { - // ExecutionTimeField Specifies a field that will contain the time the alert condition was detected. - ExecutionTimeField *string `json:"executionTimeField"` - - // Index The Elasticsearch index to be written to. - Index string `json:"index"` - - // Refresh The refresh policy for the write request, which affects when changes are made visible to search. Refer to the refresh setting for Elasticsearch document APIs. - Refresh *bool `json:"refresh,omitempty"` -} - -// ConfigPropertiesJira Defines properties for connectors when type is `.jira`. -type ConfigPropertiesJira struct { - // ApiUrl The Jira instance URL. - ApiUrl string `json:"apiUrl"` - - // ProjectKey The Jira project key. - ProjectKey string `json:"projectKey"` -} - -// ConfigPropertiesOpsgenie Defines properties for connectors when type is `.opsgenie`. -type ConfigPropertiesOpsgenie struct { - // ApiUrl The Opsgenie URL. For example, `https://api.opsgenie.com` or `https://api.eu.opsgenie.com`. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. - ApiUrl string `json:"apiUrl"` -} - -// ConfigPropertiesPagerduty Defines properties for connectors when type is `.pagerduty`. -type ConfigPropertiesPagerduty struct { - ApiUrl *string `json:"apiUrl"` -} - -// ConfigPropertiesResilient Defines properties for connectors when type is `.resilient`. -type ConfigPropertiesResilient struct { - // ApiUrl The IBM Resilient instance URL. - ApiUrl string `json:"apiUrl"` - - // OrgId The IBM Resilient organization ID. - OrgId string `json:"orgId"` -} - -// ConfigPropertiesServicenow Defines properties for connectors when type is `.servicenow`. -type ConfigPropertiesServicenow struct { - // ApiUrl The ServiceNow instance URL. - ApiUrl string `json:"apiUrl"` - - // ClientId The client ID assigned to your OAuth application. This property is required when `isOAuth` is `true`. - ClientId *string `json:"clientId,omitempty"` - - // IsOAuth The type of authentication to use. The default value is false, which means basic authentication is used instead of open authorization (OAuth). - IsOAuth *bool `json:"isOAuth,omitempty"` - - // JwtKeyId The key identifier assigned to the JWT verifier map of your OAuth application. This property is required when `isOAuth` is `true`. - JwtKeyId *string `json:"jwtKeyId,omitempty"` - - // UserIdentifierValue The identifier to use for OAuth authentication. This identifier should be the user field you selected when you created an OAuth JWT API endpoint for external clients in your ServiceNow instance. For example, if the selected user field is `Email`, the user identifier should be the user's email address. This property is required when `isOAuth` is `true`. - UserIdentifierValue *string `json:"userIdentifierValue,omitempty"` - - // UsesTableApi Determines whether the connector uses the Table API or the Import Set API. This property is supported only for ServiceNow ITSM and ServiceNow SecOps connectors. NOTE: If this property is set to `false`, the Elastic application should be installed in ServiceNow. - UsesTableApi *bool `json:"usesTableApi,omitempty"` -} - -// ConfigPropertiesServicenowItom Defines properties for connectors when type is `.servicenow`. -type ConfigPropertiesServicenowItom struct { - // ApiUrl The ServiceNow instance URL. - ApiUrl string `json:"apiUrl"` - - // ClientId The client ID assigned to your OAuth application. This property is required when `isOAuth` is `true`. - ClientId *string `json:"clientId,omitempty"` - - // IsOAuth The type of authentication to use. The default value is false, which means basic authentication is used instead of open authorization (OAuth). - IsOAuth *bool `json:"isOAuth,omitempty"` - - // JwtKeyId The key identifier assigned to the JWT verifier map of your OAuth application. This property is required when `isOAuth` is `true`. - JwtKeyId *string `json:"jwtKeyId,omitempty"` - - // UserIdentifierValue The identifier to use for OAuth authentication. This identifier should be the user field you selected when you created an OAuth JWT API endpoint for external clients in your ServiceNow instance. For example, if the selected user field is `Email`, the user identifier should be the user's email address. This property is required when `isOAuth` is `true`. - UserIdentifierValue *string `json:"userIdentifierValue,omitempty"` -} - -// ConfigPropertiesSwimlane Defines properties for connectors when type is `.swimlane`. -type ConfigPropertiesSwimlane struct { - // ApiUrl The Swimlane instance URL. - ApiUrl string `json:"apiUrl"` - - // AppId The Swimlane application ID. - AppId string `json:"appId"` - - // ConnectorType The type of connector. Valid values are `all`, `alerts`, and `cases`. - ConnectorType ConfigPropertiesSwimlaneConnectorType `json:"connectorType"` - - // Mappings The field mapping. - Mappings *ConfigPropertiesSwimlaneMappings `json:"mappings,omitempty"` -} - -// ConfigPropertiesSwimlaneConnectorType The type of connector. Valid values are `all`, `alerts`, and `cases`. -type ConfigPropertiesSwimlaneConnectorType string - -// ConfigPropertiesSwimlaneMappings The field mapping. -type ConfigPropertiesSwimlaneMappings struct { - // AlertIdConfig Mapping for the alert ID. - AlertIdConfig *struct { - // FieldType The type of field in Swimlane. - FieldType string `json:"fieldType"` - - // Id The identifier for the field in Swimlane. - Id string `json:"id"` - - // Key The key for the field in Swimlane. - Key string `json:"key"` - - // Name The name of the field in Swimlane. - Name string `json:"name"` - } `json:"alertIdConfig,omitempty"` - - // CaseIdConfig Mapping for the case ID. - CaseIdConfig *struct { - // FieldType The type of field in Swimlane. - FieldType string `json:"fieldType"` - - // Id The identifier for the field in Swimlane. - Id string `json:"id"` - - // Key The key for the field in Swimlane. - Key string `json:"key"` - - // Name The name of the field in Swimlane. - Name string `json:"name"` - } `json:"caseIdConfig,omitempty"` - - // CaseNameConfig Mapping for the case name. - CaseNameConfig *struct { - // FieldType The type of field in Swimlane. - FieldType string `json:"fieldType"` - - // Id The identifier for the field in Swimlane. - Id string `json:"id"` - - // Key The key for the field in Swimlane. - Key string `json:"key"` - - // Name The name of the field in Swimlane. - Name string `json:"name"` - } `json:"caseNameConfig,omitempty"` - - // CommentsConfig Mapping for the case comments. - CommentsConfig *struct { - // FieldType The type of field in Swimlane. - FieldType string `json:"fieldType"` - - // Id The identifier for the field in Swimlane. - Id string `json:"id"` - - // Key The key for the field in Swimlane. - Key string `json:"key"` - - // Name The name of the field in Swimlane. - Name string `json:"name"` - } `json:"commentsConfig,omitempty"` - - // DescriptionConfig Mapping for the case description. - DescriptionConfig *struct { - // FieldType The type of field in Swimlane. - FieldType string `json:"fieldType"` - - // Id The identifier for the field in Swimlane. - Id string `json:"id"` - - // Key The key for the field in Swimlane. - Key string `json:"key"` - - // Name The name of the field in Swimlane. - Name string `json:"name"` - } `json:"descriptionConfig,omitempty"` - - // RuleNameConfig Mapping for the name of the alert's rule. - RuleNameConfig *struct { - // FieldType The type of field in Swimlane. - FieldType string `json:"fieldType"` - - // Id The identifier for the field in Swimlane. - Id string `json:"id"` - - // Key The key for the field in Swimlane. - Key string `json:"key"` - - // Name The name of the field in Swimlane. - Name string `json:"name"` - } `json:"ruleNameConfig,omitempty"` - - // SeverityConfig Mapping for the severity. - SeverityConfig *struct { - // FieldType The type of field in Swimlane. - FieldType string `json:"fieldType"` - - // Id The identifier for the field in Swimlane. - Id string `json:"id"` - - // Key The key for the field in Swimlane. - Key string `json:"key"` - - // Name The name of the field in Swimlane. - Name string `json:"name"` - } `json:"severityConfig,omitempty"` -} - -// ConfigPropertiesTines Defines properties for connectors when type is `.tines`. -type ConfigPropertiesTines struct { - Url string `json:"url"` -} - -// ConfigPropertiesWebhook Defines properties for connectors when type is `.webhook`. -type ConfigPropertiesWebhook struct { - HasAuth *bool `json:"hasAuth,omitempty"` - Headers *map[string]interface{} `json:"headers,omitempty"` - Method *ConfigPropertiesWebhookMethod `json:"method,omitempty"` - Url string `json:"url"` -} - -// ConfigPropertiesWebhookMethod defines model for ConfigPropertiesWebhook.Method. -type ConfigPropertiesWebhookMethod string - -// ConfigPropertiesXmatters Defines properties for connectors when type is `.xmatters`. -type ConfigPropertiesXmatters struct { - ConfigUrl *string `json:"configUrl"` - UsesBasic *bool `json:"usesBasic,omitempty"` -} - -// ConnectorResponseProperties The properties vary depending on the connector type. -type ConnectorResponseProperties struct { - union json.RawMessage -} - -// ConnectorResponsePropertiesCasesWebhook defines model for connector_response_properties_cases_webhook. -type ConnectorResponsePropertiesCasesWebhook struct { - // Config Defines properties for connectors when type is `.cases-webhook`. - Config ConfigPropertiesCasesWebhook `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId ConnectorResponsePropertiesCasesWebhookConnectorTypeId `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// ConnectorResponsePropertiesCasesWebhookConnectorTypeId The type of connector. -type ConnectorResponsePropertiesCasesWebhookConnectorTypeId string - -// ConnectorResponsePropertiesEmail defines model for connector_response_properties_email. -type ConnectorResponsePropertiesEmail struct { - // Config Defines properties for connectors when type is `.email`. - Config ConfigPropertiesEmail `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId ConnectorResponsePropertiesEmailConnectorTypeId `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// ConnectorResponsePropertiesEmailConnectorTypeId The type of connector. -type ConnectorResponsePropertiesEmailConnectorTypeId string - -// ConnectorResponsePropertiesGemini defines model for connector_response_properties_gemini. -type ConnectorResponsePropertiesGemini struct { - // Config Defines properties for connectors when type is `.gemini`. - Config ConfigPropertiesGemini `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId ConnectorResponsePropertiesGeminiConnectorTypeId `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// ConnectorResponsePropertiesGeminiConnectorTypeId The type of connector. -type ConnectorResponsePropertiesGeminiConnectorTypeId string - -// ConnectorResponsePropertiesIndex defines model for connector_response_properties_index. -type ConnectorResponsePropertiesIndex struct { - // Config Defines properties for connectors when type is `.index`. - Config ConfigPropertiesIndex `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId ConnectorResponsePropertiesIndexConnectorTypeId `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// ConnectorResponsePropertiesIndexConnectorTypeId The type of connector. -type ConnectorResponsePropertiesIndexConnectorTypeId string - -// ConnectorResponsePropertiesJira defines model for connector_response_properties_jira. -type ConnectorResponsePropertiesJira struct { - // Config Defines properties for connectors when type is `.jira`. - Config ConfigPropertiesJira `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId ConnectorResponsePropertiesJiraConnectorTypeId `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// ConnectorResponsePropertiesJiraConnectorTypeId The type of connector. -type ConnectorResponsePropertiesJiraConnectorTypeId string - -// ConnectorResponsePropertiesOpsgenie defines model for connector_response_properties_opsgenie. -type ConnectorResponsePropertiesOpsgenie struct { - // Config Defines properties for connectors when type is `.opsgenie`. - Config ConfigPropertiesOpsgenie `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId ConnectorResponsePropertiesOpsgenieConnectorTypeId `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// ConnectorResponsePropertiesOpsgenieConnectorTypeId The type of connector. -type ConnectorResponsePropertiesOpsgenieConnectorTypeId string - -// ConnectorResponsePropertiesPagerduty defines model for connector_response_properties_pagerduty. -type ConnectorResponsePropertiesPagerduty struct { - // Config Defines properties for connectors when type is `.pagerduty`. - Config ConfigPropertiesPagerduty `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId ConnectorResponsePropertiesPagerdutyConnectorTypeId `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// ConnectorResponsePropertiesPagerdutyConnectorTypeId The type of connector. -type ConnectorResponsePropertiesPagerdutyConnectorTypeId string - -// ConnectorResponsePropertiesResilient defines model for connector_response_properties_resilient. -type ConnectorResponsePropertiesResilient struct { - // Config Defines properties for connectors when type is `.resilient`. - Config ConfigPropertiesResilient `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId ConnectorResponsePropertiesResilientConnectorTypeId `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// ConnectorResponsePropertiesResilientConnectorTypeId The type of connector. -type ConnectorResponsePropertiesResilientConnectorTypeId string - -// ConnectorResponsePropertiesServerlog defines model for connector_response_properties_serverlog. -type ConnectorResponsePropertiesServerlog struct { - Config *map[string]interface{} `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId ConnectorResponsePropertiesServerlogConnectorTypeId `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// ConnectorResponsePropertiesServerlogConnectorTypeId The type of connector. -type ConnectorResponsePropertiesServerlogConnectorTypeId string - -// ConnectorResponsePropertiesServicenow defines model for connector_response_properties_servicenow. -type ConnectorResponsePropertiesServicenow struct { - // Config Defines properties for connectors when type is `.servicenow`. - Config ConfigPropertiesServicenow `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId ConnectorResponsePropertiesServicenowConnectorTypeId `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// ConnectorResponsePropertiesServicenowConnectorTypeId The type of connector. -type ConnectorResponsePropertiesServicenowConnectorTypeId string - -// ConnectorResponsePropertiesServicenowItom defines model for connector_response_properties_servicenow_itom. -type ConnectorResponsePropertiesServicenowItom struct { - // Config Defines properties for connectors when type is `.servicenow`. - Config ConfigPropertiesServicenowItom `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId ConnectorResponsePropertiesServicenowItomConnectorTypeId `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// ConnectorResponsePropertiesServicenowItomConnectorTypeId The type of connector. -type ConnectorResponsePropertiesServicenowItomConnectorTypeId string - -// ConnectorResponsePropertiesServicenowSir defines model for connector_response_properties_servicenow_sir. -type ConnectorResponsePropertiesServicenowSir struct { - // Config Defines properties for connectors when type is `.servicenow`. - Config ConfigPropertiesServicenow `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId ConnectorResponsePropertiesServicenowSirConnectorTypeId `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// ConnectorResponsePropertiesServicenowSirConnectorTypeId The type of connector. -type ConnectorResponsePropertiesServicenowSirConnectorTypeId string - -// ConnectorResponsePropertiesSlack defines model for connector_response_properties_slack. -type ConnectorResponsePropertiesSlack struct { - // ConnectorTypeId The type of connector. - ConnectorTypeId ConnectorResponsePropertiesSlackConnectorTypeId `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// ConnectorResponsePropertiesSlackConnectorTypeId The type of connector. -type ConnectorResponsePropertiesSlackConnectorTypeId string - -// ConnectorResponsePropertiesSlackApi defines model for connector_response_properties_slack_api. -type ConnectorResponsePropertiesSlackApi struct { - // ConnectorTypeId The type of connector. - ConnectorTypeId ConnectorResponsePropertiesSlackApiConnectorTypeId `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// ConnectorResponsePropertiesSlackApiConnectorTypeId The type of connector. -type ConnectorResponsePropertiesSlackApiConnectorTypeId string - -// ConnectorResponsePropertiesSwimlane defines model for connector_response_properties_swimlane. -type ConnectorResponsePropertiesSwimlane struct { - // Config Defines properties for connectors when type is `.swimlane`. - Config ConfigPropertiesSwimlane `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId ConnectorResponsePropertiesSwimlaneConnectorTypeId `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// ConnectorResponsePropertiesSwimlaneConnectorTypeId The type of connector. -type ConnectorResponsePropertiesSwimlaneConnectorTypeId string - -// ConnectorResponsePropertiesTeams defines model for connector_response_properties_teams. -type ConnectorResponsePropertiesTeams struct { - // ConnectorTypeId The type of connector. - ConnectorTypeId ConnectorResponsePropertiesTeamsConnectorTypeId `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// ConnectorResponsePropertiesTeamsConnectorTypeId The type of connector. -type ConnectorResponsePropertiesTeamsConnectorTypeId string - -// ConnectorResponsePropertiesTines defines model for connector_response_properties_tines. -type ConnectorResponsePropertiesTines struct { - // Config Defines properties for connectors when type is `.tines`. - Config ConfigPropertiesTines `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId ConnectorResponsePropertiesTinesConnectorTypeId `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// ConnectorResponsePropertiesTinesConnectorTypeId The type of connector. -type ConnectorResponsePropertiesTinesConnectorTypeId string - -// ConnectorResponsePropertiesWebhook defines model for connector_response_properties_webhook. -type ConnectorResponsePropertiesWebhook struct { - // Config Defines properties for connectors when type is `.webhook`. - Config ConfigPropertiesWebhook `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId ConnectorResponsePropertiesWebhookConnectorTypeId `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// ConnectorResponsePropertiesWebhookConnectorTypeId The type of connector. -type ConnectorResponsePropertiesWebhookConnectorTypeId string - -// ConnectorResponsePropertiesXmatters defines model for connector_response_properties_xmatters. -type ConnectorResponsePropertiesXmatters struct { - // Config Defines properties for connectors when type is `.xmatters`. - Config ConfigPropertiesXmatters `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId ConnectorResponsePropertiesXmattersConnectorTypeId `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// ConnectorResponsePropertiesXmattersConnectorTypeId The type of connector. -type ConnectorResponsePropertiesXmattersConnectorTypeId string - -// ConnectorTypes The type of connector. For example, `.email`, `.index`, `.jira`, `.opsgenie`, or `.server-log`. -type ConnectorTypes string - -// CreateConnectorRequestCasesWebhook The Webhook - Case Management connector uses axios to send POST, PUT, and GET requests to a case management RESTful API web service. -type CreateConnectorRequestCasesWebhook struct { - // Config Defines properties for connectors when type is `.cases-webhook`. - Config ConfigPropertiesCasesWebhook `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId CreateConnectorRequestCasesWebhookConnectorTypeId `json:"connector_type_id"` - - // Name The display name for the connector. - Name string `json:"name"` - Secrets *SecretsPropertiesCasesWebhook `json:"secrets,omitempty"` -} - -// CreateConnectorRequestCasesWebhookConnectorTypeId The type of connector. -type CreateConnectorRequestCasesWebhookConnectorTypeId string - -// CreateConnectorRequestEmail The email connector uses the SMTP protocol to send mail messages, using an integration of Nodemailer. An exception is Microsoft Exchange, which uses HTTP protocol for sending emails, Send mail. Email message text is sent as both plain text and html text. -type CreateConnectorRequestEmail struct { - // Config Defines properties for connectors when type is `.email`. - Config ConfigPropertiesEmail `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId CreateConnectorRequestEmailConnectorTypeId `json:"connector_type_id"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.email`. - Secrets SecretsPropertiesEmail `json:"secrets"` -} - -// CreateConnectorRequestEmailConnectorTypeId The type of connector. -type CreateConnectorRequestEmailConnectorTypeId string - -// CreateConnectorRequestGemini The Google Gemini connector uses axios to send a POST request to Google Gemini. -type CreateConnectorRequestGemini struct { - // Config Defines properties for connectors when type is `.gemini`. - Config ConfigPropertiesGemini `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId CreateConnectorRequestGeminiConnectorTypeId `json:"connector_type_id"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.gemini`. - Secrets SecretsPropertiesGemini `json:"secrets"` -} - -// CreateConnectorRequestGeminiConnectorTypeId The type of connector. -type CreateConnectorRequestGeminiConnectorTypeId string - -// CreateConnectorRequestIndex The index connector indexes a document into Elasticsearch. -type CreateConnectorRequestIndex struct { - // Config Defines properties for connectors when type is `.index`. - Config ConfigPropertiesIndex `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId CreateConnectorRequestIndexConnectorTypeId `json:"connector_type_id"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// CreateConnectorRequestIndexConnectorTypeId The type of connector. -type CreateConnectorRequestIndexConnectorTypeId string - -// CreateConnectorRequestJira The Jira connector uses the REST API v2 to create Jira issues. -type CreateConnectorRequestJira struct { - // Config Defines properties for connectors when type is `.jira`. - Config ConfigPropertiesJira `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId CreateConnectorRequestJiraConnectorTypeId `json:"connector_type_id"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.jira`. - Secrets SecretsPropertiesJira `json:"secrets"` -} - -// CreateConnectorRequestJiraConnectorTypeId The type of connector. -type CreateConnectorRequestJiraConnectorTypeId string - -// CreateConnectorRequestOpsgenie The Opsgenie connector uses the Opsgenie alert API. -type CreateConnectorRequestOpsgenie struct { - // Config Defines properties for connectors when type is `.opsgenie`. - Config ConfigPropertiesOpsgenie `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId CreateConnectorRequestOpsgenieConnectorTypeId `json:"connector_type_id"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.opsgenie`. - Secrets SecretsPropertiesOpsgenie `json:"secrets"` -} - -// CreateConnectorRequestOpsgenieConnectorTypeId The type of connector. -type CreateConnectorRequestOpsgenieConnectorTypeId string - -// CreateConnectorRequestPagerduty The PagerDuty connector uses the v2 Events API to trigger, acknowledge, and resolve PagerDuty alerts. -type CreateConnectorRequestPagerduty struct { - // Config Defines properties for connectors when type is `.pagerduty`. - Config ConfigPropertiesPagerduty `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId CreateConnectorRequestPagerdutyConnectorTypeId `json:"connector_type_id"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.pagerduty`. - Secrets SecretsPropertiesPagerduty `json:"secrets"` -} - -// CreateConnectorRequestPagerdutyConnectorTypeId The type of connector. -type CreateConnectorRequestPagerdutyConnectorTypeId string - -// CreateConnectorRequestResilient The IBM Resilient connector uses the RESILIENT REST v2 to create IBM Resilient incidents. -type CreateConnectorRequestResilient struct { - // Config Defines properties for connectors when type is `.resilient`. - Config ConfigPropertiesResilient `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId CreateConnectorRequestResilientConnectorTypeId `json:"connector_type_id"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.resilient`. - Secrets SecretsPropertiesResilient `json:"secrets"` -} - -// CreateConnectorRequestResilientConnectorTypeId The type of connector. -type CreateConnectorRequestResilientConnectorTypeId string - -// CreateConnectorRequestServerlog This connector writes an entry to the Kibana server log. -type CreateConnectorRequestServerlog struct { - // ConnectorTypeId The type of connector. - ConnectorTypeId CreateConnectorRequestServerlogConnectorTypeId `json:"connector_type_id"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// CreateConnectorRequestServerlogConnectorTypeId The type of connector. -type CreateConnectorRequestServerlogConnectorTypeId string - -// CreateConnectorRequestServicenow The ServiceNow ITSM connector uses the import set API to create ServiceNow incidents. You can use the connector for rule actions and cases. -type CreateConnectorRequestServicenow struct { - // Config Defines properties for connectors when type is `.servicenow`. - Config ConfigPropertiesServicenow `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId CreateConnectorRequestServicenowConnectorTypeId `json:"connector_type_id"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.servicenow`, `.servicenow-sir`, or `.servicenow-itom`. - Secrets SecretsPropertiesServicenow `json:"secrets"` -} - -// CreateConnectorRequestServicenowConnectorTypeId The type of connector. -type CreateConnectorRequestServicenowConnectorTypeId string - -// CreateConnectorRequestServicenowItom The ServiceNow ITOM connector uses the event API to create ServiceNow events. You can use the connector for rule actions. -type CreateConnectorRequestServicenowItom struct { - // Config Defines properties for connectors when type is `.servicenow`. - Config ConfigPropertiesServicenowItom `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId CreateConnectorRequestServicenowItomConnectorTypeId `json:"connector_type_id"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.servicenow`, `.servicenow-sir`, or `.servicenow-itom`. - Secrets SecretsPropertiesServicenow `json:"secrets"` -} - -// CreateConnectorRequestServicenowItomConnectorTypeId The type of connector. -type CreateConnectorRequestServicenowItomConnectorTypeId string - -// CreateConnectorRequestServicenowSir The ServiceNow SecOps connector uses the import set API to create ServiceNow security incidents. You can use the connector for rule actions and cases. -type CreateConnectorRequestServicenowSir struct { - // Config Defines properties for connectors when type is `.servicenow`. - Config ConfigPropertiesServicenow `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId CreateConnectorRequestServicenowSirConnectorTypeId `json:"connector_type_id"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.servicenow`, `.servicenow-sir`, or `.servicenow-itom`. - Secrets SecretsPropertiesServicenow `json:"secrets"` -} - -// CreateConnectorRequestServicenowSirConnectorTypeId The type of connector. -type CreateConnectorRequestServicenowSirConnectorTypeId string - -// CreateConnectorRequestSlack The Slack connector uses Slack Incoming Webhooks. -type CreateConnectorRequestSlack struct { - // ConnectorTypeId The type of connector. - ConnectorTypeId CreateConnectorRequestSlackConnectorTypeId `json:"connector_type_id"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.slack`. - Secrets SecretsPropertiesSlack `json:"secrets"` -} - -// CreateConnectorRequestSlackConnectorTypeId The type of connector. -type CreateConnectorRequestSlackConnectorTypeId string - -// CreateConnectorRequestSlackApi The Slack connector uses Slack Incoming Webhooks. -type CreateConnectorRequestSlackApi struct { - // ConnectorTypeId The type of connector. - ConnectorTypeId CreateConnectorRequestSlackApiConnectorTypeId `json:"connector_type_id"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.slack`. - Secrets SecretsPropertiesSlackApi `json:"secrets"` -} - -// CreateConnectorRequestSlackApiConnectorTypeId The type of connector. -type CreateConnectorRequestSlackApiConnectorTypeId string - -// CreateConnectorRequestSwimlane The Swimlane connector uses the Swimlane REST API to create Swimlane records. -type CreateConnectorRequestSwimlane struct { - // Config Defines properties for connectors when type is `.swimlane`. - Config ConfigPropertiesSwimlane `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId CreateConnectorRequestSwimlaneConnectorTypeId `json:"connector_type_id"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.swimlane`. - Secrets SecretsPropertiesSwimlane `json:"secrets"` -} - -// CreateConnectorRequestSwimlaneConnectorTypeId The type of connector. -type CreateConnectorRequestSwimlaneConnectorTypeId string - -// CreateConnectorRequestTeams The Microsoft Teams connector uses Incoming Webhooks. -type CreateConnectorRequestTeams struct { - // ConnectorTypeId The type of connector. - ConnectorTypeId CreateConnectorRequestTeamsConnectorTypeId `json:"connector_type_id"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.teams`. - Secrets SecretsPropertiesTeams `json:"secrets"` -} - -// CreateConnectorRequestTeamsConnectorTypeId The type of connector. -type CreateConnectorRequestTeamsConnectorTypeId string - -// CreateConnectorRequestTines The Tines connector uses Tines Webhook actions to send events via POST request. -type CreateConnectorRequestTines struct { - // Config Defines properties for connectors when type is `.tines`. - Config ConfigPropertiesTines `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId CreateConnectorRequestTinesConnectorTypeId `json:"connector_type_id"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.tines`. - Secrets SecretsPropertiesTines `json:"secrets"` -} - -// CreateConnectorRequestTinesConnectorTypeId The type of connector. -type CreateConnectorRequestTinesConnectorTypeId string - -// CreateConnectorRequestWebhook The Webhook connector uses axios to send a POST or PUT request to a web service. -type CreateConnectorRequestWebhook struct { - // Config Defines properties for connectors when type is `.webhook`. - Config ConfigPropertiesWebhook `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId CreateConnectorRequestWebhookConnectorTypeId `json:"connector_type_id"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.webhook`. - Secrets SecretsPropertiesWebhook `json:"secrets"` -} - -// CreateConnectorRequestWebhookConnectorTypeId The type of connector. -type CreateConnectorRequestWebhookConnectorTypeId string - -// CreateConnectorRequestXmatters The xMatters connector uses the xMatters Workflow for Elastic to send actionable alerts to on-call xMatters resources. -type CreateConnectorRequestXmatters struct { - // Config Defines properties for connectors when type is `.xmatters`. - Config ConfigPropertiesXmatters `json:"config"` - - // ConnectorTypeId The type of connector. - ConnectorTypeId CreateConnectorRequestXmattersConnectorTypeId `json:"connector_type_id"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.xmatters`. - Secrets SecretsPropertiesXmatters `json:"secrets"` -} - -// CreateConnectorRequestXmattersConnectorTypeId The type of connector. -type CreateConnectorRequestXmattersConnectorTypeId string - -// Features The feature that uses the connector. Valid values are `alerting`, `cases`, `uptime`, and `siem`. -type Features string - -// IsDeprecated Indicates whether the connector type is deprecated. -type IsDeprecated = bool - -// IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. -type IsMissingSecrets = bool - -// IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. -type IsPreconfigured = bool - -// LegacyRunConnectorGeneralResponse defines model for legacy_run_connector_general_response. -type LegacyRunConnectorGeneralResponse struct { - ActionId *string `json:"actionId,omitempty"` - Data *LegacyRunConnectorGeneralResponse_Data `json:"data,omitempty"` - - // Status The status of the action. - Status *string `json:"status,omitempty"` -} - -// LegacyRunConnectorGeneralResponseData0 Information returned from the action. -type LegacyRunConnectorGeneralResponseData0 map[string]interface{} - -// LegacyRunConnectorGeneralResponseData1 An array of information returned from the action. -type LegacyRunConnectorGeneralResponseData1 = []map[string]interface{} - -// LegacyRunConnectorGeneralResponse_Data defines model for LegacyRunConnectorGeneralResponse.Data. -type LegacyRunConnectorGeneralResponse_Data struct { - union json.RawMessage -} - -// ObjectNotFoundError defines model for object_not_found_error. -type ObjectNotFoundError struct { - Error *ObjectNotFoundErrorError `json:"error,omitempty"` - Message *string `json:"message,omitempty"` - StatusCode *ObjectNotFoundErrorStatusCode `json:"statusCode,omitempty"` -} - -// ObjectNotFoundErrorError defines model for ObjectNotFoundError.Error. -type ObjectNotFoundErrorError string - -// ObjectNotFoundErrorStatusCode defines model for ObjectNotFoundError.StatusCode. -type ObjectNotFoundErrorStatusCode int - -// RunConnectorGeneralResponse defines model for run_connector_general_response. -type RunConnectorGeneralResponse struct { - // ConnectorId The identifier for the connector. - ConnectorId string `json:"connector_id"` - Data *RunConnectorGeneralResponse_Data `json:"data,omitempty"` - - // Status The status of the action. - Status RunConnectorGeneralResponseStatus `json:"status"` -} - -// RunConnectorGeneralResponseData0 Information returned from the action. -type RunConnectorGeneralResponseData0 map[string]interface{} - -// RunConnectorGeneralResponseData1 An array of information returned from the action. -type RunConnectorGeneralResponseData1 = []map[string]interface{} - -// RunConnectorGeneralResponse_Data defines model for RunConnectorGeneralResponse.Data. -type RunConnectorGeneralResponse_Data struct { - union json.RawMessage -} - -// RunConnectorGeneralResponseStatus The status of the action. -type RunConnectorGeneralResponseStatus string - -// RunConnectorParamsDocuments Test an action that indexes a document into Elasticsearch. -type RunConnectorParamsDocuments struct { - // Documents The documents in JSON format for index connectors. - Documents []map[string]interface{} `json:"documents"` -} - -// RunConnectorParamsLevelMessage Test an action that writes an entry to the Kibana server log. -type RunConnectorParamsLevelMessage struct { - // Level The log level of the message for server log connectors. - Level *RunConnectorParamsLevelMessageLevel `json:"level,omitempty"` - - // Message The message for server log connectors. - Message string `json:"message"` -} - -// RunConnectorParamsLevelMessageLevel The log level of the message for server log connectors. -type RunConnectorParamsLevelMessageLevel string - -// RunConnectorSubactionAddevent The `addEvent` subaction for ServiceNow ITOM connectors. -type RunConnectorSubactionAddevent struct { - // SubAction The action to test. - SubAction RunConnectorSubactionAddeventSubAction `json:"subAction"` - - // SubActionParams The set of configuration properties for the action. - SubActionParams *struct { - // AdditionalInfo Additional information about the event. - AdditionalInfo *string `json:"additional_info,omitempty"` - - // Description The details about the event. - Description *string `json:"description,omitempty"` - - // EventClass A specific instance of the source. - EventClass *string `json:"event_class,omitempty"` - - // MessageKey All actions sharing this key are associated with the same ServiceNow alert. The default value is `:`. - MessageKey *string `json:"message_key,omitempty"` - - // MetricName The name of the metric. - MetricName *string `json:"metric_name,omitempty"` - - // Node The host that the event was triggered for. - Node *string `json:"node,omitempty"` - - // Resource The name of the resource. - Resource *string `json:"resource,omitempty"` - - // Severity The severity of the event. - Severity *string `json:"severity,omitempty"` - - // Source The name of the event source type. - Source *string `json:"source,omitempty"` - - // TimeOfEvent The time of the event. - TimeOfEvent *string `json:"time_of_event,omitempty"` - - // Type The type of event. - Type *string `json:"type,omitempty"` - } `json:"subActionParams,omitempty"` -} - -// RunConnectorSubactionAddeventSubAction The action to test. -type RunConnectorSubactionAddeventSubAction string - -// RunConnectorSubactionClosealert The `closeAlert` subaction for Opsgenie connectors. -type RunConnectorSubactionClosealert struct { - // SubAction The action to test. - SubAction RunConnectorSubactionClosealertSubAction `json:"subAction"` - SubActionParams struct { - // Alias The unique identifier used for alert deduplication in Opsgenie. The alias must match the value used when creating the alert. - Alias string `json:"alias"` - - // Note Additional information for the alert. - Note *string `json:"note,omitempty"` - - // Source The display name for the source of the alert. - Source *string `json:"source,omitempty"` - - // User The display name for the owner. - User *string `json:"user,omitempty"` - } `json:"subActionParams"` -} - -// RunConnectorSubactionClosealertSubAction The action to test. -type RunConnectorSubactionClosealertSubAction string - -// RunConnectorSubactionCreatealert The `createAlert` subaction for Opsgenie connectors. -type RunConnectorSubactionCreatealert struct { - // SubAction The action to test. - SubAction RunConnectorSubactionCreatealertSubAction `json:"subAction"` - SubActionParams struct { - // Actions The custom actions available to the alert. - Actions *[]string `json:"actions,omitempty"` - - // Alias The unique identifier used for alert deduplication in Opsgenie. - Alias *string `json:"alias,omitempty"` - - // Description A description that provides detailed information about the alert. - Description *string `json:"description,omitempty"` - - // Details The custom properties of the alert. - Details *map[string]interface{} `json:"details,omitempty"` - - // Entity The domain of the alert. For example, the application or server name. - Entity *string `json:"entity,omitempty"` - - // Message The alert message. - Message string `json:"message"` - - // Note Additional information for the alert. - Note *string `json:"note,omitempty"` - - // Priority The priority level for the alert. - Priority *RunConnectorSubactionCreatealertSubActionParamsPriority `json:"priority,omitempty"` - - // Responders The entities to receive notifications about the alert. If `type` is `user`, either `id` or `username` is required. If `type` is `team`, either `id` or `name` is required. - Responders *[]struct { - // Id The identifier for the entity. - Id *string `json:"id,omitempty"` - - // Name The name of the entity. - Name *string `json:"name,omitempty"` - - // Type The type of responders, in this case `escalation`. - Type *RunConnectorSubactionCreatealertSubActionParamsRespondersType `json:"type,omitempty"` - - // Username A valid email address for the user. - Username *string `json:"username,omitempty"` - } `json:"responders,omitempty"` - - // Source The display name for the source of the alert. - Source *string `json:"source,omitempty"` - - // Tags The tags for the alert. - Tags *[]string `json:"tags,omitempty"` - - // User The display name for the owner. - User *string `json:"user,omitempty"` - - // VisibleTo The teams and users that the alert will be visible to without sending a notification. Only one of `id`, `name`, or `username` is required. - VisibleTo *[]struct { - // Id The identifier for the entity. - Id *string `json:"id,omitempty"` - - // Name The name of the entity. - Name *string `json:"name,omitempty"` - - // Type Valid values are `team` and `user`. - Type RunConnectorSubactionCreatealertSubActionParamsVisibleToType `json:"type"` - - // Username The user name. This property is required only when the `type` is `user`. - Username *string `json:"username,omitempty"` - } `json:"visibleTo,omitempty"` - } `json:"subActionParams"` -} - -// RunConnectorSubactionCreatealertSubAction The action to test. -type RunConnectorSubactionCreatealertSubAction string - -// RunConnectorSubactionCreatealertSubActionParamsPriority The priority level for the alert. -type RunConnectorSubactionCreatealertSubActionParamsPriority string - -// RunConnectorSubactionCreatealertSubActionParamsRespondersType The type of responders, in this case `escalation`. -type RunConnectorSubactionCreatealertSubActionParamsRespondersType string - -// RunConnectorSubactionCreatealertSubActionParamsVisibleToType Valid values are `team` and `user`. -type RunConnectorSubactionCreatealertSubActionParamsVisibleToType string - -// RunConnectorSubactionFieldsbyissuetype The `fieldsByIssueType` subaction for Jira connectors. -type RunConnectorSubactionFieldsbyissuetype struct { - // SubAction The action to test. - SubAction RunConnectorSubactionFieldsbyissuetypeSubAction `json:"subAction"` - SubActionParams struct { - // Id The Jira issue type identifier. - Id string `json:"id"` - } `json:"subActionParams"` -} - -// RunConnectorSubactionFieldsbyissuetypeSubAction The action to test. -type RunConnectorSubactionFieldsbyissuetypeSubAction string - -// RunConnectorSubactionGetchoices The `getChoices` subaction for ServiceNow ITOM, ServiceNow ITSM, and ServiceNow SecOps connectors. -type RunConnectorSubactionGetchoices struct { - // SubAction The action to test. - SubAction RunConnectorSubactionGetchoicesSubAction `json:"subAction"` - - // SubActionParams The set of configuration properties for the action. - SubActionParams struct { - // Fields An array of fields. - Fields []string `json:"fields"` - } `json:"subActionParams"` -} - -// RunConnectorSubactionGetchoicesSubAction The action to test. -type RunConnectorSubactionGetchoicesSubAction string - -// RunConnectorSubactionGetfields The `getFields` subaction for Jira, ServiceNow ITSM, and ServiceNow SecOps connectors. -type RunConnectorSubactionGetfields struct { - // SubAction The action to test. - SubAction RunConnectorSubactionGetfieldsSubAction `json:"subAction"` -} - -// RunConnectorSubactionGetfieldsSubAction The action to test. -type RunConnectorSubactionGetfieldsSubAction string - -// RunConnectorSubactionGetincident The `getIncident` subaction for Jira, ServiceNow ITSM, and ServiceNow SecOps connectors. -type RunConnectorSubactionGetincident struct { - // SubAction The action to test. - SubAction RunConnectorSubactionGetincidentSubAction `json:"subAction"` - SubActionParams struct { - // ExternalId The Jira, ServiceNow ITSM, or ServiceNow SecOps issue identifier. - ExternalId string `json:"externalId"` - } `json:"subActionParams"` -} - -// RunConnectorSubactionGetincidentSubAction The action to test. -type RunConnectorSubactionGetincidentSubAction string - -// RunConnectorSubactionIssue The `issue` subaction for Jira connectors. -type RunConnectorSubactionIssue struct { - // SubAction The action to test. - SubAction RunConnectorSubactionIssueSubAction `json:"subAction"` - SubActionParams *struct { - // Id The Jira issue identifier. - Id string `json:"id"` - } `json:"subActionParams,omitempty"` -} - -// RunConnectorSubactionIssueSubAction The action to test. -type RunConnectorSubactionIssueSubAction string - -// RunConnectorSubactionIssues The `issues` subaction for Jira connectors. -type RunConnectorSubactionIssues struct { - // SubAction The action to test. - SubAction RunConnectorSubactionIssuesSubAction `json:"subAction"` - SubActionParams struct { - // Title The title of the Jira issue. - Title string `json:"title"` - } `json:"subActionParams"` -} - -// RunConnectorSubactionIssuesSubAction The action to test. -type RunConnectorSubactionIssuesSubAction string - -// RunConnectorSubactionIssuetypes The `issueTypes` subaction for Jira connectors. -type RunConnectorSubactionIssuetypes struct { - // SubAction The action to test. - SubAction RunConnectorSubactionIssuetypesSubAction `json:"subAction"` -} - -// RunConnectorSubactionIssuetypesSubAction The action to test. -type RunConnectorSubactionIssuetypesSubAction string - -// RunConnectorSubactionPushtoservice The `pushToService` subaction for Jira, ServiceNow ITSM, ServiceNow SecOps, and Swimlane connectors. -type RunConnectorSubactionPushtoservice struct { - // SubAction The action to test. - SubAction RunConnectorSubactionPushtoserviceSubAction `json:"subAction"` - - // SubActionParams The set of configuration properties for the action. - SubActionParams struct { - // Comments Additional information that is sent to Jira, ServiceNow ITSM, ServiceNow SecOps, or Swimlane. - Comments *[]struct { - // Comment A comment related to the incident. For example, describe how to troubleshoot the issue. - Comment *string `json:"comment,omitempty"` - - // CommentId A unique identifier for the comment. - CommentId *int `json:"commentId,omitempty"` - } `json:"comments,omitempty"` - - // Incident Information necessary to create or update a Jira, ServiceNow ITSM, ServiveNow SecOps, or Swimlane incident. - Incident *struct { - // AlertId The alert identifier for Swimlane connectors. - AlertId *string `json:"alertId,omitempty"` - - // CaseId The case identifier for the incident for Swimlane connectors. - CaseId *string `json:"caseId,omitempty"` - - // CaseName The case name for the incident for Swimlane connectors. - CaseName *string `json:"caseName,omitempty"` - - // Category The category of the incident for ServiceNow ITSM and ServiceNow SecOps connectors. - Category *string `json:"category,omitempty"` - - // CorrelationDisplay A descriptive label of the alert for correlation purposes for ServiceNow ITSM and ServiceNow SecOps connectors. - CorrelationDisplay *string `json:"correlation_display,omitempty"` - - // CorrelationId The correlation identifier for the security incident for ServiceNow ITSM and ServiveNow SecOps connectors. Connectors using the same correlation ID are associated with the same ServiceNow incident. This value determines whether a new ServiceNow incident is created or an existing one is updated. Modifying this value is optional; if not modified, the rule ID and alert ID are combined as `{{ruleID}}:{{alert ID}}` to form the correlation ID value in ServiceNow. The maximum character length for this value is 100 characters. NOTE: Using the default configuration of `{{ruleID}}:{{alert ID}}` ensures that ServiceNow creates a separate incident record for every generated alert that uses a unique alert ID. If the rule generates multiple alerts that use the same alert IDs, ServiceNow creates and continually updates a single incident record for the alert. - CorrelationId *string `json:"correlation_id,omitempty"` - - // Description The description of the incident for Jira, ServiceNow ITSM, ServiceNow SecOps, and Swimlane connectors. - Description *string `json:"description,omitempty"` - - // DestIp A list of destination IP addresses related to the security incident for ServiceNow SecOps connectors. The IPs are added as observables to the security incident. - DestIp *RunConnectorSubactionPushtoservice_SubActionParams_Incident_DestIp `json:"dest_ip,omitempty"` - - // ExternalId The Jira, ServiceNow ITSM, or ServiceNow SecOps issue identifier. If present, the incident is updated. Otherwise, a new incident is created. - ExternalId *string `json:"externalId,omitempty"` - - // Impact The impact of the incident for ServiceNow ITSM connectors. - Impact *string `json:"impact,omitempty"` - - // IssueType The type of incident for Jira connectors. For example, 10006. To obtain the list of valid values, set `subAction` to `issueTypes`. - IssueType *int `json:"issueType,omitempty"` - - // Labels The labels for the incident for Jira connectors. NOTE: Labels cannot contain spaces. - Labels *[]string `json:"labels,omitempty"` - - // MalwareHash A list of malware hashes related to the security incident for ServiceNow SecOps connectors. The hashes are added as observables to the security incident. - MalwareHash *RunConnectorSubactionPushtoservice_SubActionParams_Incident_MalwareHash `json:"malware_hash,omitempty"` - - // MalwareUrl A list of malware URLs related to the security incident for ServiceNow SecOps connectors. The URLs are added as observables to the security incident. - MalwareUrl *string `json:"malware_url,omitempty"` - - // Parent The ID or key of the parent issue for Jira connectors. Applies only to `Sub-task` types of issues. - Parent *string `json:"parent,omitempty"` - - // Priority The priority of the incident in Jira and ServiceNow SecOps connectors. - Priority *string `json:"priority,omitempty"` - - // RuleName The rule name for Swimlane connectors. - RuleName *string `json:"ruleName,omitempty"` - - // Severity The severity of the incident for ServiceNow ITSM and Swimlane connectors. - Severity *string `json:"severity,omitempty"` - - // ShortDescription A short description of the incident for ServiceNow ITSM and ServiceNow SecOps connectors. It is used for searching the contents of the knowledge base. - ShortDescription *string `json:"short_description,omitempty"` - - // SourceIp A list of source IP addresses related to the security incident for ServiceNow SecOps connectors. The IPs are added as observables to the security incident. - SourceIp *RunConnectorSubactionPushtoservice_SubActionParams_Incident_SourceIp `json:"source_ip,omitempty"` - - // Subcategory The subcategory of the incident for ServiceNow ITSM and ServiceNow SecOps connectors. - Subcategory *string `json:"subcategory,omitempty"` - - // Summary A summary of the incident for Jira connectors. - Summary *string `json:"summary,omitempty"` - - // Title A title for the incident for Jira connectors. It is used for searching the contents of the knowledge base. - Title *string `json:"title,omitempty"` - - // Urgency The urgency of the incident for ServiceNow ITSM connectors. - Urgency *string `json:"urgency,omitempty"` - } `json:"incident,omitempty"` - } `json:"subActionParams"` -} - -// RunConnectorSubactionPushtoserviceSubAction The action to test. -type RunConnectorSubactionPushtoserviceSubAction string - -// RunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp0 defines model for . -type RunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp0 = string - -// RunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp1 defines model for . -type RunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp1 = []string - -// RunConnectorSubactionPushtoservice_SubActionParams_Incident_DestIp A list of destination IP addresses related to the security incident for ServiceNow SecOps connectors. The IPs are added as observables to the security incident. -type RunConnectorSubactionPushtoservice_SubActionParams_Incident_DestIp struct { - union json.RawMessage -} - -// RunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash0 defines model for . -type RunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash0 = string - -// RunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash1 defines model for . -type RunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash1 = []string - -// RunConnectorSubactionPushtoservice_SubActionParams_Incident_MalwareHash A list of malware hashes related to the security incident for ServiceNow SecOps connectors. The hashes are added as observables to the security incident. -type RunConnectorSubactionPushtoservice_SubActionParams_Incident_MalwareHash struct { - union json.RawMessage -} - -// RunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp0 defines model for . -type RunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp0 = string - -// RunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp1 defines model for . -type RunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp1 = []string - -// RunConnectorSubactionPushtoservice_SubActionParams_Incident_SourceIp A list of source IP addresses related to the security incident for ServiceNow SecOps connectors. The IPs are added as observables to the security incident. -type RunConnectorSubactionPushtoservice_SubActionParams_Incident_SourceIp struct { - union json.RawMessage -} - -// SecretsPropertiesCasesWebhook defines model for secrets_properties_cases_webhook. -type SecretsPropertiesCasesWebhook struct { - // Password The password for HTTP basic authentication. If `hasAuth` is set to `true`, this property is required. - Password *string `json:"password,omitempty"` - - // User The username for HTTP basic authentication. If `hasAuth` is set to `true`, this property is required. - User *string `json:"user,omitempty"` -} - -// SecretsPropertiesEmail Defines secrets for connectors when type is `.email`. -type SecretsPropertiesEmail map[string]interface{} - -// SecretsPropertiesGemini Defines secrets for connectors when type is `.gemini`. -type SecretsPropertiesGemini struct { - // CredentialsJson The service account credentials JSON file. The service account should have Vertex AI user IAM role assigned to it. - CredentialsJson string `json:"credentialsJson"` -} - -// SecretsPropertiesJira Defines secrets for connectors when type is `.jira`. -type SecretsPropertiesJira struct { - // ApiToken The Jira API authentication token for HTTP basic authentication. - ApiToken string `json:"apiToken"` - - // Email The account email for HTTP Basic authentication. - Email string `json:"email"` -} - -// SecretsPropertiesOpsgenie Defines secrets for connectors when type is `.opsgenie`. -type SecretsPropertiesOpsgenie struct { - // ApiKey The Opsgenie API authentication key for HTTP Basic authentication. - ApiKey string `json:"apiKey"` -} - -// SecretsPropertiesPagerduty Defines secrets for connectors when type is `.pagerduty`. -type SecretsPropertiesPagerduty map[string]interface{} - -// SecretsPropertiesResilient Defines secrets for connectors when type is `.resilient`. -type SecretsPropertiesResilient struct { - // ApiKeyId The authentication key ID for HTTP Basic authentication. - ApiKeyId string `json:"apiKeyId"` - - // ApiKeySecret The authentication key secret for HTTP Basic authentication. - ApiKeySecret string `json:"apiKeySecret"` -} - -// SecretsPropertiesServicenow Defines secrets for connectors when type is `.servicenow`, `.servicenow-sir`, or `.servicenow-itom`. -type SecretsPropertiesServicenow struct { - // ClientSecret The client secret assigned to your OAuth application. This property is required when `isOAuth` is `true`. - ClientSecret *string `json:"clientSecret,omitempty"` - - // Password The password for HTTP basic authentication. This property is required when `isOAuth` is `false`. - Password *string `json:"password,omitempty"` - - // PrivateKey The RSA private key that you created for use in ServiceNow. This property is required when `isOAuth` is `true`. - PrivateKey *string `json:"privateKey,omitempty"` - - // PrivateKeyPassword The password for the RSA private key. This property is required when `isOAuth` is `true` and you set a password on your private key. - PrivateKeyPassword *string `json:"privateKeyPassword,omitempty"` - - // Username The username for HTTP basic authentication. This property is required when `isOAuth` is `false`. - Username *string `json:"username,omitempty"` -} - -// SecretsPropertiesSlack Defines secrets for connectors when type is `.slack`. -type SecretsPropertiesSlack map[string]interface{} - -// SecretsPropertiesSlackApi Defines secrets for connectors when type is `.slack`. -type SecretsPropertiesSlackApi struct { - // Token Slack bot user OAuth token. - Token string `json:"token"` -} - -// SecretsPropertiesSwimlane Defines secrets for connectors when type is `.swimlane`. -type SecretsPropertiesSwimlane struct { - // ApiToken Swimlane API authentication token. - ApiToken *string `json:"apiToken,omitempty"` -} - -// SecretsPropertiesTeams Defines secrets for connectors when type is `.teams`. -type SecretsPropertiesTeams map[string]interface{} - -// SecretsPropertiesTines Defines secrets for connectors when type is `.tines`. -type SecretsPropertiesTines map[string]interface{} - -// SecretsPropertiesWebhook Defines secrets for connectors when type is `.webhook`. -type SecretsPropertiesWebhook map[string]interface{} - -// SecretsPropertiesXmatters Defines secrets for connectors when type is `.xmatters`. -type SecretsPropertiesXmatters map[string]interface{} - -// UpdateConnectorRequestCasesWebhook defines model for update_connector_request_cases_webhook. -type UpdateConnectorRequestCasesWebhook struct { - // Config Defines properties for connectors when type is `.cases-webhook`. - Config ConfigPropertiesCasesWebhook `json:"config"` - - // Name The display name for the connector. - Name string `json:"name"` - Secrets *SecretsPropertiesCasesWebhook `json:"secrets,omitempty"` -} - -// UpdateConnectorRequestEmail defines model for update_connector_request_email. -type UpdateConnectorRequestEmail struct { - // Config Defines properties for connectors when type is `.email`. - Config ConfigPropertiesEmail `json:"config"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.email`. - Secrets SecretsPropertiesEmail `json:"secrets"` -} - -// UpdateConnectorRequestGemini defines model for update_connector_request_gemini. -type UpdateConnectorRequestGemini struct { - // Config Defines properties for connectors when type is `.gemini`. - Config ConfigPropertiesGemini `json:"config"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.gemini`. - Secrets *SecretsPropertiesGemini `json:"secrets,omitempty"` -} - -// UpdateConnectorRequestIndex defines model for update_connector_request_index. -type UpdateConnectorRequestIndex struct { - // Config Defines properties for connectors when type is `.index`. - Config ConfigPropertiesIndex `json:"config"` - - // Name The display name for the connector. - Name string `json:"name"` -} - -// UpdateConnectorRequestJira defines model for update_connector_request_jira. -type UpdateConnectorRequestJira struct { - // Config Defines properties for connectors when type is `.jira`. - Config ConfigPropertiesJira `json:"config"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.jira`. - Secrets SecretsPropertiesJira `json:"secrets"` -} - -// UpdateConnectorRequestOpsgenie defines model for update_connector_request_opsgenie. -type UpdateConnectorRequestOpsgenie struct { - // Config Defines properties for connectors when type is `.opsgenie`. - Config ConfigPropertiesOpsgenie `json:"config"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.opsgenie`. - Secrets SecretsPropertiesOpsgenie `json:"secrets"` -} - -// UpdateConnectorRequestPagerduty The PagerDuty connector uses the v2 Events API to trigger, acknowledge, and resolve PagerDuty alerts. -type UpdateConnectorRequestPagerduty struct { - // Config Defines properties for connectors when type is `.pagerduty`. - Config ConfigPropertiesPagerduty `json:"config"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.pagerduty`. - Secrets SecretsPropertiesPagerduty `json:"secrets"` -} - -// UpdateConnectorRequestResilient defines model for update_connector_request_resilient. -type UpdateConnectorRequestResilient struct { - // Config Defines properties for connectors when type is `.resilient`. - Config ConfigPropertiesResilient `json:"config"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.resilient`. - Secrets SecretsPropertiesResilient `json:"secrets"` -} - -// UpdateConnectorRequestServerlog defines model for update_connector_request_serverlog. -type UpdateConnectorRequestServerlog struct { - // Name The display name for the connector. - Name string `json:"name"` -} - -// UpdateConnectorRequestServicenow defines model for update_connector_request_servicenow. -type UpdateConnectorRequestServicenow struct { - // Config Defines properties for connectors when type is `.servicenow`. - Config ConfigPropertiesServicenow `json:"config"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.servicenow`, `.servicenow-sir`, or `.servicenow-itom`. - Secrets SecretsPropertiesServicenow `json:"secrets"` -} - -// UpdateConnectorRequestServicenowItom defines model for update_connector_request_servicenow_itom. -type UpdateConnectorRequestServicenowItom struct { - // Config Defines properties for connectors when type is `.servicenow`. - Config ConfigPropertiesServicenowItom `json:"config"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.servicenow`, `.servicenow-sir`, or `.servicenow-itom`. - Secrets SecretsPropertiesServicenow `json:"secrets"` -} - -// UpdateConnectorRequestServicenowSir The ServiceNow SecOps connector uses the import set API to create ServiceNow security incidents. You can use the connector for rule actions and cases. -type UpdateConnectorRequestServicenowSir struct { - // Config Defines properties for connectors when type is `.servicenow`. - Config ConfigPropertiesServicenow `json:"config"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.servicenow`, `.servicenow-sir`, or `.servicenow-itom`. - Secrets SecretsPropertiesServicenow `json:"secrets"` -} - -// UpdateConnectorRequestSlack The Slack connector uses Slack Incoming Webhooks. -type UpdateConnectorRequestSlack struct { - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.slack`. - Secrets SecretsPropertiesSlack `json:"secrets"` -} - -// UpdateConnectorRequestSlackApi defines model for update_connector_request_slack_api. -type UpdateConnectorRequestSlackApi struct { - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.slack`. - Secrets SecretsPropertiesSlackApi `json:"secrets"` -} - -// UpdateConnectorRequestSwimlane defines model for update_connector_request_swimlane. -type UpdateConnectorRequestSwimlane struct { - // Config Defines properties for connectors when type is `.swimlane`. - Config ConfigPropertiesSwimlane `json:"config"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.swimlane`. - Secrets SecretsPropertiesSwimlane `json:"secrets"` -} - -// UpdateConnectorRequestTeams The Microsoft Teams connector uses Incoming Webhooks. -type UpdateConnectorRequestTeams struct { - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.teams`. - Secrets SecretsPropertiesTeams `json:"secrets"` -} - -// UpdateConnectorRequestTines The Tines connector uses Tines Webhook actions to send events via POST request. -type UpdateConnectorRequestTines struct { - // Config Defines properties for connectors when type is `.tines`. - Config ConfigPropertiesTines `json:"config"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.tines`. - Secrets SecretsPropertiesTines `json:"secrets"` -} - -// UpdateConnectorRequestWebhook The Webhook connector uses axios to send a POST or PUT request to a web service. -type UpdateConnectorRequestWebhook struct { - // Config Defines properties for connectors when type is `.webhook`. - Config ConfigPropertiesWebhook `json:"config"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.webhook`. - Secrets SecretsPropertiesWebhook `json:"secrets"` -} - -// UpdateConnectorRequestXmatters The xMatters connector uses the xMatters Workflow for Elastic to send actionable alerts to on-call xMatters resources. -type UpdateConnectorRequestXmatters struct { - // Config Defines properties for connectors when type is `.xmatters`. - Config ConfigPropertiesXmatters `json:"config"` - - // Name The display name for the connector. - Name string `json:"name"` - - // Secrets Defines secrets for connectors when type is `.xmatters`. - Secrets SecretsPropertiesXmatters `json:"secrets"` -} - -// ActionId defines model for action_id. -type ActionId = string - -// ConnectorId defines model for connector_id. -type ConnectorId = string - -// KbnXsrf defines model for kbn_xsrf. -type KbnXsrf = string - -// SpaceId defines model for space_id. -type SpaceId = string - -// N200Actions The properties vary depending on the action type. -type N200Actions = ActionResponseProperties - -// LegacyCreateConnectorJSONBody defines parameters for LegacyCreateConnector. -type LegacyCreateConnectorJSONBody struct { - // ActionTypeId The connector type identifier. - ActionTypeId *string `json:"actionTypeId,omitempty"` - - // Config The configuration for the connector. Configuration properties vary depending on the connector type. - Config *map[string]interface{} `json:"config,omitempty"` - - // Name The display name for the connector. - Name *string `json:"name,omitempty"` - - // Secrets The secrets configuration for the connector. Secrets configuration properties vary depending on the connector type. NOTE: Remember these values. You must provide them each time you update the connector. - Secrets *map[string]interface{} `json:"secrets,omitempty"` -} - -// LegacyCreateConnectorParams defines parameters for LegacyCreateConnector. -type LegacyCreateConnectorParams struct { - // KbnXsrf Cross-site request forgery protection - KbnXsrf KbnXsrf `json:"kbn-xsrf"` -} - -// LegacyDeleteConnectorParams defines parameters for LegacyDeleteConnector. -type LegacyDeleteConnectorParams struct { - // KbnXsrf Cross-site request forgery protection - KbnXsrf KbnXsrf `json:"kbn-xsrf"` -} - -// LegacyUpdateConnectorJSONBody defines parameters for LegacyUpdateConnector. -type LegacyUpdateConnectorJSONBody struct { - // Config The new connector configuration. Configuration properties vary depending on the connector type. - Config *map[string]interface{} `json:"config,omitempty"` - - // Name The new name for the connector. - Name *string `json:"name,omitempty"` - - // Secrets The updated secrets configuration for the connector. Secrets properties vary depending on the connector type. - Secrets *map[string]interface{} `json:"secrets,omitempty"` -} - -// LegacyUpdateConnectorParams defines parameters for LegacyUpdateConnector. -type LegacyUpdateConnectorParams struct { - // KbnXsrf Cross-site request forgery protection - KbnXsrf KbnXsrf `json:"kbn-xsrf"` -} - -// LegacyRunConnectorJSONBody defines parameters for LegacyRunConnector. -type LegacyRunConnectorJSONBody struct { - // Params The parameters of the connector. Parameter properties vary depending on the connector type. - Params map[string]interface{} `json:"params"` -} - -// LegacyRunConnectorParams defines parameters for LegacyRunConnector. -type LegacyRunConnectorParams struct { - // KbnXsrf Cross-site request forgery protection - KbnXsrf KbnXsrf `json:"kbn-xsrf"` -} - -// CreateConnectorJSONBody defines parameters for CreateConnector. -type CreateConnectorJSONBody struct { - union json.RawMessage -} - -// CreateConnectorParams defines parameters for CreateConnector. -type CreateConnectorParams struct { - // KbnXsrf Cross-site request forgery protection - KbnXsrf KbnXsrf `json:"kbn-xsrf"` -} - -// DeleteConnectorParams defines parameters for DeleteConnector. -type DeleteConnectorParams struct { - // KbnXsrf Cross-site request forgery protection - KbnXsrf KbnXsrf `json:"kbn-xsrf"` -} - -// UpdateConnectorJSONBody defines parameters for UpdateConnector. -type UpdateConnectorJSONBody struct { - union json.RawMessage -} - -// UpdateConnectorParams defines parameters for UpdateConnector. -type UpdateConnectorParams struct { - // KbnXsrf Cross-site request forgery protection - KbnXsrf KbnXsrf `json:"kbn-xsrf"` -} - -// RunConnectorJSONBody defines parameters for RunConnector. -type RunConnectorJSONBody struct { - Params RunConnectorJSONBody_Params `json:"params"` -} - -// RunConnectorParams defines parameters for RunConnector. -type RunConnectorParams struct { - // KbnXsrf Cross-site request forgery protection - KbnXsrf KbnXsrf `json:"kbn-xsrf"` -} - -// RunConnectorJSONBodyParams2 defines parameters for RunConnector. -type RunConnectorJSONBodyParams2 struct { - union json.RawMessage -} - -// RunConnectorJSONBody_Params defines parameters for RunConnector. -type RunConnectorJSONBody_Params struct { - union json.RawMessage -} - -// GetConnectorTypesParams defines parameters for GetConnectorTypes. -type GetConnectorTypesParams struct { - // FeatureId A filter to limit the retrieved connector types to those that support a specific feature (such as alerting or cases). - FeatureId *Features `form:"feature_id,omitempty" json:"feature_id,omitempty"` -} - -// LegacyCreateConnectorJSONRequestBody defines body for LegacyCreateConnector for application/json ContentType. -type LegacyCreateConnectorJSONRequestBody LegacyCreateConnectorJSONBody - -// LegacyUpdateConnectorJSONRequestBody defines body for LegacyUpdateConnector for application/json ContentType. -type LegacyUpdateConnectorJSONRequestBody LegacyUpdateConnectorJSONBody - -// LegacyRunConnectorJSONRequestBody defines body for LegacyRunConnector for application/json ContentType. -type LegacyRunConnectorJSONRequestBody LegacyRunConnectorJSONBody - -// CreateConnectorJSONRequestBody defines body for CreateConnector for application/json ContentType. -type CreateConnectorJSONRequestBody CreateConnectorJSONBody - -// UpdateConnectorJSONRequestBody defines body for UpdateConnector for application/json ContentType. -type UpdateConnectorJSONRequestBody UpdateConnectorJSONBody - -// RunConnectorJSONRequestBody defines body for RunConnector for application/json ContentType. -type RunConnectorJSONRequestBody RunConnectorJSONBody - -// AsConnectorResponsePropertiesCasesWebhook returns the union data inside the ConnectorResponseProperties as a ConnectorResponsePropertiesCasesWebhook -func (t ConnectorResponseProperties) AsConnectorResponsePropertiesCasesWebhook() (ConnectorResponsePropertiesCasesWebhook, error) { - var body ConnectorResponsePropertiesCasesWebhook - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromConnectorResponsePropertiesCasesWebhook overwrites any union data inside the ConnectorResponseProperties as the provided ConnectorResponsePropertiesCasesWebhook -func (t *ConnectorResponseProperties) FromConnectorResponsePropertiesCasesWebhook(v ConnectorResponsePropertiesCasesWebhook) error { - v.ConnectorTypeId = ".cases-webhook" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeConnectorResponsePropertiesCasesWebhook performs a merge with any union data inside the ConnectorResponseProperties, using the provided ConnectorResponsePropertiesCasesWebhook -func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesCasesWebhook(v ConnectorResponsePropertiesCasesWebhook) error { - v.ConnectorTypeId = ".cases-webhook" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsConnectorResponsePropertiesEmail returns the union data inside the ConnectorResponseProperties as a ConnectorResponsePropertiesEmail -func (t ConnectorResponseProperties) AsConnectorResponsePropertiesEmail() (ConnectorResponsePropertiesEmail, error) { - var body ConnectorResponsePropertiesEmail - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromConnectorResponsePropertiesEmail overwrites any union data inside the ConnectorResponseProperties as the provided ConnectorResponsePropertiesEmail -func (t *ConnectorResponseProperties) FromConnectorResponsePropertiesEmail(v ConnectorResponsePropertiesEmail) error { - v.ConnectorTypeId = ".email" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeConnectorResponsePropertiesEmail performs a merge with any union data inside the ConnectorResponseProperties, using the provided ConnectorResponsePropertiesEmail -func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesEmail(v ConnectorResponsePropertiesEmail) error { - v.ConnectorTypeId = ".email" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsConnectorResponsePropertiesGemini returns the union data inside the ConnectorResponseProperties as a ConnectorResponsePropertiesGemini -func (t ConnectorResponseProperties) AsConnectorResponsePropertiesGemini() (ConnectorResponsePropertiesGemini, error) { - var body ConnectorResponsePropertiesGemini - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromConnectorResponsePropertiesGemini overwrites any union data inside the ConnectorResponseProperties as the provided ConnectorResponsePropertiesGemini -func (t *ConnectorResponseProperties) FromConnectorResponsePropertiesGemini(v ConnectorResponsePropertiesGemini) error { - v.ConnectorTypeId = ".gemini" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeConnectorResponsePropertiesGemini performs a merge with any union data inside the ConnectorResponseProperties, using the provided ConnectorResponsePropertiesGemini -func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesGemini(v ConnectorResponsePropertiesGemini) error { - v.ConnectorTypeId = ".gemini" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsConnectorResponsePropertiesIndex returns the union data inside the ConnectorResponseProperties as a ConnectorResponsePropertiesIndex -func (t ConnectorResponseProperties) AsConnectorResponsePropertiesIndex() (ConnectorResponsePropertiesIndex, error) { - var body ConnectorResponsePropertiesIndex - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromConnectorResponsePropertiesIndex overwrites any union data inside the ConnectorResponseProperties as the provided ConnectorResponsePropertiesIndex -func (t *ConnectorResponseProperties) FromConnectorResponsePropertiesIndex(v ConnectorResponsePropertiesIndex) error { - v.ConnectorTypeId = ".index" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeConnectorResponsePropertiesIndex performs a merge with any union data inside the ConnectorResponseProperties, using the provided ConnectorResponsePropertiesIndex -func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesIndex(v ConnectorResponsePropertiesIndex) error { - v.ConnectorTypeId = ".index" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsConnectorResponsePropertiesJira returns the union data inside the ConnectorResponseProperties as a ConnectorResponsePropertiesJira -func (t ConnectorResponseProperties) AsConnectorResponsePropertiesJira() (ConnectorResponsePropertiesJira, error) { - var body ConnectorResponsePropertiesJira - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromConnectorResponsePropertiesJira overwrites any union data inside the ConnectorResponseProperties as the provided ConnectorResponsePropertiesJira -func (t *ConnectorResponseProperties) FromConnectorResponsePropertiesJira(v ConnectorResponsePropertiesJira) error { - v.ConnectorTypeId = ".jira" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeConnectorResponsePropertiesJira performs a merge with any union data inside the ConnectorResponseProperties, using the provided ConnectorResponsePropertiesJira -func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesJira(v ConnectorResponsePropertiesJira) error { - v.ConnectorTypeId = ".jira" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsConnectorResponsePropertiesOpsgenie returns the union data inside the ConnectorResponseProperties as a ConnectorResponsePropertiesOpsgenie -func (t ConnectorResponseProperties) AsConnectorResponsePropertiesOpsgenie() (ConnectorResponsePropertiesOpsgenie, error) { - var body ConnectorResponsePropertiesOpsgenie - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromConnectorResponsePropertiesOpsgenie overwrites any union data inside the ConnectorResponseProperties as the provided ConnectorResponsePropertiesOpsgenie -func (t *ConnectorResponseProperties) FromConnectorResponsePropertiesOpsgenie(v ConnectorResponsePropertiesOpsgenie) error { - v.ConnectorTypeId = ".opsgenie" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeConnectorResponsePropertiesOpsgenie performs a merge with any union data inside the ConnectorResponseProperties, using the provided ConnectorResponsePropertiesOpsgenie -func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesOpsgenie(v ConnectorResponsePropertiesOpsgenie) error { - v.ConnectorTypeId = ".opsgenie" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsConnectorResponsePropertiesPagerduty returns the union data inside the ConnectorResponseProperties as a ConnectorResponsePropertiesPagerduty -func (t ConnectorResponseProperties) AsConnectorResponsePropertiesPagerduty() (ConnectorResponsePropertiesPagerduty, error) { - var body ConnectorResponsePropertiesPagerduty - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromConnectorResponsePropertiesPagerduty overwrites any union data inside the ConnectorResponseProperties as the provided ConnectorResponsePropertiesPagerduty -func (t *ConnectorResponseProperties) FromConnectorResponsePropertiesPagerduty(v ConnectorResponsePropertiesPagerduty) error { - v.ConnectorTypeId = ".pagerduty" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeConnectorResponsePropertiesPagerduty performs a merge with any union data inside the ConnectorResponseProperties, using the provided ConnectorResponsePropertiesPagerduty -func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesPagerduty(v ConnectorResponsePropertiesPagerduty) error { - v.ConnectorTypeId = ".pagerduty" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsConnectorResponsePropertiesResilient returns the union data inside the ConnectorResponseProperties as a ConnectorResponsePropertiesResilient -func (t ConnectorResponseProperties) AsConnectorResponsePropertiesResilient() (ConnectorResponsePropertiesResilient, error) { - var body ConnectorResponsePropertiesResilient - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromConnectorResponsePropertiesResilient overwrites any union data inside the ConnectorResponseProperties as the provided ConnectorResponsePropertiesResilient -func (t *ConnectorResponseProperties) FromConnectorResponsePropertiesResilient(v ConnectorResponsePropertiesResilient) error { - v.ConnectorTypeId = ".resilient" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeConnectorResponsePropertiesResilient performs a merge with any union data inside the ConnectorResponseProperties, using the provided ConnectorResponsePropertiesResilient -func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesResilient(v ConnectorResponsePropertiesResilient) error { - v.ConnectorTypeId = ".resilient" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsConnectorResponsePropertiesServerlog returns the union data inside the ConnectorResponseProperties as a ConnectorResponsePropertiesServerlog -func (t ConnectorResponseProperties) AsConnectorResponsePropertiesServerlog() (ConnectorResponsePropertiesServerlog, error) { - var body ConnectorResponsePropertiesServerlog - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromConnectorResponsePropertiesServerlog overwrites any union data inside the ConnectorResponseProperties as the provided ConnectorResponsePropertiesServerlog -func (t *ConnectorResponseProperties) FromConnectorResponsePropertiesServerlog(v ConnectorResponsePropertiesServerlog) error { - v.ConnectorTypeId = ".server-log" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeConnectorResponsePropertiesServerlog performs a merge with any union data inside the ConnectorResponseProperties, using the provided ConnectorResponsePropertiesServerlog -func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesServerlog(v ConnectorResponsePropertiesServerlog) error { - v.ConnectorTypeId = ".server-log" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsConnectorResponsePropertiesServicenow returns the union data inside the ConnectorResponseProperties as a ConnectorResponsePropertiesServicenow -func (t ConnectorResponseProperties) AsConnectorResponsePropertiesServicenow() (ConnectorResponsePropertiesServicenow, error) { - var body ConnectorResponsePropertiesServicenow - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromConnectorResponsePropertiesServicenow overwrites any union data inside the ConnectorResponseProperties as the provided ConnectorResponsePropertiesServicenow -func (t *ConnectorResponseProperties) FromConnectorResponsePropertiesServicenow(v ConnectorResponsePropertiesServicenow) error { - v.ConnectorTypeId = ".servicenow" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeConnectorResponsePropertiesServicenow performs a merge with any union data inside the ConnectorResponseProperties, using the provided ConnectorResponsePropertiesServicenow -func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesServicenow(v ConnectorResponsePropertiesServicenow) error { - v.ConnectorTypeId = ".servicenow" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsConnectorResponsePropertiesServicenowItom returns the union data inside the ConnectorResponseProperties as a ConnectorResponsePropertiesServicenowItom -func (t ConnectorResponseProperties) AsConnectorResponsePropertiesServicenowItom() (ConnectorResponsePropertiesServicenowItom, error) { - var body ConnectorResponsePropertiesServicenowItom - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromConnectorResponsePropertiesServicenowItom overwrites any union data inside the ConnectorResponseProperties as the provided ConnectorResponsePropertiesServicenowItom -func (t *ConnectorResponseProperties) FromConnectorResponsePropertiesServicenowItom(v ConnectorResponsePropertiesServicenowItom) error { - v.ConnectorTypeId = ".servicenow-itom" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeConnectorResponsePropertiesServicenowItom performs a merge with any union data inside the ConnectorResponseProperties, using the provided ConnectorResponsePropertiesServicenowItom -func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesServicenowItom(v ConnectorResponsePropertiesServicenowItom) error { - v.ConnectorTypeId = ".servicenow-itom" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsConnectorResponsePropertiesServicenowSir returns the union data inside the ConnectorResponseProperties as a ConnectorResponsePropertiesServicenowSir -func (t ConnectorResponseProperties) AsConnectorResponsePropertiesServicenowSir() (ConnectorResponsePropertiesServicenowSir, error) { - var body ConnectorResponsePropertiesServicenowSir - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromConnectorResponsePropertiesServicenowSir overwrites any union data inside the ConnectorResponseProperties as the provided ConnectorResponsePropertiesServicenowSir -func (t *ConnectorResponseProperties) FromConnectorResponsePropertiesServicenowSir(v ConnectorResponsePropertiesServicenowSir) error { - v.ConnectorTypeId = ".servicenow-sir" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeConnectorResponsePropertiesServicenowSir performs a merge with any union data inside the ConnectorResponseProperties, using the provided ConnectorResponsePropertiesServicenowSir -func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesServicenowSir(v ConnectorResponsePropertiesServicenowSir) error { - v.ConnectorTypeId = ".servicenow-sir" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsConnectorResponsePropertiesSlack returns the union data inside the ConnectorResponseProperties as a ConnectorResponsePropertiesSlack -func (t ConnectorResponseProperties) AsConnectorResponsePropertiesSlack() (ConnectorResponsePropertiesSlack, error) { - var body ConnectorResponsePropertiesSlack - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromConnectorResponsePropertiesSlack overwrites any union data inside the ConnectorResponseProperties as the provided ConnectorResponsePropertiesSlack -func (t *ConnectorResponseProperties) FromConnectorResponsePropertiesSlack(v ConnectorResponsePropertiesSlack) error { - v.ConnectorTypeId = ".slack" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeConnectorResponsePropertiesSlack performs a merge with any union data inside the ConnectorResponseProperties, using the provided ConnectorResponsePropertiesSlack -func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesSlack(v ConnectorResponsePropertiesSlack) error { - v.ConnectorTypeId = ".slack" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsConnectorResponsePropertiesSlackApi returns the union data inside the ConnectorResponseProperties as a ConnectorResponsePropertiesSlackApi -func (t ConnectorResponseProperties) AsConnectorResponsePropertiesSlackApi() (ConnectorResponsePropertiesSlackApi, error) { - var body ConnectorResponsePropertiesSlackApi - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromConnectorResponsePropertiesSlackApi overwrites any union data inside the ConnectorResponseProperties as the provided ConnectorResponsePropertiesSlackApi -func (t *ConnectorResponseProperties) FromConnectorResponsePropertiesSlackApi(v ConnectorResponsePropertiesSlackApi) error { - v.ConnectorTypeId = ".slack_api" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeConnectorResponsePropertiesSlackApi performs a merge with any union data inside the ConnectorResponseProperties, using the provided ConnectorResponsePropertiesSlackApi -func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesSlackApi(v ConnectorResponsePropertiesSlackApi) error { - v.ConnectorTypeId = ".slack_api" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsConnectorResponsePropertiesSwimlane returns the union data inside the ConnectorResponseProperties as a ConnectorResponsePropertiesSwimlane -func (t ConnectorResponseProperties) AsConnectorResponsePropertiesSwimlane() (ConnectorResponsePropertiesSwimlane, error) { - var body ConnectorResponsePropertiesSwimlane - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromConnectorResponsePropertiesSwimlane overwrites any union data inside the ConnectorResponseProperties as the provided ConnectorResponsePropertiesSwimlane -func (t *ConnectorResponseProperties) FromConnectorResponsePropertiesSwimlane(v ConnectorResponsePropertiesSwimlane) error { - v.ConnectorTypeId = ".swimlane" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeConnectorResponsePropertiesSwimlane performs a merge with any union data inside the ConnectorResponseProperties, using the provided ConnectorResponsePropertiesSwimlane -func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesSwimlane(v ConnectorResponsePropertiesSwimlane) error { - v.ConnectorTypeId = ".swimlane" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsConnectorResponsePropertiesTeams returns the union data inside the ConnectorResponseProperties as a ConnectorResponsePropertiesTeams -func (t ConnectorResponseProperties) AsConnectorResponsePropertiesTeams() (ConnectorResponsePropertiesTeams, error) { - var body ConnectorResponsePropertiesTeams - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromConnectorResponsePropertiesTeams overwrites any union data inside the ConnectorResponseProperties as the provided ConnectorResponsePropertiesTeams -func (t *ConnectorResponseProperties) FromConnectorResponsePropertiesTeams(v ConnectorResponsePropertiesTeams) error { - v.ConnectorTypeId = ".teams" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeConnectorResponsePropertiesTeams performs a merge with any union data inside the ConnectorResponseProperties, using the provided ConnectorResponsePropertiesTeams -func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesTeams(v ConnectorResponsePropertiesTeams) error { - v.ConnectorTypeId = ".teams" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsConnectorResponsePropertiesTines returns the union data inside the ConnectorResponseProperties as a ConnectorResponsePropertiesTines -func (t ConnectorResponseProperties) AsConnectorResponsePropertiesTines() (ConnectorResponsePropertiesTines, error) { - var body ConnectorResponsePropertiesTines - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromConnectorResponsePropertiesTines overwrites any union data inside the ConnectorResponseProperties as the provided ConnectorResponsePropertiesTines -func (t *ConnectorResponseProperties) FromConnectorResponsePropertiesTines(v ConnectorResponsePropertiesTines) error { - v.ConnectorTypeId = ".tines" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeConnectorResponsePropertiesTines performs a merge with any union data inside the ConnectorResponseProperties, using the provided ConnectorResponsePropertiesTines -func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesTines(v ConnectorResponsePropertiesTines) error { - v.ConnectorTypeId = ".tines" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsConnectorResponsePropertiesWebhook returns the union data inside the ConnectorResponseProperties as a ConnectorResponsePropertiesWebhook -func (t ConnectorResponseProperties) AsConnectorResponsePropertiesWebhook() (ConnectorResponsePropertiesWebhook, error) { - var body ConnectorResponsePropertiesWebhook - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromConnectorResponsePropertiesWebhook overwrites any union data inside the ConnectorResponseProperties as the provided ConnectorResponsePropertiesWebhook -func (t *ConnectorResponseProperties) FromConnectorResponsePropertiesWebhook(v ConnectorResponsePropertiesWebhook) error { - v.ConnectorTypeId = ".webhook" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeConnectorResponsePropertiesWebhook performs a merge with any union data inside the ConnectorResponseProperties, using the provided ConnectorResponsePropertiesWebhook -func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesWebhook(v ConnectorResponsePropertiesWebhook) error { - v.ConnectorTypeId = ".webhook" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsConnectorResponsePropertiesXmatters returns the union data inside the ConnectorResponseProperties as a ConnectorResponsePropertiesXmatters -func (t ConnectorResponseProperties) AsConnectorResponsePropertiesXmatters() (ConnectorResponsePropertiesXmatters, error) { - var body ConnectorResponsePropertiesXmatters - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromConnectorResponsePropertiesXmatters overwrites any union data inside the ConnectorResponseProperties as the provided ConnectorResponsePropertiesXmatters -func (t *ConnectorResponseProperties) FromConnectorResponsePropertiesXmatters(v ConnectorResponsePropertiesXmatters) error { - v.ConnectorTypeId = ".xmatters" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeConnectorResponsePropertiesXmatters performs a merge with any union data inside the ConnectorResponseProperties, using the provided ConnectorResponsePropertiesXmatters -func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesXmatters(v ConnectorResponsePropertiesXmatters) error { - v.ConnectorTypeId = ".xmatters" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t ConnectorResponseProperties) Discriminator() (string, error) { - var discriminator struct { - Discriminator string `json:"connector_type_id"` - } - err := json.Unmarshal(t.union, &discriminator) - return discriminator.Discriminator, err -} - -func (t ConnectorResponseProperties) ValueByDiscriminator() (interface{}, error) { - discriminator, err := t.Discriminator() - if err != nil { - return nil, err - } - switch discriminator { - case ".cases-webhook": - return t.AsConnectorResponsePropertiesCasesWebhook() - case ".email": - return t.AsConnectorResponsePropertiesEmail() - case ".gemini": - return t.AsConnectorResponsePropertiesGemini() - case ".index": - return t.AsConnectorResponsePropertiesIndex() - case ".jira": - return t.AsConnectorResponsePropertiesJira() - case ".opsgenie": - return t.AsConnectorResponsePropertiesOpsgenie() - case ".pagerduty": - return t.AsConnectorResponsePropertiesPagerduty() - case ".resilient": - return t.AsConnectorResponsePropertiesResilient() - case ".server-log": - return t.AsConnectorResponsePropertiesServerlog() - case ".servicenow": - return t.AsConnectorResponsePropertiesServicenow() - case ".servicenow-itom": - return t.AsConnectorResponsePropertiesServicenowItom() - case ".servicenow-sir": - return t.AsConnectorResponsePropertiesServicenowSir() - case ".slack": - return t.AsConnectorResponsePropertiesSlack() - case ".slack_api": - return t.AsConnectorResponsePropertiesSlackApi() - case ".swimlane": - return t.AsConnectorResponsePropertiesSwimlane() - case ".teams": - return t.AsConnectorResponsePropertiesTeams() - case ".tines": - return t.AsConnectorResponsePropertiesTines() - case ".webhook": - return t.AsConnectorResponsePropertiesWebhook() - case ".xmatters": - return t.AsConnectorResponsePropertiesXmatters() - default: - return nil, errors.New("unknown discriminator value: " + discriminator) - } -} - -func (t ConnectorResponseProperties) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *ConnectorResponseProperties) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsLegacyRunConnectorGeneralResponseData0 returns the union data inside the LegacyRunConnectorGeneralResponse_Data as a LegacyRunConnectorGeneralResponseData0 -func (t LegacyRunConnectorGeneralResponse_Data) AsLegacyRunConnectorGeneralResponseData0() (LegacyRunConnectorGeneralResponseData0, error) { - var body LegacyRunConnectorGeneralResponseData0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromLegacyRunConnectorGeneralResponseData0 overwrites any union data inside the LegacyRunConnectorGeneralResponse_Data as the provided LegacyRunConnectorGeneralResponseData0 -func (t *LegacyRunConnectorGeneralResponse_Data) FromLegacyRunConnectorGeneralResponseData0(v LegacyRunConnectorGeneralResponseData0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeLegacyRunConnectorGeneralResponseData0 performs a merge with any union data inside the LegacyRunConnectorGeneralResponse_Data, using the provided LegacyRunConnectorGeneralResponseData0 -func (t *LegacyRunConnectorGeneralResponse_Data) MergeLegacyRunConnectorGeneralResponseData0(v LegacyRunConnectorGeneralResponseData0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsLegacyRunConnectorGeneralResponseData1 returns the union data inside the LegacyRunConnectorGeneralResponse_Data as a LegacyRunConnectorGeneralResponseData1 -func (t LegacyRunConnectorGeneralResponse_Data) AsLegacyRunConnectorGeneralResponseData1() (LegacyRunConnectorGeneralResponseData1, error) { - var body LegacyRunConnectorGeneralResponseData1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromLegacyRunConnectorGeneralResponseData1 overwrites any union data inside the LegacyRunConnectorGeneralResponse_Data as the provided LegacyRunConnectorGeneralResponseData1 -func (t *LegacyRunConnectorGeneralResponse_Data) FromLegacyRunConnectorGeneralResponseData1(v LegacyRunConnectorGeneralResponseData1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeLegacyRunConnectorGeneralResponseData1 performs a merge with any union data inside the LegacyRunConnectorGeneralResponse_Data, using the provided LegacyRunConnectorGeneralResponseData1 -func (t *LegacyRunConnectorGeneralResponse_Data) MergeLegacyRunConnectorGeneralResponseData1(v LegacyRunConnectorGeneralResponseData1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t LegacyRunConnectorGeneralResponse_Data) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *LegacyRunConnectorGeneralResponse_Data) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsRunConnectorGeneralResponseData0 returns the union data inside the RunConnectorGeneralResponse_Data as a RunConnectorGeneralResponseData0 -func (t RunConnectorGeneralResponse_Data) AsRunConnectorGeneralResponseData0() (RunConnectorGeneralResponseData0, error) { - var body RunConnectorGeneralResponseData0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromRunConnectorGeneralResponseData0 overwrites any union data inside the RunConnectorGeneralResponse_Data as the provided RunConnectorGeneralResponseData0 -func (t *RunConnectorGeneralResponse_Data) FromRunConnectorGeneralResponseData0(v RunConnectorGeneralResponseData0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeRunConnectorGeneralResponseData0 performs a merge with any union data inside the RunConnectorGeneralResponse_Data, using the provided RunConnectorGeneralResponseData0 -func (t *RunConnectorGeneralResponse_Data) MergeRunConnectorGeneralResponseData0(v RunConnectorGeneralResponseData0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsRunConnectorGeneralResponseData1 returns the union data inside the RunConnectorGeneralResponse_Data as a RunConnectorGeneralResponseData1 -func (t RunConnectorGeneralResponse_Data) AsRunConnectorGeneralResponseData1() (RunConnectorGeneralResponseData1, error) { - var body RunConnectorGeneralResponseData1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromRunConnectorGeneralResponseData1 overwrites any union data inside the RunConnectorGeneralResponse_Data as the provided RunConnectorGeneralResponseData1 -func (t *RunConnectorGeneralResponse_Data) FromRunConnectorGeneralResponseData1(v RunConnectorGeneralResponseData1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeRunConnectorGeneralResponseData1 performs a merge with any union data inside the RunConnectorGeneralResponse_Data, using the provided RunConnectorGeneralResponseData1 -func (t *RunConnectorGeneralResponse_Data) MergeRunConnectorGeneralResponseData1(v RunConnectorGeneralResponseData1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t RunConnectorGeneralResponse_Data) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *RunConnectorGeneralResponse_Data) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsRunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp0 returns the union data inside the RunConnectorSubactionPushtoservice_SubActionParams_Incident_DestIp as a RunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp0 -func (t RunConnectorSubactionPushtoservice_SubActionParams_Incident_DestIp) AsRunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp0() (RunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp0, error) { - var body RunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromRunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp0 overwrites any union data inside the RunConnectorSubactionPushtoservice_SubActionParams_Incident_DestIp as the provided RunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp0 -func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_DestIp) FromRunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp0(v RunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeRunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp0 performs a merge with any union data inside the RunConnectorSubactionPushtoservice_SubActionParams_Incident_DestIp, using the provided RunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp0 -func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_DestIp) MergeRunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp0(v RunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsRunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp1 returns the union data inside the RunConnectorSubactionPushtoservice_SubActionParams_Incident_DestIp as a RunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp1 -func (t RunConnectorSubactionPushtoservice_SubActionParams_Incident_DestIp) AsRunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp1() (RunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp1, error) { - var body RunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromRunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp1 overwrites any union data inside the RunConnectorSubactionPushtoservice_SubActionParams_Incident_DestIp as the provided RunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp1 -func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_DestIp) FromRunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp1(v RunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeRunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp1 performs a merge with any union data inside the RunConnectorSubactionPushtoservice_SubActionParams_Incident_DestIp, using the provided RunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp1 -func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_DestIp) MergeRunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp1(v RunConnectorSubactionPushtoserviceSubActionParamsIncidentDestIp1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t RunConnectorSubactionPushtoservice_SubActionParams_Incident_DestIp) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_DestIp) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsRunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash0 returns the union data inside the RunConnectorSubactionPushtoservice_SubActionParams_Incident_MalwareHash as a RunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash0 -func (t RunConnectorSubactionPushtoservice_SubActionParams_Incident_MalwareHash) AsRunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash0() (RunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash0, error) { - var body RunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromRunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash0 overwrites any union data inside the RunConnectorSubactionPushtoservice_SubActionParams_Incident_MalwareHash as the provided RunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash0 -func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_MalwareHash) FromRunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash0(v RunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeRunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash0 performs a merge with any union data inside the RunConnectorSubactionPushtoservice_SubActionParams_Incident_MalwareHash, using the provided RunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash0 -func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_MalwareHash) MergeRunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash0(v RunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsRunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash1 returns the union data inside the RunConnectorSubactionPushtoservice_SubActionParams_Incident_MalwareHash as a RunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash1 -func (t RunConnectorSubactionPushtoservice_SubActionParams_Incident_MalwareHash) AsRunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash1() (RunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash1, error) { - var body RunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromRunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash1 overwrites any union data inside the RunConnectorSubactionPushtoservice_SubActionParams_Incident_MalwareHash as the provided RunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash1 -func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_MalwareHash) FromRunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash1(v RunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeRunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash1 performs a merge with any union data inside the RunConnectorSubactionPushtoservice_SubActionParams_Incident_MalwareHash, using the provided RunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash1 -func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_MalwareHash) MergeRunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash1(v RunConnectorSubactionPushtoserviceSubActionParamsIncidentMalwareHash1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t RunConnectorSubactionPushtoservice_SubActionParams_Incident_MalwareHash) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_MalwareHash) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsRunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp0 returns the union data inside the RunConnectorSubactionPushtoservice_SubActionParams_Incident_SourceIp as a RunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp0 -func (t RunConnectorSubactionPushtoservice_SubActionParams_Incident_SourceIp) AsRunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp0() (RunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp0, error) { - var body RunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromRunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp0 overwrites any union data inside the RunConnectorSubactionPushtoservice_SubActionParams_Incident_SourceIp as the provided RunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp0 -func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_SourceIp) FromRunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp0(v RunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeRunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp0 performs a merge with any union data inside the RunConnectorSubactionPushtoservice_SubActionParams_Incident_SourceIp, using the provided RunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp0 -func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_SourceIp) MergeRunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp0(v RunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsRunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp1 returns the union data inside the RunConnectorSubactionPushtoservice_SubActionParams_Incident_SourceIp as a RunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp1 -func (t RunConnectorSubactionPushtoservice_SubActionParams_Incident_SourceIp) AsRunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp1() (RunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp1, error) { - var body RunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromRunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp1 overwrites any union data inside the RunConnectorSubactionPushtoservice_SubActionParams_Incident_SourceIp as the provided RunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp1 -func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_SourceIp) FromRunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp1(v RunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeRunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp1 performs a merge with any union data inside the RunConnectorSubactionPushtoservice_SubActionParams_Incident_SourceIp, using the provided RunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp1 -func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_SourceIp) MergeRunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp1(v RunConnectorSubactionPushtoserviceSubActionParamsIncidentSourceIp1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t RunConnectorSubactionPushtoservice_SubActionParams_Incident_SourceIp) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_SourceIp) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// RequestEditorFn is the function signature for the RequestEditor callback function -type RequestEditorFn func(ctx context.Context, req *http.Request) error - -// Doer performs HTTP requests. -// -// The standard http.Client implements this interface. -type HttpRequestDoer interface { - Do(req *http.Request) (*http.Response, error) -} - -// Client which conforms to the OpenAPI3 specification for this service. -type Client struct { - // The endpoint of the server conforming to this interface, with scheme, - // https://api.deepmap.com for example. This can contain a path relative - // to the server, such as https://api.deepmap.com/dev-test, and all the - // paths in the swagger spec will be appended to the server. - Server string - - // Doer for performing requests, typically a *http.Client with any - // customized settings, such as certificate chains. - Client HttpRequestDoer - - // A list of callbacks for modifying requests which are generated before sending over - // the network. - RequestEditors []RequestEditorFn -} - -// ClientOption allows setting custom parameters during construction -type ClientOption func(*Client) error - -// Creates a new Client, with reasonable defaults -func NewClient(server string, opts ...ClientOption) (*Client, error) { - // create a client with sane default values - client := Client{ - Server: server, - } - // mutate client and add all optional params - for _, o := range opts { - if err := o(&client); err != nil { - return nil, err - } - } - // ensure the server URL always has a trailing slash - if !strings.HasSuffix(client.Server, "/") { - client.Server += "/" - } - // create httpClient, if not already present - if client.Client == nil { - client.Client = &http.Client{} - } - return &client, nil -} - -// WithHTTPClient allows overriding the default Doer, which is -// automatically created using http.Client. This is useful for tests. -func WithHTTPClient(doer HttpRequestDoer) ClientOption { - return func(c *Client) error { - c.Client = doer - return nil - } -} - -// WithRequestEditorFn allows setting up a callback function, which will be -// called right before sending the request. This can be used to mutate the request. -func WithRequestEditorFn(fn RequestEditorFn) ClientOption { - return func(c *Client) error { - c.RequestEditors = append(c.RequestEditors, fn) - return nil - } -} - -// The interface specification for the client above. -type ClientInterface interface { - // LegacyGetConnectors request - LegacyGetConnectors(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) - - // LegacyCreateConnectorWithBody request with any body - LegacyCreateConnectorWithBody(ctx context.Context, spaceId SpaceId, params *LegacyCreateConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - LegacyCreateConnector(ctx context.Context, spaceId SpaceId, params *LegacyCreateConnectorParams, body LegacyCreateConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // LegacyDeleteConnector request - LegacyDeleteConnector(ctx context.Context, spaceId SpaceId, actionId ActionId, params *LegacyDeleteConnectorParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // LegacyGetConnector request - LegacyGetConnector(ctx context.Context, spaceId SpaceId, actionId ActionId, reqEditors ...RequestEditorFn) (*http.Response, error) - - // LegacyUpdateConnectorWithBody request with any body - LegacyUpdateConnectorWithBody(ctx context.Context, spaceId SpaceId, actionId ActionId, params *LegacyUpdateConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - LegacyUpdateConnector(ctx context.Context, spaceId SpaceId, actionId ActionId, params *LegacyUpdateConnectorParams, body LegacyUpdateConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // LegacyRunConnectorWithBody request with any body - LegacyRunConnectorWithBody(ctx context.Context, spaceId SpaceId, actionId ActionId, params *LegacyRunConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - LegacyRunConnector(ctx context.Context, spaceId SpaceId, actionId ActionId, params *LegacyRunConnectorParams, body LegacyRunConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // CreateConnectorWithBody request with any body - CreateConnectorWithBody(ctx context.Context, spaceId SpaceId, params *CreateConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - CreateConnector(ctx context.Context, spaceId SpaceId, params *CreateConnectorParams, body CreateConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DeleteConnector request - DeleteConnector(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, params *DeleteConnectorParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetConnector request - GetConnector(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, reqEditors ...RequestEditorFn) (*http.Response, error) - - // UpdateConnectorWithBody request with any body - UpdateConnectorWithBody(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, params *UpdateConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - UpdateConnector(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, params *UpdateConnectorParams, body UpdateConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // RunConnectorWithBody request with any body - RunConnectorWithBody(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, params *RunConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - RunConnector(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, params *RunConnectorParams, body RunConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetConnectorTypes request - GetConnectorTypes(ctx context.Context, spaceId SpaceId, params *GetConnectorTypesParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetConnectors request - GetConnectors(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) - - // LegacyGetConnectorTypes request - LegacyGetConnectorTypes(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) -} - -func (c *Client) LegacyGetConnectors(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewLegacyGetConnectorsRequest(c.Server, spaceId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) LegacyCreateConnectorWithBody(ctx context.Context, spaceId SpaceId, params *LegacyCreateConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewLegacyCreateConnectorRequestWithBody(c.Server, spaceId, params, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) LegacyCreateConnector(ctx context.Context, spaceId SpaceId, params *LegacyCreateConnectorParams, body LegacyCreateConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewLegacyCreateConnectorRequest(c.Server, spaceId, params, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) LegacyDeleteConnector(ctx context.Context, spaceId SpaceId, actionId ActionId, params *LegacyDeleteConnectorParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewLegacyDeleteConnectorRequest(c.Server, spaceId, actionId, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) LegacyGetConnector(ctx context.Context, spaceId SpaceId, actionId ActionId, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewLegacyGetConnectorRequest(c.Server, spaceId, actionId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) LegacyUpdateConnectorWithBody(ctx context.Context, spaceId SpaceId, actionId ActionId, params *LegacyUpdateConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewLegacyUpdateConnectorRequestWithBody(c.Server, spaceId, actionId, params, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) LegacyUpdateConnector(ctx context.Context, spaceId SpaceId, actionId ActionId, params *LegacyUpdateConnectorParams, body LegacyUpdateConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewLegacyUpdateConnectorRequest(c.Server, spaceId, actionId, params, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) LegacyRunConnectorWithBody(ctx context.Context, spaceId SpaceId, actionId ActionId, params *LegacyRunConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewLegacyRunConnectorRequestWithBody(c.Server, spaceId, actionId, params, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) LegacyRunConnector(ctx context.Context, spaceId SpaceId, actionId ActionId, params *LegacyRunConnectorParams, body LegacyRunConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewLegacyRunConnectorRequest(c.Server, spaceId, actionId, params, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CreateConnectorWithBody(ctx context.Context, spaceId SpaceId, params *CreateConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateConnectorRequestWithBody(c.Server, spaceId, params, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CreateConnector(ctx context.Context, spaceId SpaceId, params *CreateConnectorParams, body CreateConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateConnectorRequest(c.Server, spaceId, params, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) DeleteConnector(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, params *DeleteConnectorParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteConnectorRequest(c.Server, spaceId, connectorId, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetConnector(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetConnectorRequest(c.Server, spaceId, connectorId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateConnectorWithBody(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, params *UpdateConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateConnectorRequestWithBody(c.Server, spaceId, connectorId, params, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateConnector(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, params *UpdateConnectorParams, body UpdateConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateConnectorRequest(c.Server, spaceId, connectorId, params, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) RunConnectorWithBody(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, params *RunConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRunConnectorRequestWithBody(c.Server, spaceId, connectorId, params, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) RunConnector(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, params *RunConnectorParams, body RunConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRunConnectorRequest(c.Server, spaceId, connectorId, params, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetConnectorTypes(ctx context.Context, spaceId SpaceId, params *GetConnectorTypesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetConnectorTypesRequest(c.Server, spaceId, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetConnectors(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetConnectorsRequest(c.Server, spaceId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) LegacyGetConnectorTypes(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewLegacyGetConnectorTypesRequest(c.Server, spaceId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -// NewLegacyGetConnectorsRequest generates requests for LegacyGetConnectors -func NewLegacyGetConnectorsRequest(server string, spaceId SpaceId) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/s/%s/api/actions", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewLegacyCreateConnectorRequest calls the generic LegacyCreateConnector builder with application/json body -func NewLegacyCreateConnectorRequest(server string, spaceId SpaceId, params *LegacyCreateConnectorParams, body LegacyCreateConnectorJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewLegacyCreateConnectorRequestWithBody(server, spaceId, params, "application/json", bodyReader) -} - -// NewLegacyCreateConnectorRequestWithBody generates requests for LegacyCreateConnector with any type of body -func NewLegacyCreateConnectorRequestWithBody(server string, spaceId SpaceId, params *LegacyCreateConnectorParams, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/s/%s/api/actions", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - if params != nil { - - var headerParam0 string - - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "kbn-xsrf", runtime.ParamLocationHeader, params.KbnXsrf) - if err != nil { - return nil, err - } - - req.Header.Set("kbn-xsrf", headerParam0) - - } - - return req, nil -} - -// NewLegacyDeleteConnectorRequest generates requests for LegacyDeleteConnector -func NewLegacyDeleteConnectorRequest(server string, spaceId SpaceId, actionId ActionId, params *LegacyDeleteConnectorParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "actionId", runtime.ParamLocationPath, actionId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/s/%s/api/actions/action/%s", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("DELETE", queryURL.String(), nil) - if err != nil { - return nil, err - } - - if params != nil { - - var headerParam0 string - - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "kbn-xsrf", runtime.ParamLocationHeader, params.KbnXsrf) - if err != nil { - return nil, err - } - - req.Header.Set("kbn-xsrf", headerParam0) - - } - - return req, nil -} - -// NewLegacyGetConnectorRequest generates requests for LegacyGetConnector -func NewLegacyGetConnectorRequest(server string, spaceId SpaceId, actionId ActionId) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "actionId", runtime.ParamLocationPath, actionId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/s/%s/api/actions/action/%s", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewLegacyUpdateConnectorRequest calls the generic LegacyUpdateConnector builder with application/json body -func NewLegacyUpdateConnectorRequest(server string, spaceId SpaceId, actionId ActionId, params *LegacyUpdateConnectorParams, body LegacyUpdateConnectorJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewLegacyUpdateConnectorRequestWithBody(server, spaceId, actionId, params, "application/json", bodyReader) -} - -// NewLegacyUpdateConnectorRequestWithBody generates requests for LegacyUpdateConnector with any type of body -func NewLegacyUpdateConnectorRequestWithBody(server string, spaceId SpaceId, actionId ActionId, params *LegacyUpdateConnectorParams, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "actionId", runtime.ParamLocationPath, actionId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/s/%s/api/actions/action/%s", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PUT", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - if params != nil { - - var headerParam0 string - - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "kbn-xsrf", runtime.ParamLocationHeader, params.KbnXsrf) - if err != nil { - return nil, err - } - - req.Header.Set("kbn-xsrf", headerParam0) - - } - - return req, nil -} - -// NewLegacyRunConnectorRequest calls the generic LegacyRunConnector builder with application/json body -func NewLegacyRunConnectorRequest(server string, spaceId SpaceId, actionId ActionId, params *LegacyRunConnectorParams, body LegacyRunConnectorJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewLegacyRunConnectorRequestWithBody(server, spaceId, actionId, params, "application/json", bodyReader) -} - -// NewLegacyRunConnectorRequestWithBody generates requests for LegacyRunConnector with any type of body -func NewLegacyRunConnectorRequestWithBody(server string, spaceId SpaceId, actionId ActionId, params *LegacyRunConnectorParams, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "actionId", runtime.ParamLocationPath, actionId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/s/%s/api/actions/action/%s/_execute", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - if params != nil { - - var headerParam0 string - - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "kbn-xsrf", runtime.ParamLocationHeader, params.KbnXsrf) - if err != nil { - return nil, err - } - - req.Header.Set("kbn-xsrf", headerParam0) - - } - - return req, nil -} - -// NewCreateConnectorRequest calls the generic CreateConnector builder with application/json body -func NewCreateConnectorRequest(server string, spaceId SpaceId, params *CreateConnectorParams, body CreateConnectorJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreateConnectorRequestWithBody(server, spaceId, params, "application/json", bodyReader) -} - -// NewCreateConnectorRequestWithBody generates requests for CreateConnector with any type of body -func NewCreateConnectorRequestWithBody(server string, spaceId SpaceId, params *CreateConnectorParams, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/s/%s/api/actions/connector", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - if params != nil { - - var headerParam0 string - - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "kbn-xsrf", runtime.ParamLocationHeader, params.KbnXsrf) - if err != nil { - return nil, err - } - - req.Header.Set("kbn-xsrf", headerParam0) - - } - - return req, nil -} - -// NewDeleteConnectorRequest generates requests for DeleteConnector -func NewDeleteConnectorRequest(server string, spaceId SpaceId, connectorId ConnectorId, params *DeleteConnectorParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "connectorId", runtime.ParamLocationPath, connectorId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/s/%s/api/actions/connector/%s", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("DELETE", queryURL.String(), nil) - if err != nil { - return nil, err - } - - if params != nil { - - var headerParam0 string - - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "kbn-xsrf", runtime.ParamLocationHeader, params.KbnXsrf) - if err != nil { - return nil, err - } - - req.Header.Set("kbn-xsrf", headerParam0) - - } - - return req, nil -} - -// NewGetConnectorRequest generates requests for GetConnector -func NewGetConnectorRequest(server string, spaceId SpaceId, connectorId ConnectorId) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "connectorId", runtime.ParamLocationPath, connectorId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/s/%s/api/actions/connector/%s", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewUpdateConnectorRequest calls the generic UpdateConnector builder with application/json body -func NewUpdateConnectorRequest(server string, spaceId SpaceId, connectorId ConnectorId, params *UpdateConnectorParams, body UpdateConnectorJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewUpdateConnectorRequestWithBody(server, spaceId, connectorId, params, "application/json", bodyReader) -} - -// NewUpdateConnectorRequestWithBody generates requests for UpdateConnector with any type of body -func NewUpdateConnectorRequestWithBody(server string, spaceId SpaceId, connectorId ConnectorId, params *UpdateConnectorParams, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "connectorId", runtime.ParamLocationPath, connectorId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/s/%s/api/actions/connector/%s", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PUT", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - if params != nil { - - var headerParam0 string - - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "kbn-xsrf", runtime.ParamLocationHeader, params.KbnXsrf) - if err != nil { - return nil, err - } - - req.Header.Set("kbn-xsrf", headerParam0) - - } - - return req, nil -} - -// NewRunConnectorRequest calls the generic RunConnector builder with application/json body -func NewRunConnectorRequest(server string, spaceId SpaceId, connectorId ConnectorId, params *RunConnectorParams, body RunConnectorJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewRunConnectorRequestWithBody(server, spaceId, connectorId, params, "application/json", bodyReader) -} - -// NewRunConnectorRequestWithBody generates requests for RunConnector with any type of body -func NewRunConnectorRequestWithBody(server string, spaceId SpaceId, connectorId ConnectorId, params *RunConnectorParams, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "connectorId", runtime.ParamLocationPath, connectorId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/s/%s/api/actions/connector/%s/_execute", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - if params != nil { - - var headerParam0 string - - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "kbn-xsrf", runtime.ParamLocationHeader, params.KbnXsrf) - if err != nil { - return nil, err - } - - req.Header.Set("kbn-xsrf", headerParam0) - - } - - return req, nil -} - -// NewGetConnectorTypesRequest generates requests for GetConnectorTypes -func NewGetConnectorTypesRequest(server string, spaceId SpaceId, params *GetConnectorTypesParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/s/%s/api/actions/connector_types", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.FeatureId != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "feature_id", runtime.ParamLocationQuery, *params.FeatureId); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetConnectorsRequest generates requests for GetConnectors -func NewGetConnectorsRequest(server string, spaceId SpaceId) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/s/%s/api/actions/connectors", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewLegacyGetConnectorTypesRequest generates requests for LegacyGetConnectorTypes -func NewLegacyGetConnectorTypesRequest(server string, spaceId SpaceId) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/s/%s/api/actions/list_action_types", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { - for _, r := range c.RequestEditors { - if err := r(ctx, req); err != nil { - return err - } - } - for _, r := range additionalEditors { - if err := r(ctx, req); err != nil { - return err - } - } - return nil -} - -// ClientWithResponses builds on ClientInterface to offer response payloads -type ClientWithResponses struct { - ClientInterface -} - -// NewClientWithResponses creates a new ClientWithResponses, which wraps -// Client with return type handling -func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { - client, err := NewClient(server, opts...) - if err != nil { - return nil, err - } - return &ClientWithResponses{client}, nil -} - -// WithBaseURL overrides the baseURL. -func WithBaseURL(baseURL string) ClientOption { - return func(c *Client) error { - newBaseURL, err := url.Parse(baseURL) - if err != nil { - return err - } - c.Server = newBaseURL.String() - return nil - } -} - -// ClientWithResponsesInterface is the interface specification for the client with responses above. -type ClientWithResponsesInterface interface { - // LegacyGetConnectorsWithResponse request - LegacyGetConnectorsWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*LegacyGetConnectorsResponse, error) - - // LegacyCreateConnectorWithBodyWithResponse request with any body - LegacyCreateConnectorWithBodyWithResponse(ctx context.Context, spaceId SpaceId, params *LegacyCreateConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LegacyCreateConnectorResponse, error) - - LegacyCreateConnectorWithResponse(ctx context.Context, spaceId SpaceId, params *LegacyCreateConnectorParams, body LegacyCreateConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*LegacyCreateConnectorResponse, error) - - // LegacyDeleteConnectorWithResponse request - LegacyDeleteConnectorWithResponse(ctx context.Context, spaceId SpaceId, actionId ActionId, params *LegacyDeleteConnectorParams, reqEditors ...RequestEditorFn) (*LegacyDeleteConnectorResponse, error) - - // LegacyGetConnectorWithResponse request - LegacyGetConnectorWithResponse(ctx context.Context, spaceId SpaceId, actionId ActionId, reqEditors ...RequestEditorFn) (*LegacyGetConnectorResponse, error) - - // LegacyUpdateConnectorWithBodyWithResponse request with any body - LegacyUpdateConnectorWithBodyWithResponse(ctx context.Context, spaceId SpaceId, actionId ActionId, params *LegacyUpdateConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LegacyUpdateConnectorResponse, error) - - LegacyUpdateConnectorWithResponse(ctx context.Context, spaceId SpaceId, actionId ActionId, params *LegacyUpdateConnectorParams, body LegacyUpdateConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*LegacyUpdateConnectorResponse, error) - - // LegacyRunConnectorWithBodyWithResponse request with any body - LegacyRunConnectorWithBodyWithResponse(ctx context.Context, spaceId SpaceId, actionId ActionId, params *LegacyRunConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LegacyRunConnectorResponse, error) - - LegacyRunConnectorWithResponse(ctx context.Context, spaceId SpaceId, actionId ActionId, params *LegacyRunConnectorParams, body LegacyRunConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*LegacyRunConnectorResponse, error) - - // CreateConnectorWithBodyWithResponse request with any body - CreateConnectorWithBodyWithResponse(ctx context.Context, spaceId SpaceId, params *CreateConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateConnectorResponse, error) - - CreateConnectorWithResponse(ctx context.Context, spaceId SpaceId, params *CreateConnectorParams, body CreateConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateConnectorResponse, error) - - // DeleteConnectorWithResponse request - DeleteConnectorWithResponse(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, params *DeleteConnectorParams, reqEditors ...RequestEditorFn) (*DeleteConnectorResponse, error) - - // GetConnectorWithResponse request - GetConnectorWithResponse(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, reqEditors ...RequestEditorFn) (*GetConnectorResponse, error) - - // UpdateConnectorWithBodyWithResponse request with any body - UpdateConnectorWithBodyWithResponse(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, params *UpdateConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateConnectorResponse, error) - - UpdateConnectorWithResponse(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, params *UpdateConnectorParams, body UpdateConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateConnectorResponse, error) - - // RunConnectorWithBodyWithResponse request with any body - RunConnectorWithBodyWithResponse(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, params *RunConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RunConnectorResponse, error) - - RunConnectorWithResponse(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, params *RunConnectorParams, body RunConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*RunConnectorResponse, error) - - // GetConnectorTypesWithResponse request - GetConnectorTypesWithResponse(ctx context.Context, spaceId SpaceId, params *GetConnectorTypesParams, reqEditors ...RequestEditorFn) (*GetConnectorTypesResponse, error) - - // GetConnectorsWithResponse request - GetConnectorsWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*GetConnectorsResponse, error) - - // LegacyGetConnectorTypesWithResponse request - LegacyGetConnectorTypesWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*LegacyGetConnectorTypesResponse, error) -} - -type LegacyGetConnectorsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]ActionResponseProperties - JSON401 *AuthorizationError -} - -// Status returns HTTPResponse.Status -func (r LegacyGetConnectorsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r LegacyGetConnectorsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type LegacyCreateConnectorResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *N200Actions - JSON401 *AuthorizationError -} - -// Status returns HTTPResponse.Status -func (r LegacyCreateConnectorResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r LegacyCreateConnectorResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type LegacyDeleteConnectorResponse struct { - Body []byte - HTTPResponse *http.Response - JSON401 *AuthorizationError -} - -// Status returns HTTPResponse.Status -func (r LegacyDeleteConnectorResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r LegacyDeleteConnectorResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type LegacyGetConnectorResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *N200Actions - JSON401 *AuthorizationError -} - -// Status returns HTTPResponse.Status -func (r LegacyGetConnectorResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r LegacyGetConnectorResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type LegacyUpdateConnectorResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *N200Actions - JSON404 *ObjectNotFoundError -} - -// Status returns HTTPResponse.Status -func (r LegacyUpdateConnectorResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r LegacyUpdateConnectorResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type LegacyRunConnectorResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *LegacyRunConnectorGeneralResponse - JSON401 *AuthorizationError -} - -// Status returns HTTPResponse.Status -func (r LegacyRunConnectorResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r LegacyRunConnectorResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type CreateConnectorResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *ConnectorResponseProperties - JSON400 *BadRequestError - JSON401 *AuthorizationError -} - -// Status returns HTTPResponse.Status -func (r CreateConnectorResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r CreateConnectorResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type DeleteConnectorResponse struct { - Body []byte - HTTPResponse *http.Response - JSON401 *AuthorizationError - JSON404 *struct { - Error *string `json:"error,omitempty"` - Message *string `json:"message,omitempty"` - StatusCode *int `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r DeleteConnectorResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteConnectorResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetConnectorResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *ConnectorResponseProperties - JSON401 *AuthorizationError - JSON404 *struct { - Error *string `json:"error,omitempty"` - Message *string `json:"message,omitempty"` - StatusCode *int `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r GetConnectorResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetConnectorResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type UpdateConnectorResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *ConnectorResponseProperties - JSON400 *BadRequestError - JSON401 *AuthorizationError - JSON404 *ObjectNotFoundError -} - -// Status returns HTTPResponse.Status -func (r UpdateConnectorResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateConnectorResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type RunConnectorResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *RunConnectorGeneralResponse - JSON401 *AuthorizationError -} - -// Status returns HTTPResponse.Status -func (r RunConnectorResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r RunConnectorResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetConnectorTypesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]struct { - // Enabled Indicates whether the connector type is enabled in Kibana. - Enabled *bool `json:"enabled,omitempty"` - - // EnabledInConfig Indicates whether the connector type is enabled in the Kibana `.yml` file. - EnabledInConfig *bool `json:"enabled_in_config,omitempty"` - - // EnabledInLicense Indicates whether the connector is enabled in the license. - EnabledInLicense *bool `json:"enabled_in_license,omitempty"` - - // Id The type of connector. For example, `.email`, `.index`, `.jira`, `.opsgenie`, or `.server-log`. - Id *ConnectorTypes `json:"id,omitempty"` - - // MinimumLicenseRequired The license that is required to use the connector type. - MinimumLicenseRequired *string `json:"minimum_license_required,omitempty"` - - // Name The name of the connector type. - Name *string `json:"name,omitempty"` - - // SupportedFeatureIds The Kibana features that are supported by the connector type. - SupportedFeatureIds *[]Features `json:"supported_feature_ids,omitempty"` - } - JSON401 *AuthorizationError -} - -// Status returns HTTPResponse.Status -func (r GetConnectorTypesResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetConnectorTypesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetConnectorsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]struct { - // Config The configuration for the connector. Configuration properties vary depending on the connector type. - Config *map[string]interface{} `json:"config"` - - // ConnectorTypeId The type of connector. For example, `.email`, `.index`, `.jira`, `.opsgenie`, or `.server-log`. - ConnectorTypeId ConnectorTypes `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` - - // ReferencedByCount Indicates the number of saved objects that reference the connector. If `is_preconfigured` is true, this value is not calculated. - ReferencedByCount int `json:"referenced_by_count"` - } - JSON401 *AuthorizationError -} - -// Status returns HTTPResponse.Status -func (r GetConnectorsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetConnectorsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type LegacyGetConnectorTypesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]struct { - // Enabled Indicates whether the connector type is enabled in Kibana. - Enabled *bool `json:"enabled,omitempty"` - - // EnabledInConfig Indicates whether the connector type is enabled in the Kibana `.yml` file. - EnabledInConfig *bool `json:"enabledInConfig,omitempty"` - - // EnabledInLicense Indicates whether the connector is enabled in the license. - EnabledInLicense *bool `json:"enabledInLicense,omitempty"` - - // Id The unique identifier for the connector type. - Id *string `json:"id,omitempty"` - - // MinimumLicenseRequired The license that is required to use the connector type. - MinimumLicenseRequired *string `json:"minimumLicenseRequired,omitempty"` - - // Name The name of the connector type. - Name *string `json:"name,omitempty"` - } - JSON401 *AuthorizationError -} - -// Status returns HTTPResponse.Status -func (r LegacyGetConnectorTypesResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r LegacyGetConnectorTypesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -// LegacyGetConnectorsWithResponse request returning *LegacyGetConnectorsResponse -func (c *ClientWithResponses) LegacyGetConnectorsWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*LegacyGetConnectorsResponse, error) { - rsp, err := c.LegacyGetConnectors(ctx, spaceId, reqEditors...) - if err != nil { - return nil, err - } - return ParseLegacyGetConnectorsResponse(rsp) -} - -// LegacyCreateConnectorWithBodyWithResponse request with arbitrary body returning *LegacyCreateConnectorResponse -func (c *ClientWithResponses) LegacyCreateConnectorWithBodyWithResponse(ctx context.Context, spaceId SpaceId, params *LegacyCreateConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LegacyCreateConnectorResponse, error) { - rsp, err := c.LegacyCreateConnectorWithBody(ctx, spaceId, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseLegacyCreateConnectorResponse(rsp) -} - -func (c *ClientWithResponses) LegacyCreateConnectorWithResponse(ctx context.Context, spaceId SpaceId, params *LegacyCreateConnectorParams, body LegacyCreateConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*LegacyCreateConnectorResponse, error) { - rsp, err := c.LegacyCreateConnector(ctx, spaceId, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseLegacyCreateConnectorResponse(rsp) -} - -// LegacyDeleteConnectorWithResponse request returning *LegacyDeleteConnectorResponse -func (c *ClientWithResponses) LegacyDeleteConnectorWithResponse(ctx context.Context, spaceId SpaceId, actionId ActionId, params *LegacyDeleteConnectorParams, reqEditors ...RequestEditorFn) (*LegacyDeleteConnectorResponse, error) { - rsp, err := c.LegacyDeleteConnector(ctx, spaceId, actionId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseLegacyDeleteConnectorResponse(rsp) -} - -// LegacyGetConnectorWithResponse request returning *LegacyGetConnectorResponse -func (c *ClientWithResponses) LegacyGetConnectorWithResponse(ctx context.Context, spaceId SpaceId, actionId ActionId, reqEditors ...RequestEditorFn) (*LegacyGetConnectorResponse, error) { - rsp, err := c.LegacyGetConnector(ctx, spaceId, actionId, reqEditors...) - if err != nil { - return nil, err - } - return ParseLegacyGetConnectorResponse(rsp) -} - -// LegacyUpdateConnectorWithBodyWithResponse request with arbitrary body returning *LegacyUpdateConnectorResponse -func (c *ClientWithResponses) LegacyUpdateConnectorWithBodyWithResponse(ctx context.Context, spaceId SpaceId, actionId ActionId, params *LegacyUpdateConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LegacyUpdateConnectorResponse, error) { - rsp, err := c.LegacyUpdateConnectorWithBody(ctx, spaceId, actionId, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseLegacyUpdateConnectorResponse(rsp) -} - -func (c *ClientWithResponses) LegacyUpdateConnectorWithResponse(ctx context.Context, spaceId SpaceId, actionId ActionId, params *LegacyUpdateConnectorParams, body LegacyUpdateConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*LegacyUpdateConnectorResponse, error) { - rsp, err := c.LegacyUpdateConnector(ctx, spaceId, actionId, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseLegacyUpdateConnectorResponse(rsp) -} - -// LegacyRunConnectorWithBodyWithResponse request with arbitrary body returning *LegacyRunConnectorResponse -func (c *ClientWithResponses) LegacyRunConnectorWithBodyWithResponse(ctx context.Context, spaceId SpaceId, actionId ActionId, params *LegacyRunConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LegacyRunConnectorResponse, error) { - rsp, err := c.LegacyRunConnectorWithBody(ctx, spaceId, actionId, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseLegacyRunConnectorResponse(rsp) -} - -func (c *ClientWithResponses) LegacyRunConnectorWithResponse(ctx context.Context, spaceId SpaceId, actionId ActionId, params *LegacyRunConnectorParams, body LegacyRunConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*LegacyRunConnectorResponse, error) { - rsp, err := c.LegacyRunConnector(ctx, spaceId, actionId, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseLegacyRunConnectorResponse(rsp) -} - -// CreateConnectorWithBodyWithResponse request with arbitrary body returning *CreateConnectorResponse -func (c *ClientWithResponses) CreateConnectorWithBodyWithResponse(ctx context.Context, spaceId SpaceId, params *CreateConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateConnectorResponse, error) { - rsp, err := c.CreateConnectorWithBody(ctx, spaceId, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateConnectorResponse(rsp) -} - -func (c *ClientWithResponses) CreateConnectorWithResponse(ctx context.Context, spaceId SpaceId, params *CreateConnectorParams, body CreateConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateConnectorResponse, error) { - rsp, err := c.CreateConnector(ctx, spaceId, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateConnectorResponse(rsp) -} - -// DeleteConnectorWithResponse request returning *DeleteConnectorResponse -func (c *ClientWithResponses) DeleteConnectorWithResponse(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, params *DeleteConnectorParams, reqEditors ...RequestEditorFn) (*DeleteConnectorResponse, error) { - rsp, err := c.DeleteConnector(ctx, spaceId, connectorId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteConnectorResponse(rsp) -} - -// GetConnectorWithResponse request returning *GetConnectorResponse -func (c *ClientWithResponses) GetConnectorWithResponse(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, reqEditors ...RequestEditorFn) (*GetConnectorResponse, error) { - rsp, err := c.GetConnector(ctx, spaceId, connectorId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetConnectorResponse(rsp) -} - -// UpdateConnectorWithBodyWithResponse request with arbitrary body returning *UpdateConnectorResponse -func (c *ClientWithResponses) UpdateConnectorWithBodyWithResponse(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, params *UpdateConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateConnectorResponse, error) { - rsp, err := c.UpdateConnectorWithBody(ctx, spaceId, connectorId, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateConnectorResponse(rsp) -} - -func (c *ClientWithResponses) UpdateConnectorWithResponse(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, params *UpdateConnectorParams, body UpdateConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateConnectorResponse, error) { - rsp, err := c.UpdateConnector(ctx, spaceId, connectorId, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateConnectorResponse(rsp) -} - -// RunConnectorWithBodyWithResponse request with arbitrary body returning *RunConnectorResponse -func (c *ClientWithResponses) RunConnectorWithBodyWithResponse(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, params *RunConnectorParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RunConnectorResponse, error) { - rsp, err := c.RunConnectorWithBody(ctx, spaceId, connectorId, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseRunConnectorResponse(rsp) -} - -func (c *ClientWithResponses) RunConnectorWithResponse(ctx context.Context, spaceId SpaceId, connectorId ConnectorId, params *RunConnectorParams, body RunConnectorJSONRequestBody, reqEditors ...RequestEditorFn) (*RunConnectorResponse, error) { - rsp, err := c.RunConnector(ctx, spaceId, connectorId, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseRunConnectorResponse(rsp) -} - -// GetConnectorTypesWithResponse request returning *GetConnectorTypesResponse -func (c *ClientWithResponses) GetConnectorTypesWithResponse(ctx context.Context, spaceId SpaceId, params *GetConnectorTypesParams, reqEditors ...RequestEditorFn) (*GetConnectorTypesResponse, error) { - rsp, err := c.GetConnectorTypes(ctx, spaceId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetConnectorTypesResponse(rsp) -} - -// GetConnectorsWithResponse request returning *GetConnectorsResponse -func (c *ClientWithResponses) GetConnectorsWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*GetConnectorsResponse, error) { - rsp, err := c.GetConnectors(ctx, spaceId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetConnectorsResponse(rsp) -} - -// LegacyGetConnectorTypesWithResponse request returning *LegacyGetConnectorTypesResponse -func (c *ClientWithResponses) LegacyGetConnectorTypesWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*LegacyGetConnectorTypesResponse, error) { - rsp, err := c.LegacyGetConnectorTypes(ctx, spaceId, reqEditors...) - if err != nil { - return nil, err - } - return ParseLegacyGetConnectorTypesResponse(rsp) -} - -// ParseLegacyGetConnectorsResponse parses an HTTP response from a LegacyGetConnectorsWithResponse call -func ParseLegacyGetConnectorsResponse(rsp *http.Response) (*LegacyGetConnectorsResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &LegacyGetConnectorsResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []ActionResponseProperties - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest AuthorizationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - } - - return response, nil -} - -// ParseLegacyCreateConnectorResponse parses an HTTP response from a LegacyCreateConnectorWithResponse call -func ParseLegacyCreateConnectorResponse(rsp *http.Response) (*LegacyCreateConnectorResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &LegacyCreateConnectorResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest N200Actions - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest AuthorizationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - } - - return response, nil -} - -// ParseLegacyDeleteConnectorResponse parses an HTTP response from a LegacyDeleteConnectorWithResponse call -func ParseLegacyDeleteConnectorResponse(rsp *http.Response) (*LegacyDeleteConnectorResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &LegacyDeleteConnectorResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest AuthorizationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - } - - return response, nil -} - -// ParseLegacyGetConnectorResponse parses an HTTP response from a LegacyGetConnectorWithResponse call -func ParseLegacyGetConnectorResponse(rsp *http.Response) (*LegacyGetConnectorResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &LegacyGetConnectorResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest N200Actions - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest AuthorizationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - } - - return response, nil -} - -// ParseLegacyUpdateConnectorResponse parses an HTTP response from a LegacyUpdateConnectorWithResponse call -func ParseLegacyUpdateConnectorResponse(rsp *http.Response) (*LegacyUpdateConnectorResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &LegacyUpdateConnectorResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest N200Actions - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest ObjectNotFoundError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - } - - return response, nil -} - -// ParseLegacyRunConnectorResponse parses an HTTP response from a LegacyRunConnectorWithResponse call -func ParseLegacyRunConnectorResponse(rsp *http.Response) (*LegacyRunConnectorResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &LegacyRunConnectorResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest LegacyRunConnectorGeneralResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest AuthorizationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - } - - return response, nil -} - -// ParseCreateConnectorResponse parses an HTTP response from a CreateConnectorWithResponse call -func ParseCreateConnectorResponse(rsp *http.Response) (*CreateConnectorResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &CreateConnectorResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ConnectorResponseProperties - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest BadRequestError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest AuthorizationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - } - - return response, nil -} - -// ParseDeleteConnectorResponse parses an HTTP response from a DeleteConnectorWithResponse call -func ParseDeleteConnectorResponse(rsp *http.Response) (*DeleteConnectorResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DeleteConnectorResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest AuthorizationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest struct { - Error *string `json:"error,omitempty"` - Message *string `json:"message,omitempty"` - StatusCode *int `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - } - - return response, nil -} - -// ParseGetConnectorResponse parses an HTTP response from a GetConnectorWithResponse call -func ParseGetConnectorResponse(rsp *http.Response) (*GetConnectorResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetConnectorResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ConnectorResponseProperties - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest AuthorizationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest struct { - Error *string `json:"error,omitempty"` - Message *string `json:"message,omitempty"` - StatusCode *int `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - } - - return response, nil -} - -// ParseUpdateConnectorResponse parses an HTTP response from a UpdateConnectorWithResponse call -func ParseUpdateConnectorResponse(rsp *http.Response) (*UpdateConnectorResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &UpdateConnectorResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ConnectorResponseProperties - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest BadRequestError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest AuthorizationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest ObjectNotFoundError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - } - - return response, nil -} - -// ParseRunConnectorResponse parses an HTTP response from a RunConnectorWithResponse call -func ParseRunConnectorResponse(rsp *http.Response) (*RunConnectorResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &RunConnectorResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest RunConnectorGeneralResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest AuthorizationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - } - - return response, nil -} - -// ParseGetConnectorTypesResponse parses an HTTP response from a GetConnectorTypesWithResponse call -func ParseGetConnectorTypesResponse(rsp *http.Response) (*GetConnectorTypesResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetConnectorTypesResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []struct { - // Enabled Indicates whether the connector type is enabled in Kibana. - Enabled *bool `json:"enabled,omitempty"` - - // EnabledInConfig Indicates whether the connector type is enabled in the Kibana `.yml` file. - EnabledInConfig *bool `json:"enabled_in_config,omitempty"` - - // EnabledInLicense Indicates whether the connector is enabled in the license. - EnabledInLicense *bool `json:"enabled_in_license,omitempty"` - - // Id The type of connector. For example, `.email`, `.index`, `.jira`, `.opsgenie`, or `.server-log`. - Id *ConnectorTypes `json:"id,omitempty"` - - // MinimumLicenseRequired The license that is required to use the connector type. - MinimumLicenseRequired *string `json:"minimum_license_required,omitempty"` - - // Name The name of the connector type. - Name *string `json:"name,omitempty"` - - // SupportedFeatureIds The Kibana features that are supported by the connector type. - SupportedFeatureIds *[]Features `json:"supported_feature_ids,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest AuthorizationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - } - - return response, nil -} - -// ParseGetConnectorsResponse parses an HTTP response from a GetConnectorsWithResponse call -func ParseGetConnectorsResponse(rsp *http.Response) (*GetConnectorsResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetConnectorsResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []struct { - // Config The configuration for the connector. Configuration properties vary depending on the connector type. - Config *map[string]interface{} `json:"config"` - - // ConnectorTypeId The type of connector. For example, `.email`, `.index`, `.jira`, `.opsgenie`, or `.server-log`. - ConnectorTypeId ConnectorTypes `json:"connector_type_id"` - - // Id The identifier for the connector. - Id string `json:"id"` - - // IsDeprecated Indicates whether the connector type is deprecated. - IsDeprecated *IsDeprecated `json:"is_deprecated,omitempty"` - - // IsMissingSecrets Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - IsMissingSecrets *IsMissingSecrets `json:"is_missing_secrets,omitempty"` - - // IsPreconfigured Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - IsPreconfigured IsPreconfigured `json:"is_preconfigured"` - - // Name The display name for the connector. - Name string `json:"name"` - - // ReferencedByCount Indicates the number of saved objects that reference the connector. If `is_preconfigured` is true, this value is not calculated. - ReferencedByCount int `json:"referenced_by_count"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest AuthorizationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - } - - return response, nil -} - -// ParseLegacyGetConnectorTypesResponse parses an HTTP response from a LegacyGetConnectorTypesWithResponse call -func ParseLegacyGetConnectorTypesResponse(rsp *http.Response) (*LegacyGetConnectorTypesResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &LegacyGetConnectorTypesResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []struct { - // Enabled Indicates whether the connector type is enabled in Kibana. - Enabled *bool `json:"enabled,omitempty"` - - // EnabledInConfig Indicates whether the connector type is enabled in the Kibana `.yml` file. - EnabledInConfig *bool `json:"enabledInConfig,omitempty"` - - // EnabledInLicense Indicates whether the connector is enabled in the license. - EnabledInLicense *bool `json:"enabledInLicense,omitempty"` - - // Id The unique identifier for the connector type. - Id *string `json:"id,omitempty"` - - // MinimumLicenseRequired The license that is required to use the connector type. - MinimumLicenseRequired *string `json:"minimumLicenseRequired,omitempty"` - - // Name The name of the connector type. - Name *string `json:"name,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest AuthorizationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - } - - return response, nil -} diff --git a/generated/connectors/connectors.go b/generated/connectors/connectors.go deleted file mode 100644 index 8b753538a..000000000 --- a/generated/connectors/connectors.go +++ /dev/null @@ -1,3 +0,0 @@ -package connectors - -//go:generate go tool github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -package connectors -o ./connectors.gen.go -generate "types,client" ./bundled.yaml diff --git a/generated/kbapi/kibana.gen.go b/generated/kbapi/kibana.gen.go index 52a36324e..5eff5b6fb 100644 --- a/generated/kbapi/kibana.gen.go +++ b/generated/kbapi/kibana.gen.go @@ -1,6 +1,6 @@ // Package kbapi provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT. +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT. package kbapi import ( @@ -52,6 +52,71 @@ const ( Inactive AgentPolicyStatus = "inactive" ) +// Defines values for AuthType. +const ( + WebhookAuthenticationBasic AuthType = "webhook-authentication-basic" + WebhookAuthenticationSsl AuthType = "webhook-authentication-ssl" +) + +// Defines values for CasesWebhookConfigCreateCommentMethod. +const ( + CasesWebhookConfigCreateCommentMethodPatch CasesWebhookConfigCreateCommentMethod = "patch" + CasesWebhookConfigCreateCommentMethodPost CasesWebhookConfigCreateCommentMethod = "post" + CasesWebhookConfigCreateCommentMethodPut CasesWebhookConfigCreateCommentMethod = "put" +) + +// Defines values for CasesWebhookConfigCreateIncidentMethod. +const ( + CasesWebhookConfigCreateIncidentMethodPatch CasesWebhookConfigCreateIncidentMethod = "patch" + CasesWebhookConfigCreateIncidentMethodPost CasesWebhookConfigCreateIncidentMethod = "post" + CasesWebhookConfigCreateIncidentMethodPut CasesWebhookConfigCreateIncidentMethod = "put" +) + +// Defines values for CasesWebhookConfigUpdateIncidentMethod. +const ( + CasesWebhookConfigUpdateIncidentMethodPatch CasesWebhookConfigUpdateIncidentMethod = "patch" + CasesWebhookConfigUpdateIncidentMethodPost CasesWebhookConfigUpdateIncidentMethod = "post" + CasesWebhookConfigUpdateIncidentMethodPut CasesWebhookConfigUpdateIncidentMethod = "put" +) + +// Defines values for CertType. +const ( + SslCrtKey CertType = "ssl-crt-key" + SslPfx CertType = "ssl-pfx" +) + +// Defines values for EmailConfigService. +const ( + EmailConfigServiceElasticCloud EmailConfigService = "elastic_cloud" + EmailConfigServiceExchangeServer EmailConfigService = "exchange_server" + EmailConfigServiceGmail EmailConfigService = "gmail" + EmailConfigServiceOther EmailConfigService = "other" + EmailConfigServiceOutlook365 EmailConfigService = "outlook365" + EmailConfigServiceSes EmailConfigService = "ses" +) + +// Defines values for GenaiAzureConfigApiProvider. +const ( + AzureOpenAI GenaiAzureConfigApiProvider = "Azure OpenAI" +) + +// Defines values for GenaiOpenaiConfigApiProvider. +const ( + OpenAI GenaiOpenaiConfigApiProvider = "OpenAI" +) + +// Defines values for GenaiOpenaiOtherConfigApiProvider. +const ( + GenaiOpenaiOtherConfigApiProviderOther GenaiOpenaiOtherConfigApiProvider = "Other" +) + +// Defines values for GenaiOpenaiOtherConfigVerificationMode. +const ( + GenaiOpenaiOtherConfigVerificationModeCertificate GenaiOpenaiOtherConfigVerificationMode = "certificate" + GenaiOpenaiOtherConfigVerificationModeFull GenaiOpenaiOtherConfigVerificationMode = "full" + GenaiOpenaiOtherConfigVerificationModeNone GenaiOpenaiOtherConfigVerificationMode = "none" +) + // Defines values for NewOutputElasticsearchPreset. const ( NewOutputElasticsearchPresetBalanced NewOutputElasticsearchPreset = "balanced" @@ -415,6 +480,13 @@ const ( ServerHostSslClientAuthRequired ServerHostSslClientAuth = "required" ) +// Defines values for SwimlaneConfigConnectorType. +const ( + Alerts SwimlaneConfigConnectorType = "alerts" + All SwimlaneConfigConnectorType = "all" + Cases SwimlaneConfigConnectorType = "cases" +) + // Defines values for UpdateOutputElasticsearchPreset. const ( UpdateOutputElasticsearchPresetBalanced UpdateOutputElasticsearchPreset = "balanced" @@ -498,6 +570,19 @@ const ( UpdateOutputSslVerificationModeStrict UpdateOutputSslVerificationMode = "strict" ) +// Defines values for VerificationMode. +const ( + VerificationModeCertificate VerificationMode = "certificate" + VerificationModeFull VerificationMode = "full" + VerificationModeNone VerificationMode = "none" +) + +// Defines values for WebhookConfigMethod. +const ( + WebhookConfigMethodPost WebhookConfigMethod = "post" + WebhookConfigMethodPut WebhookConfigMethod = "put" +) + // Defines values for APMUIElasticApiVersion. const ( APMUIElasticApiVersionN20231031 APMUIElasticApiVersion = "2023-10-31" @@ -811,7 +896,7 @@ type DataViewsDataViewResponseObjectInner struct { Title *DataViewsTitle `json:"title,omitempty"` // TypeMeta When you use rollup indices, contains the field list for the rollup data view API endpoints. - TypeMeta *DataViewsTypemetaResponse `json:"typeMeta"` + TypeMeta *DataViewsTypemetaResponse `json:"typeMeta,omitempty"` Version *string `json:"version,omitempty"` } @@ -1023,15 +1108,15 @@ type SyntheticsPostParameterResponse struct { // AgentPolicy defines model for agent_policy. type AgentPolicy struct { AdvancedSettings *struct { - AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` - AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` - AgentLimitsGoMaxProcs *interface{} `json:"agent_limits_go_max_procs"` - AgentLoggingFilesInterval *interface{} `json:"agent_logging_files_interval"` - AgentLoggingFilesKeepfiles *interface{} `json:"agent_logging_files_keepfiles"` - AgentLoggingFilesRotateeverybytes *interface{} `json:"agent_logging_files_rotateeverybytes"` - AgentLoggingLevel *interface{} `json:"agent_logging_level"` - AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` - AgentLoggingToFiles *interface{} `json:"agent_logging_to_files"` + AgentDownloadTargetDirectory interface{} `json:"agent_download_target_directory,omitempty"` + AgentDownloadTimeout interface{} `json:"agent_download_timeout,omitempty"` + AgentLimitsGoMaxProcs interface{} `json:"agent_limits_go_max_procs,omitempty"` + AgentLoggingFilesInterval interface{} `json:"agent_logging_files_interval,omitempty"` + AgentLoggingFilesKeepfiles interface{} `json:"agent_logging_files_keepfiles,omitempty"` + AgentLoggingFilesRotateeverybytes interface{} `json:"agent_logging_files_rotateeverybytes,omitempty"` + AgentLoggingLevel interface{} `json:"agent_logging_level,omitempty"` + AgentLoggingMetricsPeriod interface{} `json:"agent_logging_metrics_period,omitempty"` + AgentLoggingToFiles interface{} `json:"agent_logging_to_files,omitempty"` } `json:"advanced_settings,omitempty"` AgentFeatures *[]struct { Enabled bool `json:"enabled"` @@ -1050,10 +1135,10 @@ type AgentPolicy struct { } `json:"resources,omitempty"` } `json:"agentless,omitempty"` Agents *float32 `json:"agents,omitempty"` - DataOutputId *string `json:"data_output_id"` + DataOutputId *string `json:"data_output_id,omitempty"` Description *string `json:"description,omitempty"` - DownloadSourceId *string `json:"download_source_id"` - FleetServerHostId *string `json:"fleet_server_host_id"` + DownloadSourceId *string `json:"download_source_id,omitempty"` + FleetServerHostId *string `json:"fleet_server_host_id,omitempty"` // GlobalDataTags User defined data tags that are added to all of the inputs. The values can be strings or numbers. GlobalDataTags *[]AgentPolicyGlobalDataTagsItem `json:"global_data_tags,omitempty"` @@ -1069,7 +1154,7 @@ type AgentPolicy struct { IsProtected bool `json:"is_protected"` // KeepMonitoringAlive When set to true, monitoring will be enabled but logs/metrics collection will be disabled - KeepMonitoringAlive *bool `json:"keep_monitoring_alive"` + KeepMonitoringAlive *bool `json:"keep_monitoring_alive,omitempty"` MonitoringDiagnostics *struct { Limit *struct { Burst *float32 `json:"burst,omitempty"` @@ -1090,13 +1175,13 @@ type AgentPolicy struct { Host *string `json:"host,omitempty"` Port *float32 `json:"port,omitempty"` } `json:"monitoring_http,omitempty"` - MonitoringOutputId *string `json:"monitoring_output_id"` + MonitoringOutputId *string `json:"monitoring_output_id,omitempty"` MonitoringPprofEnabled *bool `json:"monitoring_pprof_enabled,omitempty"` Name string `json:"name"` Namespace string `json:"namespace"` // Overrides Override settings that are defined in the agent policy. Input settings cannot be overridden. The override option should be used only in unusual circumstances and not as a routine procedure. - Overrides *map[string]interface{} `json:"overrides"` + Overrides *map[string]interface{} `json:"overrides,omitempty"` PackagePolicies *AgentPolicy_PackagePolicies `json:"package_policies,omitempty"` RequiredVersions *[]struct { // Percentage Target percentage of agents to auto upgrade @@ -1104,14 +1189,14 @@ type AgentPolicy struct { // Version Target version for automatic agent upgrade Version string `json:"version"` - } `json:"required_versions"` + } `json:"required_versions,omitempty"` Revision float32 `json:"revision"` SchemaVersion *string `json:"schema_version,omitempty"` SpaceIds *[]string `json:"space_ids,omitempty"` Status AgentPolicyStatus `json:"status"` // SupportsAgentless Indicates whether the agent policy supports agentless integrations. - SupportsAgentless *bool `json:"supports_agentless"` + SupportsAgentless *bool `json:"supports_agentless,omitempty"` UnenrollTimeout *float32 `json:"unenroll_timeout,omitempty"` UnprivilegedAgents *float32 `json:"unprivileged_agents,omitempty"` UpdatedAt string `json:"updated_at"` @@ -1128,7 +1213,7 @@ type AgentPolicyPackagePolicies0 = []string // AgentPolicyPackagePolicies1 This field is present only when retrieving a single agent policy, or when retrieving a list of agent policies with the ?full=true parameter type AgentPolicyPackagePolicies1 = []struct { // AdditionalDatastreamsPermissions Additional datastream permissions, that will be added to the agent policy. - AdditionalDatastreamsPermissions *[]string `json:"additional_datastreams_permissions"` + AdditionalDatastreamsPermissions *[]string `json:"additional_datastreams_permissions,omitempty"` Agents *float32 `json:"agents,omitempty"` CreatedAt string `json:"created_at"` CreatedBy string `json:"created_by"` @@ -1146,12 +1231,12 @@ type AgentPolicyPackagePolicies1 = []struct { // Namespace The package policy namespace. Leave blank to inherit the agent policy's namespace. Namespace *string `json:"namespace,omitempty"` - OutputId *string `json:"output_id"` + OutputId *string `json:"output_id,omitempty"` // Overrides Override settings that are defined in the package policy. The override option should be used only in unusual circumstances and not as a routine procedure. Overrides *struct { Inputs *map[string]interface{} `json:"inputs,omitempty"` - } `json:"overrides"` + } `json:"overrides,omitempty"` Package *struct { ExperimentalDataStreamFeatures *[]struct { DataStream string `json:"data_stream"` @@ -1173,8 +1258,8 @@ type AgentPolicyPackagePolicies1 = []struct { } `json:"package,omitempty"` // PolicyId Agent policy ID where that package policy will be added - // Deprecated: - PolicyId *string `json:"policy_id"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + PolicyId *string `json:"policy_id,omitempty"` PolicyIds *[]string `json:"policy_ids,omitempty"` Revision float32 `json:"revision"` SecretReferences *[]struct { @@ -1183,7 +1268,7 @@ type AgentPolicyPackagePolicies1 = []struct { SpaceIds *[]string `json:"spaceIds,omitempty"` // SupportsAgentless Indicates whether the package policy belongs to an agentless agent policy. - SupportsAgentless *bool `json:"supports_agentless"` + SupportsAgentless *bool `json:"supports_agentless,omitempty"` UpdatedAt string `json:"updated_at"` UpdatedBy string `json:"updated_by"` Vars *AgentPolicy_PackagePolicies_1_Vars `json:"vars,omitempty"` @@ -1402,6 +1487,158 @@ type AgentPolicyGlobalDataTagsItem_Value struct { union json.RawMessage } +// AuthType The type of authentication to use: basic, SSL, or none. +type AuthType string + +// BedrockConfig Defines properties for connectors when type is `.bedrock`. +type BedrockConfig struct { + // ApiUrl The Amazon Bedrock request URL. + ApiUrl string `json:"apiUrl"` + + // DefaultModel The generative artificial intelligence model for Amazon Bedrock to use. Current support is for the Anthropic Claude models. + DefaultModel *string `json:"defaultModel,omitempty"` +} + +// BedrockSecrets Defines secrets for connectors when type is `.bedrock`. +type BedrockSecrets struct { + // AccessKey The AWS access key for authentication. + AccessKey string `json:"accessKey"` + + // Secret The AWS secret for authentication. + Secret string `json:"secret"` +} + +// Ca A base64 encoded version of the certificate authority file that the connector can trust to sign and validate certificates. This option is available for all authentication types. +type Ca = string + +// CasesWebhookConfig Defines properties for connectors when type is `.cases-webhook`. +type CasesWebhookConfig struct { + // AuthType The type of authentication to use: basic, SSL, or none. + AuthType *AuthType `json:"authType,omitempty"` + + // Ca A base64 encoded version of the certificate authority file that the connector can trust to sign and validate certificates. This option is available for all authentication types. + Ca *Ca `json:"ca,omitempty"` + + // CertType If the `authType` is `webhook-authentication-ssl`, specifies whether the certificate authentication data is in a CRT and key file format or a PFX file format. + CertType *CertType `json:"certType,omitempty"` + + // CreateCommentJson A JSON payload sent to the create comment URL to create a case comment. You can use variables to add Kibana Cases data to the payload. The required variable is `case.comment`. Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated once the Mustache variables have been placed when the REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass. + CreateCommentJson *string `json:"createCommentJson,omitempty"` + + // CreateCommentMethod The REST API HTTP request method to create a case comment in the third-party system. Valid values are `patch`, `post`, and `put`. + CreateCommentMethod *CasesWebhookConfigCreateCommentMethod `json:"createCommentMethod,omitempty"` + + // CreateCommentUrl The REST API URL to create a case comment by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts setting`, add the hostname to the allowed hosts. + CreateCommentUrl *string `json:"createCommentUrl,omitempty"` + + // CreateIncidentJson A JSON payload sent to the create case URL to create a case. You can use variables to add case data to the payload. Required variables are `case.title` and `case.description`. Due to Mustache template variables (which is the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid to avoid future validation errors; disregard Mustache variables during your review. + CreateIncidentJson string `json:"createIncidentJson"` + + // CreateIncidentMethod The REST API HTTP request method to create a case in the third-party system. Valid values are `patch`, `post`, and `put`. + CreateIncidentMethod *CasesWebhookConfigCreateIncidentMethod `json:"createIncidentMethod,omitempty"` + + // CreateIncidentResponseKey The JSON key in the create external case response that contains the case ID. + CreateIncidentResponseKey string `json:"createIncidentResponseKey"` + + // CreateIncidentUrl The REST API URL to create a case in the third-party system. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. + CreateIncidentUrl string `json:"createIncidentUrl"` + + // GetIncidentResponseExternalTitleKey The JSON key in get external case response that contains the case title. + GetIncidentResponseExternalTitleKey string `json:"getIncidentResponseExternalTitleKey"` + + // GetIncidentUrl The REST API URL to get the case by ID from the third-party system. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. You can use a variable to add the external system ID to the URL. Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass. + GetIncidentUrl string `json:"getIncidentUrl"` + + // HasAuth If true, a username and password for login type authentication must be provided. + HasAuth *HasAuth `json:"hasAuth,omitempty"` + + // Headers A set of key-value pairs sent as headers with the request URLs for the create case, update case, get case, and create comment methods. + Headers *string `json:"headers,omitempty"` + + // UpdateIncidentJson The JSON payload sent to the update case URL to update the case. You can use variables to add Kibana Cases data to the payload. Required variables are `case.title` and `case.description`. Due to Mustache template variables (which is the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid to avoid future validation errors; disregard Mustache variables during your review. + UpdateIncidentJson string `json:"updateIncidentJson"` + + // UpdateIncidentMethod The REST API HTTP request method to update the case in the third-party system. Valid values are `patch`, `post`, and `put`. + UpdateIncidentMethod *CasesWebhookConfigUpdateIncidentMethod `json:"updateIncidentMethod,omitempty"` + + // UpdateIncidentUrl The REST API URL to update the case by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. + UpdateIncidentUrl string `json:"updateIncidentUrl"` + + // VerificationMode Controls the verification of certificates. Use `full` to validate that the certificate has an issue date within the `not_before` and `not_after` dates, chains to a trusted certificate authority (CA), and has a hostname or IP address that matches the names within the certificate. Use `certificate` to validate the certificate and verify that it is signed by a trusted authority; this option does not check the certificate hostname. Use `none` to skip certificate validation. + VerificationMode *VerificationMode `json:"verificationMode,omitempty"` + + // ViewIncidentUrl The URL to view the case in the external system. You can use variables to add the external system ID or external system title to the URL. + ViewIncidentUrl string `json:"viewIncidentUrl"` +} + +// CasesWebhookConfigCreateCommentMethod The REST API HTTP request method to create a case comment in the third-party system. Valid values are `patch`, `post`, and `put`. +type CasesWebhookConfigCreateCommentMethod string + +// CasesWebhookConfigCreateIncidentMethod The REST API HTTP request method to create a case in the third-party system. Valid values are `patch`, `post`, and `put`. +type CasesWebhookConfigCreateIncidentMethod string + +// CasesWebhookConfigUpdateIncidentMethod The REST API HTTP request method to update the case in the third-party system. Valid values are `patch`, `post`, and `put`. +type CasesWebhookConfigUpdateIncidentMethod string + +// CasesWebhookSecrets defines model for cases_webhook_secrets. +type CasesWebhookSecrets struct { + // Crt If `authType` is `webhook-authentication-ssl` and `certType` is `ssl-crt-key`, it is a base64 encoded version of the CRT or CERT file. + Crt *Crt `json:"crt,omitempty"` + + // Key If `authType` is `webhook-authentication-ssl` and `certType` is `ssl-crt-key`, it is a base64 encoded version of the KEY file. + Key *Key `json:"key,omitempty"` + + // Password The password for HTTP basic authentication. If `hasAuth` is set to `true` and and `authType` is `webhook-authentication-basic`, this property is required. + Password *string `json:"password,omitempty"` + + // Pfx If `authType` is `webhook-authentication-ssl` and `certType` is `ssl-pfx`, it is a base64 encoded version of the PFX or P12 file. + Pfx *Pfx `json:"pfx,omitempty"` + + // User The username for HTTP basic authentication. If `hasAuth` is set to `true` and `authType` is `webhook-authentication-basic`, this property is required. + User *string `json:"user,omitempty"` +} + +// CertType If the `authType` is `webhook-authentication-ssl`, specifies whether the certificate authentication data is in a CRT and key file format or a PFX file format. +type CertType string + +// ConnectorResponse defines model for connector_response. +type ConnectorResponse struct { + Config *map[string]interface{} `json:"config,omitempty"` + + // ConnectorTypeId The connector type identifier. + ConnectorTypeId string `json:"connector_type_id"` + + // Id The identifier for the connector. + Id string `json:"id"` + + // IsDeprecated Indicates whether the connector is deprecated. + IsDeprecated bool `json:"is_deprecated"` + + // IsMissingSecrets Indicates whether the connector is missing secrets. + IsMissingSecrets *bool `json:"is_missing_secrets,omitempty"` + + // IsPreconfigured Indicates whether the connector is preconfigured. If true, the `config` and `is_missing_secrets` properties are omitted from the response. + IsPreconfigured bool `json:"is_preconfigured"` + + // IsSystemAction Indicates whether the connector is used for system actions. + IsSystemAction bool `json:"is_system_action"` + + // Name The name of the rule. + Name string `json:"name"` +} + +// CreateConnectorConfig The connector configuration details. +type CreateConnectorConfig struct { + AdditionalProperties map[string]interface{} `json:"-"` + union json.RawMessage +} + +// CreateConnectorSecrets defines model for create_connector_secrets. +type CreateConnectorSecrets struct { + AdditionalProperties map[string]interface{} `json:"-"` + union json.RawMessage +} + // CreateParamResponse defines model for create_param_response. type CreateParamResponse struct { union json.RawMessage @@ -1410,6 +1647,103 @@ type CreateParamResponse struct { // CreateParamResponse0 defines model for . type CreateParamResponse0 = []SyntheticsPostParameterResponse +// CrowdstrikeConfig Defines config properties for connectors when type is `.crowdstrike`. +type CrowdstrikeConfig struct { + // Url The CrowdStrike tenant URL. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. + Url string `json:"url"` +} + +// CrowdstrikeSecrets Defines secrets for connectors when type is `.crowdstrike`. +type CrowdstrikeSecrets struct { + // ClientId The CrowdStrike API client identifier. + ClientId string `json:"clientId"` + + // ClientSecret The CrowdStrike API client secret to authenticate the `clientId`. + ClientSecret string `json:"clientSecret"` +} + +// Crt If `authType` is `webhook-authentication-ssl` and `certType` is `ssl-crt-key`, it is a base64 encoded version of the CRT or CERT file. +type Crt = string + +// D3securityConfig Defines properties for connectors when type is `.d3security`. +type D3securityConfig struct { + // Url The D3 Security API request URL. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. + Url string `json:"url"` +} + +// D3securitySecrets Defines secrets for connectors when type is `.d3security`. +type D3securitySecrets struct { + // Token The D3 Security token. + Token string `json:"token"` +} + +// DefenderConfig Defines properties for connectors when type is `.microsoft_defender_endpoint`. +type DefenderConfig struct { + // ApiUrl The URL of the Microsoft Defender for Endpoint API. If you are using the `xpack.actions.allowedHosts` setting, make sure the hostname is added to the allowed hosts. + ApiUrl string `json:"apiUrl"` + + // ClientId The application (client) identifier for your app in the Azure portal. + ClientId *string `json:"clientId,omitempty"` + + // OAuthScope The OAuth scopes or permission sets for the Microsoft Defender for Endpoint API. + OAuthScope *string `json:"oAuthScope,omitempty"` + + // OAuthServerUrl The OAuth server URL where authentication is sent and received for the Microsoft Defender for Endpoint API. + OAuthServerUrl *string `json:"oAuthServerUrl,omitempty"` + + // TenantId The tenant identifier for your app in the Azure portal. + TenantId *string `json:"tenantId,omitempty"` +} + +// DefenderSecrets Defines secrets for connectors when type is `..microsoft_defender_endpoint`. +type DefenderSecrets struct { + // ClientSecret The client secret for your app in the Azure portal. + ClientSecret string `json:"clientSecret"` +} + +// EmailConfig Defines properties for connectors when type is `.email`. +type EmailConfig struct { + // ClientId The client identifier, which is a part of OAuth 2.0 client credentials authentication, in GUID format. If `service` is `exchange_server`, this property is required. + ClientId *string `json:"clientId,omitempty"` + + // From The from address for all emails sent by the connector. It must be specified in `user@host-name` format. + From string `json:"from"` + + // HasAuth Specifies whether a user and password are required inside the secrets configuration. + HasAuth *bool `json:"hasAuth,omitempty"` + + // Host The host name of the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. + Host *string `json:"host,omitempty"` + OauthTokenUrl *string `json:"oauthTokenUrl,omitempty"` + + // Port The port to connect to on the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. + Port *int `json:"port,omitempty"` + + // Secure Specifies whether the connection to the service provider will use TLS. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. + Secure *bool `json:"secure,omitempty"` + + // Service The name of the email service. + Service *EmailConfigService `json:"service,omitempty"` + + // TenantId The tenant identifier, which is part of OAuth 2.0 client credentials authentication, in GUID format. If `service` is `exchange_server`, this property is required. + TenantId *string `json:"tenantId,omitempty"` +} + +// EmailConfigService The name of the email service. +type EmailConfigService string + +// EmailSecrets Defines secrets for connectors when type is `.email`. +type EmailSecrets struct { + // ClientSecret The Microsoft Exchange Client secret for OAuth 2.0 client credentials authentication. It must be URL-encoded. If `service` is `exchange_server`, this property is required. + ClientSecret *string `json:"clientSecret,omitempty"` + + // Password The password for HTTP basic authentication. If `hasAuth` is set to `true`, this property is required. + Password *string `json:"password,omitempty"` + + // User The username for HTTP basic authentication. If `hasAuth` is set to `true`, this property is required. + User *string `json:"user,omitempty"` +} + // EnrollmentApiKey defines model for enrollment_api_key. type EnrollmentApiKey struct { // Active When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents. @@ -1431,6 +1765,102 @@ type EnrollmentApiKey struct { PolicyId *string `json:"policy_id,omitempty"` } +// GeminiConfig Defines properties for connectors when type is `.gemini`. +type GeminiConfig struct { + // ApiUrl The Google Gemini request URL. + ApiUrl string `json:"apiUrl"` + + // DefaultModel The generative artificial intelligence model for Google Gemini to use. + DefaultModel *string `json:"defaultModel,omitempty"` + + // GcpProjectID The Google ProjectID that has Vertex AI endpoint enabled. + GcpProjectID string `json:"gcpProjectID"` + + // GcpRegion The GCP region where the Vertex AI endpoint enabled. + GcpRegion string `json:"gcpRegion"` +} + +// GeminiSecrets Defines secrets for connectors when type is `.gemini`. +type GeminiSecrets struct { + // CredentialsJson The service account credentials JSON file. The service account should have Vertex AI user IAM role assigned to it. + CredentialsJson string `json:"credentialsJson"` +} + +// GenaiAzureConfig Defines properties for connectors when type is `.gen-ai` and the API provider is `Azure OpenAI`. +type GenaiAzureConfig struct { + // ApiProvider The OpenAI API provider. + ApiProvider GenaiAzureConfigApiProvider `json:"apiProvider"` + + // ApiUrl The OpenAI API endpoint. + ApiUrl string `json:"apiUrl"` +} + +// GenaiAzureConfigApiProvider The OpenAI API provider. +type GenaiAzureConfigApiProvider string + +// GenaiOpenaiConfig Defines properties for connectors when type is `.gen-ai` and the API provider is `OpenAI`. +type GenaiOpenaiConfig struct { + // ApiProvider The OpenAI API provider. + ApiProvider GenaiOpenaiConfigApiProvider `json:"apiProvider"` + + // ApiUrl The OpenAI API endpoint. + ApiUrl string `json:"apiUrl"` + + // DefaultModel The default model to use for requests. + DefaultModel *string `json:"defaultModel,omitempty"` +} + +// GenaiOpenaiConfigApiProvider The OpenAI API provider. +type GenaiOpenaiConfigApiProvider string + +// GenaiOpenaiOtherConfig Defines properties for connectors when type is `.gen-ai` and the API provider is `Other` (OpenAI-compatible service), including optional PKI authentication. +type GenaiOpenaiOtherConfig struct { + // ApiProvider The OpenAI API provider. + ApiProvider GenaiOpenaiOtherConfigApiProvider `json:"apiProvider"` + + // ApiUrl The OpenAI-compatible API endpoint. + ApiUrl string `json:"apiUrl"` + + // CaData PEM-encoded CA certificate content. + CaData *string `json:"caData,omitempty"` + + // CertificateData PEM-encoded certificate content. + CertificateData *string `json:"certificateData,omitempty"` + + // DefaultModel The default model to use for requests. + DefaultModel string `json:"defaultModel"` + + // Headers Custom headers to include in requests. + Headers *map[string]string `json:"headers,omitempty"` + + // PrivateKeyData PEM-encoded private key content. + PrivateKeyData *string `json:"privateKeyData,omitempty"` + + // VerificationMode SSL verification mode for PKI authentication. + VerificationMode *GenaiOpenaiOtherConfigVerificationMode `json:"verificationMode,omitempty"` +} + +// GenaiOpenaiOtherConfigApiProvider The OpenAI API provider. +type GenaiOpenaiOtherConfigApiProvider string + +// GenaiOpenaiOtherConfigVerificationMode SSL verification mode for PKI authentication. +type GenaiOpenaiOtherConfigVerificationMode string + +// GenaiSecrets Defines secrets for connectors when type is `.gen-ai`. Supports both API key authentication (OpenAI, Azure OpenAI, and `Other`) and PKI authentication (`Other` provider only). PKI fields must be base64-encoded PEM content. +type GenaiSecrets struct { + // ApiKey The API key for authentication. For OpenAI and Azure OpenAI providers, it is required. For the `Other` provider, it is required if you do not use PKI authentication. With PKI, you can also optionally include an API key if the OpenAI-compatible service supports or requires one. + ApiKey *string `json:"apiKey,omitempty"` + + // CaData Base64-encoded PEM CA certificate content for PKI authentication (Other provider only). Optional. + CaData *string `json:"caData,omitempty"` + + // CertificateData Base64-encoded PEM certificate content for PKI authentication (Other provider only). Required for PKI. + CertificateData *string `json:"certificateData,omitempty"` + + // PrivateKeyData Base64-encoded PEM private key content for PKI authentication (Other provider only). Required for PKI. + PrivateKeyData *string `json:"privateKeyData,omitempty"` +} + // GetDataViewsResponseItem defines model for get_data_views_response_item. type GetDataViewsResponseItem struct { Id *string `json:"id,omitempty"` @@ -1440,12 +1870,48 @@ type GetDataViewsResponseItem struct { TypeMeta *map[string]interface{} `json:"typeMeta,omitempty"` } +// HasAuth If true, a username and password for login type authentication must be provided. +type HasAuth = bool + +// IndexConfig Defines properties for connectors when type is `.index`. +type IndexConfig struct { + // ExecutionTimeField A field that indicates when the document was indexed. + ExecutionTimeField *string `json:"executionTimeField,omitempty"` + + // Index The Elasticsearch index to be written to. + Index string `json:"index"` + + // Refresh The refresh policy for the write request, which affects when changes are made visible to search. Refer to the refresh setting for Elasticsearch document APIs. + Refresh *bool `json:"refresh,omitempty"` +} + +// JiraConfig Defines properties for connectors when type is `.jira`. +type JiraConfig struct { + // ApiUrl The Jira instance URL. + ApiUrl string `json:"apiUrl"` + + // ProjectKey The Jira project key. + ProjectKey string `json:"projectKey"` +} + +// JiraSecrets Defines secrets for connectors when type is `.jira`. +type JiraSecrets struct { + // ApiToken The Jira API authentication token for HTTP basic authentication. + ApiToken string `json:"apiToken"` + + // Email The account email for HTTP Basic authentication. + Email string `json:"email"` +} + +// Key If `authType` is `webhook-authentication-ssl` and `certType` is `ssl-crt-key`, it is a base64 encoded version of the KEY file. +type Key = string + // NewOutputElasticsearch defines model for new_output_elasticsearch. type NewOutputElasticsearch struct { AllowEdit *[]string `json:"allow_edit,omitempty"` CaSha256 *string `json:"ca_sha256,omitempty"` CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` - ConfigYaml *string `json:"config_yaml"` + ConfigYaml *string `json:"config_yaml,omitempty"` Hosts []string `json:"hosts"` Id *string `json:"id,omitempty"` IsDefault *bool `json:"is_default,omitempty"` @@ -1494,7 +1960,7 @@ type NewOutputKafka struct { ClientId *string `json:"client_id,omitempty"` Compression *NewOutputKafkaCompression `json:"compression,omitempty"` CompressionLevel interface{} `json:"compression_level"` - ConfigYaml *string `json:"config_yaml"` + ConfigYaml *string `json:"config_yaml,omitempty"` ConnectionType interface{} `json:"connection_type"` Hash *struct { Hash *string `json:"hash,omitempty"` @@ -1524,7 +1990,7 @@ type NewOutputKafka struct { } `json:"round_robin,omitempty"` Sasl *struct { Mechanism *NewOutputKafkaSaslMechanism `json:"mechanism,omitempty"` - } `json:"sasl"` + } `json:"sasl,omitempty"` Secrets *struct { Password *NewOutputKafka_Secrets_Password `json:"password,omitempty"` Ssl *struct { @@ -1589,7 +2055,7 @@ type NewOutputLogstash struct { AllowEdit *[]string `json:"allow_edit,omitempty"` CaSha256 *string `json:"ca_sha256,omitempty"` CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` - ConfigYaml *string `json:"config_yaml"` + ConfigYaml *string `json:"config_yaml,omitempty"` Hosts []string `json:"hosts"` Id *string `json:"id,omitempty"` IsDefault *bool `json:"is_default,omitempty"` @@ -1629,15 +2095,15 @@ type NewOutputRemoteElasticsearch struct { AllowEdit *[]string `json:"allow_edit,omitempty"` CaSha256 *string `json:"ca_sha256,omitempty"` CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` - ConfigYaml *string `json:"config_yaml"` + ConfigYaml *string `json:"config_yaml,omitempty"` Hosts []string `json:"hosts"` Id *string `json:"id,omitempty"` IsDefault *bool `json:"is_default,omitempty"` IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` IsInternal *bool `json:"is_internal,omitempty"` IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - KibanaApiKey *string `json:"kibana_api_key"` - KibanaUrl *string `json:"kibana_url"` + KibanaApiKey *string `json:"kibana_api_key,omitempty"` + KibanaUrl *string `json:"kibana_url,omitempty"` Name string `json:"name"` Preset *NewOutputRemoteElasticsearchPreset `json:"preset,omitempty"` ProxyId *string `json:"proxy_id,omitempty"` @@ -1647,7 +2113,7 @@ type NewOutputRemoteElasticsearch struct { Key *NewOutputRemoteElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` } `json:"ssl,omitempty"` } `json:"secrets,omitempty"` - ServiceToken *string `json:"service_token"` + ServiceToken *string `json:"service_token,omitempty"` Shipper *NewOutputShipper `json:"shipper,omitempty"` Ssl *NewOutputSsl `json:"ssl,omitempty"` SyncIntegrations *bool `json:"sync_integrations,omitempty"` @@ -1689,16 +2155,16 @@ type NewOutputRemoteElasticsearchType string // NewOutputShipper defines model for new_output_shipper. type NewOutputShipper struct { - CompressionLevel *float32 `json:"compression_level"` - DiskQueueCompressionEnabled *bool `json:"disk_queue_compression_enabled"` - DiskQueueEnabled *bool `json:"disk_queue_enabled"` - DiskQueueEncryptionEnabled *bool `json:"disk_queue_encryption_enabled"` - DiskQueueMaxSize *float32 `json:"disk_queue_max_size"` - DiskQueuePath *string `json:"disk_queue_path"` - Loadbalance *bool `json:"loadbalance"` - MaxBatchBytes *float32 `json:"max_batch_bytes"` - MemQueueEvents *float32 `json:"mem_queue_events"` - QueueFlushTimeout *float32 `json:"queue_flush_timeout"` + CompressionLevel *float32 `json:"compression_level,omitempty"` + DiskQueueCompressionEnabled *bool `json:"disk_queue_compression_enabled,omitempty"` + DiskQueueEnabled *bool `json:"disk_queue_enabled,omitempty"` + DiskQueueEncryptionEnabled *bool `json:"disk_queue_encryption_enabled,omitempty"` + DiskQueueMaxSize *float32 `json:"disk_queue_max_size,omitempty"` + DiskQueuePath *string `json:"disk_queue_path,omitempty"` + Loadbalance *bool `json:"loadbalance,omitempty"` + MaxBatchBytes *float32 `json:"max_batch_bytes,omitempty"` + MemQueueEvents *float32 `json:"mem_queue_events,omitempty"` + QueueFlushTimeout *float32 `json:"queue_flush_timeout,omitempty"` } // NewOutputSsl defines model for new_output_ssl. @@ -1717,12 +2183,24 @@ type NewOutputUnion struct { union json.RawMessage } +// OpsgenieConfig Defines properties for connectors when type is `.opsgenie`. +type OpsgenieConfig struct { + // ApiUrl The Opsgenie URL. For example, `https://api.opsgenie.com` or `https://api.eu.opsgenie.com`. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. + ApiUrl string `json:"apiUrl"` +} + +// OpsgenieSecrets Defines secrets for connectors when type is `.opsgenie`. +type OpsgenieSecrets struct { + // ApiKey The Opsgenie API authentication key for HTTP Basic authentication. + ApiKey string `json:"apiKey"` +} + // OutputElasticsearch defines model for output_elasticsearch. type OutputElasticsearch struct { AllowEdit *[]string `json:"allow_edit,omitempty"` - CaSha256 *string `json:"ca_sha256"` - CaTrustedFingerprint *string `json:"ca_trusted_fingerprint"` - ConfigYaml *string `json:"config_yaml"` + CaSha256 *string `json:"ca_sha256,omitempty"` + CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` + ConfigYaml *string `json:"config_yaml,omitempty"` Hosts []string `json:"hosts"` Id *string `json:"id,omitempty"` IsDefault *bool `json:"is_default,omitempty"` @@ -1731,10 +2209,10 @@ type OutputElasticsearch struct { IsPreconfigured *bool `json:"is_preconfigured,omitempty"` Name string `json:"name"` Preset *OutputElasticsearchPreset `json:"preset,omitempty"` - ProxyId *string `json:"proxy_id"` + ProxyId *string `json:"proxy_id,omitempty"` Secrets *OutputElasticsearch_Secrets `json:"secrets,omitempty"` - Shipper *OutputShipper `json:"shipper"` - Ssl *OutputSsl `json:"ssl"` + Shipper *OutputShipper `json:"shipper,omitempty"` + Ssl *OutputSsl `json:"ssl,omitempty"` Type OutputElasticsearchType `json:"type"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -1776,12 +2254,12 @@ type OutputKafka struct { AllowEdit *[]string `json:"allow_edit,omitempty"` AuthType OutputKafkaAuthType `json:"auth_type"` BrokerTimeout *float32 `json:"broker_timeout,omitempty"` - CaSha256 *string `json:"ca_sha256"` - CaTrustedFingerprint *string `json:"ca_trusted_fingerprint"` + CaSha256 *string `json:"ca_sha256,omitempty"` + CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` ClientId *string `json:"client_id,omitempty"` Compression *OutputKafkaCompression `json:"compression,omitempty"` CompressionLevel interface{} `json:"compression_level"` - ConfigYaml *string `json:"config_yaml"` + ConfigYaml *string `json:"config_yaml,omitempty"` ConnectionType interface{} `json:"connection_type"` Hash *OutputKafka_Hash `json:"hash,omitempty"` Headers *[]OutputKafka_Headers_Item `json:"headers,omitempty"` @@ -1795,14 +2273,14 @@ type OutputKafka struct { Name string `json:"name"` Partition *OutputKafkaPartition `json:"partition,omitempty"` Password interface{} `json:"password"` - ProxyId *string `json:"proxy_id"` + ProxyId *string `json:"proxy_id,omitempty"` Random *OutputKafka_Random `json:"random,omitempty"` RequiredAcks *OutputKafkaRequiredAcks `json:"required_acks,omitempty"` RoundRobin *OutputKafka_RoundRobin `json:"round_robin,omitempty"` - Sasl *OutputKafka_Sasl `json:"sasl"` + Sasl *OutputKafka_Sasl `json:"sasl,omitempty"` Secrets *OutputKafka_Secrets `json:"secrets,omitempty"` - Shipper *OutputShipper `json:"shipper"` - Ssl *OutputSsl `json:"ssl"` + Shipper *OutputShipper `json:"shipper,omitempty"` + Ssl *OutputSsl `json:"ssl,omitempty"` Timeout *float32 `json:"timeout,omitempty"` Topic *string `json:"topic,omitempty"` Type OutputKafkaType `json:"type"` @@ -1905,9 +2383,9 @@ type OutputKafkaType string // OutputLogstash defines model for output_logstash. type OutputLogstash struct { AllowEdit *[]string `json:"allow_edit,omitempty"` - CaSha256 *string `json:"ca_sha256"` - CaTrustedFingerprint *string `json:"ca_trusted_fingerprint"` - ConfigYaml *string `json:"config_yaml"` + CaSha256 *string `json:"ca_sha256,omitempty"` + CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` + ConfigYaml *string `json:"config_yaml,omitempty"` Hosts []string `json:"hosts"` Id *string `json:"id,omitempty"` IsDefault *bool `json:"is_default,omitempty"` @@ -1915,10 +2393,10 @@ type OutputLogstash struct { IsInternal *bool `json:"is_internal,omitempty"` IsPreconfigured *bool `json:"is_preconfigured,omitempty"` Name string `json:"name"` - ProxyId *string `json:"proxy_id"` + ProxyId *string `json:"proxy_id,omitempty"` Secrets *OutputLogstash_Secrets `json:"secrets,omitempty"` - Shipper *OutputShipper `json:"shipper"` - Ssl *OutputSsl `json:"ssl"` + Shipper *OutputShipper `json:"shipper,omitempty"` + Ssl *OutputSsl `json:"ssl,omitempty"` Type OutputLogstashType `json:"type"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -1955,24 +2433,24 @@ type OutputLogstashType string // OutputRemoteElasticsearch defines model for output_remote_elasticsearch. type OutputRemoteElasticsearch struct { AllowEdit *[]string `json:"allow_edit,omitempty"` - CaSha256 *string `json:"ca_sha256"` - CaTrustedFingerprint *string `json:"ca_trusted_fingerprint"` - ConfigYaml *string `json:"config_yaml"` + CaSha256 *string `json:"ca_sha256,omitempty"` + CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` + ConfigYaml *string `json:"config_yaml,omitempty"` Hosts []string `json:"hosts"` Id *string `json:"id,omitempty"` IsDefault *bool `json:"is_default,omitempty"` IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` IsInternal *bool `json:"is_internal,omitempty"` IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - KibanaApiKey *string `json:"kibana_api_key"` - KibanaUrl *string `json:"kibana_url"` + KibanaApiKey *string `json:"kibana_api_key,omitempty"` + KibanaUrl *string `json:"kibana_url,omitempty"` Name string `json:"name"` Preset *OutputRemoteElasticsearchPreset `json:"preset,omitempty"` - ProxyId *string `json:"proxy_id"` + ProxyId *string `json:"proxy_id,omitempty"` Secrets *OutputRemoteElasticsearch_Secrets `json:"secrets,omitempty"` - ServiceToken *string `json:"service_token"` - Shipper *OutputShipper `json:"shipper"` - Ssl *OutputSsl `json:"ssl"` + ServiceToken *string `json:"service_token,omitempty"` + Shipper *OutputShipper `json:"shipper,omitempty"` + Ssl *OutputSsl `json:"ssl,omitempty"` SyncIntegrations *bool `json:"sync_integrations,omitempty"` SyncUninstalledIntegrations *bool `json:"sync_uninstalled_integrations,omitempty"` Type OutputRemoteElasticsearchType `json:"type"` @@ -2028,16 +2506,16 @@ type OutputRemoteElasticsearchType string // OutputShipper defines model for output_shipper. type OutputShipper struct { - CompressionLevel *float32 `json:"compression_level"` - DiskQueueCompressionEnabled *bool `json:"disk_queue_compression_enabled"` - DiskQueueEnabled *bool `json:"disk_queue_enabled"` - DiskQueueEncryptionEnabled *bool `json:"disk_queue_encryption_enabled"` - DiskQueueMaxSize *float32 `json:"disk_queue_max_size"` - DiskQueuePath *string `json:"disk_queue_path"` - Loadbalance *bool `json:"loadbalance"` - MaxBatchBytes *float32 `json:"max_batch_bytes"` - MemQueueEvents *float32 `json:"mem_queue_events"` - QueueFlushTimeout *float32 `json:"queue_flush_timeout"` + CompressionLevel *float32 `json:"compression_level,omitempty"` + DiskQueueCompressionEnabled *bool `json:"disk_queue_compression_enabled,omitempty"` + DiskQueueEnabled *bool `json:"disk_queue_enabled,omitempty"` + DiskQueueEncryptionEnabled *bool `json:"disk_queue_encryption_enabled,omitempty"` + DiskQueueMaxSize *float32 `json:"disk_queue_max_size,omitempty"` + DiskQueuePath *string `json:"disk_queue_path,omitempty"` + Loadbalance *bool `json:"loadbalance,omitempty"` + MaxBatchBytes *float32 `json:"max_batch_bytes,omitempty"` + MemQueueEvents *float32 `json:"mem_queue_events,omitempty"` + QueueFlushTimeout *float32 `json:"queue_flush_timeout,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -2270,7 +2748,7 @@ type PackageInfo_InstallationInfo struct { Namespaces *[]string `json:"namespaces,omitempty"` Type string `json:"type"` UpdatedAt *string `json:"updated_at,omitempty"` - VerificationKeyId *string `json:"verification_key_id"` + VerificationKeyId *string `json:"verification_key_id,omitempty"` VerificationStatus PackageInfoInstallationInfoVerificationStatus `json:"verification_status"` Version string `json:"version"` AdditionalProperties map[string]interface{} `json:"-"` @@ -2502,7 +2980,7 @@ type PackageListItem_InstallationInfo struct { Namespaces *[]string `json:"namespaces,omitempty"` Type string `json:"type"` UpdatedAt *string `json:"updated_at,omitempty"` - VerificationKeyId *string `json:"verification_key_id"` + VerificationKeyId *string `json:"verification_key_id,omitempty"` VerificationStatus PackageListItemInstallationInfoVerificationStatus `json:"verification_status"` Version string `json:"version"` AdditionalProperties map[string]interface{} `json:"-"` @@ -2547,7 +3025,7 @@ type PackageListItem_Type struct { // PackagePolicy defines model for package_policy. type PackagePolicy struct { // AdditionalDatastreamsPermissions Additional datastream permissions, that will be added to the agent policy. - AdditionalDatastreamsPermissions *[]string `json:"additional_datastreams_permissions"` + AdditionalDatastreamsPermissions *[]string `json:"additional_datastreams_permissions,omitempty"` Agents *float32 `json:"agents,omitempty"` CreatedAt string `json:"created_at"` CreatedBy string `json:"created_by"` @@ -2567,12 +3045,12 @@ type PackagePolicy struct { // Namespace The package policy namespace. Leave blank to inherit the agent policy's namespace. Namespace *string `json:"namespace,omitempty"` - OutputId *string `json:"output_id"` + OutputId *string `json:"output_id,omitempty"` // Overrides Override settings that are defined in the package policy. The override option should be used only in unusual circumstances and not as a routine procedure. Overrides *struct { Inputs *map[string]interface{} `json:"inputs,omitempty"` - } `json:"overrides"` + } `json:"overrides,omitempty"` Package *struct { ExperimentalDataStreamFeatures *[]struct { DataStream string `json:"data_stream"` @@ -2594,15 +3072,15 @@ type PackagePolicy struct { } `json:"package,omitempty"` // PolicyId Agent policy ID where that package policy will be added - // Deprecated: - PolicyId *string `json:"policy_id"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + PolicyId *string `json:"policy_id,omitempty"` PolicyIds *[]string `json:"policy_ids,omitempty"` Revision float32 `json:"revision"` SecretReferences *[]PackagePolicySecretRef `json:"secret_references,omitempty"` SpaceIds *[]string `json:"spaceIds,omitempty"` // SupportsAgentless Indicates whether the package policy belongs to an agentless agent policy. - SupportsAgentless *bool `json:"supports_agentless"` + SupportsAgentless *bool `json:"supports_agentless,omitempty"` UpdatedAt string `json:"updated_at"` UpdatedBy string `json:"updated_by"` Vars *map[string]interface{} `json:"vars,omitempty"` @@ -2652,7 +3130,7 @@ type PackagePolicyRequest struct { Namespace *string `json:"namespace,omitempty"` OutputId *string `json:"output_id,omitempty"` Package PackagePolicyRequestPackage `json:"package"` - PolicyId *string `json:"policy_id"` + PolicyId *string `json:"policy_id,omitempty"` PolicyIds *[]string `json:"policy_ids,omitempty"` // SupportsAgentless Indicates whether the package policy belongs to an agentless agent policy. @@ -2703,6 +3181,51 @@ type PackagePolicySecretRef struct { Id string `json:"id"` } +// PagerdutyConfig Defines properties for connectors when type is `.pagerduty`. +type PagerdutyConfig struct { + // ApiUrl The PagerDuty event URL. + ApiUrl *string `json:"apiUrl,omitempty"` +} + +// PagerdutySecrets Defines secrets for connectors when type is `.pagerduty`. +type PagerdutySecrets struct { + // RoutingKey A 32 character PagerDuty Integration Key for an integration on a service. + RoutingKey string `json:"routingKey"` +} + +// Pfx If `authType` is `webhook-authentication-ssl` and `certType` is `ssl-pfx`, it is a base64 encoded version of the PFX or P12 file. +type Pfx = string + +// ResilientConfig Defines properties for connectors when type is `.resilient`. +type ResilientConfig struct { + // ApiUrl The IBM Resilient instance URL. + ApiUrl string `json:"apiUrl"` + + // OrgId The IBM Resilient organization ID. + OrgId string `json:"orgId"` +} + +// ResilientSecrets Defines secrets for connectors when type is `.resilient`. +type ResilientSecrets struct { + // ApiKeyId The authentication key ID for HTTP Basic authentication. + ApiKeyId string `json:"apiKeyId"` + + // ApiKeySecret The authentication key secret for HTTP Basic authentication. + ApiKeySecret string `json:"apiKeySecret"` +} + +// SentineloneConfig Defines properties for connectors when type is `.sentinelone`. +type SentineloneConfig struct { + // Url The SentinelOne tenant URL. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. + Url string `json:"url"` +} + +// SentineloneSecrets Defines secrets for connectors when type is `.sentinelone`. +type SentineloneSecrets struct { + // Token The A SentinelOne API token. + Token string `json:"token"` +} + // ServerHost defines model for server_host. type ServerHost struct { HostUrls []string `json:"host_urls"` @@ -2711,7 +3234,7 @@ type ServerHost struct { IsInternal *bool `json:"is_internal,omitempty"` IsPreconfigured *bool `json:"is_preconfigured,omitempty"` Name string `json:"name"` - ProxyId *string `json:"proxy_id"` + ProxyId *string `json:"proxy_id,omitempty"` Secrets *struct { Ssl *struct { EsKey *ServerHost_Secrets_Ssl_EsKey `json:"es_key,omitempty"` @@ -2726,7 +3249,7 @@ type ServerHost struct { EsCertificateAuthorities *[]string `json:"es_certificate_authorities,omitempty"` EsKey *string `json:"es_key,omitempty"` Key *string `json:"key,omitempty"` - } `json:"ssl"` + } `json:"ssl,omitempty"` } // ServerHostSecretsSslEsKey0 defines model for . @@ -2758,65 +3281,329 @@ type ServerHost_Secrets_Ssl_Key struct { // ServerHostSslClientAuth defines model for ServerHost.Ssl.ClientAuth. type ServerHostSslClientAuth string -// UpdateOutputElasticsearch defines model for update_output_elasticsearch. -type UpdateOutputElasticsearch struct { - AllowEdit *[]string `json:"allow_edit,omitempty"` - CaSha256 *string `json:"ca_sha256,omitempty"` - CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` - ConfigYaml *string `json:"config_yaml"` - Hosts *[]string `json:"hosts,omitempty"` - IsDefault *bool `json:"is_default,omitempty"` - IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` - IsInternal *bool `json:"is_internal,omitempty"` - IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - Name *string `json:"name,omitempty"` - Preset *UpdateOutputElasticsearchPreset `json:"preset,omitempty"` - ProxyId *string `json:"proxy_id,omitempty"` - Secrets *struct { - Ssl *struct { - Key *UpdateOutputElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` - } `json:"ssl,omitempty"` - } `json:"secrets,omitempty"` - Shipper *UpdateOutputShipper `json:"shipper,omitempty"` - Ssl *UpdateOutputSsl `json:"ssl,omitempty"` - Type *UpdateOutputElasticsearchType `json:"type,omitempty"` +// ServicenowConfig Defines properties for connectors when type is `.servicenow`. +type ServicenowConfig struct { + // ApiUrl The ServiceNow instance URL. + ApiUrl string `json:"apiUrl"` + + // ClientId The client ID assigned to your OAuth application. This property is required when `isOAuth` is `true`. + ClientId *string `json:"clientId,omitempty"` + + // IsOAuth The type of authentication to use. The default value is false, which means basic authentication is used instead of open authorization (OAuth). + IsOAuth *bool `json:"isOAuth,omitempty"` + + // JwtKeyId The key identifier assigned to the JWT verifier map of your OAuth application. This property is required when `isOAuth` is `true`. + JwtKeyId *string `json:"jwtKeyId,omitempty"` + + // UserIdentifierValue The identifier to use for OAuth authentication. This identifier should be the user field you selected when you created an OAuth JWT API endpoint for external clients in your ServiceNow instance. For example, if the selected user field is `Email`, the user identifier should be the user's email address. This property is required when `isOAuth` is `true`. + UserIdentifierValue *string `json:"userIdentifierValue,omitempty"` + + // UsesTableApi Determines whether the connector uses the Table API or the Import Set API. This property is supported only for ServiceNow ITSM and ServiceNow SecOps connectors. NOTE: If this property is set to `false`, the Elastic application should be installed in ServiceNow. + UsesTableApi *bool `json:"usesTableApi,omitempty"` } -// UpdateOutputElasticsearchPreset defines model for UpdateOutputElasticsearch.Preset. -type UpdateOutputElasticsearchPreset string +// ServicenowItomConfig Defines properties for connectors when type is `.servicenow-itom`. +type ServicenowItomConfig struct { + // ApiUrl The ServiceNow instance URL. + ApiUrl string `json:"apiUrl"` -// UpdateOutputElasticsearchSecretsSslKey0 defines model for . -type UpdateOutputElasticsearchSecretsSslKey0 struct { - Id string `json:"id"` + // ClientId The client ID assigned to your OAuth application. This property is required when `isOAuth` is `true`. + ClientId *string `json:"clientId,omitempty"` + + // IsOAuth The type of authentication to use. The default value is false, which means basic authentication is used instead of open authorization (OAuth). + IsOAuth *bool `json:"isOAuth,omitempty"` + + // JwtKeyId The key identifier assigned to the JWT verifier map of your OAuth application. This property is required when `isOAuth` is `true`. + JwtKeyId *string `json:"jwtKeyId,omitempty"` + + // UserIdentifierValue The identifier to use for OAuth authentication. This identifier should be the user field you selected when you created an OAuth JWT API endpoint for external clients in your ServiceNow instance. For example, if the selected user field is `Email`, the user identifier should be the user's email address. This property is required when `isOAuth` is `true`. + UserIdentifierValue *string `json:"userIdentifierValue,omitempty"` } -// UpdateOutputElasticsearchSecretsSslKey1 defines model for . -type UpdateOutputElasticsearchSecretsSslKey1 = string +// ServicenowSecrets Defines secrets for connectors when type is `.servicenow`, `.servicenow-sir`, or `.servicenow-itom`. +type ServicenowSecrets struct { + // ClientSecret The client secret assigned to your OAuth application. This property is required when `isOAuth` is `true`. + ClientSecret *string `json:"clientSecret,omitempty"` -// UpdateOutputElasticsearch_Secrets_Ssl_Key defines model for UpdateOutputElasticsearch.Secrets.Ssl.Key. -type UpdateOutputElasticsearch_Secrets_Ssl_Key struct { - union json.RawMessage + // Password The password for HTTP basic authentication. This property is required when `isOAuth` is `false`. + Password *string `json:"password,omitempty"` + + // PrivateKey The RSA private key that you created for use in ServiceNow. This property is required when `isOAuth` is `true`. + PrivateKey *string `json:"privateKey,omitempty"` + + // PrivateKeyPassword The password for the RSA private key. This property is required when `isOAuth` is `true` and you set a password on your private key. + PrivateKeyPassword *string `json:"privateKeyPassword,omitempty"` + + // Username The username for HTTP basic authentication. This property is required when `isOAuth` is `false`. + Username *string `json:"username,omitempty"` } -// UpdateOutputElasticsearchType defines model for UpdateOutputElasticsearch.Type. -type UpdateOutputElasticsearchType string +// SlackApiConfig Defines properties for connectors when type is `.slack_api`. +type SlackApiConfig struct { + // AllowedChannels A list of valid Slack channels. + AllowedChannels *[]struct { + // Id The Slack channel ID. + Id string `json:"id"` -// UpdateOutputKafka defines model for update_output_kafka. -type UpdateOutputKafka struct { - AllowEdit *[]string `json:"allow_edit,omitempty"` - AuthType *UpdateOutputKafkaAuthType `json:"auth_type,omitempty"` - BrokerTimeout *float32 `json:"broker_timeout,omitempty"` - CaSha256 *string `json:"ca_sha256,omitempty"` - CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` - ClientId *string `json:"client_id,omitempty"` - Compression *UpdateOutputKafkaCompression `json:"compression,omitempty"` - CompressionLevel interface{} `json:"compression_level"` - ConfigYaml *string `json:"config_yaml"` - ConnectionType interface{} `json:"connection_type"` - Hash *struct { - Hash *string `json:"hash,omitempty"` - Random *bool `json:"random,omitempty"` - } `json:"hash,omitempty"` + // Name The Slack channel name. + Name string `json:"name"` + } `json:"allowedChannels,omitempty"` +} + +// SlackApiSecrets Defines secrets for connectors when type is `.slack`. +type SlackApiSecrets struct { + // Token Slack bot user OAuth token. + Token string `json:"token"` +} + +// SwimlaneConfig Defines properties for connectors when type is `.swimlane`. +type SwimlaneConfig struct { + // ApiUrl The Swimlane instance URL. + ApiUrl string `json:"apiUrl"` + + // AppId The Swimlane application ID. + AppId string `json:"appId"` + + // ConnectorType The type of connector. Valid values are `all`, `alerts`, and `cases`. + ConnectorType SwimlaneConfigConnectorType `json:"connectorType"` + + // Mappings The field mapping. + Mappings *struct { + // AlertIdConfig Mapping for the alert ID. + AlertIdConfig *struct { + // FieldType The type of field in Swimlane. + FieldType string `json:"fieldType"` + + // Id The identifier for the field in Swimlane. + Id string `json:"id"` + + // Key The key for the field in Swimlane. + Key string `json:"key"` + + // Name The name of the field in Swimlane. + Name string `json:"name"` + } `json:"alertIdConfig,omitempty"` + + // CaseIdConfig Mapping for the case ID. + CaseIdConfig *struct { + // FieldType The type of field in Swimlane. + FieldType string `json:"fieldType"` + + // Id The identifier for the field in Swimlane. + Id string `json:"id"` + + // Key The key for the field in Swimlane. + Key string `json:"key"` + + // Name The name of the field in Swimlane. + Name string `json:"name"` + } `json:"caseIdConfig,omitempty"` + + // CaseNameConfig Mapping for the case name. + CaseNameConfig *struct { + // FieldType The type of field in Swimlane. + FieldType string `json:"fieldType"` + + // Id The identifier for the field in Swimlane. + Id string `json:"id"` + + // Key The key for the field in Swimlane. + Key string `json:"key"` + + // Name The name of the field in Swimlane. + Name string `json:"name"` + } `json:"caseNameConfig,omitempty"` + + // CommentsConfig Mapping for the case comments. + CommentsConfig *struct { + // FieldType The type of field in Swimlane. + FieldType string `json:"fieldType"` + + // Id The identifier for the field in Swimlane. + Id string `json:"id"` + + // Key The key for the field in Swimlane. + Key string `json:"key"` + + // Name The name of the field in Swimlane. + Name string `json:"name"` + } `json:"commentsConfig,omitempty"` + + // DescriptionConfig Mapping for the case description. + DescriptionConfig *struct { + // FieldType The type of field in Swimlane. + FieldType string `json:"fieldType"` + + // Id The identifier for the field in Swimlane. + Id string `json:"id"` + + // Key The key for the field in Swimlane. + Key string `json:"key"` + + // Name The name of the field in Swimlane. + Name string `json:"name"` + } `json:"descriptionConfig,omitempty"` + + // RuleNameConfig Mapping for the name of the alert's rule. + RuleNameConfig *struct { + // FieldType The type of field in Swimlane. + FieldType string `json:"fieldType"` + + // Id The identifier for the field in Swimlane. + Id string `json:"id"` + + // Key The key for the field in Swimlane. + Key string `json:"key"` + + // Name The name of the field in Swimlane. + Name string `json:"name"` + } `json:"ruleNameConfig,omitempty"` + + // SeverityConfig Mapping for the severity. + SeverityConfig *struct { + // FieldType The type of field in Swimlane. + FieldType string `json:"fieldType"` + + // Id The identifier for the field in Swimlane. + Id string `json:"id"` + + // Key The key for the field in Swimlane. + Key string `json:"key"` + + // Name The name of the field in Swimlane. + Name string `json:"name"` + } `json:"severityConfig,omitempty"` + } `json:"mappings,omitempty"` +} + +// SwimlaneConfigConnectorType The type of connector. Valid values are `all`, `alerts`, and `cases`. +type SwimlaneConfigConnectorType string + +// SwimlaneSecrets Defines secrets for connectors when type is `.swimlane`. +type SwimlaneSecrets struct { + // ApiToken Swimlane API authentication token. + ApiToken *string `json:"apiToken,omitempty"` +} + +// TeamsSecrets Defines secrets for connectors when type is `.teams`. +type TeamsSecrets struct { + // WebhookUrl The URL of the incoming webhook. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. + WebhookUrl string `json:"webhookUrl"` +} + +// ThehiveConfig Defines configuration properties for connectors when type is `.thehive`. +type ThehiveConfig struct { + // Organisation The organisation in TheHive that will contain the alerts or cases. By default, the connector uses the default organisation of the user account that created the API key. + Organisation *string `json:"organisation,omitempty"` + + // Url The instance URL in TheHive. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. + Url string `json:"url"` +} + +// ThehiveSecrets Defines secrets for connectors when type is `.thehive`. +type ThehiveSecrets struct { + // ApiKey The API key for authentication in TheHive. + ApiKey string `json:"apiKey"` +} + +// TinesConfig Defines properties for connectors when type is `.tines`. +type TinesConfig struct { + // Url The Tines tenant URL. If you are using the `xpack.actions.allowedHosts` setting, make sure this hostname is added to the allowed hosts. + Url string `json:"url"` +} + +// TinesSecrets Defines secrets for connectors when type is `.tines`. +type TinesSecrets struct { + // Email The email used to sign in to Tines. + Email string `json:"email"` + + // Token The Tines API token. + Token string `json:"token"` +} + +// TorqConfig Defines properties for connectors when type is `.torq`. +type TorqConfig struct { + // WebhookIntegrationUrl The endpoint URL of the Elastic Security integration in Torq. + WebhookIntegrationUrl string `json:"webhookIntegrationUrl"` +} + +// TorqSecrets Defines secrets for connectors when type is `.torq`. +type TorqSecrets struct { + // Token The secret of the webhook authentication header. + Token string `json:"token"` +} + +// UpdateConnectorConfig The connector configuration details. +type UpdateConnectorConfig struct { + AdditionalProperties map[string]interface{} `json:"-"` + union json.RawMessage +} + +// UpdateConnectorSecrets defines model for update_connector_secrets. +type UpdateConnectorSecrets struct { + AdditionalProperties map[string]interface{} `json:"-"` + union json.RawMessage +} + +// UpdateOutputElasticsearch defines model for update_output_elasticsearch. +type UpdateOutputElasticsearch struct { + AllowEdit *[]string `json:"allow_edit,omitempty"` + CaSha256 *string `json:"ca_sha256,omitempty"` + CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` + ConfigYaml *string `json:"config_yaml,omitempty"` + Hosts *[]string `json:"hosts,omitempty"` + IsDefault *bool `json:"is_default,omitempty"` + IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` + IsInternal *bool `json:"is_internal,omitempty"` + IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + Name *string `json:"name,omitempty"` + Preset *UpdateOutputElasticsearchPreset `json:"preset,omitempty"` + ProxyId *string `json:"proxy_id,omitempty"` + Secrets *struct { + Ssl *struct { + Key *UpdateOutputElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` + } `json:"ssl,omitempty"` + } `json:"secrets,omitempty"` + Shipper *UpdateOutputShipper `json:"shipper,omitempty"` + Ssl *UpdateOutputSsl `json:"ssl,omitempty"` + Type *UpdateOutputElasticsearchType `json:"type,omitempty"` +} + +// UpdateOutputElasticsearchPreset defines model for UpdateOutputElasticsearch.Preset. +type UpdateOutputElasticsearchPreset string + +// UpdateOutputElasticsearchSecretsSslKey0 defines model for . +type UpdateOutputElasticsearchSecretsSslKey0 struct { + Id string `json:"id"` +} + +// UpdateOutputElasticsearchSecretsSslKey1 defines model for . +type UpdateOutputElasticsearchSecretsSslKey1 = string + +// UpdateOutputElasticsearch_Secrets_Ssl_Key defines model for UpdateOutputElasticsearch.Secrets.Ssl.Key. +type UpdateOutputElasticsearch_Secrets_Ssl_Key struct { + union json.RawMessage +} + +// UpdateOutputElasticsearchType defines model for UpdateOutputElasticsearch.Type. +type UpdateOutputElasticsearchType string + +// UpdateOutputKafka defines model for update_output_kafka. +type UpdateOutputKafka struct { + AllowEdit *[]string `json:"allow_edit,omitempty"` + AuthType *UpdateOutputKafkaAuthType `json:"auth_type,omitempty"` + BrokerTimeout *float32 `json:"broker_timeout,omitempty"` + CaSha256 *string `json:"ca_sha256,omitempty"` + CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` + ClientId *string `json:"client_id,omitempty"` + Compression *UpdateOutputKafkaCompression `json:"compression,omitempty"` + CompressionLevel interface{} `json:"compression_level"` + ConfigYaml *string `json:"config_yaml,omitempty"` + ConnectionType interface{} `json:"connection_type"` + Hash *struct { + Hash *string `json:"hash,omitempty"` + Random *bool `json:"random,omitempty"` + } `json:"hash,omitempty"` Headers *[]struct { Key string `json:"key"` Value string `json:"value"` @@ -2840,7 +3627,7 @@ type UpdateOutputKafka struct { } `json:"round_robin,omitempty"` Sasl *struct { Mechanism *UpdateOutputKafkaSaslMechanism `json:"mechanism,omitempty"` - } `json:"sasl"` + } `json:"sasl,omitempty"` Secrets *struct { Password *UpdateOutputKafka_Secrets_Password `json:"password,omitempty"` Ssl *struct { @@ -2905,7 +3692,7 @@ type UpdateOutputLogstash struct { AllowEdit *[]string `json:"allow_edit,omitempty"` CaSha256 *string `json:"ca_sha256,omitempty"` CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` - ConfigYaml *string `json:"config_yaml"` + ConfigYaml *string `json:"config_yaml,omitempty"` Hosts *[]string `json:"hosts,omitempty"` IsDefault *bool `json:"is_default,omitempty"` IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` @@ -2944,14 +3731,14 @@ type UpdateOutputRemoteElasticsearch struct { AllowEdit *[]string `json:"allow_edit,omitempty"` CaSha256 *string `json:"ca_sha256,omitempty"` CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` - ConfigYaml *string `json:"config_yaml"` + ConfigYaml *string `json:"config_yaml,omitempty"` Hosts *[]string `json:"hosts,omitempty"` IsDefault *bool `json:"is_default,omitempty"` IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` IsInternal *bool `json:"is_internal,omitempty"` IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - KibanaApiKey *string `json:"kibana_api_key"` - KibanaUrl *string `json:"kibana_url"` + KibanaApiKey *string `json:"kibana_api_key,omitempty"` + KibanaUrl *string `json:"kibana_url,omitempty"` Name *string `json:"name,omitempty"` Preset *UpdateOutputRemoteElasticsearchPreset `json:"preset,omitempty"` ProxyId *string `json:"proxy_id,omitempty"` @@ -2961,7 +3748,7 @@ type UpdateOutputRemoteElasticsearch struct { Key *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` } `json:"ssl,omitempty"` } `json:"secrets,omitempty"` - ServiceToken *string `json:"service_token"` + ServiceToken *string `json:"service_token,omitempty"` Shipper *UpdateOutputShipper `json:"shipper,omitempty"` Ssl *UpdateOutputSsl `json:"ssl,omitempty"` SyncIntegrations *bool `json:"sync_integrations,omitempty"` @@ -3003,16 +3790,16 @@ type UpdateOutputRemoteElasticsearchType string // UpdateOutputShipper defines model for update_output_shipper. type UpdateOutputShipper struct { - CompressionLevel *float32 `json:"compression_level"` - DiskQueueCompressionEnabled *bool `json:"disk_queue_compression_enabled"` - DiskQueueEnabled *bool `json:"disk_queue_enabled"` - DiskQueueEncryptionEnabled *bool `json:"disk_queue_encryption_enabled"` - DiskQueueMaxSize *float32 `json:"disk_queue_max_size"` - DiskQueuePath *string `json:"disk_queue_path"` - Loadbalance *bool `json:"loadbalance"` - MaxBatchBytes *float32 `json:"max_batch_bytes"` - MemQueueEvents *float32 `json:"mem_queue_events"` - QueueFlushTimeout *float32 `json:"queue_flush_timeout"` + CompressionLevel *float32 `json:"compression_level,omitempty"` + DiskQueueCompressionEnabled *bool `json:"disk_queue_compression_enabled,omitempty"` + DiskQueueEnabled *bool `json:"disk_queue_enabled,omitempty"` + DiskQueueEncryptionEnabled *bool `json:"disk_queue_encryption_enabled,omitempty"` + DiskQueueMaxSize *float32 `json:"disk_queue_max_size,omitempty"` + DiskQueuePath *string `json:"disk_queue_path,omitempty"` + Loadbalance *bool `json:"loadbalance,omitempty"` + MaxBatchBytes *float32 `json:"max_batch_bytes,omitempty"` + MemQueueEvents *float32 `json:"mem_queue_events,omitempty"` + QueueFlushTimeout *float32 `json:"queue_flush_timeout,omitempty"` } // UpdateOutputSsl defines model for update_output_ssl. @@ -3031,6 +3818,78 @@ type UpdateOutputUnion struct { union json.RawMessage } +// VerificationMode Controls the verification of certificates. Use `full` to validate that the certificate has an issue date within the `not_before` and `not_after` dates, chains to a trusted certificate authority (CA), and has a hostname or IP address that matches the names within the certificate. Use `certificate` to validate the certificate and verify that it is signed by a trusted authority; this option does not check the certificate hostname. Use `none` to skip certificate validation. +type VerificationMode string + +// WebhookConfig Defines properties for connectors when type is `.webhook`. +type WebhookConfig struct { + // AuthType The type of authentication to use: basic, SSL, or none. + AuthType *AuthType `json:"authType,omitempty"` + + // Ca A base64 encoded version of the certificate authority file that the connector can trust to sign and validate certificates. This option is available for all authentication types. + Ca *Ca `json:"ca,omitempty"` + + // CertType If the `authType` is `webhook-authentication-ssl`, specifies whether the certificate authentication data is in a CRT and key file format or a PFX file format. + CertType *CertType `json:"certType,omitempty"` + + // HasAuth If true, a username and password for login type authentication must be provided. + HasAuth *HasAuth `json:"hasAuth,omitempty"` + + // Headers A set of key-value pairs sent as headers with the request. + Headers *map[string]interface{} `json:"headers,omitempty"` + + // Method The HTTP request method, either `post` or `put`. + Method *WebhookConfigMethod `json:"method,omitempty"` + + // Url The request URL. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. + Url *string `json:"url,omitempty"` + + // VerificationMode Controls the verification of certificates. Use `full` to validate that the certificate has an issue date within the `not_before` and `not_after` dates, chains to a trusted certificate authority (CA), and has a hostname or IP address that matches the names within the certificate. Use `certificate` to validate the certificate and verify that it is signed by a trusted authority; this option does not check the certificate hostname. Use `none` to skip certificate validation. + VerificationMode *VerificationMode `json:"verificationMode,omitempty"` +} + +// WebhookConfigMethod The HTTP request method, either `post` or `put`. +type WebhookConfigMethod string + +// WebhookSecrets Defines secrets for connectors when type is `.webhook`. +type WebhookSecrets struct { + // Crt If `authType` is `webhook-authentication-ssl` and `certType` is `ssl-crt-key`, it is a base64 encoded version of the CRT or CERT file. + Crt *Crt `json:"crt,omitempty"` + + // Key If `authType` is `webhook-authentication-ssl` and `certType` is `ssl-crt-key`, it is a base64 encoded version of the KEY file. + Key *Key `json:"key,omitempty"` + + // Password The password for HTTP basic authentication or the passphrase for the SSL certificate files. If `hasAuth` is set to `true` and `authType` is `webhook-authentication-basic`, this property is required. + Password *string `json:"password,omitempty"` + + // Pfx If `authType` is `webhook-authentication-ssl` and `certType` is `ssl-pfx`, it is a base64 encoded version of the PFX or P12 file. + Pfx *Pfx `json:"pfx,omitempty"` + + // User The username for HTTP basic authentication. If `hasAuth` is set to `true` and `authType` is `webhook-authentication-basic`, this property is required. + User *string `json:"user,omitempty"` +} + +// XmattersConfig Defines properties for connectors when type is `.xmatters`. +type XmattersConfig struct { + // ConfigUrl The request URL for the Elastic Alerts trigger in xMatters. It is applicable only when `usesBasic` is `true`. + ConfigUrl *string `json:"configUrl,omitempty"` + + // UsesBasic Specifies whether the connector uses HTTP basic authentication (`true`) or URL authentication (`false`). + UsesBasic *bool `json:"usesBasic,omitempty"` +} + +// XmattersSecrets Defines secrets for connectors when type is `.xmatters`. +type XmattersSecrets struct { + // Password A user name for HTTP basic authentication. It is applicable only when `usesBasic` is `true`. + Password *string `json:"password,omitempty"` + + // SecretsUrl The request URL for the Elastic Alerts trigger in xMatters with the API key included in the URL. It is applicable only when `usesBasic` is `false`. + SecretsUrl *string `json:"secretsUrl,omitempty"` + + // User A password for HTTP basic authentication. It is applicable only when `usesBasic` is `true`. + User *string `json:"user,omitempty"` +} + // APMUIElasticApiVersion defines model for APM_UI_elastic_api_version. type APMUIElasticApiVersion string @@ -3099,15 +3958,15 @@ type GetFleetAgentPoliciesParamsFormat string // PostFleetAgentPoliciesJSONBody defines parameters for PostFleetAgentPolicies. type PostFleetAgentPoliciesJSONBody struct { AdvancedSettings *struct { - AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` - AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` - AgentLimitsGoMaxProcs *interface{} `json:"agent_limits_go_max_procs"` - AgentLoggingFilesInterval *interface{} `json:"agent_logging_files_interval"` - AgentLoggingFilesKeepfiles *interface{} `json:"agent_logging_files_keepfiles"` - AgentLoggingFilesRotateeverybytes *interface{} `json:"agent_logging_files_rotateeverybytes"` - AgentLoggingLevel *interface{} `json:"agent_logging_level"` - AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` - AgentLoggingToFiles *interface{} `json:"agent_logging_to_files"` + AgentDownloadTargetDirectory interface{} `json:"agent_download_target_directory,omitempty"` + AgentDownloadTimeout interface{} `json:"agent_download_timeout,omitempty"` + AgentLimitsGoMaxProcs interface{} `json:"agent_limits_go_max_procs,omitempty"` + AgentLoggingFilesInterval interface{} `json:"agent_logging_files_interval,omitempty"` + AgentLoggingFilesKeepfiles interface{} `json:"agent_logging_files_keepfiles,omitempty"` + AgentLoggingFilesRotateeverybytes interface{} `json:"agent_logging_files_rotateeverybytes,omitempty"` + AgentLoggingLevel interface{} `json:"agent_logging_level,omitempty"` + AgentLoggingMetricsPeriod interface{} `json:"agent_logging_metrics_period,omitempty"` + AgentLoggingToFiles interface{} `json:"agent_logging_to_files,omitempty"` } `json:"advanced_settings,omitempty"` AgentFeatures *[]struct { Enabled bool `json:"enabled"` @@ -3125,10 +3984,10 @@ type PostFleetAgentPoliciesJSONBody struct { } `json:"requests,omitempty"` } `json:"resources,omitempty"` } `json:"agentless,omitempty"` - DataOutputId *string `json:"data_output_id"` + DataOutputId *string `json:"data_output_id,omitempty"` Description *string `json:"description,omitempty"` - DownloadSourceId *string `json:"download_source_id"` - FleetServerHostId *string `json:"fleet_server_host_id"` + DownloadSourceId *string `json:"download_source_id,omitempty"` + FleetServerHostId *string `json:"fleet_server_host_id,omitempty"` Force *bool `json:"force,omitempty"` // GlobalDataTags User defined data tags that are added to all of the inputs. The values can be strings or numbers. @@ -3163,7 +4022,7 @@ type PostFleetAgentPoliciesJSONBody struct { Host *string `json:"host,omitempty"` Port *float32 `json:"port,omitempty"` } `json:"monitoring_http,omitempty"` - MonitoringOutputId *string `json:"monitoring_output_id"` + MonitoringOutputId *string `json:"monitoring_output_id,omitempty"` MonitoringPprofEnabled *bool `json:"monitoring_pprof_enabled,omitempty"` Name string `json:"name"` Namespace string `json:"namespace"` @@ -3211,15 +4070,15 @@ type GetFleetAgentPoliciesAgentpolicyidParamsFormat string // PutFleetAgentPoliciesAgentpolicyidJSONBody defines parameters for PutFleetAgentPoliciesAgentpolicyid. type PutFleetAgentPoliciesAgentpolicyidJSONBody struct { AdvancedSettings *struct { - AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` - AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` - AgentLimitsGoMaxProcs *interface{} `json:"agent_limits_go_max_procs"` - AgentLoggingFilesInterval *interface{} `json:"agent_logging_files_interval"` - AgentLoggingFilesKeepfiles *interface{} `json:"agent_logging_files_keepfiles"` - AgentLoggingFilesRotateeverybytes *interface{} `json:"agent_logging_files_rotateeverybytes"` - AgentLoggingLevel *interface{} `json:"agent_logging_level"` - AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` - AgentLoggingToFiles *interface{} `json:"agent_logging_to_files"` + AgentDownloadTargetDirectory interface{} `json:"agent_download_target_directory,omitempty"` + AgentDownloadTimeout interface{} `json:"agent_download_timeout,omitempty"` + AgentLimitsGoMaxProcs interface{} `json:"agent_limits_go_max_procs,omitempty"` + AgentLoggingFilesInterval interface{} `json:"agent_logging_files_interval,omitempty"` + AgentLoggingFilesKeepfiles interface{} `json:"agent_logging_files_keepfiles,omitempty"` + AgentLoggingFilesRotateeverybytes interface{} `json:"agent_logging_files_rotateeverybytes,omitempty"` + AgentLoggingLevel interface{} `json:"agent_logging_level,omitempty"` + AgentLoggingMetricsPeriod interface{} `json:"agent_logging_metrics_period,omitempty"` + AgentLoggingToFiles interface{} `json:"agent_logging_to_files,omitempty"` } `json:"advanced_settings,omitempty"` AgentFeatures *[]struct { Enabled bool `json:"enabled"` @@ -3238,10 +4097,10 @@ type PutFleetAgentPoliciesAgentpolicyidJSONBody struct { } `json:"resources,omitempty"` } `json:"agentless,omitempty"` BumpRevision *bool `json:"bumpRevision,omitempty"` - DataOutputId *string `json:"data_output_id"` + DataOutputId *string `json:"data_output_id,omitempty"` Description *string `json:"description,omitempty"` - DownloadSourceId *string `json:"download_source_id"` - FleetServerHostId *string `json:"fleet_server_host_id"` + DownloadSourceId *string `json:"download_source_id,omitempty"` + FleetServerHostId *string `json:"fleet_server_host_id,omitempty"` Force *bool `json:"force,omitempty"` // GlobalDataTags User defined data tags that are added to all of the inputs. The values can be strings or numbers. @@ -3276,7 +4135,7 @@ type PutFleetAgentPoliciesAgentpolicyidJSONBody struct { Host *string `json:"host,omitempty"` Port *float32 `json:"port,omitempty"` } `json:"monitoring_http,omitempty"` - MonitoringOutputId *string `json:"monitoring_output_id"` + MonitoringOutputId *string `json:"monitoring_output_id,omitempty"` MonitoringPprofEnabled *bool `json:"monitoring_pprof_enabled,omitempty"` Name string `json:"name"` Namespace string `json:"namespace"` @@ -3533,6 +4392,29 @@ type PutParameterJSONBody struct { Value *string `json:"value,omitempty"` } +// PostActionsConnectorIdJSONBody defines parameters for PostActionsConnectorId. +type PostActionsConnectorIdJSONBody struct { + // Config The connector configuration details. + Config *CreateConnectorConfig `json:"config,omitempty"` + + // ConnectorTypeId The type of connector. + ConnectorTypeId string `json:"connector_type_id"` + + // Name The display name for the connector. + Name string `json:"name"` + Secrets *CreateConnectorSecrets `json:"secrets,omitempty"` +} + +// PutActionsConnectorIdJSONBody defines parameters for PutActionsConnectorId. +type PutActionsConnectorIdJSONBody struct { + // Config The connector configuration details. + Config *UpdateConnectorConfig `json:"config,omitempty"` + + // Name The display name for the connector. + Name string `json:"name"` + Secrets *UpdateConnectorSecrets `json:"secrets,omitempty"` +} + // DeleteAgentConfigurationJSONRequestBody defines body for DeleteAgentConfiguration for application/json ContentType. type DeleteAgentConfigurationJSONRequestBody = APMUIDeleteServiceObject @@ -3575,6 +4457,12 @@ type PostParametersJSONRequestBody PostParametersJSONBody // PutParameterJSONRequestBody defines body for PutParameter for application/json ContentType. type PutParameterJSONRequestBody PutParameterJSONBody +// PostActionsConnectorIdJSONRequestBody defines body for PostActionsConnectorId for application/json ContentType. +type PostActionsConnectorIdJSONRequestBody PostActionsConnectorIdJSONBody + +// PutActionsConnectorIdJSONRequestBody defines body for PutActionsConnectorId for application/json ContentType. +type PutActionsConnectorIdJSONRequestBody PutActionsConnectorIdJSONBody + // CreateDataViewDefaultwJSONRequestBody defines body for CreateDataViewDefaultw for application/json ContentType. type CreateDataViewDefaultwJSONRequestBody = DataViewsCreateDataViewRequestObject @@ -3717,6 +4605,40 @@ func (a AgentPolicy_PackagePolicies_1_Elasticsearch) MarshalJSON() ([]byte, erro return json.Marshal(object) } +// Getter for additional properties for CreateConnectorConfig. Returns the specified +// element and whether it was found +func (a CreateConnectorConfig) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for CreateConnectorConfig +func (a *CreateConnectorConfig) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Getter for additional properties for CreateConnectorSecrets. Returns the specified +// element and whether it was found +func (a CreateConnectorSecrets) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for CreateConnectorSecrets +func (a *CreateConnectorSecrets) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + // Getter for additional properties for OutputElasticsearch. Returns the specified // element and whether it was found func (a OutputElasticsearch) Get(fieldName string) (value interface{}, found bool) { @@ -11464,6 +12386,40 @@ func (a PackagePolicy_Elasticsearch) MarshalJSON() ([]byte, error) { return json.Marshal(object) } +// Getter for additional properties for UpdateConnectorConfig. Returns the specified +// element and whether it was found +func (a UpdateConnectorConfig) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for UpdateConnectorConfig +func (a *UpdateConnectorConfig) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Getter for additional properties for UpdateConnectorSecrets. Returns the specified +// element and whether it was found +func (a UpdateConnectorSecrets) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for UpdateConnectorSecrets +func (a *UpdateConnectorSecrets) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + // AsAgentPolicyPackagePolicies1Inputs1StreamsVars0 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars0 func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars0() (AgentPolicyPackagePolicies1Inputs1StreamsVars0, error) { var body AgentPolicyPackagePolicies1Inputs1StreamsVars0 @@ -12210,22 +13166,22 @@ func (t *AgentPolicyGlobalDataTagsItem_Value) UnmarshalJSON(b []byte) error { return err } -// AsCreateParamResponse0 returns the union data inside the CreateParamResponse as a CreateParamResponse0 -func (t CreateParamResponse) AsCreateParamResponse0() (CreateParamResponse0, error) { - var body CreateParamResponse0 +// AsBedrockConfig returns the union data inside the CreateConnectorConfig as a BedrockConfig +func (t CreateConnectorConfig) AsBedrockConfig() (BedrockConfig, error) { + var body BedrockConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromCreateParamResponse0 overwrites any union data inside the CreateParamResponse as the provided CreateParamResponse0 -func (t *CreateParamResponse) FromCreateParamResponse0(v CreateParamResponse0) error { +// FromBedrockConfig overwrites any union data inside the CreateConnectorConfig as the provided BedrockConfig +func (t *CreateConnectorConfig) FromBedrockConfig(v BedrockConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeCreateParamResponse0 performs a merge with any union data inside the CreateParamResponse, using the provided CreateParamResponse0 -func (t *CreateParamResponse) MergeCreateParamResponse0(v CreateParamResponse0) error { +// MergeBedrockConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided BedrockConfig +func (t *CreateConnectorConfig) MergeBedrockConfig(v BedrockConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12236,22 +13192,22 @@ func (t *CreateParamResponse) MergeCreateParamResponse0(v CreateParamResponse0) return err } -// AsSyntheticsPostParameterResponse returns the union data inside the CreateParamResponse as a SyntheticsPostParameterResponse -func (t CreateParamResponse) AsSyntheticsPostParameterResponse() (SyntheticsPostParameterResponse, error) { - var body SyntheticsPostParameterResponse +// AsCrowdstrikeConfig returns the union data inside the CreateConnectorConfig as a CrowdstrikeConfig +func (t CreateConnectorConfig) AsCrowdstrikeConfig() (CrowdstrikeConfig, error) { + var body CrowdstrikeConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromSyntheticsPostParameterResponse overwrites any union data inside the CreateParamResponse as the provided SyntheticsPostParameterResponse -func (t *CreateParamResponse) FromSyntheticsPostParameterResponse(v SyntheticsPostParameterResponse) error { +// FromCrowdstrikeConfig overwrites any union data inside the CreateConnectorConfig as the provided CrowdstrikeConfig +func (t *CreateConnectorConfig) FromCrowdstrikeConfig(v CrowdstrikeConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSyntheticsPostParameterResponse performs a merge with any union data inside the CreateParamResponse, using the provided SyntheticsPostParameterResponse -func (t *CreateParamResponse) MergeSyntheticsPostParameterResponse(v SyntheticsPostParameterResponse) error { +// MergeCrowdstrikeConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided CrowdstrikeConfig +func (t *CreateConnectorConfig) MergeCrowdstrikeConfig(v CrowdstrikeConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12262,32 +13218,22 @@ func (t *CreateParamResponse) MergeSyntheticsPostParameterResponse(v SyntheticsP return err } -func (t CreateParamResponse) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *CreateParamResponse) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsNewOutputElasticsearchSecretsSslKey0 returns the union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as a NewOutputElasticsearchSecretsSslKey0 -func (t NewOutputElasticsearch_Secrets_Ssl_Key) AsNewOutputElasticsearchSecretsSslKey0() (NewOutputElasticsearchSecretsSslKey0, error) { - var body NewOutputElasticsearchSecretsSslKey0 +// AsD3securityConfig returns the union data inside the CreateConnectorConfig as a D3securityConfig +func (t CreateConnectorConfig) AsD3securityConfig() (D3securityConfig, error) { + var body D3securityConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromNewOutputElasticsearchSecretsSslKey0 overwrites any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as the provided NewOutputElasticsearchSecretsSslKey0 -func (t *NewOutputElasticsearch_Secrets_Ssl_Key) FromNewOutputElasticsearchSecretsSslKey0(v NewOutputElasticsearchSecretsSslKey0) error { +// FromD3securityConfig overwrites any union data inside the CreateConnectorConfig as the provided D3securityConfig +func (t *CreateConnectorConfig) FromD3securityConfig(v D3securityConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNewOutputElasticsearchSecretsSslKey0 performs a merge with any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key, using the provided NewOutputElasticsearchSecretsSslKey0 -func (t *NewOutputElasticsearch_Secrets_Ssl_Key) MergeNewOutputElasticsearchSecretsSslKey0(v NewOutputElasticsearchSecretsSslKey0) error { +// MergeD3securityConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided D3securityConfig +func (t *CreateConnectorConfig) MergeD3securityConfig(v D3securityConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12298,22 +13244,22 @@ func (t *NewOutputElasticsearch_Secrets_Ssl_Key) MergeNewOutputElasticsearchSecr return err } -// AsNewOutputElasticsearchSecretsSslKey1 returns the union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as a NewOutputElasticsearchSecretsSslKey1 -func (t NewOutputElasticsearch_Secrets_Ssl_Key) AsNewOutputElasticsearchSecretsSslKey1() (NewOutputElasticsearchSecretsSslKey1, error) { - var body NewOutputElasticsearchSecretsSslKey1 +// AsEmailConfig returns the union data inside the CreateConnectorConfig as a EmailConfig +func (t CreateConnectorConfig) AsEmailConfig() (EmailConfig, error) { + var body EmailConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromNewOutputElasticsearchSecretsSslKey1 overwrites any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as the provided NewOutputElasticsearchSecretsSslKey1 -func (t *NewOutputElasticsearch_Secrets_Ssl_Key) FromNewOutputElasticsearchSecretsSslKey1(v NewOutputElasticsearchSecretsSslKey1) error { +// FromEmailConfig overwrites any union data inside the CreateConnectorConfig as the provided EmailConfig +func (t *CreateConnectorConfig) FromEmailConfig(v EmailConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNewOutputElasticsearchSecretsSslKey1 performs a merge with any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key, using the provided NewOutputElasticsearchSecretsSslKey1 -func (t *NewOutputElasticsearch_Secrets_Ssl_Key) MergeNewOutputElasticsearchSecretsSslKey1(v NewOutputElasticsearchSecretsSslKey1) error { +// MergeEmailConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided EmailConfig +func (t *CreateConnectorConfig) MergeEmailConfig(v EmailConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12324,32 +13270,22 @@ func (t *NewOutputElasticsearch_Secrets_Ssl_Key) MergeNewOutputElasticsearchSecr return err } -func (t NewOutputElasticsearch_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *NewOutputElasticsearch_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsNewOutputKafkaSecretsPassword0 returns the union data inside the NewOutputKafka_Secrets_Password as a NewOutputKafkaSecretsPassword0 -func (t NewOutputKafka_Secrets_Password) AsNewOutputKafkaSecretsPassword0() (NewOutputKafkaSecretsPassword0, error) { - var body NewOutputKafkaSecretsPassword0 +// AsGeminiConfig returns the union data inside the CreateConnectorConfig as a GeminiConfig +func (t CreateConnectorConfig) AsGeminiConfig() (GeminiConfig, error) { + var body GeminiConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromNewOutputKafkaSecretsPassword0 overwrites any union data inside the NewOutputKafka_Secrets_Password as the provided NewOutputKafkaSecretsPassword0 -func (t *NewOutputKafka_Secrets_Password) FromNewOutputKafkaSecretsPassword0(v NewOutputKafkaSecretsPassword0) error { +// FromGeminiConfig overwrites any union data inside the CreateConnectorConfig as the provided GeminiConfig +func (t *CreateConnectorConfig) FromGeminiConfig(v GeminiConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNewOutputKafkaSecretsPassword0 performs a merge with any union data inside the NewOutputKafka_Secrets_Password, using the provided NewOutputKafkaSecretsPassword0 -func (t *NewOutputKafka_Secrets_Password) MergeNewOutputKafkaSecretsPassword0(v NewOutputKafkaSecretsPassword0) error { +// MergeGeminiConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided GeminiConfig +func (t *CreateConnectorConfig) MergeGeminiConfig(v GeminiConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12360,22 +13296,22 @@ func (t *NewOutputKafka_Secrets_Password) MergeNewOutputKafkaSecretsPassword0(v return err } -// AsNewOutputKafkaSecretsPassword1 returns the union data inside the NewOutputKafka_Secrets_Password as a NewOutputKafkaSecretsPassword1 -func (t NewOutputKafka_Secrets_Password) AsNewOutputKafkaSecretsPassword1() (NewOutputKafkaSecretsPassword1, error) { - var body NewOutputKafkaSecretsPassword1 +// AsResilientConfig returns the union data inside the CreateConnectorConfig as a ResilientConfig +func (t CreateConnectorConfig) AsResilientConfig() (ResilientConfig, error) { + var body ResilientConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromNewOutputKafkaSecretsPassword1 overwrites any union data inside the NewOutputKafka_Secrets_Password as the provided NewOutputKafkaSecretsPassword1 -func (t *NewOutputKafka_Secrets_Password) FromNewOutputKafkaSecretsPassword1(v NewOutputKafkaSecretsPassword1) error { +// FromResilientConfig overwrites any union data inside the CreateConnectorConfig as the provided ResilientConfig +func (t *CreateConnectorConfig) FromResilientConfig(v ResilientConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNewOutputKafkaSecretsPassword1 performs a merge with any union data inside the NewOutputKafka_Secrets_Password, using the provided NewOutputKafkaSecretsPassword1 -func (t *NewOutputKafka_Secrets_Password) MergeNewOutputKafkaSecretsPassword1(v NewOutputKafkaSecretsPassword1) error { +// MergeResilientConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided ResilientConfig +func (t *CreateConnectorConfig) MergeResilientConfig(v ResilientConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12386,32 +13322,22 @@ func (t *NewOutputKafka_Secrets_Password) MergeNewOutputKafkaSecretsPassword1(v return err } -func (t NewOutputKafka_Secrets_Password) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *NewOutputKafka_Secrets_Password) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsNewOutputKafkaSecretsSslKey0 returns the union data inside the NewOutputKafka_Secrets_Ssl_Key as a NewOutputKafkaSecretsSslKey0 -func (t NewOutputKafka_Secrets_Ssl_Key) AsNewOutputKafkaSecretsSslKey0() (NewOutputKafkaSecretsSslKey0, error) { - var body NewOutputKafkaSecretsSslKey0 +// AsIndexConfig returns the union data inside the CreateConnectorConfig as a IndexConfig +func (t CreateConnectorConfig) AsIndexConfig() (IndexConfig, error) { + var body IndexConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromNewOutputKafkaSecretsSslKey0 overwrites any union data inside the NewOutputKafka_Secrets_Ssl_Key as the provided NewOutputKafkaSecretsSslKey0 -func (t *NewOutputKafka_Secrets_Ssl_Key) FromNewOutputKafkaSecretsSslKey0(v NewOutputKafkaSecretsSslKey0) error { +// FromIndexConfig overwrites any union data inside the CreateConnectorConfig as the provided IndexConfig +func (t *CreateConnectorConfig) FromIndexConfig(v IndexConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNewOutputKafkaSecretsSslKey0 performs a merge with any union data inside the NewOutputKafka_Secrets_Ssl_Key, using the provided NewOutputKafkaSecretsSslKey0 -func (t *NewOutputKafka_Secrets_Ssl_Key) MergeNewOutputKafkaSecretsSslKey0(v NewOutputKafkaSecretsSslKey0) error { +// MergeIndexConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided IndexConfig +func (t *CreateConnectorConfig) MergeIndexConfig(v IndexConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12422,22 +13348,22 @@ func (t *NewOutputKafka_Secrets_Ssl_Key) MergeNewOutputKafkaSecretsSslKey0(v New return err } -// AsNewOutputKafkaSecretsSslKey1 returns the union data inside the NewOutputKafka_Secrets_Ssl_Key as a NewOutputKafkaSecretsSslKey1 -func (t NewOutputKafka_Secrets_Ssl_Key) AsNewOutputKafkaSecretsSslKey1() (NewOutputKafkaSecretsSslKey1, error) { - var body NewOutputKafkaSecretsSslKey1 +// AsJiraConfig returns the union data inside the CreateConnectorConfig as a JiraConfig +func (t CreateConnectorConfig) AsJiraConfig() (JiraConfig, error) { + var body JiraConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromNewOutputKafkaSecretsSslKey1 overwrites any union data inside the NewOutputKafka_Secrets_Ssl_Key as the provided NewOutputKafkaSecretsSslKey1 -func (t *NewOutputKafka_Secrets_Ssl_Key) FromNewOutputKafkaSecretsSslKey1(v NewOutputKafkaSecretsSslKey1) error { +// FromJiraConfig overwrites any union data inside the CreateConnectorConfig as the provided JiraConfig +func (t *CreateConnectorConfig) FromJiraConfig(v JiraConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNewOutputKafkaSecretsSslKey1 performs a merge with any union data inside the NewOutputKafka_Secrets_Ssl_Key, using the provided NewOutputKafkaSecretsSslKey1 -func (t *NewOutputKafka_Secrets_Ssl_Key) MergeNewOutputKafkaSecretsSslKey1(v NewOutputKafkaSecretsSslKey1) error { +// MergeJiraConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided JiraConfig +func (t *CreateConnectorConfig) MergeJiraConfig(v JiraConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12448,32 +13374,22 @@ func (t *NewOutputKafka_Secrets_Ssl_Key) MergeNewOutputKafkaSecretsSslKey1(v New return err } -func (t NewOutputKafka_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *NewOutputKafka_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsNewOutputLogstashSecretsSslKey0 returns the union data inside the NewOutputLogstash_Secrets_Ssl_Key as a NewOutputLogstashSecretsSslKey0 -func (t NewOutputLogstash_Secrets_Ssl_Key) AsNewOutputLogstashSecretsSslKey0() (NewOutputLogstashSecretsSslKey0, error) { - var body NewOutputLogstashSecretsSslKey0 +// AsGenaiAzureConfig returns the union data inside the CreateConnectorConfig as a GenaiAzureConfig +func (t CreateConnectorConfig) AsGenaiAzureConfig() (GenaiAzureConfig, error) { + var body GenaiAzureConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromNewOutputLogstashSecretsSslKey0 overwrites any union data inside the NewOutputLogstash_Secrets_Ssl_Key as the provided NewOutputLogstashSecretsSslKey0 -func (t *NewOutputLogstash_Secrets_Ssl_Key) FromNewOutputLogstashSecretsSslKey0(v NewOutputLogstashSecretsSslKey0) error { +// FromGenaiAzureConfig overwrites any union data inside the CreateConnectorConfig as the provided GenaiAzureConfig +func (t *CreateConnectorConfig) FromGenaiAzureConfig(v GenaiAzureConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNewOutputLogstashSecretsSslKey0 performs a merge with any union data inside the NewOutputLogstash_Secrets_Ssl_Key, using the provided NewOutputLogstashSecretsSslKey0 -func (t *NewOutputLogstash_Secrets_Ssl_Key) MergeNewOutputLogstashSecretsSslKey0(v NewOutputLogstashSecretsSslKey0) error { +// MergeGenaiAzureConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided GenaiAzureConfig +func (t *CreateConnectorConfig) MergeGenaiAzureConfig(v GenaiAzureConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12484,22 +13400,22 @@ func (t *NewOutputLogstash_Secrets_Ssl_Key) MergeNewOutputLogstashSecretsSslKey0 return err } -// AsNewOutputLogstashSecretsSslKey1 returns the union data inside the NewOutputLogstash_Secrets_Ssl_Key as a NewOutputLogstashSecretsSslKey1 -func (t NewOutputLogstash_Secrets_Ssl_Key) AsNewOutputLogstashSecretsSslKey1() (NewOutputLogstashSecretsSslKey1, error) { - var body NewOutputLogstashSecretsSslKey1 +// AsGenaiOpenaiConfig returns the union data inside the CreateConnectorConfig as a GenaiOpenaiConfig +func (t CreateConnectorConfig) AsGenaiOpenaiConfig() (GenaiOpenaiConfig, error) { + var body GenaiOpenaiConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromNewOutputLogstashSecretsSslKey1 overwrites any union data inside the NewOutputLogstash_Secrets_Ssl_Key as the provided NewOutputLogstashSecretsSslKey1 -func (t *NewOutputLogstash_Secrets_Ssl_Key) FromNewOutputLogstashSecretsSslKey1(v NewOutputLogstashSecretsSslKey1) error { +// FromGenaiOpenaiConfig overwrites any union data inside the CreateConnectorConfig as the provided GenaiOpenaiConfig +func (t *CreateConnectorConfig) FromGenaiOpenaiConfig(v GenaiOpenaiConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNewOutputLogstashSecretsSslKey1 performs a merge with any union data inside the NewOutputLogstash_Secrets_Ssl_Key, using the provided NewOutputLogstashSecretsSslKey1 -func (t *NewOutputLogstash_Secrets_Ssl_Key) MergeNewOutputLogstashSecretsSslKey1(v NewOutputLogstashSecretsSslKey1) error { +// MergeGenaiOpenaiConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided GenaiOpenaiConfig +func (t *CreateConnectorConfig) MergeGenaiOpenaiConfig(v GenaiOpenaiConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12510,32 +13426,22 @@ func (t *NewOutputLogstash_Secrets_Ssl_Key) MergeNewOutputLogstashSecretsSslKey1 return err } -func (t NewOutputLogstash_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *NewOutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsNewOutputRemoteElasticsearchSecretsServiceToken0 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken as a NewOutputRemoteElasticsearchSecretsServiceToken0 -func (t NewOutputRemoteElasticsearch_Secrets_ServiceToken) AsNewOutputRemoteElasticsearchSecretsServiceToken0() (NewOutputRemoteElasticsearchSecretsServiceToken0, error) { - var body NewOutputRemoteElasticsearchSecretsServiceToken0 +// AsGenaiOpenaiOtherConfig returns the union data inside the CreateConnectorConfig as a GenaiOpenaiOtherConfig +func (t CreateConnectorConfig) AsGenaiOpenaiOtherConfig() (GenaiOpenaiOtherConfig, error) { + var body GenaiOpenaiOtherConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromNewOutputRemoteElasticsearchSecretsServiceToken0 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken as the provided NewOutputRemoteElasticsearchSecretsServiceToken0 -func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) FromNewOutputRemoteElasticsearchSecretsServiceToken0(v NewOutputRemoteElasticsearchSecretsServiceToken0) error { +// FromGenaiOpenaiOtherConfig overwrites any union data inside the CreateConnectorConfig as the provided GenaiOpenaiOtherConfig +func (t *CreateConnectorConfig) FromGenaiOpenaiOtherConfig(v GenaiOpenaiOtherConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNewOutputRemoteElasticsearchSecretsServiceToken0 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken, using the provided NewOutputRemoteElasticsearchSecretsServiceToken0 -func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) MergeNewOutputRemoteElasticsearchSecretsServiceToken0(v NewOutputRemoteElasticsearchSecretsServiceToken0) error { +// MergeGenaiOpenaiOtherConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided GenaiOpenaiOtherConfig +func (t *CreateConnectorConfig) MergeGenaiOpenaiOtherConfig(v GenaiOpenaiOtherConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12546,22 +13452,22 @@ func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) MergeNewOutputRemote return err } -// AsNewOutputRemoteElasticsearchSecretsServiceToken1 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken as a NewOutputRemoteElasticsearchSecretsServiceToken1 -func (t NewOutputRemoteElasticsearch_Secrets_ServiceToken) AsNewOutputRemoteElasticsearchSecretsServiceToken1() (NewOutputRemoteElasticsearchSecretsServiceToken1, error) { - var body NewOutputRemoteElasticsearchSecretsServiceToken1 +// AsOpsgenieConfig returns the union data inside the CreateConnectorConfig as a OpsgenieConfig +func (t CreateConnectorConfig) AsOpsgenieConfig() (OpsgenieConfig, error) { + var body OpsgenieConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromNewOutputRemoteElasticsearchSecretsServiceToken1 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken as the provided NewOutputRemoteElasticsearchSecretsServiceToken1 -func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) FromNewOutputRemoteElasticsearchSecretsServiceToken1(v NewOutputRemoteElasticsearchSecretsServiceToken1) error { +// FromOpsgenieConfig overwrites any union data inside the CreateConnectorConfig as the provided OpsgenieConfig +func (t *CreateConnectorConfig) FromOpsgenieConfig(v OpsgenieConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNewOutputRemoteElasticsearchSecretsServiceToken1 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken, using the provided NewOutputRemoteElasticsearchSecretsServiceToken1 -func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) MergeNewOutputRemoteElasticsearchSecretsServiceToken1(v NewOutputRemoteElasticsearchSecretsServiceToken1) error { +// MergeOpsgenieConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided OpsgenieConfig +func (t *CreateConnectorConfig) MergeOpsgenieConfig(v OpsgenieConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12572,32 +13478,22 @@ func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) MergeNewOutputRemote return err } -func (t NewOutputRemoteElasticsearch_Secrets_ServiceToken) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsNewOutputRemoteElasticsearchSecretsSslKey0 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as a NewOutputRemoteElasticsearchSecretsSslKey0 -func (t NewOutputRemoteElasticsearch_Secrets_Ssl_Key) AsNewOutputRemoteElasticsearchSecretsSslKey0() (NewOutputRemoteElasticsearchSecretsSslKey0, error) { - var body NewOutputRemoteElasticsearchSecretsSslKey0 +// AsPagerdutyConfig returns the union data inside the CreateConnectorConfig as a PagerdutyConfig +func (t CreateConnectorConfig) AsPagerdutyConfig() (PagerdutyConfig, error) { + var body PagerdutyConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromNewOutputRemoteElasticsearchSecretsSslKey0 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as the provided NewOutputRemoteElasticsearchSecretsSslKey0 -func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) FromNewOutputRemoteElasticsearchSecretsSslKey0(v NewOutputRemoteElasticsearchSecretsSslKey0) error { +// FromPagerdutyConfig overwrites any union data inside the CreateConnectorConfig as the provided PagerdutyConfig +func (t *CreateConnectorConfig) FromPagerdutyConfig(v PagerdutyConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNewOutputRemoteElasticsearchSecretsSslKey0 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided NewOutputRemoteElasticsearchSecretsSslKey0 -func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeNewOutputRemoteElasticsearchSecretsSslKey0(v NewOutputRemoteElasticsearchSecretsSslKey0) error { +// MergePagerdutyConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided PagerdutyConfig +func (t *CreateConnectorConfig) MergePagerdutyConfig(v PagerdutyConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12608,22 +13504,22 @@ func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeNewOutputRemoteElast return err } -// AsNewOutputRemoteElasticsearchSecretsSslKey1 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as a NewOutputRemoteElasticsearchSecretsSslKey1 -func (t NewOutputRemoteElasticsearch_Secrets_Ssl_Key) AsNewOutputRemoteElasticsearchSecretsSslKey1() (NewOutputRemoteElasticsearchSecretsSslKey1, error) { - var body NewOutputRemoteElasticsearchSecretsSslKey1 +// AsSentineloneConfig returns the union data inside the CreateConnectorConfig as a SentineloneConfig +func (t CreateConnectorConfig) AsSentineloneConfig() (SentineloneConfig, error) { + var body SentineloneConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromNewOutputRemoteElasticsearchSecretsSslKey1 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as the provided NewOutputRemoteElasticsearchSecretsSslKey1 -func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) FromNewOutputRemoteElasticsearchSecretsSslKey1(v NewOutputRemoteElasticsearchSecretsSslKey1) error { +// FromSentineloneConfig overwrites any union data inside the CreateConnectorConfig as the provided SentineloneConfig +func (t *CreateConnectorConfig) FromSentineloneConfig(v SentineloneConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNewOutputRemoteElasticsearchSecretsSslKey1 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided NewOutputRemoteElasticsearchSecretsSslKey1 -func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeNewOutputRemoteElasticsearchSecretsSslKey1(v NewOutputRemoteElasticsearchSecretsSslKey1) error { +// MergeSentineloneConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided SentineloneConfig +func (t *CreateConnectorConfig) MergeSentineloneConfig(v SentineloneConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12634,32 +13530,22 @@ func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeNewOutputRemoteElast return err } -func (t NewOutputRemoteElasticsearch_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsNewOutputElasticsearch returns the union data inside the NewOutputUnion as a NewOutputElasticsearch -func (t NewOutputUnion) AsNewOutputElasticsearch() (NewOutputElasticsearch, error) { - var body NewOutputElasticsearch +// AsServicenowConfig returns the union data inside the CreateConnectorConfig as a ServicenowConfig +func (t CreateConnectorConfig) AsServicenowConfig() (ServicenowConfig, error) { + var body ServicenowConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromNewOutputElasticsearch overwrites any union data inside the NewOutputUnion as the provided NewOutputElasticsearch -func (t *NewOutputUnion) FromNewOutputElasticsearch(v NewOutputElasticsearch) error { +// FromServicenowConfig overwrites any union data inside the CreateConnectorConfig as the provided ServicenowConfig +func (t *CreateConnectorConfig) FromServicenowConfig(v ServicenowConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNewOutputElasticsearch performs a merge with any union data inside the NewOutputUnion, using the provided NewOutputElasticsearch -func (t *NewOutputUnion) MergeNewOutputElasticsearch(v NewOutputElasticsearch) error { +// MergeServicenowConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided ServicenowConfig +func (t *CreateConnectorConfig) MergeServicenowConfig(v ServicenowConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12670,22 +13556,22 @@ func (t *NewOutputUnion) MergeNewOutputElasticsearch(v NewOutputElasticsearch) e return err } -// AsNewOutputRemoteElasticsearch returns the union data inside the NewOutputUnion as a NewOutputRemoteElasticsearch -func (t NewOutputUnion) AsNewOutputRemoteElasticsearch() (NewOutputRemoteElasticsearch, error) { - var body NewOutputRemoteElasticsearch +// AsServicenowItomConfig returns the union data inside the CreateConnectorConfig as a ServicenowItomConfig +func (t CreateConnectorConfig) AsServicenowItomConfig() (ServicenowItomConfig, error) { + var body ServicenowItomConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromNewOutputRemoteElasticsearch overwrites any union data inside the NewOutputUnion as the provided NewOutputRemoteElasticsearch -func (t *NewOutputUnion) FromNewOutputRemoteElasticsearch(v NewOutputRemoteElasticsearch) error { +// FromServicenowItomConfig overwrites any union data inside the CreateConnectorConfig as the provided ServicenowItomConfig +func (t *CreateConnectorConfig) FromServicenowItomConfig(v ServicenowItomConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNewOutputRemoteElasticsearch performs a merge with any union data inside the NewOutputUnion, using the provided NewOutputRemoteElasticsearch -func (t *NewOutputUnion) MergeNewOutputRemoteElasticsearch(v NewOutputRemoteElasticsearch) error { +// MergeServicenowItomConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided ServicenowItomConfig +func (t *CreateConnectorConfig) MergeServicenowItomConfig(v ServicenowItomConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12696,22 +13582,22 @@ func (t *NewOutputUnion) MergeNewOutputRemoteElasticsearch(v NewOutputRemoteElas return err } -// AsNewOutputLogstash returns the union data inside the NewOutputUnion as a NewOutputLogstash -func (t NewOutputUnion) AsNewOutputLogstash() (NewOutputLogstash, error) { - var body NewOutputLogstash +// AsSlackApiConfig returns the union data inside the CreateConnectorConfig as a SlackApiConfig +func (t CreateConnectorConfig) AsSlackApiConfig() (SlackApiConfig, error) { + var body SlackApiConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromNewOutputLogstash overwrites any union data inside the NewOutputUnion as the provided NewOutputLogstash -func (t *NewOutputUnion) FromNewOutputLogstash(v NewOutputLogstash) error { +// FromSlackApiConfig overwrites any union data inside the CreateConnectorConfig as the provided SlackApiConfig +func (t *CreateConnectorConfig) FromSlackApiConfig(v SlackApiConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNewOutputLogstash performs a merge with any union data inside the NewOutputUnion, using the provided NewOutputLogstash -func (t *NewOutputUnion) MergeNewOutputLogstash(v NewOutputLogstash) error { +// MergeSlackApiConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided SlackApiConfig +func (t *CreateConnectorConfig) MergeSlackApiConfig(v SlackApiConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12722,22 +13608,22 @@ func (t *NewOutputUnion) MergeNewOutputLogstash(v NewOutputLogstash) error { return err } -// AsNewOutputKafka returns the union data inside the NewOutputUnion as a NewOutputKafka -func (t NewOutputUnion) AsNewOutputKafka() (NewOutputKafka, error) { - var body NewOutputKafka +// AsSwimlaneConfig returns the union data inside the CreateConnectorConfig as a SwimlaneConfig +func (t CreateConnectorConfig) AsSwimlaneConfig() (SwimlaneConfig, error) { + var body SwimlaneConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromNewOutputKafka overwrites any union data inside the NewOutputUnion as the provided NewOutputKafka -func (t *NewOutputUnion) FromNewOutputKafka(v NewOutputKafka) error { +// FromSwimlaneConfig overwrites any union data inside the CreateConnectorConfig as the provided SwimlaneConfig +func (t *CreateConnectorConfig) FromSwimlaneConfig(v SwimlaneConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNewOutputKafka performs a merge with any union data inside the NewOutputUnion, using the provided NewOutputKafka -func (t *NewOutputUnion) MergeNewOutputKafka(v NewOutputKafka) error { +// MergeSwimlaneConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided SwimlaneConfig +func (t *CreateConnectorConfig) MergeSwimlaneConfig(v SwimlaneConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12748,32 +13634,22 @@ func (t *NewOutputUnion) MergeNewOutputKafka(v NewOutputKafka) error { return err } -func (t NewOutputUnion) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *NewOutputUnion) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsOutputElasticsearchSecretsSslKey0 returns the union data inside the OutputElasticsearch_Secrets_Ssl_Key as a OutputElasticsearchSecretsSslKey0 -func (t OutputElasticsearch_Secrets_Ssl_Key) AsOutputElasticsearchSecretsSslKey0() (OutputElasticsearchSecretsSslKey0, error) { - var body OutputElasticsearchSecretsSslKey0 +// AsThehiveConfig returns the union data inside the CreateConnectorConfig as a ThehiveConfig +func (t CreateConnectorConfig) AsThehiveConfig() (ThehiveConfig, error) { + var body ThehiveConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromOutputElasticsearchSecretsSslKey0 overwrites any union data inside the OutputElasticsearch_Secrets_Ssl_Key as the provided OutputElasticsearchSecretsSslKey0 -func (t *OutputElasticsearch_Secrets_Ssl_Key) FromOutputElasticsearchSecretsSslKey0(v OutputElasticsearchSecretsSslKey0) error { +// FromThehiveConfig overwrites any union data inside the CreateConnectorConfig as the provided ThehiveConfig +func (t *CreateConnectorConfig) FromThehiveConfig(v ThehiveConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeOutputElasticsearchSecretsSslKey0 performs a merge with any union data inside the OutputElasticsearch_Secrets_Ssl_Key, using the provided OutputElasticsearchSecretsSslKey0 -func (t *OutputElasticsearch_Secrets_Ssl_Key) MergeOutputElasticsearchSecretsSslKey0(v OutputElasticsearchSecretsSslKey0) error { +// MergeThehiveConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided ThehiveConfig +func (t *CreateConnectorConfig) MergeThehiveConfig(v ThehiveConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12784,22 +13660,22 @@ func (t *OutputElasticsearch_Secrets_Ssl_Key) MergeOutputElasticsearchSecretsSsl return err } -// AsOutputElasticsearchSecretsSslKey1 returns the union data inside the OutputElasticsearch_Secrets_Ssl_Key as a OutputElasticsearchSecretsSslKey1 -func (t OutputElasticsearch_Secrets_Ssl_Key) AsOutputElasticsearchSecretsSslKey1() (OutputElasticsearchSecretsSslKey1, error) { - var body OutputElasticsearchSecretsSslKey1 +// AsTinesConfig returns the union data inside the CreateConnectorConfig as a TinesConfig +func (t CreateConnectorConfig) AsTinesConfig() (TinesConfig, error) { + var body TinesConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromOutputElasticsearchSecretsSslKey1 overwrites any union data inside the OutputElasticsearch_Secrets_Ssl_Key as the provided OutputElasticsearchSecretsSslKey1 -func (t *OutputElasticsearch_Secrets_Ssl_Key) FromOutputElasticsearchSecretsSslKey1(v OutputElasticsearchSecretsSslKey1) error { +// FromTinesConfig overwrites any union data inside the CreateConnectorConfig as the provided TinesConfig +func (t *CreateConnectorConfig) FromTinesConfig(v TinesConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeOutputElasticsearchSecretsSslKey1 performs a merge with any union data inside the OutputElasticsearch_Secrets_Ssl_Key, using the provided OutputElasticsearchSecretsSslKey1 -func (t *OutputElasticsearch_Secrets_Ssl_Key) MergeOutputElasticsearchSecretsSslKey1(v OutputElasticsearchSecretsSslKey1) error { +// MergeTinesConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided TinesConfig +func (t *CreateConnectorConfig) MergeTinesConfig(v TinesConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12810,32 +13686,22 @@ func (t *OutputElasticsearch_Secrets_Ssl_Key) MergeOutputElasticsearchSecretsSsl return err } -func (t OutputElasticsearch_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *OutputElasticsearch_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsOutputKafkaSecretsPassword0 returns the union data inside the OutputKafka_Secrets_Password as a OutputKafkaSecretsPassword0 -func (t OutputKafka_Secrets_Password) AsOutputKafkaSecretsPassword0() (OutputKafkaSecretsPassword0, error) { - var body OutputKafkaSecretsPassword0 +// AsTorqConfig returns the union data inside the CreateConnectorConfig as a TorqConfig +func (t CreateConnectorConfig) AsTorqConfig() (TorqConfig, error) { + var body TorqConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromOutputKafkaSecretsPassword0 overwrites any union data inside the OutputKafka_Secrets_Password as the provided OutputKafkaSecretsPassword0 -func (t *OutputKafka_Secrets_Password) FromOutputKafkaSecretsPassword0(v OutputKafkaSecretsPassword0) error { +// FromTorqConfig overwrites any union data inside the CreateConnectorConfig as the provided TorqConfig +func (t *CreateConnectorConfig) FromTorqConfig(v TorqConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeOutputKafkaSecretsPassword0 performs a merge with any union data inside the OutputKafka_Secrets_Password, using the provided OutputKafkaSecretsPassword0 -func (t *OutputKafka_Secrets_Password) MergeOutputKafkaSecretsPassword0(v OutputKafkaSecretsPassword0) error { +// MergeTorqConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided TorqConfig +func (t *CreateConnectorConfig) MergeTorqConfig(v TorqConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12846,22 +13712,22 @@ func (t *OutputKafka_Secrets_Password) MergeOutputKafkaSecretsPassword0(v Output return err } -// AsOutputKafkaSecretsPassword1 returns the union data inside the OutputKafka_Secrets_Password as a OutputKafkaSecretsPassword1 -func (t OutputKafka_Secrets_Password) AsOutputKafkaSecretsPassword1() (OutputKafkaSecretsPassword1, error) { - var body OutputKafkaSecretsPassword1 +// AsWebhookConfig returns the union data inside the CreateConnectorConfig as a WebhookConfig +func (t CreateConnectorConfig) AsWebhookConfig() (WebhookConfig, error) { + var body WebhookConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromOutputKafkaSecretsPassword1 overwrites any union data inside the OutputKafka_Secrets_Password as the provided OutputKafkaSecretsPassword1 -func (t *OutputKafka_Secrets_Password) FromOutputKafkaSecretsPassword1(v OutputKafkaSecretsPassword1) error { +// FromWebhookConfig overwrites any union data inside the CreateConnectorConfig as the provided WebhookConfig +func (t *CreateConnectorConfig) FromWebhookConfig(v WebhookConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeOutputKafkaSecretsPassword1 performs a merge with any union data inside the OutputKafka_Secrets_Password, using the provided OutputKafkaSecretsPassword1 -func (t *OutputKafka_Secrets_Password) MergeOutputKafkaSecretsPassword1(v OutputKafkaSecretsPassword1) error { +// MergeWebhookConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided WebhookConfig +func (t *CreateConnectorConfig) MergeWebhookConfig(v WebhookConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12872,32 +13738,22 @@ func (t *OutputKafka_Secrets_Password) MergeOutputKafkaSecretsPassword1(v Output return err } -func (t OutputKafka_Secrets_Password) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *OutputKafka_Secrets_Password) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsOutputKafkaSecretsSslKey0 returns the union data inside the OutputKafka_Secrets_Ssl_Key as a OutputKafkaSecretsSslKey0 -func (t OutputKafka_Secrets_Ssl_Key) AsOutputKafkaSecretsSslKey0() (OutputKafkaSecretsSslKey0, error) { - var body OutputKafkaSecretsSslKey0 +// AsCasesWebhookConfig returns the union data inside the CreateConnectorConfig as a CasesWebhookConfig +func (t CreateConnectorConfig) AsCasesWebhookConfig() (CasesWebhookConfig, error) { + var body CasesWebhookConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromOutputKafkaSecretsSslKey0 overwrites any union data inside the OutputKafka_Secrets_Ssl_Key as the provided OutputKafkaSecretsSslKey0 -func (t *OutputKafka_Secrets_Ssl_Key) FromOutputKafkaSecretsSslKey0(v OutputKafkaSecretsSslKey0) error { +// FromCasesWebhookConfig overwrites any union data inside the CreateConnectorConfig as the provided CasesWebhookConfig +func (t *CreateConnectorConfig) FromCasesWebhookConfig(v CasesWebhookConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeOutputKafkaSecretsSslKey0 performs a merge with any union data inside the OutputKafka_Secrets_Ssl_Key, using the provided OutputKafkaSecretsSslKey0 -func (t *OutputKafka_Secrets_Ssl_Key) MergeOutputKafkaSecretsSslKey0(v OutputKafkaSecretsSslKey0) error { +// MergeCasesWebhookConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided CasesWebhookConfig +func (t *CreateConnectorConfig) MergeCasesWebhookConfig(v CasesWebhookConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12908,22 +13764,22 @@ func (t *OutputKafka_Secrets_Ssl_Key) MergeOutputKafkaSecretsSslKey0(v OutputKaf return err } -// AsOutputKafkaSecretsSslKey1 returns the union data inside the OutputKafka_Secrets_Ssl_Key as a OutputKafkaSecretsSslKey1 -func (t OutputKafka_Secrets_Ssl_Key) AsOutputKafkaSecretsSslKey1() (OutputKafkaSecretsSslKey1, error) { - var body OutputKafkaSecretsSslKey1 +// AsXmattersConfig returns the union data inside the CreateConnectorConfig as a XmattersConfig +func (t CreateConnectorConfig) AsXmattersConfig() (XmattersConfig, error) { + var body XmattersConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromOutputKafkaSecretsSslKey1 overwrites any union data inside the OutputKafka_Secrets_Ssl_Key as the provided OutputKafkaSecretsSslKey1 -func (t *OutputKafka_Secrets_Ssl_Key) FromOutputKafkaSecretsSslKey1(v OutputKafkaSecretsSslKey1) error { +// FromXmattersConfig overwrites any union data inside the CreateConnectorConfig as the provided XmattersConfig +func (t *CreateConnectorConfig) FromXmattersConfig(v XmattersConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeOutputKafkaSecretsSslKey1 performs a merge with any union data inside the OutputKafka_Secrets_Ssl_Key, using the provided OutputKafkaSecretsSslKey1 -func (t *OutputKafka_Secrets_Ssl_Key) MergeOutputKafkaSecretsSslKey1(v OutputKafkaSecretsSslKey1) error { +// MergeXmattersConfig performs a merge with any union data inside the CreateConnectorConfig, using the provided XmattersConfig +func (t *CreateConnectorConfig) MergeXmattersConfig(v XmattersConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -12934,32 +13790,22 @@ func (t *OutputKafka_Secrets_Ssl_Key) MergeOutputKafkaSecretsSslKey1(v OutputKaf return err } -func (t OutputKafka_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *OutputKafka_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsOutputLogstashSecretsSslKey0 returns the union data inside the OutputLogstash_Secrets_Ssl_Key as a OutputLogstashSecretsSslKey0 -func (t OutputLogstash_Secrets_Ssl_Key) AsOutputLogstashSecretsSslKey0() (OutputLogstashSecretsSslKey0, error) { - var body OutputLogstashSecretsSslKey0 +// AsBedrockSecrets returns the union data inside the CreateConnectorSecrets as a BedrockSecrets +func (t CreateConnectorSecrets) AsBedrockSecrets() (BedrockSecrets, error) { + var body BedrockSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromOutputLogstashSecretsSslKey0 overwrites any union data inside the OutputLogstash_Secrets_Ssl_Key as the provided OutputLogstashSecretsSslKey0 -func (t *OutputLogstash_Secrets_Ssl_Key) FromOutputLogstashSecretsSslKey0(v OutputLogstashSecretsSslKey0) error { +// FromBedrockSecrets overwrites any union data inside the CreateConnectorSecrets as the provided BedrockSecrets +func (t *CreateConnectorSecrets) FromBedrockSecrets(v BedrockSecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergeOutputLogstashSecretsSslKey0 performs a merge with any union data inside the OutputLogstash_Secrets_Ssl_Key, using the provided OutputLogstashSecretsSslKey0 -func (t *OutputLogstash_Secrets_Ssl_Key) MergeOutputLogstashSecretsSslKey0(v OutputLogstashSecretsSslKey0) error { +// MergeBedrockSecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided BedrockSecrets +func (t *CreateConnectorSecrets) MergeBedrockSecrets(v BedrockSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -12970,22 +13816,22 @@ func (t *OutputLogstash_Secrets_Ssl_Key) MergeOutputLogstashSecretsSslKey0(v Out return err } -// AsOutputLogstashSecretsSslKey1 returns the union data inside the OutputLogstash_Secrets_Ssl_Key as a OutputLogstashSecretsSslKey1 -func (t OutputLogstash_Secrets_Ssl_Key) AsOutputLogstashSecretsSslKey1() (OutputLogstashSecretsSslKey1, error) { - var body OutputLogstashSecretsSslKey1 +// AsCrowdstrikeSecrets returns the union data inside the CreateConnectorSecrets as a CrowdstrikeSecrets +func (t CreateConnectorSecrets) AsCrowdstrikeSecrets() (CrowdstrikeSecrets, error) { + var body CrowdstrikeSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromOutputLogstashSecretsSslKey1 overwrites any union data inside the OutputLogstash_Secrets_Ssl_Key as the provided OutputLogstashSecretsSslKey1 -func (t *OutputLogstash_Secrets_Ssl_Key) FromOutputLogstashSecretsSslKey1(v OutputLogstashSecretsSslKey1) error { +// FromCrowdstrikeSecrets overwrites any union data inside the CreateConnectorSecrets as the provided CrowdstrikeSecrets +func (t *CreateConnectorSecrets) FromCrowdstrikeSecrets(v CrowdstrikeSecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergeOutputLogstashSecretsSslKey1 performs a merge with any union data inside the OutputLogstash_Secrets_Ssl_Key, using the provided OutputLogstashSecretsSslKey1 -func (t *OutputLogstash_Secrets_Ssl_Key) MergeOutputLogstashSecretsSslKey1(v OutputLogstashSecretsSslKey1) error { +// MergeCrowdstrikeSecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided CrowdstrikeSecrets +func (t *CreateConnectorSecrets) MergeCrowdstrikeSecrets(v CrowdstrikeSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -12996,32 +13842,2601 @@ func (t *OutputLogstash_Secrets_Ssl_Key) MergeOutputLogstashSecretsSslKey1(v Out return err } -func (t OutputLogstash_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() +// AsD3securitySecrets returns the union data inside the CreateConnectorSecrets as a D3securitySecrets +func (t CreateConnectorSecrets) AsD3securitySecrets() (D3securitySecrets, error) { + var body D3securitySecrets + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromD3securitySecrets overwrites any union data inside the CreateConnectorSecrets as the provided D3securitySecrets +func (t *CreateConnectorSecrets) FromD3securitySecrets(v D3securitySecrets) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeD3securitySecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided D3securitySecrets +func (t *CreateConnectorSecrets) MergeD3securitySecrets(v D3securitySecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsEmailSecrets returns the union data inside the CreateConnectorSecrets as a EmailSecrets +func (t CreateConnectorSecrets) AsEmailSecrets() (EmailSecrets, error) { + var body EmailSecrets + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromEmailSecrets overwrites any union data inside the CreateConnectorSecrets as the provided EmailSecrets +func (t *CreateConnectorSecrets) FromEmailSecrets(v EmailSecrets) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeEmailSecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided EmailSecrets +func (t *CreateConnectorSecrets) MergeEmailSecrets(v EmailSecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsGeminiSecrets returns the union data inside the CreateConnectorSecrets as a GeminiSecrets +func (t CreateConnectorSecrets) AsGeminiSecrets() (GeminiSecrets, error) { + var body GeminiSecrets + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromGeminiSecrets overwrites any union data inside the CreateConnectorSecrets as the provided GeminiSecrets +func (t *CreateConnectorSecrets) FromGeminiSecrets(v GeminiSecrets) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeGeminiSecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided GeminiSecrets +func (t *CreateConnectorSecrets) MergeGeminiSecrets(v GeminiSecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsResilientSecrets returns the union data inside the CreateConnectorSecrets as a ResilientSecrets +func (t CreateConnectorSecrets) AsResilientSecrets() (ResilientSecrets, error) { + var body ResilientSecrets + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromResilientSecrets overwrites any union data inside the CreateConnectorSecrets as the provided ResilientSecrets +func (t *CreateConnectorSecrets) FromResilientSecrets(v ResilientSecrets) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeResilientSecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided ResilientSecrets +func (t *CreateConnectorSecrets) MergeResilientSecrets(v ResilientSecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsJiraSecrets returns the union data inside the CreateConnectorSecrets as a JiraSecrets +func (t CreateConnectorSecrets) AsJiraSecrets() (JiraSecrets, error) { + var body JiraSecrets + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromJiraSecrets overwrites any union data inside the CreateConnectorSecrets as the provided JiraSecrets +func (t *CreateConnectorSecrets) FromJiraSecrets(v JiraSecrets) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeJiraSecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided JiraSecrets +func (t *CreateConnectorSecrets) MergeJiraSecrets(v JiraSecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsDefenderSecrets returns the union data inside the CreateConnectorSecrets as a DefenderSecrets +func (t CreateConnectorSecrets) AsDefenderSecrets() (DefenderSecrets, error) { + var body DefenderSecrets + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromDefenderSecrets overwrites any union data inside the CreateConnectorSecrets as the provided DefenderSecrets +func (t *CreateConnectorSecrets) FromDefenderSecrets(v DefenderSecrets) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeDefenderSecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided DefenderSecrets +func (t *CreateConnectorSecrets) MergeDefenderSecrets(v DefenderSecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsTeamsSecrets returns the union data inside the CreateConnectorSecrets as a TeamsSecrets +func (t CreateConnectorSecrets) AsTeamsSecrets() (TeamsSecrets, error) { + var body TeamsSecrets + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromTeamsSecrets overwrites any union data inside the CreateConnectorSecrets as the provided TeamsSecrets +func (t *CreateConnectorSecrets) FromTeamsSecrets(v TeamsSecrets) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeTeamsSecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided TeamsSecrets +func (t *CreateConnectorSecrets) MergeTeamsSecrets(v TeamsSecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsGenaiSecrets returns the union data inside the CreateConnectorSecrets as a GenaiSecrets +func (t CreateConnectorSecrets) AsGenaiSecrets() (GenaiSecrets, error) { + var body GenaiSecrets + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromGenaiSecrets overwrites any union data inside the CreateConnectorSecrets as the provided GenaiSecrets +func (t *CreateConnectorSecrets) FromGenaiSecrets(v GenaiSecrets) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeGenaiSecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided GenaiSecrets +func (t *CreateConnectorSecrets) MergeGenaiSecrets(v GenaiSecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOpsgenieSecrets returns the union data inside the CreateConnectorSecrets as a OpsgenieSecrets +func (t CreateConnectorSecrets) AsOpsgenieSecrets() (OpsgenieSecrets, error) { + var body OpsgenieSecrets + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOpsgenieSecrets overwrites any union data inside the CreateConnectorSecrets as the provided OpsgenieSecrets +func (t *CreateConnectorSecrets) FromOpsgenieSecrets(v OpsgenieSecrets) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOpsgenieSecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided OpsgenieSecrets +func (t *CreateConnectorSecrets) MergeOpsgenieSecrets(v OpsgenieSecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPagerdutySecrets returns the union data inside the CreateConnectorSecrets as a PagerdutySecrets +func (t CreateConnectorSecrets) AsPagerdutySecrets() (PagerdutySecrets, error) { + var body PagerdutySecrets + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPagerdutySecrets overwrites any union data inside the CreateConnectorSecrets as the provided PagerdutySecrets +func (t *CreateConnectorSecrets) FromPagerdutySecrets(v PagerdutySecrets) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePagerdutySecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided PagerdutySecrets +func (t *CreateConnectorSecrets) MergePagerdutySecrets(v PagerdutySecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsSentineloneSecrets returns the union data inside the CreateConnectorSecrets as a SentineloneSecrets +func (t CreateConnectorSecrets) AsSentineloneSecrets() (SentineloneSecrets, error) { + var body SentineloneSecrets + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromSentineloneSecrets overwrites any union data inside the CreateConnectorSecrets as the provided SentineloneSecrets +func (t *CreateConnectorSecrets) FromSentineloneSecrets(v SentineloneSecrets) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeSentineloneSecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided SentineloneSecrets +func (t *CreateConnectorSecrets) MergeSentineloneSecrets(v SentineloneSecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsServicenowSecrets returns the union data inside the CreateConnectorSecrets as a ServicenowSecrets +func (t CreateConnectorSecrets) AsServicenowSecrets() (ServicenowSecrets, error) { + var body ServicenowSecrets + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromServicenowSecrets overwrites any union data inside the CreateConnectorSecrets as the provided ServicenowSecrets +func (t *CreateConnectorSecrets) FromServicenowSecrets(v ServicenowSecrets) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeServicenowSecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided ServicenowSecrets +func (t *CreateConnectorSecrets) MergeServicenowSecrets(v ServicenowSecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsSlackApiSecrets returns the union data inside the CreateConnectorSecrets as a SlackApiSecrets +func (t CreateConnectorSecrets) AsSlackApiSecrets() (SlackApiSecrets, error) { + var body SlackApiSecrets + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromSlackApiSecrets overwrites any union data inside the CreateConnectorSecrets as the provided SlackApiSecrets +func (t *CreateConnectorSecrets) FromSlackApiSecrets(v SlackApiSecrets) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeSlackApiSecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided SlackApiSecrets +func (t *CreateConnectorSecrets) MergeSlackApiSecrets(v SlackApiSecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsSwimlaneSecrets returns the union data inside the CreateConnectorSecrets as a SwimlaneSecrets +func (t CreateConnectorSecrets) AsSwimlaneSecrets() (SwimlaneSecrets, error) { + var body SwimlaneSecrets + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromSwimlaneSecrets overwrites any union data inside the CreateConnectorSecrets as the provided SwimlaneSecrets +func (t *CreateConnectorSecrets) FromSwimlaneSecrets(v SwimlaneSecrets) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeSwimlaneSecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided SwimlaneSecrets +func (t *CreateConnectorSecrets) MergeSwimlaneSecrets(v SwimlaneSecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsThehiveSecrets returns the union data inside the CreateConnectorSecrets as a ThehiveSecrets +func (t CreateConnectorSecrets) AsThehiveSecrets() (ThehiveSecrets, error) { + var body ThehiveSecrets + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromThehiveSecrets overwrites any union data inside the CreateConnectorSecrets as the provided ThehiveSecrets +func (t *CreateConnectorSecrets) FromThehiveSecrets(v ThehiveSecrets) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeThehiveSecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided ThehiveSecrets +func (t *CreateConnectorSecrets) MergeThehiveSecrets(v ThehiveSecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsTinesSecrets returns the union data inside the CreateConnectorSecrets as a TinesSecrets +func (t CreateConnectorSecrets) AsTinesSecrets() (TinesSecrets, error) { + var body TinesSecrets + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromTinesSecrets overwrites any union data inside the CreateConnectorSecrets as the provided TinesSecrets +func (t *CreateConnectorSecrets) FromTinesSecrets(v TinesSecrets) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeTinesSecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided TinesSecrets +func (t *CreateConnectorSecrets) MergeTinesSecrets(v TinesSecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsTorqSecrets returns the union data inside the CreateConnectorSecrets as a TorqSecrets +func (t CreateConnectorSecrets) AsTorqSecrets() (TorqSecrets, error) { + var body TorqSecrets + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromTorqSecrets overwrites any union data inside the CreateConnectorSecrets as the provided TorqSecrets +func (t *CreateConnectorSecrets) FromTorqSecrets(v TorqSecrets) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeTorqSecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided TorqSecrets +func (t *CreateConnectorSecrets) MergeTorqSecrets(v TorqSecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsWebhookSecrets returns the union data inside the CreateConnectorSecrets as a WebhookSecrets +func (t CreateConnectorSecrets) AsWebhookSecrets() (WebhookSecrets, error) { + var body WebhookSecrets + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromWebhookSecrets overwrites any union data inside the CreateConnectorSecrets as the provided WebhookSecrets +func (t *CreateConnectorSecrets) FromWebhookSecrets(v WebhookSecrets) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeWebhookSecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided WebhookSecrets +func (t *CreateConnectorSecrets) MergeWebhookSecrets(v WebhookSecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsCasesWebhookSecrets returns the union data inside the CreateConnectorSecrets as a CasesWebhookSecrets +func (t CreateConnectorSecrets) AsCasesWebhookSecrets() (CasesWebhookSecrets, error) { + var body CasesWebhookSecrets + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromCasesWebhookSecrets overwrites any union data inside the CreateConnectorSecrets as the provided CasesWebhookSecrets +func (t *CreateConnectorSecrets) FromCasesWebhookSecrets(v CasesWebhookSecrets) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeCasesWebhookSecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided CasesWebhookSecrets +func (t *CreateConnectorSecrets) MergeCasesWebhookSecrets(v CasesWebhookSecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsXmattersSecrets returns the union data inside the CreateConnectorSecrets as a XmattersSecrets +func (t CreateConnectorSecrets) AsXmattersSecrets() (XmattersSecrets, error) { + var body XmattersSecrets + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromXmattersSecrets overwrites any union data inside the CreateConnectorSecrets as the provided XmattersSecrets +func (t *CreateConnectorSecrets) FromXmattersSecrets(v XmattersSecrets) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeXmattersSecrets performs a merge with any union data inside the CreateConnectorSecrets, using the provided XmattersSecrets +func (t *CreateConnectorSecrets) MergeXmattersSecrets(v XmattersSecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsCreateParamResponse0 returns the union data inside the CreateParamResponse as a CreateParamResponse0 +func (t CreateParamResponse) AsCreateParamResponse0() (CreateParamResponse0, error) { + var body CreateParamResponse0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromCreateParamResponse0 overwrites any union data inside the CreateParamResponse as the provided CreateParamResponse0 +func (t *CreateParamResponse) FromCreateParamResponse0(v CreateParamResponse0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeCreateParamResponse0 performs a merge with any union data inside the CreateParamResponse, using the provided CreateParamResponse0 +func (t *CreateParamResponse) MergeCreateParamResponse0(v CreateParamResponse0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsSyntheticsPostParameterResponse returns the union data inside the CreateParamResponse as a SyntheticsPostParameterResponse +func (t CreateParamResponse) AsSyntheticsPostParameterResponse() (SyntheticsPostParameterResponse, error) { + var body SyntheticsPostParameterResponse + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromSyntheticsPostParameterResponse overwrites any union data inside the CreateParamResponse as the provided SyntheticsPostParameterResponse +func (t *CreateParamResponse) FromSyntheticsPostParameterResponse(v SyntheticsPostParameterResponse) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeSyntheticsPostParameterResponse performs a merge with any union data inside the CreateParamResponse, using the provided SyntheticsPostParameterResponse +func (t *CreateParamResponse) MergeSyntheticsPostParameterResponse(v SyntheticsPostParameterResponse) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t CreateParamResponse) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *CreateParamResponse) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsNewOutputElasticsearchSecretsSslKey0 returns the union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as a NewOutputElasticsearchSecretsSslKey0 +func (t NewOutputElasticsearch_Secrets_Ssl_Key) AsNewOutputElasticsearchSecretsSslKey0() (NewOutputElasticsearchSecretsSslKey0, error) { + var body NewOutputElasticsearchSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputElasticsearchSecretsSslKey0 overwrites any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as the provided NewOutputElasticsearchSecretsSslKey0 +func (t *NewOutputElasticsearch_Secrets_Ssl_Key) FromNewOutputElasticsearchSecretsSslKey0(v NewOutputElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputElasticsearchSecretsSslKey0 performs a merge with any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key, using the provided NewOutputElasticsearchSecretsSslKey0 +func (t *NewOutputElasticsearch_Secrets_Ssl_Key) MergeNewOutputElasticsearchSecretsSslKey0(v NewOutputElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputElasticsearchSecretsSslKey1 returns the union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as a NewOutputElasticsearchSecretsSslKey1 +func (t NewOutputElasticsearch_Secrets_Ssl_Key) AsNewOutputElasticsearchSecretsSslKey1() (NewOutputElasticsearchSecretsSslKey1, error) { + var body NewOutputElasticsearchSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputElasticsearchSecretsSslKey1 overwrites any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as the provided NewOutputElasticsearchSecretsSslKey1 +func (t *NewOutputElasticsearch_Secrets_Ssl_Key) FromNewOutputElasticsearchSecretsSslKey1(v NewOutputElasticsearchSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputElasticsearchSecretsSslKey1 performs a merge with any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key, using the provided NewOutputElasticsearchSecretsSslKey1 +func (t *NewOutputElasticsearch_Secrets_Ssl_Key) MergeNewOutputElasticsearchSecretsSslKey1(v NewOutputElasticsearchSecretsSslKey1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t NewOutputElasticsearch_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *NewOutputElasticsearch_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsNewOutputKafkaSecretsPassword0 returns the union data inside the NewOutputKafka_Secrets_Password as a NewOutputKafkaSecretsPassword0 +func (t NewOutputKafka_Secrets_Password) AsNewOutputKafkaSecretsPassword0() (NewOutputKafkaSecretsPassword0, error) { + var body NewOutputKafkaSecretsPassword0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputKafkaSecretsPassword0 overwrites any union data inside the NewOutputKafka_Secrets_Password as the provided NewOutputKafkaSecretsPassword0 +func (t *NewOutputKafka_Secrets_Password) FromNewOutputKafkaSecretsPassword0(v NewOutputKafkaSecretsPassword0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputKafkaSecretsPassword0 performs a merge with any union data inside the NewOutputKafka_Secrets_Password, using the provided NewOutputKafkaSecretsPassword0 +func (t *NewOutputKafka_Secrets_Password) MergeNewOutputKafkaSecretsPassword0(v NewOutputKafkaSecretsPassword0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputKafkaSecretsPassword1 returns the union data inside the NewOutputKafka_Secrets_Password as a NewOutputKafkaSecretsPassword1 +func (t NewOutputKafka_Secrets_Password) AsNewOutputKafkaSecretsPassword1() (NewOutputKafkaSecretsPassword1, error) { + var body NewOutputKafkaSecretsPassword1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputKafkaSecretsPassword1 overwrites any union data inside the NewOutputKafka_Secrets_Password as the provided NewOutputKafkaSecretsPassword1 +func (t *NewOutputKafka_Secrets_Password) FromNewOutputKafkaSecretsPassword1(v NewOutputKafkaSecretsPassword1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputKafkaSecretsPassword1 performs a merge with any union data inside the NewOutputKafka_Secrets_Password, using the provided NewOutputKafkaSecretsPassword1 +func (t *NewOutputKafka_Secrets_Password) MergeNewOutputKafkaSecretsPassword1(v NewOutputKafkaSecretsPassword1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t NewOutputKafka_Secrets_Password) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *NewOutputKafka_Secrets_Password) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsNewOutputKafkaSecretsSslKey0 returns the union data inside the NewOutputKafka_Secrets_Ssl_Key as a NewOutputKafkaSecretsSslKey0 +func (t NewOutputKafka_Secrets_Ssl_Key) AsNewOutputKafkaSecretsSslKey0() (NewOutputKafkaSecretsSslKey0, error) { + var body NewOutputKafkaSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputKafkaSecretsSslKey0 overwrites any union data inside the NewOutputKafka_Secrets_Ssl_Key as the provided NewOutputKafkaSecretsSslKey0 +func (t *NewOutputKafka_Secrets_Ssl_Key) FromNewOutputKafkaSecretsSslKey0(v NewOutputKafkaSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputKafkaSecretsSslKey0 performs a merge with any union data inside the NewOutputKafka_Secrets_Ssl_Key, using the provided NewOutputKafkaSecretsSslKey0 +func (t *NewOutputKafka_Secrets_Ssl_Key) MergeNewOutputKafkaSecretsSslKey0(v NewOutputKafkaSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputKafkaSecretsSslKey1 returns the union data inside the NewOutputKafka_Secrets_Ssl_Key as a NewOutputKafkaSecretsSslKey1 +func (t NewOutputKafka_Secrets_Ssl_Key) AsNewOutputKafkaSecretsSslKey1() (NewOutputKafkaSecretsSslKey1, error) { + var body NewOutputKafkaSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputKafkaSecretsSslKey1 overwrites any union data inside the NewOutputKafka_Secrets_Ssl_Key as the provided NewOutputKafkaSecretsSslKey1 +func (t *NewOutputKafka_Secrets_Ssl_Key) FromNewOutputKafkaSecretsSslKey1(v NewOutputKafkaSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputKafkaSecretsSslKey1 performs a merge with any union data inside the NewOutputKafka_Secrets_Ssl_Key, using the provided NewOutputKafkaSecretsSslKey1 +func (t *NewOutputKafka_Secrets_Ssl_Key) MergeNewOutputKafkaSecretsSslKey1(v NewOutputKafkaSecretsSslKey1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t NewOutputKafka_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *NewOutputKafka_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsNewOutputLogstashSecretsSslKey0 returns the union data inside the NewOutputLogstash_Secrets_Ssl_Key as a NewOutputLogstashSecretsSslKey0 +func (t NewOutputLogstash_Secrets_Ssl_Key) AsNewOutputLogstashSecretsSslKey0() (NewOutputLogstashSecretsSslKey0, error) { + var body NewOutputLogstashSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputLogstashSecretsSslKey0 overwrites any union data inside the NewOutputLogstash_Secrets_Ssl_Key as the provided NewOutputLogstashSecretsSslKey0 +func (t *NewOutputLogstash_Secrets_Ssl_Key) FromNewOutputLogstashSecretsSslKey0(v NewOutputLogstashSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputLogstashSecretsSslKey0 performs a merge with any union data inside the NewOutputLogstash_Secrets_Ssl_Key, using the provided NewOutputLogstashSecretsSslKey0 +func (t *NewOutputLogstash_Secrets_Ssl_Key) MergeNewOutputLogstashSecretsSslKey0(v NewOutputLogstashSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputLogstashSecretsSslKey1 returns the union data inside the NewOutputLogstash_Secrets_Ssl_Key as a NewOutputLogstashSecretsSslKey1 +func (t NewOutputLogstash_Secrets_Ssl_Key) AsNewOutputLogstashSecretsSslKey1() (NewOutputLogstashSecretsSslKey1, error) { + var body NewOutputLogstashSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputLogstashSecretsSslKey1 overwrites any union data inside the NewOutputLogstash_Secrets_Ssl_Key as the provided NewOutputLogstashSecretsSslKey1 +func (t *NewOutputLogstash_Secrets_Ssl_Key) FromNewOutputLogstashSecretsSslKey1(v NewOutputLogstashSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputLogstashSecretsSslKey1 performs a merge with any union data inside the NewOutputLogstash_Secrets_Ssl_Key, using the provided NewOutputLogstashSecretsSslKey1 +func (t *NewOutputLogstash_Secrets_Ssl_Key) MergeNewOutputLogstashSecretsSslKey1(v NewOutputLogstashSecretsSslKey1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t NewOutputLogstash_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *NewOutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsNewOutputRemoteElasticsearchSecretsServiceToken0 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken as a NewOutputRemoteElasticsearchSecretsServiceToken0 +func (t NewOutputRemoteElasticsearch_Secrets_ServiceToken) AsNewOutputRemoteElasticsearchSecretsServiceToken0() (NewOutputRemoteElasticsearchSecretsServiceToken0, error) { + var body NewOutputRemoteElasticsearchSecretsServiceToken0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputRemoteElasticsearchSecretsServiceToken0 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken as the provided NewOutputRemoteElasticsearchSecretsServiceToken0 +func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) FromNewOutputRemoteElasticsearchSecretsServiceToken0(v NewOutputRemoteElasticsearchSecretsServiceToken0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputRemoteElasticsearchSecretsServiceToken0 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken, using the provided NewOutputRemoteElasticsearchSecretsServiceToken0 +func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) MergeNewOutputRemoteElasticsearchSecretsServiceToken0(v NewOutputRemoteElasticsearchSecretsServiceToken0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputRemoteElasticsearchSecretsServiceToken1 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken as a NewOutputRemoteElasticsearchSecretsServiceToken1 +func (t NewOutputRemoteElasticsearch_Secrets_ServiceToken) AsNewOutputRemoteElasticsearchSecretsServiceToken1() (NewOutputRemoteElasticsearchSecretsServiceToken1, error) { + var body NewOutputRemoteElasticsearchSecretsServiceToken1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputRemoteElasticsearchSecretsServiceToken1 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken as the provided NewOutputRemoteElasticsearchSecretsServiceToken1 +func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) FromNewOutputRemoteElasticsearchSecretsServiceToken1(v NewOutputRemoteElasticsearchSecretsServiceToken1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputRemoteElasticsearchSecretsServiceToken1 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken, using the provided NewOutputRemoteElasticsearchSecretsServiceToken1 +func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) MergeNewOutputRemoteElasticsearchSecretsServiceToken1(v NewOutputRemoteElasticsearchSecretsServiceToken1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t NewOutputRemoteElasticsearch_Secrets_ServiceToken) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsNewOutputRemoteElasticsearchSecretsSslKey0 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as a NewOutputRemoteElasticsearchSecretsSslKey0 +func (t NewOutputRemoteElasticsearch_Secrets_Ssl_Key) AsNewOutputRemoteElasticsearchSecretsSslKey0() (NewOutputRemoteElasticsearchSecretsSslKey0, error) { + var body NewOutputRemoteElasticsearchSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputRemoteElasticsearchSecretsSslKey0 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as the provided NewOutputRemoteElasticsearchSecretsSslKey0 +func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) FromNewOutputRemoteElasticsearchSecretsSslKey0(v NewOutputRemoteElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputRemoteElasticsearchSecretsSslKey0 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided NewOutputRemoteElasticsearchSecretsSslKey0 +func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeNewOutputRemoteElasticsearchSecretsSslKey0(v NewOutputRemoteElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputRemoteElasticsearchSecretsSslKey1 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as a NewOutputRemoteElasticsearchSecretsSslKey1 +func (t NewOutputRemoteElasticsearch_Secrets_Ssl_Key) AsNewOutputRemoteElasticsearchSecretsSslKey1() (NewOutputRemoteElasticsearchSecretsSslKey1, error) { + var body NewOutputRemoteElasticsearchSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputRemoteElasticsearchSecretsSslKey1 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as the provided NewOutputRemoteElasticsearchSecretsSslKey1 +func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) FromNewOutputRemoteElasticsearchSecretsSslKey1(v NewOutputRemoteElasticsearchSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputRemoteElasticsearchSecretsSslKey1 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided NewOutputRemoteElasticsearchSecretsSslKey1 +func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeNewOutputRemoteElasticsearchSecretsSslKey1(v NewOutputRemoteElasticsearchSecretsSslKey1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t NewOutputRemoteElasticsearch_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsNewOutputElasticsearch returns the union data inside the NewOutputUnion as a NewOutputElasticsearch +func (t NewOutputUnion) AsNewOutputElasticsearch() (NewOutputElasticsearch, error) { + var body NewOutputElasticsearch + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputElasticsearch overwrites any union data inside the NewOutputUnion as the provided NewOutputElasticsearch +func (t *NewOutputUnion) FromNewOutputElasticsearch(v NewOutputElasticsearch) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputElasticsearch performs a merge with any union data inside the NewOutputUnion, using the provided NewOutputElasticsearch +func (t *NewOutputUnion) MergeNewOutputElasticsearch(v NewOutputElasticsearch) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputRemoteElasticsearch returns the union data inside the NewOutputUnion as a NewOutputRemoteElasticsearch +func (t NewOutputUnion) AsNewOutputRemoteElasticsearch() (NewOutputRemoteElasticsearch, error) { + var body NewOutputRemoteElasticsearch + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputRemoteElasticsearch overwrites any union data inside the NewOutputUnion as the provided NewOutputRemoteElasticsearch +func (t *NewOutputUnion) FromNewOutputRemoteElasticsearch(v NewOutputRemoteElasticsearch) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputRemoteElasticsearch performs a merge with any union data inside the NewOutputUnion, using the provided NewOutputRemoteElasticsearch +func (t *NewOutputUnion) MergeNewOutputRemoteElasticsearch(v NewOutputRemoteElasticsearch) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputLogstash returns the union data inside the NewOutputUnion as a NewOutputLogstash +func (t NewOutputUnion) AsNewOutputLogstash() (NewOutputLogstash, error) { + var body NewOutputLogstash + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputLogstash overwrites any union data inside the NewOutputUnion as the provided NewOutputLogstash +func (t *NewOutputUnion) FromNewOutputLogstash(v NewOutputLogstash) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputLogstash performs a merge with any union data inside the NewOutputUnion, using the provided NewOutputLogstash +func (t *NewOutputUnion) MergeNewOutputLogstash(v NewOutputLogstash) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputKafka returns the union data inside the NewOutputUnion as a NewOutputKafka +func (t NewOutputUnion) AsNewOutputKafka() (NewOutputKafka, error) { + var body NewOutputKafka + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputKafka overwrites any union data inside the NewOutputUnion as the provided NewOutputKafka +func (t *NewOutputUnion) FromNewOutputKafka(v NewOutputKafka) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputKafka performs a merge with any union data inside the NewOutputUnion, using the provided NewOutputKafka +func (t *NewOutputUnion) MergeNewOutputKafka(v NewOutputKafka) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t NewOutputUnion) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *NewOutputUnion) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsOutputElasticsearchSecretsSslKey0 returns the union data inside the OutputElasticsearch_Secrets_Ssl_Key as a OutputElasticsearchSecretsSslKey0 +func (t OutputElasticsearch_Secrets_Ssl_Key) AsOutputElasticsearchSecretsSslKey0() (OutputElasticsearchSecretsSslKey0, error) { + var body OutputElasticsearchSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputElasticsearchSecretsSslKey0 overwrites any union data inside the OutputElasticsearch_Secrets_Ssl_Key as the provided OutputElasticsearchSecretsSslKey0 +func (t *OutputElasticsearch_Secrets_Ssl_Key) FromOutputElasticsearchSecretsSslKey0(v OutputElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputElasticsearchSecretsSslKey0 performs a merge with any union data inside the OutputElasticsearch_Secrets_Ssl_Key, using the provided OutputElasticsearchSecretsSslKey0 +func (t *OutputElasticsearch_Secrets_Ssl_Key) MergeOutputElasticsearchSecretsSslKey0(v OutputElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputElasticsearchSecretsSslKey1 returns the union data inside the OutputElasticsearch_Secrets_Ssl_Key as a OutputElasticsearchSecretsSslKey1 +func (t OutputElasticsearch_Secrets_Ssl_Key) AsOutputElasticsearchSecretsSslKey1() (OutputElasticsearchSecretsSslKey1, error) { + var body OutputElasticsearchSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputElasticsearchSecretsSslKey1 overwrites any union data inside the OutputElasticsearch_Secrets_Ssl_Key as the provided OutputElasticsearchSecretsSslKey1 +func (t *OutputElasticsearch_Secrets_Ssl_Key) FromOutputElasticsearchSecretsSslKey1(v OutputElasticsearchSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputElasticsearchSecretsSslKey1 performs a merge with any union data inside the OutputElasticsearch_Secrets_Ssl_Key, using the provided OutputElasticsearchSecretsSslKey1 +func (t *OutputElasticsearch_Secrets_Ssl_Key) MergeOutputElasticsearchSecretsSslKey1(v OutputElasticsearchSecretsSslKey1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t OutputElasticsearch_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *OutputElasticsearch_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsOutputKafkaSecretsPassword0 returns the union data inside the OutputKafka_Secrets_Password as a OutputKafkaSecretsPassword0 +func (t OutputKafka_Secrets_Password) AsOutputKafkaSecretsPassword0() (OutputKafkaSecretsPassword0, error) { + var body OutputKafkaSecretsPassword0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputKafkaSecretsPassword0 overwrites any union data inside the OutputKafka_Secrets_Password as the provided OutputKafkaSecretsPassword0 +func (t *OutputKafka_Secrets_Password) FromOutputKafkaSecretsPassword0(v OutputKafkaSecretsPassword0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputKafkaSecretsPassword0 performs a merge with any union data inside the OutputKafka_Secrets_Password, using the provided OutputKafkaSecretsPassword0 +func (t *OutputKafka_Secrets_Password) MergeOutputKafkaSecretsPassword0(v OutputKafkaSecretsPassword0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputKafkaSecretsPassword1 returns the union data inside the OutputKafka_Secrets_Password as a OutputKafkaSecretsPassword1 +func (t OutputKafka_Secrets_Password) AsOutputKafkaSecretsPassword1() (OutputKafkaSecretsPassword1, error) { + var body OutputKafkaSecretsPassword1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputKafkaSecretsPassword1 overwrites any union data inside the OutputKafka_Secrets_Password as the provided OutputKafkaSecretsPassword1 +func (t *OutputKafka_Secrets_Password) FromOutputKafkaSecretsPassword1(v OutputKafkaSecretsPassword1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputKafkaSecretsPassword1 performs a merge with any union data inside the OutputKafka_Secrets_Password, using the provided OutputKafkaSecretsPassword1 +func (t *OutputKafka_Secrets_Password) MergeOutputKafkaSecretsPassword1(v OutputKafkaSecretsPassword1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t OutputKafka_Secrets_Password) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *OutputKafka_Secrets_Password) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsOutputKafkaSecretsSslKey0 returns the union data inside the OutputKafka_Secrets_Ssl_Key as a OutputKafkaSecretsSslKey0 +func (t OutputKafka_Secrets_Ssl_Key) AsOutputKafkaSecretsSslKey0() (OutputKafkaSecretsSslKey0, error) { + var body OutputKafkaSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputKafkaSecretsSslKey0 overwrites any union data inside the OutputKafka_Secrets_Ssl_Key as the provided OutputKafkaSecretsSslKey0 +func (t *OutputKafka_Secrets_Ssl_Key) FromOutputKafkaSecretsSslKey0(v OutputKafkaSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputKafkaSecretsSslKey0 performs a merge with any union data inside the OutputKafka_Secrets_Ssl_Key, using the provided OutputKafkaSecretsSslKey0 +func (t *OutputKafka_Secrets_Ssl_Key) MergeOutputKafkaSecretsSslKey0(v OutputKafkaSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputKafkaSecretsSslKey1 returns the union data inside the OutputKafka_Secrets_Ssl_Key as a OutputKafkaSecretsSslKey1 +func (t OutputKafka_Secrets_Ssl_Key) AsOutputKafkaSecretsSslKey1() (OutputKafkaSecretsSslKey1, error) { + var body OutputKafkaSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputKafkaSecretsSslKey1 overwrites any union data inside the OutputKafka_Secrets_Ssl_Key as the provided OutputKafkaSecretsSslKey1 +func (t *OutputKafka_Secrets_Ssl_Key) FromOutputKafkaSecretsSslKey1(v OutputKafkaSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputKafkaSecretsSslKey1 performs a merge with any union data inside the OutputKafka_Secrets_Ssl_Key, using the provided OutputKafkaSecretsSslKey1 +func (t *OutputKafka_Secrets_Ssl_Key) MergeOutputKafkaSecretsSslKey1(v OutputKafkaSecretsSslKey1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t OutputKafka_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *OutputKafka_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsOutputLogstashSecretsSslKey0 returns the union data inside the OutputLogstash_Secrets_Ssl_Key as a OutputLogstashSecretsSslKey0 +func (t OutputLogstash_Secrets_Ssl_Key) AsOutputLogstashSecretsSslKey0() (OutputLogstashSecretsSslKey0, error) { + var body OutputLogstashSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputLogstashSecretsSslKey0 overwrites any union data inside the OutputLogstash_Secrets_Ssl_Key as the provided OutputLogstashSecretsSslKey0 +func (t *OutputLogstash_Secrets_Ssl_Key) FromOutputLogstashSecretsSslKey0(v OutputLogstashSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputLogstashSecretsSslKey0 performs a merge with any union data inside the OutputLogstash_Secrets_Ssl_Key, using the provided OutputLogstashSecretsSslKey0 +func (t *OutputLogstash_Secrets_Ssl_Key) MergeOutputLogstashSecretsSslKey0(v OutputLogstashSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputLogstashSecretsSslKey1 returns the union data inside the OutputLogstash_Secrets_Ssl_Key as a OutputLogstashSecretsSslKey1 +func (t OutputLogstash_Secrets_Ssl_Key) AsOutputLogstashSecretsSslKey1() (OutputLogstashSecretsSslKey1, error) { + var body OutputLogstashSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputLogstashSecretsSslKey1 overwrites any union data inside the OutputLogstash_Secrets_Ssl_Key as the provided OutputLogstashSecretsSslKey1 +func (t *OutputLogstash_Secrets_Ssl_Key) FromOutputLogstashSecretsSslKey1(v OutputLogstashSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputLogstashSecretsSslKey1 performs a merge with any union data inside the OutputLogstash_Secrets_Ssl_Key, using the provided OutputLogstashSecretsSslKey1 +func (t *OutputLogstash_Secrets_Ssl_Key) MergeOutputLogstashSecretsSslKey1(v OutputLogstashSecretsSslKey1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t OutputLogstash_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *OutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsOutputRemoteElasticsearchSecretsServiceToken0 returns the union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken as a OutputRemoteElasticsearchSecretsServiceToken0 +func (t OutputRemoteElasticsearch_Secrets_ServiceToken) AsOutputRemoteElasticsearchSecretsServiceToken0() (OutputRemoteElasticsearchSecretsServiceToken0, error) { + var body OutputRemoteElasticsearchSecretsServiceToken0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputRemoteElasticsearchSecretsServiceToken0 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken as the provided OutputRemoteElasticsearchSecretsServiceToken0 +func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) FromOutputRemoteElasticsearchSecretsServiceToken0(v OutputRemoteElasticsearchSecretsServiceToken0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputRemoteElasticsearchSecretsServiceToken0 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken, using the provided OutputRemoteElasticsearchSecretsServiceToken0 +func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) MergeOutputRemoteElasticsearchSecretsServiceToken0(v OutputRemoteElasticsearchSecretsServiceToken0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputRemoteElasticsearchSecretsServiceToken1 returns the union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken as a OutputRemoteElasticsearchSecretsServiceToken1 +func (t OutputRemoteElasticsearch_Secrets_ServiceToken) AsOutputRemoteElasticsearchSecretsServiceToken1() (OutputRemoteElasticsearchSecretsServiceToken1, error) { + var body OutputRemoteElasticsearchSecretsServiceToken1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputRemoteElasticsearchSecretsServiceToken1 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken as the provided OutputRemoteElasticsearchSecretsServiceToken1 +func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) FromOutputRemoteElasticsearchSecretsServiceToken1(v OutputRemoteElasticsearchSecretsServiceToken1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputRemoteElasticsearchSecretsServiceToken1 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken, using the provided OutputRemoteElasticsearchSecretsServiceToken1 +func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) MergeOutputRemoteElasticsearchSecretsServiceToken1(v OutputRemoteElasticsearchSecretsServiceToken1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t OutputRemoteElasticsearch_Secrets_ServiceToken) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsOutputRemoteElasticsearchSecretsSslKey0 returns the union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as a OutputRemoteElasticsearchSecretsSslKey0 +func (t OutputRemoteElasticsearch_Secrets_Ssl_Key) AsOutputRemoteElasticsearchSecretsSslKey0() (OutputRemoteElasticsearchSecretsSslKey0, error) { + var body OutputRemoteElasticsearchSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputRemoteElasticsearchSecretsSslKey0 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as the provided OutputRemoteElasticsearchSecretsSslKey0 +func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) FromOutputRemoteElasticsearchSecretsSslKey0(v OutputRemoteElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputRemoteElasticsearchSecretsSslKey0 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided OutputRemoteElasticsearchSecretsSslKey0 +func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) MergeOutputRemoteElasticsearchSecretsSslKey0(v OutputRemoteElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputRemoteElasticsearchSecretsSslKey1 returns the union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as a OutputRemoteElasticsearchSecretsSslKey1 +func (t OutputRemoteElasticsearch_Secrets_Ssl_Key) AsOutputRemoteElasticsearchSecretsSslKey1() (OutputRemoteElasticsearchSecretsSslKey1, error) { + var body OutputRemoteElasticsearchSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputRemoteElasticsearchSecretsSslKey1 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as the provided OutputRemoteElasticsearchSecretsSslKey1 +func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) FromOutputRemoteElasticsearchSecretsSslKey1(v OutputRemoteElasticsearchSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputRemoteElasticsearchSecretsSslKey1 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided OutputRemoteElasticsearchSecretsSslKey1 +func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) MergeOutputRemoteElasticsearchSecretsSslKey1(v OutputRemoteElasticsearchSecretsSslKey1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t OutputRemoteElasticsearch_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsOutputElasticsearch returns the union data inside the OutputUnion as a OutputElasticsearch +func (t OutputUnion) AsOutputElasticsearch() (OutputElasticsearch, error) { + var body OutputElasticsearch + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputElasticsearch overwrites any union data inside the OutputUnion as the provided OutputElasticsearch +func (t *OutputUnion) FromOutputElasticsearch(v OutputElasticsearch) error { + v.Type = "elasticsearch" + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputElasticsearch performs a merge with any union data inside the OutputUnion, using the provided OutputElasticsearch +func (t *OutputUnion) MergeOutputElasticsearch(v OutputElasticsearch) error { + v.Type = "elasticsearch" + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputRemoteElasticsearch returns the union data inside the OutputUnion as a OutputRemoteElasticsearch +func (t OutputUnion) AsOutputRemoteElasticsearch() (OutputRemoteElasticsearch, error) { + var body OutputRemoteElasticsearch + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputRemoteElasticsearch overwrites any union data inside the OutputUnion as the provided OutputRemoteElasticsearch +func (t *OutputUnion) FromOutputRemoteElasticsearch(v OutputRemoteElasticsearch) error { + v.Type = "remote_elasticsearch" + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputRemoteElasticsearch performs a merge with any union data inside the OutputUnion, using the provided OutputRemoteElasticsearch +func (t *OutputUnion) MergeOutputRemoteElasticsearch(v OutputRemoteElasticsearch) error { + v.Type = "remote_elasticsearch" + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputLogstash returns the union data inside the OutputUnion as a OutputLogstash +func (t OutputUnion) AsOutputLogstash() (OutputLogstash, error) { + var body OutputLogstash + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputLogstash overwrites any union data inside the OutputUnion as the provided OutputLogstash +func (t *OutputUnion) FromOutputLogstash(v OutputLogstash) error { + v.Type = "logstash" + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputLogstash performs a merge with any union data inside the OutputUnion, using the provided OutputLogstash +func (t *OutputUnion) MergeOutputLogstash(v OutputLogstash) error { + v.Type = "logstash" + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputKafka returns the union data inside the OutputUnion as a OutputKafka +func (t OutputUnion) AsOutputKafka() (OutputKafka, error) { + var body OutputKafka + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputKafka overwrites any union data inside the OutputUnion as the provided OutputKafka +func (t *OutputUnion) FromOutputKafka(v OutputKafka) error { + v.Type = "kafka" + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputKafka performs a merge with any union data inside the OutputUnion, using the provided OutputKafka +func (t *OutputUnion) MergeOutputKafka(v OutputKafka) error { + v.Type = "kafka" + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t OutputUnion) Discriminator() (string, error) { + var discriminator struct { + Discriminator string `json:"type"` + } + err := json.Unmarshal(t.union, &discriminator) + return discriminator.Discriminator, err +} + +func (t OutputUnion) ValueByDiscriminator() (interface{}, error) { + discriminator, err := t.Discriminator() + if err != nil { + return nil, err + } + switch discriminator { + case "elasticsearch": + return t.AsOutputElasticsearch() + case "kafka": + return t.AsOutputKafka() + case "logstash": + return t.AsOutputLogstash() + case "remote_elasticsearch": + return t.AsOutputRemoteElasticsearch() + default: + return nil, errors.New("unknown discriminator value: " + discriminator) + } +} + +func (t OutputUnion) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *OutputUnion) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 returns the union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 +func (t PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0() (PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0, error) { + var body PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 overwrites any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 +func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 performs a merge with any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 +func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 returns the union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 +func (t PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1() (PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1, error) { + var body PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 overwrites any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 +func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 performs a merge with any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 +func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsPackageInfoInstallationInfoInstalledKibanaType0 returns the union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as a PackageInfoInstallationInfoInstalledKibanaType0 +func (t PackageInfo_InstallationInfo_InstalledKibana_Type) AsPackageInfoInstallationInfoInstalledKibanaType0() (PackageInfoInstallationInfoInstalledKibanaType0, error) { + var body PackageInfoInstallationInfoInstalledKibanaType0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoInstallationInfoInstalledKibanaType0 overwrites any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as the provided PackageInfoInstallationInfoInstalledKibanaType0 +func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) FromPackageInfoInstallationInfoInstalledKibanaType0(v PackageInfoInstallationInfoInstalledKibanaType0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoInstallationInfoInstalledKibanaType0 performs a merge with any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type, using the provided PackageInfoInstallationInfoInstalledKibanaType0 +func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) MergePackageInfoInstallationInfoInstalledKibanaType0(v PackageInfoInstallationInfoInstalledKibanaType0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageInfoInstallationInfoInstalledKibanaType1 returns the union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as a PackageInfoInstallationInfoInstalledKibanaType1 +func (t PackageInfo_InstallationInfo_InstalledKibana_Type) AsPackageInfoInstallationInfoInstalledKibanaType1() (PackageInfoInstallationInfoInstalledKibanaType1, error) { + var body PackageInfoInstallationInfoInstalledKibanaType1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoInstallationInfoInstalledKibanaType1 overwrites any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as the provided PackageInfoInstallationInfoInstalledKibanaType1 +func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) FromPackageInfoInstallationInfoInstalledKibanaType1(v PackageInfoInstallationInfoInstalledKibanaType1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoInstallationInfoInstalledKibanaType1 performs a merge with any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type, using the provided PackageInfoInstallationInfoInstalledKibanaType1 +func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) MergePackageInfoInstallationInfoInstalledKibanaType1(v PackageInfoInstallationInfoInstalledKibanaType1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t PackageInfo_InstallationInfo_InstalledKibana_Type) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsPackageInfoType0 returns the union data inside the PackageInfo_Type as a PackageInfoType0 +func (t PackageInfo_Type) AsPackageInfoType0() (PackageInfoType0, error) { + var body PackageInfoType0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoType0 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType0 +func (t *PackageInfo_Type) FromPackageInfoType0(v PackageInfoType0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoType0 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType0 +func (t *PackageInfo_Type) MergePackageInfoType0(v PackageInfoType0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageInfoType1 returns the union data inside the PackageInfo_Type as a PackageInfoType1 +func (t PackageInfo_Type) AsPackageInfoType1() (PackageInfoType1, error) { + var body PackageInfoType1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoType1 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType1 +func (t *PackageInfo_Type) FromPackageInfoType1(v PackageInfoType1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoType1 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType1 +func (t *PackageInfo_Type) MergePackageInfoType1(v PackageInfoType1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageInfoType2 returns the union data inside the PackageInfo_Type as a PackageInfoType2 +func (t PackageInfo_Type) AsPackageInfoType2() (PackageInfoType2, error) { + var body PackageInfoType2 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoType2 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType2 +func (t *PackageInfo_Type) FromPackageInfoType2(v PackageInfoType2) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoType2 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType2 +func (t *PackageInfo_Type) MergePackageInfoType2(v PackageInfoType2) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageInfoType3 returns the union data inside the PackageInfo_Type as a PackageInfoType3 +func (t PackageInfo_Type) AsPackageInfoType3() (PackageInfoType3, error) { + var body PackageInfoType3 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoType3 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType3 +func (t *PackageInfo_Type) FromPackageInfoType3(v PackageInfoType3) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoType3 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType3 +func (t *PackageInfo_Type) MergePackageInfoType3(v PackageInfoType3) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t PackageInfo_Type) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *PackageInfo_Type) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 returns the union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 +func (t PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0() (PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0, error) { + var body PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 overwrites any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 +func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 performs a merge with any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 +func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 returns the union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 +func (t PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1() (PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1, error) { + var body PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 overwrites any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 +func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 performs a merge with any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 +func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsPackageListItemInstallationInfoInstalledKibanaType0 returns the union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as a PackageListItemInstallationInfoInstalledKibanaType0 +func (t PackageListItem_InstallationInfo_InstalledKibana_Type) AsPackageListItemInstallationInfoInstalledKibanaType0() (PackageListItemInstallationInfoInstalledKibanaType0, error) { + var body PackageListItemInstallationInfoInstalledKibanaType0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageListItemInstallationInfoInstalledKibanaType0 overwrites any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as the provided PackageListItemInstallationInfoInstalledKibanaType0 +func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) FromPackageListItemInstallationInfoInstalledKibanaType0(v PackageListItemInstallationInfoInstalledKibanaType0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageListItemInstallationInfoInstalledKibanaType0 performs a merge with any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type, using the provided PackageListItemInstallationInfoInstalledKibanaType0 +func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) MergePackageListItemInstallationInfoInstalledKibanaType0(v PackageListItemInstallationInfoInstalledKibanaType0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageListItemInstallationInfoInstalledKibanaType1 returns the union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as a PackageListItemInstallationInfoInstalledKibanaType1 +func (t PackageListItem_InstallationInfo_InstalledKibana_Type) AsPackageListItemInstallationInfoInstalledKibanaType1() (PackageListItemInstallationInfoInstalledKibanaType1, error) { + var body PackageListItemInstallationInfoInstalledKibanaType1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageListItemInstallationInfoInstalledKibanaType1 overwrites any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as the provided PackageListItemInstallationInfoInstalledKibanaType1 +func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) FromPackageListItemInstallationInfoInstalledKibanaType1(v PackageListItemInstallationInfoInstalledKibanaType1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageListItemInstallationInfoInstalledKibanaType1 performs a merge with any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type, using the provided PackageListItemInstallationInfoInstalledKibanaType1 +func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) MergePackageListItemInstallationInfoInstalledKibanaType1(v PackageListItemInstallationInfoInstalledKibanaType1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t PackageListItem_InstallationInfo_InstalledKibana_Type) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsPackageListItemType0 returns the union data inside the PackageListItem_Type as a PackageListItemType0 +func (t PackageListItem_Type) AsPackageListItemType0() (PackageListItemType0, error) { + var body PackageListItemType0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageListItemType0 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType0 +func (t *PackageListItem_Type) FromPackageListItemType0(v PackageListItemType0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageListItemType0 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType0 +func (t *PackageListItem_Type) MergePackageListItemType0(v PackageListItemType0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageListItemType1 returns the union data inside the PackageListItem_Type as a PackageListItemType1 +func (t PackageListItem_Type) AsPackageListItemType1() (PackageListItemType1, error) { + var body PackageListItemType1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageListItemType1 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType1 +func (t *PackageListItem_Type) FromPackageListItemType1(v PackageListItemType1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageListItemType1 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType1 +func (t *PackageListItem_Type) MergePackageListItemType1(v PackageListItemType1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageListItemType2 returns the union data inside the PackageListItem_Type as a PackageListItemType2 +func (t PackageListItem_Type) AsPackageListItemType2() (PackageListItemType2, error) { + var body PackageListItemType2 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageListItemType2 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType2 +func (t *PackageListItem_Type) FromPackageListItemType2(v PackageListItemType2) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageListItemType2 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType2 +func (t *PackageListItem_Type) MergePackageListItemType2(v PackageListItemType2) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageListItemType3 returns the union data inside the PackageListItem_Type as a PackageListItemType3 +func (t PackageListItem_Type) AsPackageListItemType3() (PackageListItemType3, error) { + var body PackageListItemType3 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageListItemType3 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType3 +func (t *PackageListItem_Type) FromPackageListItemType3(v PackageListItemType3) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageListItemType3 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType3 +func (t *PackageListItem_Type) MergePackageListItemType3(v PackageListItemType3) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t PackageListItem_Type) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *PackageListItem_Type) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsServerHostSecretsSslEsKey0 returns the union data inside the ServerHost_Secrets_Ssl_EsKey as a ServerHostSecretsSslEsKey0 +func (t ServerHost_Secrets_Ssl_EsKey) AsServerHostSecretsSslEsKey0() (ServerHostSecretsSslEsKey0, error) { + var body ServerHostSecretsSslEsKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromServerHostSecretsSslEsKey0 overwrites any union data inside the ServerHost_Secrets_Ssl_EsKey as the provided ServerHostSecretsSslEsKey0 +func (t *ServerHost_Secrets_Ssl_EsKey) FromServerHostSecretsSslEsKey0(v ServerHostSecretsSslEsKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeServerHostSecretsSslEsKey0 performs a merge with any union data inside the ServerHost_Secrets_Ssl_EsKey, using the provided ServerHostSecretsSslEsKey0 +func (t *ServerHost_Secrets_Ssl_EsKey) MergeServerHostSecretsSslEsKey0(v ServerHostSecretsSslEsKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsServerHostSecretsSslEsKey1 returns the union data inside the ServerHost_Secrets_Ssl_EsKey as a ServerHostSecretsSslEsKey1 +func (t ServerHost_Secrets_Ssl_EsKey) AsServerHostSecretsSslEsKey1() (ServerHostSecretsSslEsKey1, error) { + var body ServerHostSecretsSslEsKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromServerHostSecretsSslEsKey1 overwrites any union data inside the ServerHost_Secrets_Ssl_EsKey as the provided ServerHostSecretsSslEsKey1 +func (t *ServerHost_Secrets_Ssl_EsKey) FromServerHostSecretsSslEsKey1(v ServerHostSecretsSslEsKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeServerHostSecretsSslEsKey1 performs a merge with any union data inside the ServerHost_Secrets_Ssl_EsKey, using the provided ServerHostSecretsSslEsKey1 +func (t *ServerHost_Secrets_Ssl_EsKey) MergeServerHostSecretsSslEsKey1(v ServerHostSecretsSslEsKey1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t ServerHost_Secrets_Ssl_EsKey) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *ServerHost_Secrets_Ssl_EsKey) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsServerHostSecretsSslKey0 returns the union data inside the ServerHost_Secrets_Ssl_Key as a ServerHostSecretsSslKey0 +func (t ServerHost_Secrets_Ssl_Key) AsServerHostSecretsSslKey0() (ServerHostSecretsSslKey0, error) { + var body ServerHostSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromServerHostSecretsSslKey0 overwrites any union data inside the ServerHost_Secrets_Ssl_Key as the provided ServerHostSecretsSslKey0 +func (t *ServerHost_Secrets_Ssl_Key) FromServerHostSecretsSslKey0(v ServerHostSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeServerHostSecretsSslKey0 performs a merge with any union data inside the ServerHost_Secrets_Ssl_Key, using the provided ServerHostSecretsSslKey0 +func (t *ServerHost_Secrets_Ssl_Key) MergeServerHostSecretsSslKey0(v ServerHostSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsServerHostSecretsSslKey1 returns the union data inside the ServerHost_Secrets_Ssl_Key as a ServerHostSecretsSslKey1 +func (t ServerHost_Secrets_Ssl_Key) AsServerHostSecretsSslKey1() (ServerHostSecretsSslKey1, error) { + var body ServerHostSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromServerHostSecretsSslKey1 overwrites any union data inside the ServerHost_Secrets_Ssl_Key as the provided ServerHostSecretsSslKey1 +func (t *ServerHost_Secrets_Ssl_Key) FromServerHostSecretsSslKey1(v ServerHostSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeServerHostSecretsSslKey1 performs a merge with any union data inside the ServerHost_Secrets_Ssl_Key, using the provided ServerHostSecretsSslKey1 +func (t *ServerHost_Secrets_Ssl_Key) MergeServerHostSecretsSslKey1(v ServerHostSecretsSslKey1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t ServerHost_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() return b, err } -func (t *OutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) +func (t *ServerHost_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsBedrockConfig returns the union data inside the UpdateConnectorConfig as a BedrockConfig +func (t UpdateConnectorConfig) AsBedrockConfig() (BedrockConfig, error) { + var body BedrockConfig + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromBedrockConfig overwrites any union data inside the UpdateConnectorConfig as the provided BedrockConfig +func (t *UpdateConnectorConfig) FromBedrockConfig(v BedrockConfig) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeBedrockConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided BedrockConfig +func (t *UpdateConnectorConfig) MergeBedrockConfig(v BedrockConfig) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsCrowdstrikeConfig returns the union data inside the UpdateConnectorConfig as a CrowdstrikeConfig +func (t UpdateConnectorConfig) AsCrowdstrikeConfig() (CrowdstrikeConfig, error) { + var body CrowdstrikeConfig + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromCrowdstrikeConfig overwrites any union data inside the UpdateConnectorConfig as the provided CrowdstrikeConfig +func (t *UpdateConnectorConfig) FromCrowdstrikeConfig(v CrowdstrikeConfig) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeCrowdstrikeConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided CrowdstrikeConfig +func (t *UpdateConnectorConfig) MergeCrowdstrikeConfig(v CrowdstrikeConfig) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsD3securityConfig returns the union data inside the UpdateConnectorConfig as a D3securityConfig +func (t UpdateConnectorConfig) AsD3securityConfig() (D3securityConfig, error) { + var body D3securityConfig + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromD3securityConfig overwrites any union data inside the UpdateConnectorConfig as the provided D3securityConfig +func (t *UpdateConnectorConfig) FromD3securityConfig(v D3securityConfig) error { + b, err := json.Marshal(v) + t.union = b return err } -// AsOutputRemoteElasticsearchSecretsServiceToken0 returns the union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken as a OutputRemoteElasticsearchSecretsServiceToken0 -func (t OutputRemoteElasticsearch_Secrets_ServiceToken) AsOutputRemoteElasticsearchSecretsServiceToken0() (OutputRemoteElasticsearchSecretsServiceToken0, error) { - var body OutputRemoteElasticsearchSecretsServiceToken0 +// MergeD3securityConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided D3securityConfig +func (t *UpdateConnectorConfig) MergeD3securityConfig(v D3securityConfig) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsEmailConfig returns the union data inside the UpdateConnectorConfig as a EmailConfig +func (t UpdateConnectorConfig) AsEmailConfig() (EmailConfig, error) { + var body EmailConfig + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromEmailConfig overwrites any union data inside the UpdateConnectorConfig as the provided EmailConfig +func (t *UpdateConnectorConfig) FromEmailConfig(v EmailConfig) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeEmailConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided EmailConfig +func (t *UpdateConnectorConfig) MergeEmailConfig(v EmailConfig) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsGeminiConfig returns the union data inside the UpdateConnectorConfig as a GeminiConfig +func (t UpdateConnectorConfig) AsGeminiConfig() (GeminiConfig, error) { + var body GeminiConfig + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromGeminiConfig overwrites any union data inside the UpdateConnectorConfig as the provided GeminiConfig +func (t *UpdateConnectorConfig) FromGeminiConfig(v GeminiConfig) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeGeminiConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided GeminiConfig +func (t *UpdateConnectorConfig) MergeGeminiConfig(v GeminiConfig) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsResilientConfig returns the union data inside the UpdateConnectorConfig as a ResilientConfig +func (t UpdateConnectorConfig) AsResilientConfig() (ResilientConfig, error) { + var body ResilientConfig + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromResilientConfig overwrites any union data inside the UpdateConnectorConfig as the provided ResilientConfig +func (t *UpdateConnectorConfig) FromResilientConfig(v ResilientConfig) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeResilientConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided ResilientConfig +func (t *UpdateConnectorConfig) MergeResilientConfig(v ResilientConfig) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsIndexConfig returns the union data inside the UpdateConnectorConfig as a IndexConfig +func (t UpdateConnectorConfig) AsIndexConfig() (IndexConfig, error) { + var body IndexConfig + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromIndexConfig overwrites any union data inside the UpdateConnectorConfig as the provided IndexConfig +func (t *UpdateConnectorConfig) FromIndexConfig(v IndexConfig) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeIndexConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided IndexConfig +func (t *UpdateConnectorConfig) MergeIndexConfig(v IndexConfig) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsJiraConfig returns the union data inside the UpdateConnectorConfig as a JiraConfig +func (t UpdateConnectorConfig) AsJiraConfig() (JiraConfig, error) { + var body JiraConfig + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromJiraConfig overwrites any union data inside the UpdateConnectorConfig as the provided JiraConfig +func (t *UpdateConnectorConfig) FromJiraConfig(v JiraConfig) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeJiraConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided JiraConfig +func (t *UpdateConnectorConfig) MergeJiraConfig(v JiraConfig) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsDefenderConfig returns the union data inside the UpdateConnectorConfig as a DefenderConfig +func (t UpdateConnectorConfig) AsDefenderConfig() (DefenderConfig, error) { + var body DefenderConfig + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromDefenderConfig overwrites any union data inside the UpdateConnectorConfig as the provided DefenderConfig +func (t *UpdateConnectorConfig) FromDefenderConfig(v DefenderConfig) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeDefenderConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided DefenderConfig +func (t *UpdateConnectorConfig) MergeDefenderConfig(v DefenderConfig) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsGenaiAzureConfig returns the union data inside the UpdateConnectorConfig as a GenaiAzureConfig +func (t UpdateConnectorConfig) AsGenaiAzureConfig() (GenaiAzureConfig, error) { + var body GenaiAzureConfig + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromGenaiAzureConfig overwrites any union data inside the UpdateConnectorConfig as the provided GenaiAzureConfig +func (t *UpdateConnectorConfig) FromGenaiAzureConfig(v GenaiAzureConfig) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeGenaiAzureConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided GenaiAzureConfig +func (t *UpdateConnectorConfig) MergeGenaiAzureConfig(v GenaiAzureConfig) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsGenaiOpenaiConfig returns the union data inside the UpdateConnectorConfig as a GenaiOpenaiConfig +func (t UpdateConnectorConfig) AsGenaiOpenaiConfig() (GenaiOpenaiConfig, error) { + var body GenaiOpenaiConfig + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromGenaiOpenaiConfig overwrites any union data inside the UpdateConnectorConfig as the provided GenaiOpenaiConfig +func (t *UpdateConnectorConfig) FromGenaiOpenaiConfig(v GenaiOpenaiConfig) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeGenaiOpenaiConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided GenaiOpenaiConfig +func (t *UpdateConnectorConfig) MergeGenaiOpenaiConfig(v GenaiOpenaiConfig) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOpsgenieConfig returns the union data inside the UpdateConnectorConfig as a OpsgenieConfig +func (t UpdateConnectorConfig) AsOpsgenieConfig() (OpsgenieConfig, error) { + var body OpsgenieConfig + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOpsgenieConfig overwrites any union data inside the UpdateConnectorConfig as the provided OpsgenieConfig +func (t *UpdateConnectorConfig) FromOpsgenieConfig(v OpsgenieConfig) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOpsgenieConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided OpsgenieConfig +func (t *UpdateConnectorConfig) MergeOpsgenieConfig(v OpsgenieConfig) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPagerdutyConfig returns the union data inside the UpdateConnectorConfig as a PagerdutyConfig +func (t UpdateConnectorConfig) AsPagerdutyConfig() (PagerdutyConfig, error) { + var body PagerdutyConfig + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPagerdutyConfig overwrites any union data inside the UpdateConnectorConfig as the provided PagerdutyConfig +func (t *UpdateConnectorConfig) FromPagerdutyConfig(v PagerdutyConfig) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePagerdutyConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided PagerdutyConfig +func (t *UpdateConnectorConfig) MergePagerdutyConfig(v PagerdutyConfig) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsSentineloneConfig returns the union data inside the UpdateConnectorConfig as a SentineloneConfig +func (t UpdateConnectorConfig) AsSentineloneConfig() (SentineloneConfig, error) { + var body SentineloneConfig + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromSentineloneConfig overwrites any union data inside the UpdateConnectorConfig as the provided SentineloneConfig +func (t *UpdateConnectorConfig) FromSentineloneConfig(v SentineloneConfig) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeSentineloneConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided SentineloneConfig +func (t *UpdateConnectorConfig) MergeSentineloneConfig(v SentineloneConfig) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsServicenowConfig returns the union data inside the UpdateConnectorConfig as a ServicenowConfig +func (t UpdateConnectorConfig) AsServicenowConfig() (ServicenowConfig, error) { + var body ServicenowConfig + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromServicenowConfig overwrites any union data inside the UpdateConnectorConfig as the provided ServicenowConfig +func (t *UpdateConnectorConfig) FromServicenowConfig(v ServicenowConfig) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeServicenowConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided ServicenowConfig +func (t *UpdateConnectorConfig) MergeServicenowConfig(v ServicenowConfig) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsServicenowItomConfig returns the union data inside the UpdateConnectorConfig as a ServicenowItomConfig +func (t UpdateConnectorConfig) AsServicenowItomConfig() (ServicenowItomConfig, error) { + var body ServicenowItomConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromOutputRemoteElasticsearchSecretsServiceToken0 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken as the provided OutputRemoteElasticsearchSecretsServiceToken0 -func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) FromOutputRemoteElasticsearchSecretsServiceToken0(v OutputRemoteElasticsearchSecretsServiceToken0) error { +// FromServicenowItomConfig overwrites any union data inside the UpdateConnectorConfig as the provided ServicenowItomConfig +func (t *UpdateConnectorConfig) FromServicenowItomConfig(v ServicenowItomConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeOutputRemoteElasticsearchSecretsServiceToken0 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken, using the provided OutputRemoteElasticsearchSecretsServiceToken0 -func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) MergeOutputRemoteElasticsearchSecretsServiceToken0(v OutputRemoteElasticsearchSecretsServiceToken0) error { +// MergeServicenowItomConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided ServicenowItomConfig +func (t *UpdateConnectorConfig) MergeServicenowItomConfig(v ServicenowItomConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -13032,22 +16447,22 @@ func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) MergeOutputRemoteElasti return err } -// AsOutputRemoteElasticsearchSecretsServiceToken1 returns the union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken as a OutputRemoteElasticsearchSecretsServiceToken1 -func (t OutputRemoteElasticsearch_Secrets_ServiceToken) AsOutputRemoteElasticsearchSecretsServiceToken1() (OutputRemoteElasticsearchSecretsServiceToken1, error) { - var body OutputRemoteElasticsearchSecretsServiceToken1 +// AsSlackApiConfig returns the union data inside the UpdateConnectorConfig as a SlackApiConfig +func (t UpdateConnectorConfig) AsSlackApiConfig() (SlackApiConfig, error) { + var body SlackApiConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromOutputRemoteElasticsearchSecretsServiceToken1 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken as the provided OutputRemoteElasticsearchSecretsServiceToken1 -func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) FromOutputRemoteElasticsearchSecretsServiceToken1(v OutputRemoteElasticsearchSecretsServiceToken1) error { +// FromSlackApiConfig overwrites any union data inside the UpdateConnectorConfig as the provided SlackApiConfig +func (t *UpdateConnectorConfig) FromSlackApiConfig(v SlackApiConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeOutputRemoteElasticsearchSecretsServiceToken1 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken, using the provided OutputRemoteElasticsearchSecretsServiceToken1 -func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) MergeOutputRemoteElasticsearchSecretsServiceToken1(v OutputRemoteElasticsearchSecretsServiceToken1) error { +// MergeSlackApiConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided SlackApiConfig +func (t *UpdateConnectorConfig) MergeSlackApiConfig(v SlackApiConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -13058,32 +16473,22 @@ func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) MergeOutputRemoteElasti return err } -func (t OutputRemoteElasticsearch_Secrets_ServiceToken) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsOutputRemoteElasticsearchSecretsSslKey0 returns the union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as a OutputRemoteElasticsearchSecretsSslKey0 -func (t OutputRemoteElasticsearch_Secrets_Ssl_Key) AsOutputRemoteElasticsearchSecretsSslKey0() (OutputRemoteElasticsearchSecretsSslKey0, error) { - var body OutputRemoteElasticsearchSecretsSslKey0 +// AsSwimlaneConfig returns the union data inside the UpdateConnectorConfig as a SwimlaneConfig +func (t UpdateConnectorConfig) AsSwimlaneConfig() (SwimlaneConfig, error) { + var body SwimlaneConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromOutputRemoteElasticsearchSecretsSslKey0 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as the provided OutputRemoteElasticsearchSecretsSslKey0 -func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) FromOutputRemoteElasticsearchSecretsSslKey0(v OutputRemoteElasticsearchSecretsSslKey0) error { +// FromSwimlaneConfig overwrites any union data inside the UpdateConnectorConfig as the provided SwimlaneConfig +func (t *UpdateConnectorConfig) FromSwimlaneConfig(v SwimlaneConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeOutputRemoteElasticsearchSecretsSslKey0 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided OutputRemoteElasticsearchSecretsSslKey0 -func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) MergeOutputRemoteElasticsearchSecretsSslKey0(v OutputRemoteElasticsearchSecretsSslKey0) error { +// MergeSwimlaneConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided SwimlaneConfig +func (t *UpdateConnectorConfig) MergeSwimlaneConfig(v SwimlaneConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -13094,22 +16499,22 @@ func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) MergeOutputRemoteElasticsear return err } -// AsOutputRemoteElasticsearchSecretsSslKey1 returns the union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as a OutputRemoteElasticsearchSecretsSslKey1 -func (t OutputRemoteElasticsearch_Secrets_Ssl_Key) AsOutputRemoteElasticsearchSecretsSslKey1() (OutputRemoteElasticsearchSecretsSslKey1, error) { - var body OutputRemoteElasticsearchSecretsSslKey1 +// AsThehiveConfig returns the union data inside the UpdateConnectorConfig as a ThehiveConfig +func (t UpdateConnectorConfig) AsThehiveConfig() (ThehiveConfig, error) { + var body ThehiveConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromOutputRemoteElasticsearchSecretsSslKey1 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as the provided OutputRemoteElasticsearchSecretsSslKey1 -func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) FromOutputRemoteElasticsearchSecretsSslKey1(v OutputRemoteElasticsearchSecretsSslKey1) error { +// FromThehiveConfig overwrites any union data inside the UpdateConnectorConfig as the provided ThehiveConfig +func (t *UpdateConnectorConfig) FromThehiveConfig(v ThehiveConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeOutputRemoteElasticsearchSecretsSslKey1 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided OutputRemoteElasticsearchSecretsSslKey1 -func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) MergeOutputRemoteElasticsearchSecretsSslKey1(v OutputRemoteElasticsearchSecretsSslKey1) error { +// MergeThehiveConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided ThehiveConfig +func (t *UpdateConnectorConfig) MergeThehiveConfig(v ThehiveConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -13120,34 +16525,22 @@ func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) MergeOutputRemoteElasticsear return err } -func (t OutputRemoteElasticsearch_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsOutputElasticsearch returns the union data inside the OutputUnion as a OutputElasticsearch -func (t OutputUnion) AsOutputElasticsearch() (OutputElasticsearch, error) { - var body OutputElasticsearch +// AsTinesConfig returns the union data inside the UpdateConnectorConfig as a TinesConfig +func (t UpdateConnectorConfig) AsTinesConfig() (TinesConfig, error) { + var body TinesConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromOutputElasticsearch overwrites any union data inside the OutputUnion as the provided OutputElasticsearch -func (t *OutputUnion) FromOutputElasticsearch(v OutputElasticsearch) error { - v.Type = "elasticsearch" +// FromTinesConfig overwrites any union data inside the UpdateConnectorConfig as the provided TinesConfig +func (t *UpdateConnectorConfig) FromTinesConfig(v TinesConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeOutputElasticsearch performs a merge with any union data inside the OutputUnion, using the provided OutputElasticsearch -func (t *OutputUnion) MergeOutputElasticsearch(v OutputElasticsearch) error { - v.Type = "elasticsearch" +// MergeTinesConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided TinesConfig +func (t *UpdateConnectorConfig) MergeTinesConfig(v TinesConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -13158,24 +16551,22 @@ func (t *OutputUnion) MergeOutputElasticsearch(v OutputElasticsearch) error { return err } -// AsOutputRemoteElasticsearch returns the union data inside the OutputUnion as a OutputRemoteElasticsearch -func (t OutputUnion) AsOutputRemoteElasticsearch() (OutputRemoteElasticsearch, error) { - var body OutputRemoteElasticsearch +// AsTorqConfig returns the union data inside the UpdateConnectorConfig as a TorqConfig +func (t UpdateConnectorConfig) AsTorqConfig() (TorqConfig, error) { + var body TorqConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromOutputRemoteElasticsearch overwrites any union data inside the OutputUnion as the provided OutputRemoteElasticsearch -func (t *OutputUnion) FromOutputRemoteElasticsearch(v OutputRemoteElasticsearch) error { - v.Type = "remote_elasticsearch" +// FromTorqConfig overwrites any union data inside the UpdateConnectorConfig as the provided TorqConfig +func (t *UpdateConnectorConfig) FromTorqConfig(v TorqConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeOutputRemoteElasticsearch performs a merge with any union data inside the OutputUnion, using the provided OutputRemoteElasticsearch -func (t *OutputUnion) MergeOutputRemoteElasticsearch(v OutputRemoteElasticsearch) error { - v.Type = "remote_elasticsearch" +// MergeTorqConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided TorqConfig +func (t *UpdateConnectorConfig) MergeTorqConfig(v TorqConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -13186,24 +16577,22 @@ func (t *OutputUnion) MergeOutputRemoteElasticsearch(v OutputRemoteElasticsearch return err } -// AsOutputLogstash returns the union data inside the OutputUnion as a OutputLogstash -func (t OutputUnion) AsOutputLogstash() (OutputLogstash, error) { - var body OutputLogstash +// AsWebhookConfig returns the union data inside the UpdateConnectorConfig as a WebhookConfig +func (t UpdateConnectorConfig) AsWebhookConfig() (WebhookConfig, error) { + var body WebhookConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromOutputLogstash overwrites any union data inside the OutputUnion as the provided OutputLogstash -func (t *OutputUnion) FromOutputLogstash(v OutputLogstash) error { - v.Type = "logstash" +// FromWebhookConfig overwrites any union data inside the UpdateConnectorConfig as the provided WebhookConfig +func (t *UpdateConnectorConfig) FromWebhookConfig(v WebhookConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeOutputLogstash performs a merge with any union data inside the OutputUnion, using the provided OutputLogstash -func (t *OutputUnion) MergeOutputLogstash(v OutputLogstash) error { - v.Type = "logstash" +// MergeWebhookConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided WebhookConfig +func (t *UpdateConnectorConfig) MergeWebhookConfig(v WebhookConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -13214,24 +16603,22 @@ func (t *OutputUnion) MergeOutputLogstash(v OutputLogstash) error { return err } -// AsOutputKafka returns the union data inside the OutputUnion as a OutputKafka -func (t OutputUnion) AsOutputKafka() (OutputKafka, error) { - var body OutputKafka +// AsCasesWebhookConfig returns the union data inside the UpdateConnectorConfig as a CasesWebhookConfig +func (t UpdateConnectorConfig) AsCasesWebhookConfig() (CasesWebhookConfig, error) { + var body CasesWebhookConfig err := json.Unmarshal(t.union, &body) return body, err } -// FromOutputKafka overwrites any union data inside the OutputUnion as the provided OutputKafka -func (t *OutputUnion) FromOutputKafka(v OutputKafka) error { - v.Type = "kafka" +// FromCasesWebhookConfig overwrites any union data inside the UpdateConnectorConfig as the provided CasesWebhookConfig +func (t *UpdateConnectorConfig) FromCasesWebhookConfig(v CasesWebhookConfig) error { b, err := json.Marshal(v) t.union = b return err } -// MergeOutputKafka performs a merge with any union data inside the OutputUnion, using the provided OutputKafka -func (t *OutputUnion) MergeOutputKafka(v OutputKafka) error { - v.Type = "kafka" +// MergeCasesWebhookConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided CasesWebhookConfig +func (t *UpdateConnectorConfig) MergeCasesWebhookConfig(v CasesWebhookConfig) error { b, err := json.Marshal(v) if err != nil { return err @@ -13242,59 +16629,48 @@ func (t *OutputUnion) MergeOutputKafka(v OutputKafka) error { return err } -func (t OutputUnion) Discriminator() (string, error) { - var discriminator struct { - Discriminator string `json:"type"` - } - err := json.Unmarshal(t.union, &discriminator) - return discriminator.Discriminator, err +// AsXmattersConfig returns the union data inside the UpdateConnectorConfig as a XmattersConfig +func (t UpdateConnectorConfig) AsXmattersConfig() (XmattersConfig, error) { + var body XmattersConfig + err := json.Unmarshal(t.union, &body) + return body, err } -func (t OutputUnion) ValueByDiscriminator() (interface{}, error) { - discriminator, err := t.Discriminator() - if err != nil { - return nil, err - } - switch discriminator { - case "elasticsearch": - return t.AsOutputElasticsearch() - case "kafka": - return t.AsOutputKafka() - case "logstash": - return t.AsOutputLogstash() - case "remote_elasticsearch": - return t.AsOutputRemoteElasticsearch() - default: - return nil, errors.New("unknown discriminator value: " + discriminator) - } +// FromXmattersConfig overwrites any union data inside the UpdateConnectorConfig as the provided XmattersConfig +func (t *UpdateConnectorConfig) FromXmattersConfig(v XmattersConfig) error { + b, err := json.Marshal(v) + t.union = b + return err } -func (t OutputUnion) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} +// MergeXmattersConfig performs a merge with any union data inside the UpdateConnectorConfig, using the provided XmattersConfig +func (t *UpdateConnectorConfig) MergeXmattersConfig(v XmattersConfig) error { + b, err := json.Marshal(v) + if err != nil { + return err + } -func (t *OutputUnion) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged return err } -// AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 returns the union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 -func (t PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0() (PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0, error) { - var body PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 +// AsBedrockSecrets returns the union data inside the UpdateConnectorSecrets as a BedrockSecrets +func (t UpdateConnectorSecrets) AsBedrockSecrets() (BedrockSecrets, error) { + var body BedrockSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 overwrites any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 -func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0) error { +// FromBedrockSecrets overwrites any union data inside the UpdateConnectorSecrets as the provided BedrockSecrets +func (t *UpdateConnectorSecrets) FromBedrockSecrets(v BedrockSecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 performs a merge with any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 -func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0) error { +// MergeBedrockSecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided BedrockSecrets +func (t *UpdateConnectorSecrets) MergeBedrockSecrets(v BedrockSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -13305,22 +16681,22 @@ func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) Merg return err } -// AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 returns the union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 -func (t PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1() (PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1, error) { - var body PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 +// AsCrowdstrikeSecrets returns the union data inside the UpdateConnectorSecrets as a CrowdstrikeSecrets +func (t UpdateConnectorSecrets) AsCrowdstrikeSecrets() (CrowdstrikeSecrets, error) { + var body CrowdstrikeSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 overwrites any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 -func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1) error { +// FromCrowdstrikeSecrets overwrites any union data inside the UpdateConnectorSecrets as the provided CrowdstrikeSecrets +func (t *UpdateConnectorSecrets) FromCrowdstrikeSecrets(v CrowdstrikeSecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 performs a merge with any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 -func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1) error { +// MergeCrowdstrikeSecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided CrowdstrikeSecrets +func (t *UpdateConnectorSecrets) MergeCrowdstrikeSecrets(v CrowdstrikeSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -13331,32 +16707,22 @@ func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) Merg return err } -func (t PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsPackageInfoInstallationInfoInstalledKibanaType0 returns the union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as a PackageInfoInstallationInfoInstalledKibanaType0 -func (t PackageInfo_InstallationInfo_InstalledKibana_Type) AsPackageInfoInstallationInfoInstalledKibanaType0() (PackageInfoInstallationInfoInstalledKibanaType0, error) { - var body PackageInfoInstallationInfoInstalledKibanaType0 +// AsD3securitySecrets returns the union data inside the UpdateConnectorSecrets as a D3securitySecrets +func (t UpdateConnectorSecrets) AsD3securitySecrets() (D3securitySecrets, error) { + var body D3securitySecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromPackageInfoInstallationInfoInstalledKibanaType0 overwrites any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as the provided PackageInfoInstallationInfoInstalledKibanaType0 -func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) FromPackageInfoInstallationInfoInstalledKibanaType0(v PackageInfoInstallationInfoInstalledKibanaType0) error { +// FromD3securitySecrets overwrites any union data inside the UpdateConnectorSecrets as the provided D3securitySecrets +func (t *UpdateConnectorSecrets) FromD3securitySecrets(v D3securitySecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergePackageInfoInstallationInfoInstalledKibanaType0 performs a merge with any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type, using the provided PackageInfoInstallationInfoInstalledKibanaType0 -func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) MergePackageInfoInstallationInfoInstalledKibanaType0(v PackageInfoInstallationInfoInstalledKibanaType0) error { +// MergeD3securitySecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided D3securitySecrets +func (t *UpdateConnectorSecrets) MergeD3securitySecrets(v D3securitySecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -13367,22 +16733,22 @@ func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) MergePackageInfoInst return err } -// AsPackageInfoInstallationInfoInstalledKibanaType1 returns the union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as a PackageInfoInstallationInfoInstalledKibanaType1 -func (t PackageInfo_InstallationInfo_InstalledKibana_Type) AsPackageInfoInstallationInfoInstalledKibanaType1() (PackageInfoInstallationInfoInstalledKibanaType1, error) { - var body PackageInfoInstallationInfoInstalledKibanaType1 +// AsEmailSecrets returns the union data inside the UpdateConnectorSecrets as a EmailSecrets +func (t UpdateConnectorSecrets) AsEmailSecrets() (EmailSecrets, error) { + var body EmailSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromPackageInfoInstallationInfoInstalledKibanaType1 overwrites any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as the provided PackageInfoInstallationInfoInstalledKibanaType1 -func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) FromPackageInfoInstallationInfoInstalledKibanaType1(v PackageInfoInstallationInfoInstalledKibanaType1) error { +// FromEmailSecrets overwrites any union data inside the UpdateConnectorSecrets as the provided EmailSecrets +func (t *UpdateConnectorSecrets) FromEmailSecrets(v EmailSecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergePackageInfoInstallationInfoInstalledKibanaType1 performs a merge with any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type, using the provided PackageInfoInstallationInfoInstalledKibanaType1 -func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) MergePackageInfoInstallationInfoInstalledKibanaType1(v PackageInfoInstallationInfoInstalledKibanaType1) error { +// MergeEmailSecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided EmailSecrets +func (t *UpdateConnectorSecrets) MergeEmailSecrets(v EmailSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -13393,32 +16759,22 @@ func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) MergePackageInfoInst return err } -func (t PackageInfo_InstallationInfo_InstalledKibana_Type) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsPackageInfoType0 returns the union data inside the PackageInfo_Type as a PackageInfoType0 -func (t PackageInfo_Type) AsPackageInfoType0() (PackageInfoType0, error) { - var body PackageInfoType0 +// AsGeminiSecrets returns the union data inside the UpdateConnectorSecrets as a GeminiSecrets +func (t UpdateConnectorSecrets) AsGeminiSecrets() (GeminiSecrets, error) { + var body GeminiSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromPackageInfoType0 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType0 -func (t *PackageInfo_Type) FromPackageInfoType0(v PackageInfoType0) error { +// FromGeminiSecrets overwrites any union data inside the UpdateConnectorSecrets as the provided GeminiSecrets +func (t *UpdateConnectorSecrets) FromGeminiSecrets(v GeminiSecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergePackageInfoType0 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType0 -func (t *PackageInfo_Type) MergePackageInfoType0(v PackageInfoType0) error { +// MergeGeminiSecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided GeminiSecrets +func (t *UpdateConnectorSecrets) MergeGeminiSecrets(v GeminiSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -13429,22 +16785,22 @@ func (t *PackageInfo_Type) MergePackageInfoType0(v PackageInfoType0) error { return err } -// AsPackageInfoType1 returns the union data inside the PackageInfo_Type as a PackageInfoType1 -func (t PackageInfo_Type) AsPackageInfoType1() (PackageInfoType1, error) { - var body PackageInfoType1 +// AsResilientSecrets returns the union data inside the UpdateConnectorSecrets as a ResilientSecrets +func (t UpdateConnectorSecrets) AsResilientSecrets() (ResilientSecrets, error) { + var body ResilientSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromPackageInfoType1 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType1 -func (t *PackageInfo_Type) FromPackageInfoType1(v PackageInfoType1) error { +// FromResilientSecrets overwrites any union data inside the UpdateConnectorSecrets as the provided ResilientSecrets +func (t *UpdateConnectorSecrets) FromResilientSecrets(v ResilientSecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergePackageInfoType1 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType1 -func (t *PackageInfo_Type) MergePackageInfoType1(v PackageInfoType1) error { +// MergeResilientSecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided ResilientSecrets +func (t *UpdateConnectorSecrets) MergeResilientSecrets(v ResilientSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -13455,22 +16811,22 @@ func (t *PackageInfo_Type) MergePackageInfoType1(v PackageInfoType1) error { return err } -// AsPackageInfoType2 returns the union data inside the PackageInfo_Type as a PackageInfoType2 -func (t PackageInfo_Type) AsPackageInfoType2() (PackageInfoType2, error) { - var body PackageInfoType2 +// AsJiraSecrets returns the union data inside the UpdateConnectorSecrets as a JiraSecrets +func (t UpdateConnectorSecrets) AsJiraSecrets() (JiraSecrets, error) { + var body JiraSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromPackageInfoType2 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType2 -func (t *PackageInfo_Type) FromPackageInfoType2(v PackageInfoType2) error { +// FromJiraSecrets overwrites any union data inside the UpdateConnectorSecrets as the provided JiraSecrets +func (t *UpdateConnectorSecrets) FromJiraSecrets(v JiraSecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergePackageInfoType2 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType2 -func (t *PackageInfo_Type) MergePackageInfoType2(v PackageInfoType2) error { +// MergeJiraSecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided JiraSecrets +func (t *UpdateConnectorSecrets) MergeJiraSecrets(v JiraSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -13481,22 +16837,22 @@ func (t *PackageInfo_Type) MergePackageInfoType2(v PackageInfoType2) error { return err } -// AsPackageInfoType3 returns the union data inside the PackageInfo_Type as a PackageInfoType3 -func (t PackageInfo_Type) AsPackageInfoType3() (PackageInfoType3, error) { - var body PackageInfoType3 +// AsTeamsSecrets returns the union data inside the UpdateConnectorSecrets as a TeamsSecrets +func (t UpdateConnectorSecrets) AsTeamsSecrets() (TeamsSecrets, error) { + var body TeamsSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromPackageInfoType3 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType3 -func (t *PackageInfo_Type) FromPackageInfoType3(v PackageInfoType3) error { +// FromTeamsSecrets overwrites any union data inside the UpdateConnectorSecrets as the provided TeamsSecrets +func (t *UpdateConnectorSecrets) FromTeamsSecrets(v TeamsSecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergePackageInfoType3 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType3 -func (t *PackageInfo_Type) MergePackageInfoType3(v PackageInfoType3) error { +// MergeTeamsSecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided TeamsSecrets +func (t *UpdateConnectorSecrets) MergeTeamsSecrets(v TeamsSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -13507,32 +16863,22 @@ func (t *PackageInfo_Type) MergePackageInfoType3(v PackageInfoType3) error { return err } -func (t PackageInfo_Type) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *PackageInfo_Type) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 returns the union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 -func (t PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0() (PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0, error) { - var body PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 +// AsGenaiSecrets returns the union data inside the UpdateConnectorSecrets as a GenaiSecrets +func (t UpdateConnectorSecrets) AsGenaiSecrets() (GenaiSecrets, error) { + var body GenaiSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 overwrites any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 -func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0) error { +// FromGenaiSecrets overwrites any union data inside the UpdateConnectorSecrets as the provided GenaiSecrets +func (t *UpdateConnectorSecrets) FromGenaiSecrets(v GenaiSecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 performs a merge with any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 -func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0) error { +// MergeGenaiSecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided GenaiSecrets +func (t *UpdateConnectorSecrets) MergeGenaiSecrets(v GenaiSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -13543,22 +16889,22 @@ func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) return err } -// AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 returns the union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 -func (t PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1() (PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1, error) { - var body PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 +// AsOpsgenieSecrets returns the union data inside the UpdateConnectorSecrets as a OpsgenieSecrets +func (t UpdateConnectorSecrets) AsOpsgenieSecrets() (OpsgenieSecrets, error) { + var body OpsgenieSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 overwrites any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 -func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1) error { +// FromOpsgenieSecrets overwrites any union data inside the UpdateConnectorSecrets as the provided OpsgenieSecrets +func (t *UpdateConnectorSecrets) FromOpsgenieSecrets(v OpsgenieSecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 performs a merge with any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 -func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1) error { +// MergeOpsgenieSecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided OpsgenieSecrets +func (t *UpdateConnectorSecrets) MergeOpsgenieSecrets(v OpsgenieSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -13569,32 +16915,48 @@ func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) return err } -func (t PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err +// AsPagerdutySecrets returns the union data inside the UpdateConnectorSecrets as a PagerdutySecrets +func (t UpdateConnectorSecrets) AsPagerdutySecrets() (PagerdutySecrets, error) { + var body PagerdutySecrets + err := json.Unmarshal(t.union, &body) + return body, err } -func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) +// FromPagerdutySecrets overwrites any union data inside the UpdateConnectorSecrets as the provided PagerdutySecrets +func (t *UpdateConnectorSecrets) FromPagerdutySecrets(v PagerdutySecrets) error { + b, err := json.Marshal(v) + t.union = b return err } -// AsPackageListItemInstallationInfoInstalledKibanaType0 returns the union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as a PackageListItemInstallationInfoInstalledKibanaType0 -func (t PackageListItem_InstallationInfo_InstalledKibana_Type) AsPackageListItemInstallationInfoInstalledKibanaType0() (PackageListItemInstallationInfoInstalledKibanaType0, error) { - var body PackageListItemInstallationInfoInstalledKibanaType0 +// MergePagerdutySecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided PagerdutySecrets +func (t *UpdateConnectorSecrets) MergePagerdutySecrets(v PagerdutySecrets) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsSentineloneSecrets returns the union data inside the UpdateConnectorSecrets as a SentineloneSecrets +func (t UpdateConnectorSecrets) AsSentineloneSecrets() (SentineloneSecrets, error) { + var body SentineloneSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromPackageListItemInstallationInfoInstalledKibanaType0 overwrites any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as the provided PackageListItemInstallationInfoInstalledKibanaType0 -func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) FromPackageListItemInstallationInfoInstalledKibanaType0(v PackageListItemInstallationInfoInstalledKibanaType0) error { +// FromSentineloneSecrets overwrites any union data inside the UpdateConnectorSecrets as the provided SentineloneSecrets +func (t *UpdateConnectorSecrets) FromSentineloneSecrets(v SentineloneSecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergePackageListItemInstallationInfoInstalledKibanaType0 performs a merge with any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type, using the provided PackageListItemInstallationInfoInstalledKibanaType0 -func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) MergePackageListItemInstallationInfoInstalledKibanaType0(v PackageListItemInstallationInfoInstalledKibanaType0) error { +// MergeSentineloneSecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided SentineloneSecrets +func (t *UpdateConnectorSecrets) MergeSentineloneSecrets(v SentineloneSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -13605,22 +16967,22 @@ func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) MergePackageList return err } -// AsPackageListItemInstallationInfoInstalledKibanaType1 returns the union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as a PackageListItemInstallationInfoInstalledKibanaType1 -func (t PackageListItem_InstallationInfo_InstalledKibana_Type) AsPackageListItemInstallationInfoInstalledKibanaType1() (PackageListItemInstallationInfoInstalledKibanaType1, error) { - var body PackageListItemInstallationInfoInstalledKibanaType1 +// AsServicenowSecrets returns the union data inside the UpdateConnectorSecrets as a ServicenowSecrets +func (t UpdateConnectorSecrets) AsServicenowSecrets() (ServicenowSecrets, error) { + var body ServicenowSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromPackageListItemInstallationInfoInstalledKibanaType1 overwrites any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as the provided PackageListItemInstallationInfoInstalledKibanaType1 -func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) FromPackageListItemInstallationInfoInstalledKibanaType1(v PackageListItemInstallationInfoInstalledKibanaType1) error { +// FromServicenowSecrets overwrites any union data inside the UpdateConnectorSecrets as the provided ServicenowSecrets +func (t *UpdateConnectorSecrets) FromServicenowSecrets(v ServicenowSecrets) error { b, err := json.Marshal(v) t.union = b return err } - -// MergePackageListItemInstallationInfoInstalledKibanaType1 performs a merge with any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type, using the provided PackageListItemInstallationInfoInstalledKibanaType1 -func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) MergePackageListItemInstallationInfoInstalledKibanaType1(v PackageListItemInstallationInfoInstalledKibanaType1) error { + +// MergeServicenowSecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided ServicenowSecrets +func (t *UpdateConnectorSecrets) MergeServicenowSecrets(v ServicenowSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -13631,32 +16993,22 @@ func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) MergePackageList return err } -func (t PackageListItem_InstallationInfo_InstalledKibana_Type) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsPackageListItemType0 returns the union data inside the PackageListItem_Type as a PackageListItemType0 -func (t PackageListItem_Type) AsPackageListItemType0() (PackageListItemType0, error) { - var body PackageListItemType0 +// AsSlackApiSecrets returns the union data inside the UpdateConnectorSecrets as a SlackApiSecrets +func (t UpdateConnectorSecrets) AsSlackApiSecrets() (SlackApiSecrets, error) { + var body SlackApiSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromPackageListItemType0 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType0 -func (t *PackageListItem_Type) FromPackageListItemType0(v PackageListItemType0) error { +// FromSlackApiSecrets overwrites any union data inside the UpdateConnectorSecrets as the provided SlackApiSecrets +func (t *UpdateConnectorSecrets) FromSlackApiSecrets(v SlackApiSecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergePackageListItemType0 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType0 -func (t *PackageListItem_Type) MergePackageListItemType0(v PackageListItemType0) error { +// MergeSlackApiSecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided SlackApiSecrets +func (t *UpdateConnectorSecrets) MergeSlackApiSecrets(v SlackApiSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -13667,22 +17019,22 @@ func (t *PackageListItem_Type) MergePackageListItemType0(v PackageListItemType0) return err } -// AsPackageListItemType1 returns the union data inside the PackageListItem_Type as a PackageListItemType1 -func (t PackageListItem_Type) AsPackageListItemType1() (PackageListItemType1, error) { - var body PackageListItemType1 +// AsSwimlaneSecrets returns the union data inside the UpdateConnectorSecrets as a SwimlaneSecrets +func (t UpdateConnectorSecrets) AsSwimlaneSecrets() (SwimlaneSecrets, error) { + var body SwimlaneSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromPackageListItemType1 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType1 -func (t *PackageListItem_Type) FromPackageListItemType1(v PackageListItemType1) error { +// FromSwimlaneSecrets overwrites any union data inside the UpdateConnectorSecrets as the provided SwimlaneSecrets +func (t *UpdateConnectorSecrets) FromSwimlaneSecrets(v SwimlaneSecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergePackageListItemType1 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType1 -func (t *PackageListItem_Type) MergePackageListItemType1(v PackageListItemType1) error { +// MergeSwimlaneSecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided SwimlaneSecrets +func (t *UpdateConnectorSecrets) MergeSwimlaneSecrets(v SwimlaneSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -13693,22 +17045,22 @@ func (t *PackageListItem_Type) MergePackageListItemType1(v PackageListItemType1) return err } -// AsPackageListItemType2 returns the union data inside the PackageListItem_Type as a PackageListItemType2 -func (t PackageListItem_Type) AsPackageListItemType2() (PackageListItemType2, error) { - var body PackageListItemType2 +// AsThehiveSecrets returns the union data inside the UpdateConnectorSecrets as a ThehiveSecrets +func (t UpdateConnectorSecrets) AsThehiveSecrets() (ThehiveSecrets, error) { + var body ThehiveSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromPackageListItemType2 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType2 -func (t *PackageListItem_Type) FromPackageListItemType2(v PackageListItemType2) error { +// FromThehiveSecrets overwrites any union data inside the UpdateConnectorSecrets as the provided ThehiveSecrets +func (t *UpdateConnectorSecrets) FromThehiveSecrets(v ThehiveSecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergePackageListItemType2 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType2 -func (t *PackageListItem_Type) MergePackageListItemType2(v PackageListItemType2) error { +// MergeThehiveSecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided ThehiveSecrets +func (t *UpdateConnectorSecrets) MergeThehiveSecrets(v ThehiveSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -13719,22 +17071,22 @@ func (t *PackageListItem_Type) MergePackageListItemType2(v PackageListItemType2) return err } -// AsPackageListItemType3 returns the union data inside the PackageListItem_Type as a PackageListItemType3 -func (t PackageListItem_Type) AsPackageListItemType3() (PackageListItemType3, error) { - var body PackageListItemType3 +// AsTinesSecrets returns the union data inside the UpdateConnectorSecrets as a TinesSecrets +func (t UpdateConnectorSecrets) AsTinesSecrets() (TinesSecrets, error) { + var body TinesSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromPackageListItemType3 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType3 -func (t *PackageListItem_Type) FromPackageListItemType3(v PackageListItemType3) error { +// FromTinesSecrets overwrites any union data inside the UpdateConnectorSecrets as the provided TinesSecrets +func (t *UpdateConnectorSecrets) FromTinesSecrets(v TinesSecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergePackageListItemType3 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType3 -func (t *PackageListItem_Type) MergePackageListItemType3(v PackageListItemType3) error { +// MergeTinesSecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided TinesSecrets +func (t *UpdateConnectorSecrets) MergeTinesSecrets(v TinesSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -13745,32 +17097,22 @@ func (t *PackageListItem_Type) MergePackageListItemType3(v PackageListItemType3) return err } -func (t PackageListItem_Type) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *PackageListItem_Type) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsServerHostSecretsSslEsKey0 returns the union data inside the ServerHost_Secrets_Ssl_EsKey as a ServerHostSecretsSslEsKey0 -func (t ServerHost_Secrets_Ssl_EsKey) AsServerHostSecretsSslEsKey0() (ServerHostSecretsSslEsKey0, error) { - var body ServerHostSecretsSslEsKey0 +// AsTorqSecrets returns the union data inside the UpdateConnectorSecrets as a TorqSecrets +func (t UpdateConnectorSecrets) AsTorqSecrets() (TorqSecrets, error) { + var body TorqSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromServerHostSecretsSslEsKey0 overwrites any union data inside the ServerHost_Secrets_Ssl_EsKey as the provided ServerHostSecretsSslEsKey0 -func (t *ServerHost_Secrets_Ssl_EsKey) FromServerHostSecretsSslEsKey0(v ServerHostSecretsSslEsKey0) error { +// FromTorqSecrets overwrites any union data inside the UpdateConnectorSecrets as the provided TorqSecrets +func (t *UpdateConnectorSecrets) FromTorqSecrets(v TorqSecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergeServerHostSecretsSslEsKey0 performs a merge with any union data inside the ServerHost_Secrets_Ssl_EsKey, using the provided ServerHostSecretsSslEsKey0 -func (t *ServerHost_Secrets_Ssl_EsKey) MergeServerHostSecretsSslEsKey0(v ServerHostSecretsSslEsKey0) error { +// MergeTorqSecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided TorqSecrets +func (t *UpdateConnectorSecrets) MergeTorqSecrets(v TorqSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -13781,22 +17123,22 @@ func (t *ServerHost_Secrets_Ssl_EsKey) MergeServerHostSecretsSslEsKey0(v ServerH return err } -// AsServerHostSecretsSslEsKey1 returns the union data inside the ServerHost_Secrets_Ssl_EsKey as a ServerHostSecretsSslEsKey1 -func (t ServerHost_Secrets_Ssl_EsKey) AsServerHostSecretsSslEsKey1() (ServerHostSecretsSslEsKey1, error) { - var body ServerHostSecretsSslEsKey1 +// AsWebhookSecrets returns the union data inside the UpdateConnectorSecrets as a WebhookSecrets +func (t UpdateConnectorSecrets) AsWebhookSecrets() (WebhookSecrets, error) { + var body WebhookSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromServerHostSecretsSslEsKey1 overwrites any union data inside the ServerHost_Secrets_Ssl_EsKey as the provided ServerHostSecretsSslEsKey1 -func (t *ServerHost_Secrets_Ssl_EsKey) FromServerHostSecretsSslEsKey1(v ServerHostSecretsSslEsKey1) error { +// FromWebhookSecrets overwrites any union data inside the UpdateConnectorSecrets as the provided WebhookSecrets +func (t *UpdateConnectorSecrets) FromWebhookSecrets(v WebhookSecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergeServerHostSecretsSslEsKey1 performs a merge with any union data inside the ServerHost_Secrets_Ssl_EsKey, using the provided ServerHostSecretsSslEsKey1 -func (t *ServerHost_Secrets_Ssl_EsKey) MergeServerHostSecretsSslEsKey1(v ServerHostSecretsSslEsKey1) error { +// MergeWebhookSecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided WebhookSecrets +func (t *UpdateConnectorSecrets) MergeWebhookSecrets(v WebhookSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -13807,32 +17149,22 @@ func (t *ServerHost_Secrets_Ssl_EsKey) MergeServerHostSecretsSslEsKey1(v ServerH return err } -func (t ServerHost_Secrets_Ssl_EsKey) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *ServerHost_Secrets_Ssl_EsKey) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsServerHostSecretsSslKey0 returns the union data inside the ServerHost_Secrets_Ssl_Key as a ServerHostSecretsSslKey0 -func (t ServerHost_Secrets_Ssl_Key) AsServerHostSecretsSslKey0() (ServerHostSecretsSslKey0, error) { - var body ServerHostSecretsSslKey0 +// AsCasesWebhookSecrets returns the union data inside the UpdateConnectorSecrets as a CasesWebhookSecrets +func (t UpdateConnectorSecrets) AsCasesWebhookSecrets() (CasesWebhookSecrets, error) { + var body CasesWebhookSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromServerHostSecretsSslKey0 overwrites any union data inside the ServerHost_Secrets_Ssl_Key as the provided ServerHostSecretsSslKey0 -func (t *ServerHost_Secrets_Ssl_Key) FromServerHostSecretsSslKey0(v ServerHostSecretsSslKey0) error { +// FromCasesWebhookSecrets overwrites any union data inside the UpdateConnectorSecrets as the provided CasesWebhookSecrets +func (t *UpdateConnectorSecrets) FromCasesWebhookSecrets(v CasesWebhookSecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergeServerHostSecretsSslKey0 performs a merge with any union data inside the ServerHost_Secrets_Ssl_Key, using the provided ServerHostSecretsSslKey0 -func (t *ServerHost_Secrets_Ssl_Key) MergeServerHostSecretsSslKey0(v ServerHostSecretsSslKey0) error { +// MergeCasesWebhookSecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided CasesWebhookSecrets +func (t *UpdateConnectorSecrets) MergeCasesWebhookSecrets(v CasesWebhookSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -13843,22 +17175,22 @@ func (t *ServerHost_Secrets_Ssl_Key) MergeServerHostSecretsSslKey0(v ServerHostS return err } -// AsServerHostSecretsSslKey1 returns the union data inside the ServerHost_Secrets_Ssl_Key as a ServerHostSecretsSslKey1 -func (t ServerHost_Secrets_Ssl_Key) AsServerHostSecretsSslKey1() (ServerHostSecretsSslKey1, error) { - var body ServerHostSecretsSslKey1 +// AsXmattersSecrets returns the union data inside the UpdateConnectorSecrets as a XmattersSecrets +func (t UpdateConnectorSecrets) AsXmattersSecrets() (XmattersSecrets, error) { + var body XmattersSecrets err := json.Unmarshal(t.union, &body) return body, err } -// FromServerHostSecretsSslKey1 overwrites any union data inside the ServerHost_Secrets_Ssl_Key as the provided ServerHostSecretsSslKey1 -func (t *ServerHost_Secrets_Ssl_Key) FromServerHostSecretsSslKey1(v ServerHostSecretsSslKey1) error { +// FromXmattersSecrets overwrites any union data inside the UpdateConnectorSecrets as the provided XmattersSecrets +func (t *UpdateConnectorSecrets) FromXmattersSecrets(v XmattersSecrets) error { b, err := json.Marshal(v) t.union = b return err } -// MergeServerHostSecretsSslKey1 performs a merge with any union data inside the ServerHost_Secrets_Ssl_Key, using the provided ServerHostSecretsSslKey1 -func (t *ServerHost_Secrets_Ssl_Key) MergeServerHostSecretsSslKey1(v ServerHostSecretsSslKey1) error { +// MergeXmattersSecrets performs a merge with any union data inside the UpdateConnectorSecrets, using the provided XmattersSecrets +func (t *UpdateConnectorSecrets) MergeXmattersSecrets(v XmattersSecrets) error { b, err := json.Marshal(v) if err != nil { return err @@ -13869,16 +17201,6 @@ func (t *ServerHost_Secrets_Ssl_Key) MergeServerHostSecretsSslKey1(v ServerHostS return err } -func (t ServerHost_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *ServerHost_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - // AsUpdateOutputElasticsearchSecretsSslKey0 returns the union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key as a UpdateOutputElasticsearchSecretsSslKey0 func (t UpdateOutputElasticsearch_Secrets_Ssl_Key) AsUpdateOutputElasticsearchSecretsSslKey0() (UpdateOutputElasticsearchSecretsSslKey0, error) { var body UpdateOutputElasticsearchSecretsSslKey0 @@ -14360,9 +17682,209 @@ func (t UpdateOutputUnion) MarshalJSON() ([]byte, error) { return b, err } -func (t *UpdateOutputUnion) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err +func (t *UpdateOutputUnion) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// Override default JSON handling for CreateConnectorConfig to handle AdditionalProperties and union +func (a *CreateConnectorConfig) UnmarshalJSON(b []byte) error { + err := a.union.UnmarshalJSON(b) + if err != nil { + return err + } + object := make(map[string]json.RawMessage) + err = json.Unmarshal(b, &object) + if err != nil { + return err + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for CreateConnectorConfig to handle AdditionalProperties and union +func (a CreateConnectorConfig) MarshalJSON() ([]byte, error) { + var err error + b, err := a.union.MarshalJSON() + if err != nil { + return nil, err + } + object := make(map[string]json.RawMessage) + if a.union != nil { + err = json.Unmarshal(b, &object) + if err != nil { + return nil, err + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Override default JSON handling for CreateConnectorSecrets to handle AdditionalProperties and union +func (a *CreateConnectorSecrets) UnmarshalJSON(b []byte) error { + err := a.union.UnmarshalJSON(b) + if err != nil { + return err + } + object := make(map[string]json.RawMessage) + err = json.Unmarshal(b, &object) + if err != nil { + return err + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for CreateConnectorSecrets to handle AdditionalProperties and union +func (a CreateConnectorSecrets) MarshalJSON() ([]byte, error) { + var err error + b, err := a.union.MarshalJSON() + if err != nil { + return nil, err + } + object := make(map[string]json.RawMessage) + if a.union != nil { + err = json.Unmarshal(b, &object) + if err != nil { + return nil, err + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Override default JSON handling for UpdateConnectorConfig to handle AdditionalProperties and union +func (a *UpdateConnectorConfig) UnmarshalJSON(b []byte) error { + err := a.union.UnmarshalJSON(b) + if err != nil { + return err + } + object := make(map[string]json.RawMessage) + err = json.Unmarshal(b, &object) + if err != nil { + return err + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for UpdateConnectorConfig to handle AdditionalProperties and union +func (a UpdateConnectorConfig) MarshalJSON() ([]byte, error) { + var err error + b, err := a.union.MarshalJSON() + if err != nil { + return nil, err + } + object := make(map[string]json.RawMessage) + if a.union != nil { + err = json.Unmarshal(b, &object) + if err != nil { + return nil, err + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Override default JSON handling for UpdateConnectorSecrets to handle AdditionalProperties and union +func (a *UpdateConnectorSecrets) UnmarshalJSON(b []byte) error { + err := a.union.UnmarshalJSON(b) + if err != nil { + return err + } + object := make(map[string]json.RawMessage) + err = json.Unmarshal(b, &object) + if err != nil { + return err + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for UpdateConnectorSecrets to handle AdditionalProperties and union +func (a UpdateConnectorSecrets) MarshalJSON() ([]byte, error) { + var err error + b, err := a.union.MarshalJSON() + if err != nil { + return nil, err + } + object := make(map[string]json.RawMessage) + if a.union != nil { + err = json.Unmarshal(b, &object) + if err != nil { + return nil, err + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) } // RequestEditorFn is the function signature for the RequestEditor callback function @@ -14565,6 +18087,25 @@ type ClientInterface interface { PutParameter(ctx context.Context, id string, body PutParameterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // DeleteActionsConnectorId request + DeleteActionsConnectorId(ctx context.Context, spaceId SpaceId, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetActionsConnectorId request + GetActionsConnectorId(ctx context.Context, spaceId SpaceId, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostActionsConnectorIdWithBody request with any body + PostActionsConnectorIdWithBody(ctx context.Context, spaceId SpaceId, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostActionsConnectorId(ctx context.Context, spaceId SpaceId, id string, body PostActionsConnectorIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PutActionsConnectorIdWithBody request with any body + PutActionsConnectorIdWithBody(ctx context.Context, spaceId SpaceId, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PutActionsConnectorId(ctx context.Context, spaceId SpaceId, id string, body PutActionsConnectorIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetActionsConnectors request + GetActionsConnectors(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetAllDataViewsDefault request GetAllDataViewsDefault(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -15149,6 +18690,90 @@ func (c *Client) PutParameter(ctx context.Context, id string, body PutParameterJ return c.Client.Do(req) } +func (c *Client) DeleteActionsConnectorId(ctx context.Context, spaceId SpaceId, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteActionsConnectorIdRequest(c.Server, spaceId, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetActionsConnectorId(ctx context.Context, spaceId SpaceId, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetActionsConnectorIdRequest(c.Server, spaceId, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostActionsConnectorIdWithBody(ctx context.Context, spaceId SpaceId, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostActionsConnectorIdRequestWithBody(c.Server, spaceId, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostActionsConnectorId(ctx context.Context, spaceId SpaceId, id string, body PostActionsConnectorIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostActionsConnectorIdRequest(c.Server, spaceId, id, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PutActionsConnectorIdWithBody(ctx context.Context, spaceId SpaceId, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutActionsConnectorIdRequestWithBody(c.Server, spaceId, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PutActionsConnectorId(ctx context.Context, spaceId SpaceId, id string, body PutActionsConnectorIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutActionsConnectorIdRequest(c.Server, spaceId, id, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetActionsConnectors(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetActionsConnectorsRequest(c.Server, spaceId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) GetAllDataViewsDefault(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetAllDataViewsDefaultRequest(c.Server, spaceId) if err != nil { @@ -17111,32 +20736,190 @@ func NewPutFleetPackagePoliciesPackagepolicyidRequestWithBody(server string, pac return nil, err } - req.Header.Add("Content-Type", contentType) - - return req, nil -} + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewPostParametersRequest calls the generic PostParameters builder with application/json body +func NewPostParametersRequest(server string, body PostParametersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostParametersRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostParametersRequestWithBody generates requests for PostParameters with any type of body +func NewPostParametersRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/synthetics/params") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteParameterRequest generates requests for DeleteParameter +func NewDeleteParameterRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/synthetics/params/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetParameterRequest generates requests for GetParameter +func NewGetParameterRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/synthetics/params/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPutParameterRequest calls the generic PutParameter builder with application/json body +func NewPutParameterRequest(server string, id string, body PutParameterJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutParameterRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewPutParameterRequestWithBody generates requests for PutParameter with any type of body +func NewPutParameterRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/synthetics/params/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteActionsConnectorIdRequest generates requests for DeleteActionsConnectorId +func NewDeleteActionsConnectorIdRequest(server string, spaceId SpaceId, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) + if err != nil { + return nil, err + } + + var pathParam1 string -// NewPostParametersRequest calls the generic PostParameters builder with application/json body -func NewPostParametersRequest(server string, body PostParametersJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewPostParametersRequestWithBody(server, "application/json", bodyReader) -} - -// NewPostParametersRequestWithBody generates requests for PostParameters with any type of body -func NewPostParametersRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/api/synthetics/params") + operationPath := fmt.Sprintf("/s/%s/api/actions/connector/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -17146,23 +20929,28 @@ func NewPostParametersRequestWithBody(server string, contentType string, body io return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewDeleteParameterRequest generates requests for DeleteParameter -func NewDeleteParameterRequest(server string, id string) (*http.Request, error) { +// NewGetActionsConnectorIdRequest generates requests for GetActionsConnectorId +func NewGetActionsConnectorIdRequest(server string, spaceId SpaceId, id string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) if err != nil { return nil, err } @@ -17172,7 +20960,7 @@ func NewDeleteParameterRequest(server string, id string) (*http.Request, error) return nil, err } - operationPath := fmt.Sprintf("/api/synthetics/params/%s", pathParam0) + operationPath := fmt.Sprintf("/s/%s/api/actions/connector/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -17182,7 +20970,7 @@ func NewDeleteParameterRequest(server string, id string) (*http.Request, error) return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } @@ -17190,13 +20978,31 @@ func NewDeleteParameterRequest(server string, id string) (*http.Request, error) return req, nil } -// NewGetParameterRequest generates requests for GetParameter -func NewGetParameterRequest(server string, id string) (*http.Request, error) { +// NewPostActionsConnectorIdRequest calls the generic PostActionsConnectorId builder with application/json body +func NewPostActionsConnectorIdRequest(server string, spaceId SpaceId, id string, body PostActionsConnectorIdJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostActionsConnectorIdRequestWithBody(server, spaceId, id, "application/json", bodyReader) +} + +// NewPostActionsConnectorIdRequestWithBody generates requests for PostActionsConnectorId with any type of body +func NewPostActionsConnectorIdRequestWithBody(server string, spaceId SpaceId, id string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) if err != nil { return nil, err } @@ -17206,7 +21012,7 @@ func NewGetParameterRequest(server string, id string) (*http.Request, error) { return nil, err } - operationPath := fmt.Sprintf("/api/synthetics/params/%s", pathParam0) + operationPath := fmt.Sprintf("/s/%s/api/actions/connector/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -17216,32 +21022,41 @@ func NewGetParameterRequest(server string, id string) (*http.Request, error) { return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewPutParameterRequest calls the generic PutParameter builder with application/json body -func NewPutParameterRequest(server string, id string, body PutParameterJSONRequestBody) (*http.Request, error) { +// NewPutActionsConnectorIdRequest calls the generic PutActionsConnectorId builder with application/json body +func NewPutActionsConnectorIdRequest(server string, spaceId SpaceId, id string, body PutActionsConnectorIdJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewPutParameterRequestWithBody(server, id, "application/json", bodyReader) + return NewPutActionsConnectorIdRequestWithBody(server, spaceId, id, "application/json", bodyReader) } -// NewPutParameterRequestWithBody generates requests for PutParameter with any type of body -func NewPutParameterRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { +// NewPutActionsConnectorIdRequestWithBody generates requests for PutActionsConnectorId with any type of body +func NewPutActionsConnectorIdRequestWithBody(server string, spaceId SpaceId, id string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) if err != nil { return nil, err } @@ -17251,7 +21066,7 @@ func NewPutParameterRequestWithBody(server string, id string, contentType string return nil, err } - operationPath := fmt.Sprintf("/api/synthetics/params/%s", pathParam0) + operationPath := fmt.Sprintf("/s/%s/api/actions/connector/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -17271,6 +21086,40 @@ func NewPutParameterRequestWithBody(server string, id string, contentType string return req, nil } +// NewGetActionsConnectorsRequest generates requests for GetActionsConnectors +func NewGetActionsConnectorsRequest(server string, spaceId SpaceId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/s/%s/api/actions/connectors", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewGetAllDataViewsDefaultRequest generates requests for GetAllDataViewsDefault func NewGetAllDataViewsDefaultRequest(server string, spaceId SpaceId) (*http.Request, error) { var err error @@ -17658,6 +21507,25 @@ type ClientWithResponsesInterface interface { PutParameterWithResponse(ctx context.Context, id string, body PutParameterJSONRequestBody, reqEditors ...RequestEditorFn) (*PutParameterResponse, error) + // DeleteActionsConnectorIdWithResponse request + DeleteActionsConnectorIdWithResponse(ctx context.Context, spaceId SpaceId, id string, reqEditors ...RequestEditorFn) (*DeleteActionsConnectorIdResponse, error) + + // GetActionsConnectorIdWithResponse request + GetActionsConnectorIdWithResponse(ctx context.Context, spaceId SpaceId, id string, reqEditors ...RequestEditorFn) (*GetActionsConnectorIdResponse, error) + + // PostActionsConnectorIdWithBodyWithResponse request with any body + PostActionsConnectorIdWithBodyWithResponse(ctx context.Context, spaceId SpaceId, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostActionsConnectorIdResponse, error) + + PostActionsConnectorIdWithResponse(ctx context.Context, spaceId SpaceId, id string, body PostActionsConnectorIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PostActionsConnectorIdResponse, error) + + // PutActionsConnectorIdWithBodyWithResponse request with any body + PutActionsConnectorIdWithBodyWithResponse(ctx context.Context, spaceId SpaceId, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutActionsConnectorIdResponse, error) + + PutActionsConnectorIdWithResponse(ctx context.Context, spaceId SpaceId, id string, body PutActionsConnectorIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutActionsConnectorIdResponse, error) + + // GetActionsConnectorsWithResponse request + GetActionsConnectorsWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*GetActionsConnectorsResponse, error) + // GetAllDataViewsDefaultWithResponse request GetAllDataViewsDefaultWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*GetAllDataViewsDefaultResponse, error) @@ -17919,7 +21787,7 @@ type GetFleetEnrollmentApiKeysResponse struct { HTTPResponse *http.Response JSON200 *struct { Items []EnrollmentApiKey `json:"items"` - // Deprecated: + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set List []struct { // Active When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents. Active bool `json:"active"` @@ -18109,7 +21977,7 @@ type PostFleetEpmPackagesPkgnamePkgversionResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { - Meta struct { + UnderscoreMeta struct { InstallSource string `json:"install_source"` Name string `json:"name"` } `json:"_meta"` @@ -18540,7 +22408,153 @@ type PostFleetPackagePoliciesResponse struct { } // Status returns HTTPResponse.Status -func (r PostFleetPackagePoliciesResponse) Status() string { +func (r PostFleetPackagePoliciesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostFleetPackagePoliciesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteFleetPackagePoliciesPackagepolicyidResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Id string `json:"id"` + } + JSON400 *struct { + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + ErrorType *string `json:"errorType,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r DeleteFleetPackagePoliciesPackagepolicyidResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteFleetPackagePoliciesPackagepolicyidResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetFleetPackagePoliciesPackagepolicyidResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Item PackagePolicy `json:"item"` + } + JSON400 *struct { + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + ErrorType *string `json:"errorType,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + JSON404 *struct { + Message string `json:"message"` + } +} + +// Status returns HTTPResponse.Status +func (r GetFleetPackagePoliciesPackagepolicyidResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetFleetPackagePoliciesPackagepolicyidResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PutFleetPackagePoliciesPackagepolicyidResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Item PackagePolicy `json:"item"` + } + JSON400 *struct { + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + ErrorType *string `json:"errorType,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + JSON403 *struct { + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + ErrorType *string `json:"errorType,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r PutFleetPackagePoliciesPackagepolicyidResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PutFleetPackagePoliciesPackagepolicyidResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostParametersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *CreateParamResponse +} + +// Status returns HTTPResponse.Status +func (r PostParametersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostParametersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteParameterResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r DeleteParameterResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -18548,30 +22562,21 @@ func (r PostFleetPackagePoliciesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r PostFleetPackagePoliciesResponse) StatusCode() int { +func (r DeleteParameterResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteFleetPackagePoliciesPackagepolicyidResponse struct { +type GetParameterResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *struct { - Id string `json:"id"` - } - JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - ErrorType *string `json:"errorType,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } + JSON200 *SyntheticsGetParameterResponse } // Status returns HTTPResponse.Status -func (r DeleteFleetPackagePoliciesPackagepolicyidResponse) Status() string { +func (r GetParameterResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -18579,33 +22584,21 @@ func (r DeleteFleetPackagePoliciesPackagepolicyidResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteFleetPackagePoliciesPackagepolicyidResponse) StatusCode() int { +func (r GetParameterResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetFleetPackagePoliciesPackagepolicyidResponse struct { +type PutParameterResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *struct { - Item PackagePolicy `json:"item"` - } - JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - ErrorType *string `json:"errorType,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - JSON404 *struct { - Message string `json:"message"` - } + JSON200 *map[string]interface{} } // Status returns HTTPResponse.Status -func (r GetFleetPackagePoliciesPackagepolicyidResponse) Status() string { +func (r PutParameterResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -18613,37 +22606,20 @@ func (r GetFleetPackagePoliciesPackagepolicyidResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetFleetPackagePoliciesPackagepolicyidResponse) StatusCode() int { +func (r PutParameterResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type PutFleetPackagePoliciesPackagepolicyidResponse struct { +type DeleteActionsConnectorIdResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *struct { - Item PackagePolicy `json:"item"` - } - JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - ErrorType *string `json:"errorType,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - JSON403 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - ErrorType *string `json:"errorType,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } } // Status returns HTTPResponse.Status -func (r PutFleetPackagePoliciesPackagepolicyidResponse) Status() string { +func (r DeleteActionsConnectorIdResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -18651,21 +22627,21 @@ func (r PutFleetPackagePoliciesPackagepolicyidResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r PutFleetPackagePoliciesPackagepolicyidResponse) StatusCode() int { +func (r DeleteActionsConnectorIdResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type PostParametersResponse struct { +type GetActionsConnectorIdResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *CreateParamResponse + JSON200 *ConnectorResponse } // Status returns HTTPResponse.Status -func (r PostParametersResponse) Status() string { +func (r GetActionsConnectorIdResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -18673,20 +22649,44 @@ func (r PostParametersResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r PostParametersResponse) StatusCode() int { +func (r GetActionsConnectorIdResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteParameterResponse struct { +type PostActionsConnectorIdResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *struct { + Config *map[string]interface{} `json:"config,omitempty"` + + // ConnectorTypeId The connector type identifier. + ConnectorTypeId string `json:"connector_type_id"` + + // Id The identifier for the connector. + Id string `json:"id"` + + // IsDeprecated Indicates whether the connector is deprecated. + IsDeprecated bool `json:"is_deprecated"` + + // IsMissingSecrets Indicates whether the connector is missing secrets. + IsMissingSecrets *bool `json:"is_missing_secrets,omitempty"` + + // IsPreconfigured Indicates whether the connector is preconfigured. If true, the `config` and `is_missing_secrets` properties are omitted from the response. + IsPreconfigured bool `json:"is_preconfigured"` + + // IsSystemAction Indicates whether the connector is used for system actions. + IsSystemAction bool `json:"is_system_action"` + + // Name The name of the rule. + Name string `json:"name"` + } } // Status returns HTTPResponse.Status -func (r DeleteParameterResponse) Status() string { +func (r PostActionsConnectorIdResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -18694,21 +22694,44 @@ func (r DeleteParameterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteParameterResponse) StatusCode() int { +func (r PostActionsConnectorIdResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetParameterResponse struct { +type PutActionsConnectorIdResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *SyntheticsGetParameterResponse + JSON200 *struct { + Config *map[string]interface{} `json:"config,omitempty"` + + // ConnectorTypeId The connector type identifier. + ConnectorTypeId string `json:"connector_type_id"` + + // Id The identifier for the connector. + Id string `json:"id"` + + // IsDeprecated Indicates whether the connector is deprecated. + IsDeprecated bool `json:"is_deprecated"` + + // IsMissingSecrets Indicates whether the connector is missing secrets. + IsMissingSecrets *bool `json:"is_missing_secrets,omitempty"` + + // IsPreconfigured Indicates whether the connector is preconfigured. If true, the `config` and `is_missing_secrets` properties are omitted from the response. + IsPreconfigured bool `json:"is_preconfigured"` + + // IsSystemAction Indicates whether the connector is used for system actions. + IsSystemAction bool `json:"is_system_action"` + + // Name The name of the rule. + Name string `json:"name"` + } } // Status returns HTTPResponse.Status -func (r GetParameterResponse) Status() string { +func (r PutActionsConnectorIdResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -18716,21 +22739,21 @@ func (r GetParameterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetParameterResponse) StatusCode() int { +func (r PutActionsConnectorIdResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type PutParameterResponse struct { +type GetActionsConnectorsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *map[string]interface{} + JSON200 *[]ConnectorResponse } // Status returns HTTPResponse.Status -func (r PutParameterResponse) Status() string { +func (r GetActionsConnectorsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -18738,7 +22761,7 @@ func (r PutParameterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r PutParameterResponse) StatusCode() int { +func (r GetActionsConnectorsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -19270,6 +23293,67 @@ func (c *ClientWithResponses) PutParameterWithResponse(ctx context.Context, id s return ParsePutParameterResponse(rsp) } +// DeleteActionsConnectorIdWithResponse request returning *DeleteActionsConnectorIdResponse +func (c *ClientWithResponses) DeleteActionsConnectorIdWithResponse(ctx context.Context, spaceId SpaceId, id string, reqEditors ...RequestEditorFn) (*DeleteActionsConnectorIdResponse, error) { + rsp, err := c.DeleteActionsConnectorId(ctx, spaceId, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteActionsConnectorIdResponse(rsp) +} + +// GetActionsConnectorIdWithResponse request returning *GetActionsConnectorIdResponse +func (c *ClientWithResponses) GetActionsConnectorIdWithResponse(ctx context.Context, spaceId SpaceId, id string, reqEditors ...RequestEditorFn) (*GetActionsConnectorIdResponse, error) { + rsp, err := c.GetActionsConnectorId(ctx, spaceId, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetActionsConnectorIdResponse(rsp) +} + +// PostActionsConnectorIdWithBodyWithResponse request with arbitrary body returning *PostActionsConnectorIdResponse +func (c *ClientWithResponses) PostActionsConnectorIdWithBodyWithResponse(ctx context.Context, spaceId SpaceId, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostActionsConnectorIdResponse, error) { + rsp, err := c.PostActionsConnectorIdWithBody(ctx, spaceId, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostActionsConnectorIdResponse(rsp) +} + +func (c *ClientWithResponses) PostActionsConnectorIdWithResponse(ctx context.Context, spaceId SpaceId, id string, body PostActionsConnectorIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PostActionsConnectorIdResponse, error) { + rsp, err := c.PostActionsConnectorId(ctx, spaceId, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostActionsConnectorIdResponse(rsp) +} + +// PutActionsConnectorIdWithBodyWithResponse request with arbitrary body returning *PutActionsConnectorIdResponse +func (c *ClientWithResponses) PutActionsConnectorIdWithBodyWithResponse(ctx context.Context, spaceId SpaceId, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutActionsConnectorIdResponse, error) { + rsp, err := c.PutActionsConnectorIdWithBody(ctx, spaceId, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutActionsConnectorIdResponse(rsp) +} + +func (c *ClientWithResponses) PutActionsConnectorIdWithResponse(ctx context.Context, spaceId SpaceId, id string, body PutActionsConnectorIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutActionsConnectorIdResponse, error) { + rsp, err := c.PutActionsConnectorId(ctx, spaceId, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutActionsConnectorIdResponse(rsp) +} + +// GetActionsConnectorsWithResponse request returning *GetActionsConnectorsResponse +func (c *ClientWithResponses) GetActionsConnectorsWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*GetActionsConnectorsResponse, error) { + rsp, err := c.GetActionsConnectors(ctx, spaceId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetActionsConnectorsResponse(rsp) +} + // GetAllDataViewsDefaultWithResponse request returning *GetAllDataViewsDefaultResponse func (c *ClientWithResponses) GetAllDataViewsDefaultWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*GetAllDataViewsDefaultResponse, error) { rsp, err := c.GetAllDataViewsDefault(ctx, spaceId, reqEditors...) @@ -19712,7 +23796,7 @@ func ParseGetFleetEnrollmentApiKeysResponse(rsp *http.Response) (*GetFleetEnroll case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest struct { Items []EnrollmentApiKey `json:"items"` - // Deprecated: + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set List []struct { // Active When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents. Active bool `json:"active"` @@ -19917,7 +24001,7 @@ func ParsePostFleetEpmPackagesPkgnamePkgversionResponse(rsp *http.Response) (*Po switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest struct { - Meta struct { + UnderscoreMeta struct { InstallSource string `json:"install_source"` Name string `json:"name"` } `json:"_meta"` @@ -20712,6 +24796,172 @@ func ParsePutParameterResponse(rsp *http.Response) (*PutParameterResponse, error return response, nil } +// ParseDeleteActionsConnectorIdResponse parses an HTTP response from a DeleteActionsConnectorIdWithResponse call +func ParseDeleteActionsConnectorIdResponse(rsp *http.Response) (*DeleteActionsConnectorIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteActionsConnectorIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseGetActionsConnectorIdResponse parses an HTTP response from a GetActionsConnectorIdWithResponse call +func ParseGetActionsConnectorIdResponse(rsp *http.Response) (*GetActionsConnectorIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetActionsConnectorIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ConnectorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePostActionsConnectorIdResponse parses an HTTP response from a PostActionsConnectorIdWithResponse call +func ParsePostActionsConnectorIdResponse(rsp *http.Response) (*PostActionsConnectorIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostActionsConnectorIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Config *map[string]interface{} `json:"config,omitempty"` + + // ConnectorTypeId The connector type identifier. + ConnectorTypeId string `json:"connector_type_id"` + + // Id The identifier for the connector. + Id string `json:"id"` + + // IsDeprecated Indicates whether the connector is deprecated. + IsDeprecated bool `json:"is_deprecated"` + + // IsMissingSecrets Indicates whether the connector is missing secrets. + IsMissingSecrets *bool `json:"is_missing_secrets,omitempty"` + + // IsPreconfigured Indicates whether the connector is preconfigured. If true, the `config` and `is_missing_secrets` properties are omitted from the response. + IsPreconfigured bool `json:"is_preconfigured"` + + // IsSystemAction Indicates whether the connector is used for system actions. + IsSystemAction bool `json:"is_system_action"` + + // Name The name of the rule. + Name string `json:"name"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePutActionsConnectorIdResponse parses an HTTP response from a PutActionsConnectorIdWithResponse call +func ParsePutActionsConnectorIdResponse(rsp *http.Response) (*PutActionsConnectorIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PutActionsConnectorIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Config *map[string]interface{} `json:"config,omitempty"` + + // ConnectorTypeId The connector type identifier. + ConnectorTypeId string `json:"connector_type_id"` + + // Id The identifier for the connector. + Id string `json:"id"` + + // IsDeprecated Indicates whether the connector is deprecated. + IsDeprecated bool `json:"is_deprecated"` + + // IsMissingSecrets Indicates whether the connector is missing secrets. + IsMissingSecrets *bool `json:"is_missing_secrets,omitempty"` + + // IsPreconfigured Indicates whether the connector is preconfigured. If true, the `config` and `is_missing_secrets` properties are omitted from the response. + IsPreconfigured bool `json:"is_preconfigured"` + + // IsSystemAction Indicates whether the connector is used for system actions. + IsSystemAction bool `json:"is_system_action"` + + // Name The name of the rule. + Name string `json:"name"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetActionsConnectorsResponse parses an HTTP response from a GetActionsConnectorsWithResponse call +func ParseGetActionsConnectorsResponse(rsp *http.Response) (*GetActionsConnectorsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetActionsConnectorsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []ConnectorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + // ParseGetAllDataViewsDefaultResponse parses an HTTP response from a GetAllDataViewsDefaultWithResponse call func ParseGetAllDataViewsDefaultResponse(rsp *http.Response) (*GetAllDataViewsDefaultResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/generated/kbapi/transform_schema.go b/generated/kbapi/transform_schema.go index 11453eb8a..17d86fb24 100644 --- a/generated/kbapi/transform_schema.go +++ b/generated/kbapi/transform_schema.go @@ -547,6 +547,7 @@ var transformers = []TransformFunc{ transformFleetPaths, transformRemoveExamples, transformRemoveUnusedComponents, + transformOmitEmptyNullable, } // transformFilterPaths filters the paths in a schema down to a specified list @@ -571,6 +572,8 @@ func transformFilterPaths(schema *Schema) { "/api/synthetics/params": {"post"}, "/api/synthetics/params/{id}": {"get", "put", "delete"}, "/api/apm/settings/agent-configuration": {"get", "put", "delete"}, + "/api/actions/connector/{id}": {"get", "put", "post", "delete"}, + "/api/actions/connectors": {"get"}, } for path, pathInfo := range schema.Paths { @@ -717,6 +720,8 @@ func transformKibanaPaths(schema *Schema) { "/api/data_views", "/api/data_views/data_view", "/api/data_views/data_view/{viewId}", + "/api/actions/connector/{id}", + "/api/actions/connectors", } // Add a spaceId parameter if not already present @@ -748,6 +753,25 @@ func transformKibanaPaths(schema *Schema) { } } + // Connectors + // Can be removed when https://github.com/elastic/kibana/issues/230149 is addressed. + connectorPath := schema.MustGetPath("/s/{spaceId}/api/actions/connector/{id}") + connectorsPath := schema.MustGetPath("/s/{spaceId}/api/actions/connectors") + + connectorPath.Post.CreateRef(schema, "create_connector_config", "requestBody.content.application/json.schema.properties.config") + connectorPath.Post.CreateRef(schema, "create_connector_secrets", "requestBody.content.application/json.schema.properties.secrets") + + connectorPath.Put.CreateRef(schema, "update_connector_config", "requestBody.content.application/json.schema.properties.config") + connectorPath.Put.CreateRef(schema, "update_connector_secrets", "requestBody.content.application/json.schema.properties.secrets") + + connectorPath.Get.CreateRef(schema, "connector_response", "responses.200.content.application/json.schema") + connectorsPath.Get.Set("responses.200.content.application/json.schema", Map{ + "type": "array", + "items": Map{ + "$ref": "#/components/schemas/connector_response", + }, + }) + // Data views // https://github.com/elastic/kibana/blob/main/src/plugins/data_views/server/rest_api_routes/schema.ts @@ -836,16 +860,6 @@ func transformFleetPaths(schema *Schema) { agentPolicyPath.Get.CreateRef(schema, "agent_policy", "responses.200.content.application/json.schema.properties.item") agentPolicyPath.Put.CreateRef(schema, "agent_policy", "responses.200.content.application/json.schema.properties.item") - // See: https://github.com/elastic/kibana/issues/197155 - // [request body.keep_monitoring_alive]: expected value of type [boolean] but got [null] - // [request body.supports_agentless]: expected value of type [boolean] but got [null] - // [request body.overrides]: expected value of type [boolean] but got [null] - // [request body.required_versions]: definition for this key is missing"} - for _, key := range []string{"keep_monitoring_alive", "supports_agentless", "overrides", "required_versions"} { - agentPoliciesPath.Post.Set(fmt.Sprintf("requestBody.content.application/json.schema.properties.%s.x-omitempty", key), true) - agentPolicyPath.Put.Set(fmt.Sprintf("requestBody.content.application/json.schema.properties.%s.x-omitempty", key), true) - } - schema.Components.CreateRef(schema, "agent_policy_global_data_tags_item", "schemas.agent_policy.properties.global_data_tags.items") // Define the value types for the GlobalDataTags @@ -880,14 +894,6 @@ func transformFleetPaths(schema *Schema) { hostPath.Get.CreateRef(schema, "server_host", "responses.200.content.application/json.schema.properties.item") hostPath.Put.CreateRef(schema, "server_host", "responses.200.content.application/json.schema.properties.item") - // 8.6.2 regression - // [request body.proxy_id]: definition for this key is missing - // See: https://github.com/elastic/kibana/issues/197155 - hostsPath.Post.Set("requestBody.content.application/json.schema.properties.proxy_id.x-omitempty", true) - hostPath.Put.Set("requestBody.content.application/json.schema.properties.proxy_id.x-omitempty", true) - hostsPath.Post.Set("requestBody.content.application/json.schema.properties.ssl.x-omitempty", true) - hostPath.Put.Set("requestBody.content.application/json.schema.properties.ssl.x-omitempty", true) - // Outputs // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/models/output.ts // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/rest_spec/output.ts @@ -950,32 +956,6 @@ func transformFleetPaths(schema *Schema) { }, }) - for _, name := range []string{"new_output", "update_output"} { - for _, typ := range []string{"elasticsearch", "remote_elasticsearch", "logstash", "kafka"} { - // [request body.1.ca_sha256]: expected value of type [string] but got [null]" - // See: https://github.com/elastic/kibana/issues/197155 - schema.Components.Set(fmt.Sprintf("schemas.%s_%s.properties.ca_sha256.x-omitempty", name, typ), true) - - // [request body.1.ca_trusted_fingerprint]: expected value of type [string] but got [null] - // See: https://github.com/elastic/kibana/issues/197155 - schema.Components.Set(fmt.Sprintf("schemas.%s_%s.properties.ca_trusted_fingerprint.x-omitempty", name, typ), true) - - // 8.6.2 regression - // [request body.proxy_id]: definition for this key is missing" - // See: https://github.com/elastic/kibana/issues/197155 - schema.Components.Set(fmt.Sprintf("schemas.%s_%s.properties.proxy_id.x-omitempty", name, typ), true) - } - - // [request body.1.shipper]: expected a plain object value, but found [null] instead - // See: https://github.com/elastic/kibana/issues/197155 - schema.Components.Set(fmt.Sprintf("schemas.%s_shipper.x-omitempty", name), true) - - // [request body.1.ssl]: expected a plain object value, but found [null] instead - // See: https://github.com/elastic/kibana/issues/197155 - schema.Components.Set(fmt.Sprintf("schemas.%s_ssl.x-omitempty", name), true) - - } - for _, typ := range []string{"elasticsearch", "remote_elasticsearch", "logstash", "kafka"} { // strict_dynamic_mapping_exception: [1:345] mapping set to strict, dynamic introduction of [id] within [ingest-outputs] is not allowed" // See: https://github.com/elastic/kibana/issues/197155 @@ -1017,13 +997,35 @@ func transformFleetPaths(schema *Schema) { schema.Components.Set("schemas.package_policy_request.properties.vars", Map{"type": "object"}) schema.Components.Set("schemas.package_policy_request_input.properties.vars", Map{"type": "object"}) schema.Components.Set("schemas.package_policy_request_input_stream.properties.vars", Map{"type": "object"}) +} + +func setAllXOmitEmpty(key string, node Map) { + maybeNullable, hasNullable := node.Get("nullable") + isNullable, ok := maybeNullable.(bool) + if hasNullable && ok && isNullable { + node.Set("x-omitempty", true) + } + + properties, hasProperties := node.GetMap("properties") + if !hasProperties { + return + } + + properties.Iterate(setAllXOmitEmpty) +} + +func transformOmitEmptyNullable(schema *Schema) { + componentSchemas := schema.Components.MustGetMap("schemas") + componentSchemas.Iterate(setAllXOmitEmpty) - // [request body.0.output_id]: expected value of type [string] but got [null] - // [request body.1.output_id]: definition for this key is missing" - // See: https://github.com/elastic/kibana/issues/197155 - schema.Components.Set("schemas.package_policy_request.properties.output_id.x-omitempty", true) - schema.Components.Set("schemas.package_policy_request.properties.additional_datastreams_permissions.x-omitempty", true) - schema.Components.Set("schemas.package_policy_request.properties.supports_agentless.x-omitempty", true) + for _, pathInfo := range schema.Paths { + for _, methInfo := range pathInfo.Endpoints { + requestBody, ok := methInfo.GetMap("requestBody.content.application/json.schema.properties") + if ok { + requestBody.Iterate(setAllXOmitEmpty) + } + } + } } // transformRemoveExamples removes all examples. diff --git a/internal/clients/api_client.go b/internal/clients/api_client.go index d2cdee505..0174b6daf 100644 --- a/internal/clients/api_client.go +++ b/internal/clients/api_client.go @@ -11,7 +11,6 @@ import ( "github.com/disaster37/go-kibana-rest/v8" "github.com/elastic/go-elasticsearch/v8" "github.com/elastic/terraform-provider-elasticstack/generated/alerting" - "github.com/elastic/terraform-provider-elasticstack/generated/connectors" "github.com/elastic/terraform-provider-elasticstack/generated/slo" "github.com/elastic/terraform-provider-elasticstack/internal/clients/config" "github.com/elastic/terraform-provider-elasticstack/internal/clients/fleet" @@ -25,7 +24,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/oapi-codegen/oapi-codegen/v2/pkg/securityprovider" ) type CompositeId struct { @@ -76,7 +74,6 @@ type ApiClient struct { kibana *kibana.Client kibanaOapi *kibana_oapi.Client alerting alerting.AlertingAPI - connectors *connectors.Client slo slo.SloAPI kibanaConfig kibana.Config fleet *fleet.Client @@ -105,11 +102,6 @@ func NewAcceptanceTestingClient() (*ApiClient, error) { kibanaHttpClient := kib.Client.GetClient() - actionConnectors, err := buildConnectorsClient(cfg, kibanaHttpClient) - if err != nil { - return nil, fmt.Errorf("cannot create Kibana action connectors client: [%w]", err) - } - kibOapi, err := kibana_oapi.NewClient(*cfg.KibanaOapi) if err != nil { return nil, err @@ -126,7 +118,6 @@ func NewAcceptanceTestingClient() (*ApiClient, error) { kibanaOapi: kibOapi, alerting: buildAlertingClient(cfg, kibanaHttpClient).AlertingAPI, slo: buildSloClient(cfg, kibanaHttpClient).SloAPI, - connectors: actionConnectors, kibanaConfig: *cfg.Kibana, fleet: fleetClient, version: version, @@ -262,14 +253,6 @@ func (a *ApiClient) GetAlertingClient() (alerting.AlertingAPI, error) { return a.alerting, nil } -func (a *ApiClient) GetKibanaConnectorsClient(ctx context.Context) (*connectors.Client, error) { - if a.connectors == nil { - return nil, errors.New("kibana action connector client not found") - } - - return a.connectors, nil -} - func (a *ApiClient) GetSloClient() (slo.SloAPI, error) { if a.slo == nil { return nil, errors.New("slo client not found") @@ -551,33 +534,6 @@ func buildAlertingClient(cfg config.Client, httpClient *http.Client) *alerting.A return alerting.NewAPIClient(&alertingConfig) } -func buildConnectorsClient(cfg config.Client, httpClient *http.Client) (*connectors.Client, error) { - var authInterceptor connectors.ClientOption - if cfg.Kibana.ApiKey != "" { - apiKeyProvider, err := securityprovider.NewSecurityProviderApiKey( - "header", - "Authorization", - "ApiKey "+cfg.Kibana.ApiKey, - ) - if err != nil { - return nil, fmt.Errorf("unable to create api key auth provider: %w", err) - } - authInterceptor = connectors.WithRequestEditorFn(apiKeyProvider.Intercept) - } else { - basicAuthProvider, err := securityprovider.NewSecurityProviderBasicAuth(cfg.Kibana.Username, cfg.Kibana.Password) - if err != nil { - return nil, fmt.Errorf("unable to create basic auth provider: %w", err) - } - authInterceptor = connectors.WithRequestEditorFn(basicAuthProvider.Intercept) - } - - return connectors.NewClient( - cfg.Kibana.Address, - authInterceptor, - connectors.WithHTTPClient(httpClient), - ) -} - func buildSloClient(cfg config.Client, httpClient *http.Client) *slo.APIClient { sloConfig := slo.Configuration{ Debug: logging.IsDebugOrHigher(), @@ -643,14 +599,9 @@ func newApiClientFromConfig(cfg config.Client, version string) (*ApiClient, erro client.kibanaOapi = kibanaOapiClient kibanaHttpClient := kibanaClient.Client.GetClient() - connectorsClient, err := buildConnectorsClient(cfg, kibanaHttpClient) - if err != nil { - return nil, fmt.Errorf("cannot create Kibana connectors client: [%w]", err) - } client.alerting = buildAlertingClient(cfg, kibanaHttpClient).AlertingAPI client.slo = buildSloClient(cfg, kibanaHttpClient).SloAPI - client.connectors = connectorsClient } if cfg.Fleet != nil { diff --git a/internal/clients/kibana/connector.go b/internal/clients/kibana/connector.go deleted file mode 100644 index 050cdbd08..000000000 --- a/internal/clients/kibana/connector.go +++ /dev/null @@ -1,1670 +0,0 @@ -package kibana - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - - "github.com/elastic/terraform-provider-elasticstack/generated/connectors" - "github.com/elastic/terraform-provider-elasticstack/internal/clients" - "github.com/elastic/terraform-provider-elasticstack/internal/models" - "github.com/elastic/terraform-provider-elasticstack/internal/utils" - "github.com/hashicorp/terraform-plugin-log/tflog" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" -) - -func CreateConnector(ctx context.Context, apiClient *clients.ApiClient, connectorOld models.KibanaActionConnector) (string, diag.Diagnostics) { - client, err := apiClient.GetKibanaConnectorsClient(ctx) - if err != nil { - return "", diag.FromErr(err) - } - - body, err := createConnectorRequestBody(connectorOld) - if err != nil { - return "", diag.FromErr(err) - } - - httpResp, err := client.CreateConnectorWithBody(ctx, connectorOld.SpaceID, &connectors.CreateConnectorParams{KbnXsrf: connectors.KbnXsrf("true")}, "application/json", body) - - if err != nil { - return "", diag.Errorf("unable to create connector: [%v]", err) - } - - defer httpResp.Body.Close() - - resp, err := connectors.ParseCreateConnectorResponse(httpResp) - if err != nil { - return "", diag.Errorf("unable to parse connector create response: [%v]", err) - } - - if resp.JSON400 != nil { - return "", diag.Errorf("%s: %s", *resp.JSON400.Error, *resp.JSON400.Message) - } - - if resp.JSON401 != nil { - return "", diag.Errorf("%s: %s", *resp.JSON401.Error, *resp.JSON401.Message) - } - - if resp.JSON200 == nil { - return "", diag.Errorf("%s: %s", resp.Status(), string(resp.Body)) - } - - connectorNew, err := connectorResponseToModel(connectorOld.SpaceID, *resp.JSON200) - if err != nil { - return "", diag.FromErr(err) - } - - return connectorNew.ConnectorID, nil -} - -func UpdateConnector(ctx context.Context, apiClient *clients.ApiClient, connectorOld models.KibanaActionConnector) (string, diag.Diagnostics) { - client, err := apiClient.GetKibanaConnectorsClient(ctx) - if err != nil { - return "", diag.FromErr(err) - } - - body, err := updateConnectorRequestBody(connectorOld) - if err != nil { - return "", diag.FromErr(err) - } - - httpResp, err := client.UpdateConnectorWithBody(ctx, connectorOld.SpaceID, connectorOld.ConnectorID, &connectors.UpdateConnectorParams{KbnXsrf: connectors.KbnXsrf("true")}, "application/json", body) - - if err != nil { - return "", diag.Errorf("unable to update connector: [%v]", err) - } - - defer httpResp.Body.Close() - - resp, err := connectors.ParseCreateConnectorResponse(httpResp) - if err != nil { - return "", diag.Errorf("unable to parse connector update response: [%v]", err) - } - - if resp.JSON400 != nil { - return "", diag.Errorf("%s: %s", *resp.JSON400.Error, *resp.JSON400.Message) - } - - if resp.JSON401 != nil { - return "", diag.Errorf("%s: %s", *resp.JSON401.Error, *resp.JSON401.Message) - } - - if resp.JSON200 == nil { - return "", diag.Errorf("%s: %s", resp.Status(), string(resp.Body)) - } - - connectorNew, err := connectorResponseToModel(connectorOld.SpaceID, *resp.JSON200) - if err != nil { - return "", diag.FromErr(err) - } - - return connectorNew.ConnectorID, nil -} - -func GetConnector(ctx context.Context, apiClient *clients.ApiClient, connectorID, spaceID string) (*models.KibanaActionConnector, diag.Diagnostics) { - client, err := apiClient.GetKibanaConnectorsClient(ctx) - if err != nil { - return nil, diag.FromErr(err) - } - - httpResp, err := client.GetConnector(ctx, spaceID, connectorID) - - if err != nil { - return nil, diag.Errorf("unable to get connector: [%v]", err) - } - - defer httpResp.Body.Close() - - resp, err := connectors.ParseGetConnectorResponse(httpResp) - if err != nil { - return nil, diag.Errorf("unable to parse connector get response: [%v]", err) - } - - if resp.JSON401 != nil { - return nil, diag.Errorf("%s: %s", *resp.JSON401.Error, *resp.JSON401.Message) - } - - if resp.JSON404 != nil { - return nil, nil - } - - if resp.JSON200 == nil { - return nil, diag.Errorf("%s: %s", resp.Status(), string(resp.Body)) - } - - connector, err := connectorResponseToModel(spaceID, *resp.JSON200) - if err != nil { - return nil, diag.Errorf("unable to convert response to model: %v", err) - } - - return connector, nil -} - -func SearchConnectors(ctx context.Context, apiClient *clients.ApiClient, connectorName, spaceID, connectorTypeID string) ([]*models.KibanaActionConnector, diag.Diagnostics) { - client, err := apiClient.GetKibanaConnectorsClient(ctx) - if err != nil { - return nil, diag.FromErr(err) - } - - httpResp, err := client.GetConnectors(ctx, spaceID) - - if err != nil { - return nil, diag.Errorf("unable to get connectors: [%v]", err) - } - - defer httpResp.Body.Close() - - resp, err := connectors.ParseGetConnectorsResponse(httpResp) - if err != nil { - return nil, diag.Errorf("unable to parse connectors get response: [%v]", err) - } - - if resp.JSON401 != nil { - return nil, diag.Errorf("%s: %s", *resp.JSON401.Error, *resp.JSON401.Message) - } - - if resp.JSON200 == nil { - return nil, diag.Errorf("%s: %s", resp.Status(), string(resp.Body)) - } - - foundConnectors := []*models.KibanaActionConnector{} - for _, connector := range *resp.JSON200 { - if connector.Name != connectorName { - continue - } - - if connectorTypeID != "" && string(connector.ConnectorTypeId) != connectorTypeID { - continue - } - - //this marshaling and unmarshaling business allows us to create a type with unexported fields. - bytes, err := json.Marshal(connector) - if err != nil { - return nil, diag.Errorf("cannot marshal connector: %v", err) - } - - var respProps connectors.ConnectorResponseProperties - err = json.Unmarshal(bytes, &respProps) - if err != nil { - return nil, diag.Errorf("cannot unmarshal connector: %v", err) - } - - c, err := connectorResponseToModel(spaceID, respProps) - if err != nil { - return nil, diag.Errorf("unable to convert response to model: %v", err) - } - - foundConnectors = append(foundConnectors, c) - } - if len(foundConnectors) == 0 { - tflog.Debug(ctx, fmt.Sprintf("no connectors found with name [%s/%s] and type [%s]", spaceID, connectorName, connectorTypeID)) - } - - return foundConnectors, nil -} - -func DeleteConnector(ctx context.Context, apiClient *clients.ApiClient, connectorID string, spaceID string) diag.Diagnostics { - client, err := apiClient.GetKibanaConnectorsClient(ctx) - if err != nil { - return diag.FromErr(err) - } - - httpResp, err := client.DeleteConnector(ctx, spaceID, connectorID, &connectors.DeleteConnectorParams{KbnXsrf: "true"}) - - if err != nil { - return diag.Errorf("unable to delete connector: [%v]", err) - } - - defer httpResp.Body.Close() - - resp, err := connectors.ParseDeleteConnectorResponse(httpResp) - if err != nil { - return diag.Errorf("unable to parse connector get response: [%v]", err) - } - - if resp.JSON404 != nil { - return diag.Errorf("%s: %s", *resp.JSON404.Error, *resp.JSON404.Message) - } - - if resp.JSON401 != nil { - return diag.Errorf("%s: %s", *resp.JSON401.Error, *resp.JSON401.Message) - } - - if resp.StatusCode() != 200 && resp.StatusCode() != 204 { - return diag.Errorf("failed to delete connector: got status [%v] [%s]", resp.StatusCode(), resp.Status()) - } - - return nil -} - -func ConnectorConfigWithDefaults(connectorTypeID, plan, backend, state string) (string, error) { - switch connectors.ConnectorTypes(connectorTypeID) { - - case connectors.ConnectorTypesDotCasesWebhook: - return connectorConfigWithDefaultsCasesWebhook(plan) - - case connectors.ConnectorTypesDotEmail: - return connectorConfigWithDefaultsEmail(plan) - - case connectors.ConnectorTypesDotGemini: - return connectorConfigWithDefaultsGemini(plan) - - case connectors.ConnectorTypesDotIndex: - return connectorConfigWithDefaultsIndex(plan) - - case connectors.ConnectorTypesDotJira: - return connectorConfigWithDefaultsJira(plan) - - case connectors.ConnectorTypesDotOpsgenie: - return connectorConfigWithDefaultsOpsgenie(plan) - - case connectors.ConnectorTypesDotPagerduty: - return connectorConfigWithDefaultsPagerduty(plan) - - case connectors.ConnectorTypesDotResilient: - return connectorConfigWithDefaultsResilient(plan) - - case connectors.ConnectorTypesDotServicenow: - return connectorConfigWithDefaultsServicenow(plan, backend) - - case connectors.ConnectorTypesDotServicenowItom: - return connectorConfigWithDefaultsServicenowItom(plan) - - case connectors.ConnectorTypesDotServicenowSir: - return connectorConfigWithDefaultsServicenowSir(plan, backend) - - case connectors.ConnectorTypesDotSwimlane: - return connectorConfigWithDefaultsSwimlane(plan) - - case connectors.ConnectorTypesDotTines: - return connectorConfigWithDefaultsTines(plan) - - case connectors.ConnectorTypesDotWebhook: - return connectorConfigWithDefaultsWebhook(plan) - - case connectors.ConnectorTypesDotXmatters: - return connectorConfigWithDefaultsXmatters(plan) - } - return plan, nil -} - -// User can omit optonal fields in config JSON. -// The func adds empty optional fields to the diff. -// Otherwise plan command shows omitted fields as the diff, -// because backend returns all fields. -func connectorConfigWithDefaults[T any](plan string) (string, error) { - var config T - if err := json.Unmarshal([]byte(plan), &config); err != nil { - return "", err - } - customJSON, err := json.Marshal(config) - if err != nil { - return "", err - } - return string(customJSON), nil -} - -func connectorConfigWithDefaultsCasesWebhook(plan string) (string, error) { - var custom connectors.ConfigPropertiesCasesWebhook - if err := json.Unmarshal([]byte(plan), &custom); err != nil { - return "", err - } - if custom.CreateIncidentMethod == nil { - custom.CreateIncidentMethod = new(connectors.ConfigPropertiesCasesWebhookCreateIncidentMethod) - *custom.CreateIncidentMethod = connectors.ConfigPropertiesCasesWebhookCreateIncidentMethodPost - } - if custom.HasAuth == nil { - custom.HasAuth = utils.Pointer(true) - } - if custom.UpdateIncidentMethod == nil { - custom.UpdateIncidentMethod = new(connectors.ConfigPropertiesCasesWebhookUpdateIncidentMethod) - *custom.UpdateIncidentMethod = connectors.ConfigPropertiesCasesWebhookUpdateIncidentMethodPut - } - customJSON, err := json.Marshal(custom) - if err != nil { - return "", err - } - return string(customJSON), nil -} - -func connectorConfigWithDefaultsEmail(plan string) (string, error) { - var custom connectors.ConfigPropertiesEmail - if err := json.Unmarshal([]byte(plan), &custom); err != nil { - return "", err - } - if custom.HasAuth == nil { - custom.HasAuth = utils.Pointer(true) - } - if custom.Service == nil { - custom.Service = new(string) - *custom.Service = "other" - } - customJSON, err := json.Marshal(custom) - if err != nil { - return "", err - } - return string(customJSON), nil -} - -func connectorConfigWithDefaultsGemini(plan string) (string, error) { - return plan, nil -} - -func connectorConfigWithDefaultsIndex(plan string) (string, error) { - var custom connectors.ConfigPropertiesIndex - if err := json.Unmarshal([]byte(plan), &custom); err != nil { - return "", err - } - if custom.Refresh == nil { - custom.Refresh = utils.Pointer(false) - } - customJSON, err := json.Marshal(custom) - if err != nil { - return "", err - } - return string(customJSON), nil -} - -func connectorConfigWithDefaultsJira(plan string) (string, error) { - return connectorConfigWithDefaults[connectors.ConfigPropertiesJira](plan) -} - -func connectorConfigWithDefaultsOpsgenie(plan string) (string, error) { - return plan, nil -} - -func connectorConfigWithDefaultsPagerduty(plan string) (string, error) { - return connectorConfigWithDefaults[connectors.ConfigPropertiesPagerduty](plan) -} - -func connectorConfigWithDefaultsResilient(plan string) (string, error) { - return plan, nil -} - -func connectorConfigWithDefaultsServicenow(plan, backend string) (string, error) { - var planConfig connectors.ConfigPropertiesServicenow - if err := json.Unmarshal([]byte(plan), &planConfig); err != nil { - return "", err - } - var backendConfig connectors.ConfigPropertiesServicenow - if err := json.Unmarshal([]byte(backend), &backendConfig); err != nil { - return "", err - } - if planConfig.IsOAuth == nil && backendConfig.IsOAuth != nil && !*backendConfig.IsOAuth { - planConfig.IsOAuth = utils.Pointer(false) - } - if planConfig.UsesTableApi == nil { - planConfig.UsesTableApi = utils.Pointer(true) - } - customJSON, err := json.Marshal(planConfig) - if err != nil { - return "", err - } - return string(customJSON), nil -} - -func connectorConfigWithDefaultsServicenowItom(plan string) (string, error) { - var custom connectors.ConfigPropertiesServicenowItom - if err := json.Unmarshal([]byte(plan), &custom); err != nil { - return "", err - } - if custom.IsOAuth == nil { - custom.IsOAuth = utils.Pointer(false) - } - customJSON, err := json.Marshal(custom) - if err != nil { - return "", err - } - return string(customJSON), nil -} - -func connectorConfigWithDefaultsServicenowSir(plan, backend string) (string, error) { - return connectorConfigWithDefaultsServicenow(plan, backend) -} - -func connectorConfigWithDefaultsSwimlane(plan string) (string, error) { - var custom connectors.ConfigPropertiesSwimlane - if err := json.Unmarshal([]byte(plan), &custom); err != nil { - return "", err - } - if custom.Mappings == nil { - custom.Mappings = &connectors.ConfigPropertiesSwimlaneMappings{} - } - customJSON, err := json.Marshal(custom) - if err != nil { - return "", err - } - return string(customJSON), nil -} - -func connectorConfigWithDefaultsTines(plan string) (string, error) { - return plan, nil -} - -func connectorConfigWithDefaultsWebhook(plan string) (string, error) { - return plan, nil -} - -func connectorConfigWithDefaultsXmatters(plan string) (string, error) { - var custom connectors.ConfigPropertiesXmatters - if err := json.Unmarshal([]byte(plan), &custom); err != nil { - return "", err - } - if custom.UsesBasic == nil { - custom.UsesBasic = utils.Pointer(true) - } - customJSON, err := json.Marshal(custom) - if err != nil { - return "", err - } - return string(customJSON), nil -} - -func createConnectorRequestBody(connector models.KibanaActionConnector) (io.Reader, error) { - switch connectors.ConnectorTypes(connector.ConnectorTypeID) { - - case connectors.ConnectorTypesDotCasesWebhook: - return createConnectorRequestCasesWebhook(connector) - - case connectors.ConnectorTypesDotEmail: - return createConnectorRequestEmail(connector) - - case connectors.ConnectorTypesDotGemini: - return createConnectorRequestGemini(connector) - - case connectors.ConnectorTypesDotIndex: - return createConnectorRequestIndex(connector) - - case connectors.ConnectorTypesDotJira: - return createConnectorRequestJira(connector) - - case connectors.ConnectorTypesDotOpsgenie: - return createConnectorRequestOpsgenie(connector) - - case connectors.ConnectorTypesDotPagerduty: - return createConnectorRequestPagerduty(connector) - - case connectors.ConnectorTypesDotResilient: - return createConnectorRequestResilient(connector) - - case connectors.ConnectorTypesDotServicenow: - return createConnectorRequestServicenow(connector) - - case connectors.ConnectorTypesDotServicenowItom: - return createConnectorRequestServicenowItom(connector) - - case connectors.ConnectorTypesDotServicenowSir: - return createConnectorRequestServicenowSir(connector) - - case connectors.ConnectorTypesDotServerLog: - return createConnectorRequestServerLog(connector) - - case connectors.ConnectorTypesDotSlack: - return createConnectorRequestSlack(connector) - - case connectors.ConnectorTypesDotSlackApi: - return createConnectorRequestSlackApi(connector) - - case connectors.ConnectorTypesDotSwimlane: - return createConnectorRequestSwimlane(connector) - - case connectors.ConnectorTypesDotTeams: - return createConnectorRequestTeams(connector) - - case connectors.ConnectorTypesDotTines: - return createConnectorRequestTines(connector) - - case connectors.ConnectorTypesDotWebhook: - return createConnectorRequestWebhook(connector) - - case connectors.ConnectorTypesDotXmatters: - return createConnectorRequestXmatters(connector) - } - - return nil, fmt.Errorf("unknown connector type [%s]", connector.ConnectorTypeID) -} - -func updateConnectorRequestBody(connector models.KibanaActionConnector) (io.Reader, error) { - switch connectors.ConnectorTypes(connector.ConnectorTypeID) { - - case connectors.ConnectorTypesDotCasesWebhook: - return updateConnectorRequestCasesWebhook(connector) - - case connectors.ConnectorTypesDotEmail: - return updateConnectorRequestEmail(connector) - - case connectors.ConnectorTypesDotGemini: - return updateConnectorRequestGemini(connector) - - case connectors.ConnectorTypesDotIndex: - return updateConnectorRequestIndex(connector) - - case connectors.ConnectorTypesDotJira: - return updateConnectorRequestJira(connector) - - case connectors.ConnectorTypesDotOpsgenie: - return updateConnectorRequestOpsgenie(connector) - - case connectors.ConnectorTypesDotPagerduty: - return updateConnectorRequestPagerduty(connector) - - case connectors.ConnectorTypesDotResilient: - return updateConnectorRequestResilient(connector) - - case connectors.ConnectorTypesDotServicenow: - return updateConnectorRequestServicenow(connector) - - case connectors.ConnectorTypesDotServicenowItom: - return updateConnectorRequestServicenowItom(connector) - - case connectors.ConnectorTypesDotServicenowSir: - return updateConnectorRequestServicenowSir(connector) - - case connectors.ConnectorTypesDotServerLog: - return updateConnectorRequestServerlog(connector) - - case connectors.ConnectorTypesDotSlack: - return updateConnectorRequestSlack(connector) - - case connectors.ConnectorTypesDotSlackApi: - return updateConnectorRequestSlackApi(connector) - - case connectors.ConnectorTypesDotSwimlane: - return updateConnectorRequestSwimlane(connector) - - case connectors.ConnectorTypesDotTeams: - return updateConnectorRequestTeams(connector) - - case connectors.ConnectorTypesDotTines: - return updateConnectorRequestTines(connector) - - case connectors.ConnectorTypesDotWebhook: - return updateConnectorRequestWebhook(connector) - - case connectors.ConnectorTypesDotXmatters: - return updateConnectorRequestXmatters(connector) - } - - return nil, fmt.Errorf("unknown connector type [%s]", connector.ConnectorTypeID) -} - -func marshalConnectorRequest[C, S, R any](connector models.KibanaActionConnector, config *C, secrets *S, request *R) (io.Reader, error) { - if config != nil && len(connector.ConfigJSON) > 0 { - if err := json.Unmarshal([]byte(connector.ConfigJSON), config); err != nil { - return nil, fmt.Errorf("failed to unmarshal [config] attribute: %w", err) - } - } - - if secrets != nil && len(connector.SecretsJSON) > 0 { - if err := json.Unmarshal([]byte(connector.SecretsJSON), secrets); err != nil { - return nil, fmt.Errorf("failed to unmarshal [secrets] attribute: %w", err) - } - } - - bt, err := json.Marshal(request) - if err != nil { - return nil, fmt.Errorf("failed to marshal request: %w", err) - } - - return bytes.NewReader(bt), nil -} - -func createConnectorRequestCasesWebhook(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.CreateConnectorRequestCasesWebhook{ - ConnectorTypeId: connectors.DotCasesWebhook, - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func createConnectorRequestEmail(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.CreateConnectorRequestEmail{ - ConnectorTypeId: connectors.CreateConnectorRequestEmailConnectorTypeIdDotEmail, - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func createConnectorRequestGemini(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.CreateConnectorRequestGemini{ - ConnectorTypeId: connectors.CreateConnectorRequestGeminiConnectorTypeIdDotGemini, - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func createConnectorRequestIndex(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.CreateConnectorRequestIndex{ - ConnectorTypeId: connectors.CreateConnectorRequestIndexConnectorTypeIdDotIndex, - Name: connector.Name, - } - - return marshalConnectorRequest[connectors.ConfigPropertiesIndex, any](connector, &request.Config, nil, &request) -} - -func createConnectorRequestJira(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.CreateConnectorRequestJira{ - ConnectorTypeId: connectors.CreateConnectorRequestJiraConnectorTypeIdDotJira, - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func createConnectorRequestOpsgenie(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.CreateConnectorRequestOpsgenie{ - ConnectorTypeId: connectors.CreateConnectorRequestOpsgenieConnectorTypeIdDotOpsgenie, - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func createConnectorRequestPagerduty(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.CreateConnectorRequestPagerduty{ - ConnectorTypeId: connectors.CreateConnectorRequestPagerdutyConnectorTypeIdDotPagerduty, - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func createConnectorRequestResilient(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.CreateConnectorRequestResilient{ - ConnectorTypeId: connectors.CreateConnectorRequestResilientConnectorTypeIdDotResilient, - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func createConnectorRequestServicenow(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.CreateConnectorRequestServicenow{ - ConnectorTypeId: connectors.CreateConnectorRequestServicenowConnectorTypeIdDotServicenow, - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func createConnectorRequestServicenowItom(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.CreateConnectorRequestServicenowItom{ - ConnectorTypeId: connectors.CreateConnectorRequestServicenowItomConnectorTypeIdDotServicenowItom, - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func createConnectorRequestServicenowSir(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.CreateConnectorRequestServicenowSir{ - ConnectorTypeId: connectors.CreateConnectorRequestServicenowSirConnectorTypeIdDotServicenowSir, - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func createConnectorRequestServerLog(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.CreateConnectorRequestServerlog{ - ConnectorTypeId: connectors.CreateConnectorRequestServerlogConnectorTypeIdDotServerLog, - Name: connector.Name, - } - - return marshalConnectorRequest[any, any](connector, nil, nil, &request) -} - -func createConnectorRequestSlack(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.CreateConnectorRequestSlack{ - ConnectorTypeId: connectors.CreateConnectorRequestSlackConnectorTypeIdDotSlack, - Name: connector.Name, - } - - return marshalConnectorRequest[any](connector, nil, &request.Secrets, &request) -} - -func createConnectorRequestSlackApi(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.CreateConnectorRequestSlackApi{ - ConnectorTypeId: connectors.CreateConnectorRequestSlackApiConnectorTypeIdDotSlackApi, - Name: connector.Name, - } - - return marshalConnectorRequest[any](connector, nil, &request.Secrets, &request) -} - -func createConnectorRequestSwimlane(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.CreateConnectorRequestSwimlane{ - ConnectorTypeId: connectors.CreateConnectorRequestSwimlaneConnectorTypeIdDotSwimlane, - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func createConnectorRequestTeams(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.CreateConnectorRequestTeams{ - ConnectorTypeId: connectors.CreateConnectorRequestTeamsConnectorTypeIdDotTeams, - Name: connector.Name, - } - - return marshalConnectorRequest[any](connector, nil, &request.Secrets, &request) -} - -func createConnectorRequestTines(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.CreateConnectorRequestTines{ - ConnectorTypeId: connectors.CreateConnectorRequestTinesConnectorTypeIdDotTines, - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func createConnectorRequestWebhook(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.CreateConnectorRequestWebhook{ - ConnectorTypeId: connectors.CreateConnectorRequestWebhookConnectorTypeIdDotWebhook, - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func createConnectorRequestXmatters(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.CreateConnectorRequestXmatters{ - ConnectorTypeId: connectors.CreateConnectorRequestXmattersConnectorTypeIdDotXmatters, - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func updateConnectorRequestCasesWebhook(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.UpdateConnectorRequestCasesWebhook{ - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func updateConnectorRequestEmail(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.UpdateConnectorRequestEmail{ - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func updateConnectorRequestGemini(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.UpdateConnectorRequestGemini{ - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func updateConnectorRequestIndex(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.UpdateConnectorRequestIndex{ - Name: connector.Name, - } - - return marshalConnectorRequest[connectors.ConfigPropertiesIndex, any](connector, &request.Config, nil, &request) -} - -func updateConnectorRequestJira(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.UpdateConnectorRequestJira{ - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func updateConnectorRequestOpsgenie(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.UpdateConnectorRequestOpsgenie{ - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func updateConnectorRequestPagerduty(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.UpdateConnectorRequestPagerduty{ - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func updateConnectorRequestResilient(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.UpdateConnectorRequestResilient{ - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func updateConnectorRequestServicenow(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.UpdateConnectorRequestServicenow{ - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func updateConnectorRequestServicenowItom(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.UpdateConnectorRequestServicenowItom{ - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func updateConnectorRequestServicenowSir(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.UpdateConnectorRequestServicenowSir{ - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func updateConnectorRequestServerlog(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.UpdateConnectorRequestServerlog{ - Name: connector.Name, - } - - return marshalConnectorRequest[any, any](connector, nil, nil, &request) -} - -func updateConnectorRequestSlack(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.UpdateConnectorRequestSlack{ - Name: connector.Name, - } - - return marshalConnectorRequest[any](connector, nil, &request.Secrets, &request) -} - -func updateConnectorRequestSlackApi(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.UpdateConnectorRequestSlackApi{ - Name: connector.Name, - } - - return marshalConnectorRequest[any](connector, nil, &request.Secrets, &request) -} - -func updateConnectorRequestSwimlane(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.UpdateConnectorRequestSwimlane{ - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func updateConnectorRequestTeams(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.UpdateConnectorRequestTeams{ - Name: connector.Name, - } - - return marshalConnectorRequest[any](connector, nil, &request.Secrets, &request) -} - -func updateConnectorRequestTines(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.UpdateConnectorRequestTines{ - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func updateConnectorRequestWebhook(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.UpdateConnectorRequestWebhook{ - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func updateConnectorRequestXmatters(connector models.KibanaActionConnector) (io.Reader, error) { - request := connectors.UpdateConnectorRequestXmatters{ - Name: connector.Name, - } - - return marshalConnectorRequest(connector, &request.Config, &request.Secrets, &request) -} - -func connectorResponseToModel(spaceID string, properties connectors.ConnectorResponseProperties) (*models.KibanaActionConnector, error) { - discriminator, err := properties.Discriminator() - if err != nil { - return nil, err - } - - switch connectors.ConnectorTypes(discriminator) { - - case connectors.ConnectorTypesDotCasesWebhook: - return connectorResponseToModelCasesWebhook(discriminator, spaceID, properties) - - case connectors.ConnectorTypesDotEmail: - return connectorResponseToModelEmail(discriminator, spaceID, properties) - - case connectors.ConnectorTypesDotGemini: - return connectorResponseToModelGemini(discriminator, spaceID, properties) - - case connectors.ConnectorTypesDotIndex: - return connectorResponseToModelIndex(discriminator, spaceID, properties) - - case connectors.ConnectorTypesDotJira: - return connectorResponseToModelJira(discriminator, spaceID, properties) - - case connectors.ConnectorTypesDotOpsgenie: - return connectorResponseToModelOpsgenie(discriminator, spaceID, properties) - - case connectors.ConnectorTypesDotPagerduty: - return connectorResponseToModelPagerduty(discriminator, spaceID, properties) - - case connectors.ConnectorTypesDotResilient: - return connectorResponseToModelResilient(discriminator, spaceID, properties) - - case connectors.ConnectorTypesDotServerLog: - return connectorResponseToModelServerlog(discriminator, spaceID, properties) - - case connectors.ConnectorTypesDotServicenow: - return connectorResponseToModelServicenow(discriminator, spaceID, properties) - - case connectors.ConnectorTypesDotServicenowItom: - return connectorResponseToModelServicenowItom(discriminator, spaceID, properties) - - case connectors.ConnectorTypesDotServicenowSir: - return connectorResponseToModelServicenowSir(discriminator, spaceID, properties) - - case connectors.ConnectorTypesDotSlack: - return connectorResponseToModelSlack(discriminator, spaceID, properties) - - case connectors.ConnectorTypesDotSlackApi: - return connectorResponseToModelSlackApi(discriminator, spaceID, properties) - - case connectors.ConnectorTypesDotSwimlane: - return connectorResponseToModelSwimlane(discriminator, spaceID, properties) - - case connectors.ConnectorTypesDotTeams: - return connectorResponseToModelTeams(discriminator, spaceID, properties) - - case connectors.ConnectorTypesDotTines: - return connectorResponseToModelTines(discriminator, spaceID, properties) - - case connectors.ConnectorTypesDotWebhook: - return connectorResponseToModelWebhook(discriminator, spaceID, properties) - - case connectors.ConnectorTypesDotXmatters: - return connectorResponseToModelXmatters(discriminator, spaceID, properties) - } - - return nil, fmt.Errorf("unknown connector type [%s]", discriminator) -} - -func connectorResponseToModelCasesWebhook(discriminator, spaceID string, properties connectors.ConnectorResponseProperties) (*models.KibanaActionConnector, error) { - resp, err := properties.AsConnectorResponsePropertiesCasesWebhook() - if err != nil { - return nil, err - } - - config, err := json.Marshal(resp.Config) - if err != nil { - return nil, fmt.Errorf("unable to marshal config: %w", err) - } - - isDeprecated := false - isMissingSecrets := false - - if resp.IsDeprecated != nil { - isDeprecated = *resp.IsDeprecated - } - - if resp.IsMissingSecrets != nil { - isMissingSecrets = *resp.IsMissingSecrets - } - - connector := models.KibanaActionConnector{ - ConnectorID: resp.Id, - SpaceID: spaceID, - Name: resp.Name, - ConnectorTypeID: discriminator, - IsDeprecated: isDeprecated, - IsMissingSecrets: isMissingSecrets, - IsPreconfigured: bool(resp.IsPreconfigured), - ConfigJSON: string(config), - } - - return &connector, nil -} - -func connectorResponseToModelEmail(discriminator, spaceID string, properties connectors.ConnectorResponseProperties) (*models.KibanaActionConnector, error) { - resp, err := properties.AsConnectorResponsePropertiesEmail() - if err != nil { - return nil, err - } - - config, err := json.Marshal(resp.Config) - if err != nil { - return nil, fmt.Errorf("unable to marshal config: %w", err) - } - - isDeprecated := false - isMissingSecrets := false - - if resp.IsDeprecated != nil { - isDeprecated = *resp.IsDeprecated - } - - if resp.IsMissingSecrets != nil { - isMissingSecrets = *resp.IsMissingSecrets - } - - connector := models.KibanaActionConnector{ - ConnectorID: resp.Id, - SpaceID: spaceID, - Name: resp.Name, - ConnectorTypeID: discriminator, - IsDeprecated: isDeprecated, - IsMissingSecrets: isMissingSecrets, - IsPreconfigured: bool(resp.IsPreconfigured), - ConfigJSON: string(config), - } - - return &connector, nil -} - -func connectorResponseToModelGemini(discriminator, spaceID string, properties connectors.ConnectorResponseProperties) (*models.KibanaActionConnector, error) { - resp, err := properties.AsConnectorResponsePropertiesGemini() - if err != nil { - return nil, err - } - - config, err := json.Marshal(resp.Config) - if err != nil { - return nil, fmt.Errorf("unable to marshal config: %w", err) - } - - isDeprecated := false - isMissingSecrets := false - - if resp.IsDeprecated != nil { - isDeprecated = *resp.IsDeprecated - } - - if resp.IsMissingSecrets != nil { - isMissingSecrets = *resp.IsMissingSecrets - } - - connector := models.KibanaActionConnector{ - ConnectorID: resp.Id, - SpaceID: spaceID, - Name: resp.Name, - ConnectorTypeID: discriminator, - IsDeprecated: isDeprecated, - IsMissingSecrets: isMissingSecrets, - IsPreconfigured: bool(resp.IsPreconfigured), - ConfigJSON: string(config), - } - - return &connector, nil -} - -func connectorResponseToModelIndex(discriminator, spaceID string, properties connectors.ConnectorResponseProperties) (*models.KibanaActionConnector, error) { - resp, err := properties.AsConnectorResponsePropertiesIndex() - if err != nil { - return nil, err - } - - config, err := json.Marshal(resp.Config) - if err != nil { - return nil, fmt.Errorf("unable to marshal config: %w", err) - } - - isDeprecated := false - isMissingSecrets := false - - if resp.IsDeprecated != nil { - isDeprecated = *resp.IsDeprecated - } - - if resp.IsMissingSecrets != nil { - isMissingSecrets = *resp.IsMissingSecrets - } - - connector := models.KibanaActionConnector{ - ConnectorID: resp.Id, - SpaceID: spaceID, - Name: resp.Name, - ConnectorTypeID: discriminator, - IsDeprecated: isDeprecated, - IsMissingSecrets: isMissingSecrets, - IsPreconfigured: bool(resp.IsPreconfigured), - ConfigJSON: string(config), - } - - return &connector, nil -} - -func connectorResponseToModelJira(discriminator, spaceID string, properties connectors.ConnectorResponseProperties) (*models.KibanaActionConnector, error) { - resp, err := properties.AsConnectorResponsePropertiesJira() - if err != nil { - return nil, err - } - - config, err := json.Marshal(resp.Config) - if err != nil { - return nil, fmt.Errorf("unable to marshal config: %w", err) - } - - isDeprecated := false - isMissingSecrets := false - - if resp.IsDeprecated != nil { - isDeprecated = *resp.IsDeprecated - } - - if resp.IsMissingSecrets != nil { - isMissingSecrets = *resp.IsMissingSecrets - } - - connector := models.KibanaActionConnector{ - ConnectorID: resp.Id, - SpaceID: spaceID, - Name: resp.Name, - ConnectorTypeID: discriminator, - IsDeprecated: isDeprecated, - IsMissingSecrets: isMissingSecrets, - IsPreconfigured: bool(resp.IsPreconfigured), - ConfigJSON: string(config), - } - - return &connector, nil -} - -func connectorResponseToModelOpsgenie(discriminator, spaceID string, properties connectors.ConnectorResponseProperties) (*models.KibanaActionConnector, error) { - resp, err := properties.AsConnectorResponsePropertiesOpsgenie() - if err != nil { - return nil, err - } - - config, err := json.Marshal(resp.Config) - if err != nil { - return nil, fmt.Errorf("unable to marshal config: %w", err) - } - - isDeprecated := false - isMissingSecrets := false - - if resp.IsDeprecated != nil { - isDeprecated = *resp.IsDeprecated - } - - if resp.IsMissingSecrets != nil { - isMissingSecrets = *resp.IsMissingSecrets - } - - connector := models.KibanaActionConnector{ - ConnectorID: resp.Id, - SpaceID: spaceID, - Name: resp.Name, - ConnectorTypeID: discriminator, - IsDeprecated: isDeprecated, - IsMissingSecrets: isMissingSecrets, - IsPreconfigured: bool(resp.IsPreconfigured), - ConfigJSON: string(config), - } - - return &connector, nil -} - -func connectorResponseToModelPagerduty(discriminator, spaceID string, properties connectors.ConnectorResponseProperties) (*models.KibanaActionConnector, error) { - resp, err := properties.AsConnectorResponsePropertiesPagerduty() - if err != nil { - return nil, err - } - - config, err := json.Marshal(resp.Config) - if err != nil { - return nil, fmt.Errorf("unable to marshal config: %w", err) - } - - isDeprecated := false - isMissingSecrets := false - - if resp.IsDeprecated != nil { - isDeprecated = *resp.IsDeprecated - } - - if resp.IsMissingSecrets != nil { - isMissingSecrets = *resp.IsMissingSecrets - } - - connector := models.KibanaActionConnector{ - ConnectorID: resp.Id, - SpaceID: spaceID, - Name: resp.Name, - ConnectorTypeID: discriminator, - IsDeprecated: isDeprecated, - IsMissingSecrets: isMissingSecrets, - IsPreconfigured: bool(resp.IsPreconfigured), - ConfigJSON: string(config), - } - - return &connector, nil -} - -func connectorResponseToModelResilient(discriminator, spaceID string, properties connectors.ConnectorResponseProperties) (*models.KibanaActionConnector, error) { - resp, err := properties.AsConnectorResponsePropertiesResilient() - if err != nil { - return nil, err - } - - config, err := json.Marshal(resp.Config) - if err != nil { - return nil, fmt.Errorf("unable to marshal config: %w", err) - } - - isDeprecated := false - isMissingSecrets := false - - if resp.IsDeprecated != nil { - isDeprecated = *resp.IsDeprecated - } - - if resp.IsMissingSecrets != nil { - isMissingSecrets = *resp.IsMissingSecrets - } - - connector := models.KibanaActionConnector{ - ConnectorID: resp.Id, - SpaceID: spaceID, - Name: resp.Name, - ConnectorTypeID: discriminator, - IsDeprecated: isDeprecated, - IsMissingSecrets: isMissingSecrets, - IsPreconfigured: bool(resp.IsPreconfigured), - ConfigJSON: string(config), - } - - return &connector, nil -} - -func connectorResponseToModelServerlog(discriminator, spaceID string, properties connectors.ConnectorResponseProperties) (*models.KibanaActionConnector, error) { - resp, err := properties.AsConnectorResponsePropertiesServerlog() - if err != nil { - return nil, err - } - - config, err := json.Marshal(resp.Config) - if err != nil { - return nil, fmt.Errorf("unable to marshal config: %w", err) - } - - isDeprecated := false - isMissingSecrets := false - - if resp.IsDeprecated != nil { - isDeprecated = *resp.IsDeprecated - } - - if resp.IsMissingSecrets != nil { - isMissingSecrets = *resp.IsMissingSecrets - } - - connector := models.KibanaActionConnector{ - ConnectorID: resp.Id, - SpaceID: spaceID, - Name: resp.Name, - ConnectorTypeID: discriminator, - IsDeprecated: isDeprecated, - IsMissingSecrets: isMissingSecrets, - IsPreconfigured: bool(resp.IsPreconfigured), - ConfigJSON: string(config), - } - - return &connector, nil -} - -func connectorResponseToModelServicenow(discriminator, spaceID string, properties connectors.ConnectorResponseProperties) (*models.KibanaActionConnector, error) { - resp, err := properties.AsConnectorResponsePropertiesServicenow() - if err != nil { - return nil, err - } - - config, err := json.Marshal(resp.Config) - if err != nil { - return nil, fmt.Errorf("unable to marshal config: %w", err) - } - - isDeprecated := false - isMissingSecrets := false - - if resp.IsDeprecated != nil { - isDeprecated = *resp.IsDeprecated - } - - if resp.IsMissingSecrets != nil { - isMissingSecrets = *resp.IsMissingSecrets - } - - connector := models.KibanaActionConnector{ - ConnectorID: resp.Id, - SpaceID: spaceID, - Name: resp.Name, - ConnectorTypeID: discriminator, - IsDeprecated: isDeprecated, - IsMissingSecrets: isMissingSecrets, - IsPreconfigured: bool(resp.IsPreconfigured), - ConfigJSON: string(config), - } - - return &connector, nil -} - -func connectorResponseToModelServicenowItom(discriminator, spaceID string, properties connectors.ConnectorResponseProperties) (*models.KibanaActionConnector, error) { - resp, err := properties.AsConnectorResponsePropertiesServicenowItom() - if err != nil { - return nil, err - } - - config, err := json.Marshal(resp.Config) - if err != nil { - return nil, fmt.Errorf("unable to marshal config: %w", err) - } - - isDeprecated := false - isMissingSecrets := false - - if resp.IsDeprecated != nil { - isDeprecated = *resp.IsDeprecated - } - - if resp.IsMissingSecrets != nil { - isMissingSecrets = *resp.IsMissingSecrets - } - - connector := models.KibanaActionConnector{ - ConnectorID: resp.Id, - SpaceID: spaceID, - Name: resp.Name, - ConnectorTypeID: discriminator, - IsDeprecated: isDeprecated, - IsMissingSecrets: isMissingSecrets, - IsPreconfigured: bool(resp.IsPreconfigured), - ConfigJSON: string(config), - } - - return &connector, nil -} - -func connectorResponseToModelServicenowSir(discriminator, spaceID string, properties connectors.ConnectorResponseProperties) (*models.KibanaActionConnector, error) { - resp, err := properties.AsConnectorResponsePropertiesServicenowSir() - if err != nil { - return nil, err - } - - config, err := json.Marshal(resp.Config) - if err != nil { - return nil, fmt.Errorf("unable to marshal config: %w", err) - } - - isDeprecated := false - isMissingSecrets := false - - if resp.IsDeprecated != nil { - isDeprecated = *resp.IsDeprecated - } - - if resp.IsMissingSecrets != nil { - isMissingSecrets = *resp.IsMissingSecrets - } - - connector := models.KibanaActionConnector{ - ConnectorID: resp.Id, - SpaceID: spaceID, - Name: resp.Name, - ConnectorTypeID: discriminator, - IsDeprecated: isDeprecated, - IsMissingSecrets: isMissingSecrets, - IsPreconfigured: bool(resp.IsPreconfigured), - ConfigJSON: string(config), - } - - return &connector, nil -} - -func connectorResponseToModelSlack(discriminator, spaceID string, properties connectors.ConnectorResponseProperties) (*models.KibanaActionConnector, error) { - resp, err := properties.AsConnectorResponsePropertiesSlack() - if err != nil { - return nil, err - } - - isDeprecated := false - isMissingSecrets := false - - if resp.IsDeprecated != nil { - isDeprecated = *resp.IsDeprecated - } - - if resp.IsMissingSecrets != nil { - isMissingSecrets = *resp.IsMissingSecrets - } - - connector := models.KibanaActionConnector{ - ConnectorID: resp.Id, - SpaceID: spaceID, - Name: resp.Name, - ConnectorTypeID: discriminator, - IsDeprecated: isDeprecated, - IsMissingSecrets: isMissingSecrets, - IsPreconfigured: bool(resp.IsPreconfigured), - } - - return &connector, nil -} - -func connectorResponseToModelSlackApi(discriminator, spaceID string, properties connectors.ConnectorResponseProperties) (*models.KibanaActionConnector, error) { - resp, err := properties.AsConnectorResponsePropertiesSlackApi() - if err != nil { - return nil, err - } - - isDeprecated := false - isMissingSecrets := false - - if resp.IsDeprecated != nil { - isDeprecated = *resp.IsDeprecated - } - - if resp.IsMissingSecrets != nil { - isMissingSecrets = *resp.IsMissingSecrets - } - - connector := models.KibanaActionConnector{ - ConnectorID: resp.Id, - SpaceID: spaceID, - Name: resp.Name, - ConnectorTypeID: discriminator, - IsDeprecated: isDeprecated, - IsMissingSecrets: isMissingSecrets, - IsPreconfigured: bool(resp.IsPreconfigured), - } - - return &connector, nil -} - -func connectorResponseToModelSwimlane(discriminator, spaceID string, properties connectors.ConnectorResponseProperties) (*models.KibanaActionConnector, error) { - resp, err := properties.AsConnectorResponsePropertiesSwimlane() - if err != nil { - return nil, err - } - - config, err := json.Marshal(resp.Config) - if err != nil { - return nil, fmt.Errorf("unable to marshal config: %w", err) - } - - isDeprecated := false - isMissingSecrets := false - - if resp.IsDeprecated != nil { - isDeprecated = *resp.IsDeprecated - } - - if resp.IsMissingSecrets != nil { - isMissingSecrets = *resp.IsMissingSecrets - } - - connector := models.KibanaActionConnector{ - ConnectorID: resp.Id, - SpaceID: spaceID, - Name: resp.Name, - ConnectorTypeID: discriminator, - IsDeprecated: isDeprecated, - IsMissingSecrets: isMissingSecrets, - IsPreconfigured: bool(resp.IsPreconfigured), - ConfigJSON: string(config), - } - - return &connector, nil -} - -func connectorResponseToModelTeams(discriminator, spaceID string, properties connectors.ConnectorResponseProperties) (*models.KibanaActionConnector, error) { - resp, err := properties.AsConnectorResponsePropertiesTeams() - if err != nil { - return nil, err - } - - isDeprecated := false - isMissingSecrets := false - - if resp.IsDeprecated != nil { - isDeprecated = *resp.IsDeprecated - } - - if resp.IsMissingSecrets != nil { - isMissingSecrets = *resp.IsMissingSecrets - } - - connector := models.KibanaActionConnector{ - ConnectorID: resp.Id, - SpaceID: spaceID, - Name: resp.Name, - ConnectorTypeID: discriminator, - IsDeprecated: isDeprecated, - IsMissingSecrets: isMissingSecrets, - IsPreconfigured: bool(resp.IsPreconfigured), - } - - return &connector, nil -} - -func connectorResponseToModelTines(discriminator, spaceID string, properties connectors.ConnectorResponseProperties) (*models.KibanaActionConnector, error) { - resp, err := properties.AsConnectorResponsePropertiesTines() - if err != nil { - return nil, err - } - - config, err := json.Marshal(resp.Config) - if err != nil { - return nil, fmt.Errorf("unable to marshal config: %w", err) - } - - isDeprecated := false - isMissingSecrets := false - - if resp.IsDeprecated != nil { - isDeprecated = *resp.IsDeprecated - } - - if resp.IsMissingSecrets != nil { - isMissingSecrets = *resp.IsMissingSecrets - } - - connector := models.KibanaActionConnector{ - ConnectorID: resp.Id, - SpaceID: spaceID, - Name: resp.Name, - ConnectorTypeID: discriminator, - IsDeprecated: isDeprecated, - IsMissingSecrets: isMissingSecrets, - IsPreconfigured: bool(resp.IsPreconfigured), - ConfigJSON: string(config), - } - - return &connector, nil -} - -func connectorResponseToModelWebhook(discriminator, spaceID string, properties connectors.ConnectorResponseProperties) (*models.KibanaActionConnector, error) { - resp, err := properties.AsConnectorResponsePropertiesWebhook() - if err != nil { - return nil, err - } - - config, err := json.Marshal(resp.Config) - if err != nil { - return nil, fmt.Errorf("unable to marshal config: %w", err) - } - - isDeprecated := false - isMissingSecrets := false - - if resp.IsDeprecated != nil { - isDeprecated = *resp.IsDeprecated - } - - if resp.IsMissingSecrets != nil { - isMissingSecrets = *resp.IsMissingSecrets - } - - connector := models.KibanaActionConnector{ - ConnectorID: resp.Id, - SpaceID: spaceID, - Name: resp.Name, - ConnectorTypeID: discriminator, - IsDeprecated: isDeprecated, - IsMissingSecrets: isMissingSecrets, - IsPreconfigured: bool(resp.IsPreconfigured), - ConfigJSON: string(config), - } - - return &connector, nil -} - -func connectorResponseToModelXmatters(discriminator, spaceID string, properties connectors.ConnectorResponseProperties) (*models.KibanaActionConnector, error) { - resp, err := properties.AsConnectorResponsePropertiesXmatters() - if err != nil { - return nil, err - } - - config, err := json.Marshal(resp.Config) - if err != nil { - return nil, fmt.Errorf("unable to marshal config: %w", err) - } - - isDeprecated := false - isMissingSecrets := false - - if resp.IsDeprecated != nil { - isDeprecated = *resp.IsDeprecated - } - - if resp.IsMissingSecrets != nil { - isMissingSecrets = *resp.IsMissingSecrets - } - - connector := models.KibanaActionConnector{ - ConnectorID: resp.Id, - SpaceID: spaceID, - Name: resp.Name, - ConnectorTypeID: discriminator, - IsDeprecated: isDeprecated, - IsMissingSecrets: isMissingSecrets, - IsPreconfigured: bool(resp.IsPreconfigured), - ConfigJSON: string(config), - } - - return &connector, nil -} diff --git a/internal/clients/kibana/connector_test.go b/internal/clients/kibana/connector_test.go deleted file mode 100644 index 44a352fc2..000000000 --- a/internal/clients/kibana/connector_test.go +++ /dev/null @@ -1,256 +0,0 @@ -package kibana - -import ( - "context" - "encoding/json" - "fmt" - "net/http" - "net/http/httptest" - "os" - "testing" - - "github.com/elastic/terraform-provider-elasticstack/generated/connectors" - "github.com/elastic/terraform-provider-elasticstack/internal/clients" - "github.com/elastic/terraform-provider-elasticstack/internal/models" - "github.com/stretchr/testify/require" -) - -func Test_connectorResponseToModel(t *testing.T) { - type testCase struct { - name string - spaceId string - response connectors.ConnectorResponseProperties - expectedModel *models.KibanaActionConnector - expectedError error - } - - generator := func(connectorTypeID string, config any, propertiesGenerator func(*connectors.ConnectorResponseProperties) error) testCase { - return testCase{ - name: fmt.Sprintf("it should parse empty [%s] connector", connectorTypeID), - spaceId: "test", - response: func() connectors.ConnectorResponseProperties { - var properties connectors.ConnectorResponseProperties - err := propertiesGenerator(&properties) - require.Nil(t, err) - return properties - }(), - expectedModel: &models.KibanaActionConnector{ - SpaceID: "test", - ConnectorTypeID: connectorTypeID, - ConfigJSON: func() string { - if config == nil { - return "" - } - byt, err := json.Marshal(config) - require.Nil(t, err) - return string(byt) - }(), - }, - } - } - tests := []testCase{ - { - name: "it should fail if discriminator is unknown", - response: func() connectors.ConnectorResponseProperties { - discriminator := struct { - Discriminator string `json:"connector_type_id"` - }{"unknown-value"} - byt, err := json.Marshal(discriminator) - require.Nil(t, err) - var resp connectors.ConnectorResponseProperties - err = resp.UnmarshalJSON(byt) - require.Nil(t, err) - return resp - }(), - expectedError: func() error { return fmt.Errorf("unknown connector type [unknown-value]") }(), - }, - generator(".cases-webhook", connectors.ConfigPropertiesCasesWebhook{}, func(props *connectors.ConnectorResponseProperties) error { - return props.FromConnectorResponsePropertiesCasesWebhook(connectors.ConnectorResponsePropertiesCasesWebhook{}) - }), - generator(".email", connectors.ConfigPropertiesEmail{}, func(props *connectors.ConnectorResponseProperties) error { - return props.FromConnectorResponsePropertiesEmail(connectors.ConnectorResponsePropertiesEmail{}) - }), - generator(".gemini", connectors.ConfigPropertiesGemini{}, func(props *connectors.ConnectorResponseProperties) error { - return props.FromConnectorResponsePropertiesGemini(connectors.ConnectorResponsePropertiesGemini{}) - }), - generator(".index", connectors.ConfigPropertiesIndex{}, func(props *connectors.ConnectorResponseProperties) error { - return props.FromConnectorResponsePropertiesIndex(connectors.ConnectorResponsePropertiesIndex{}) - }), - generator(".jira", connectors.ConfigPropertiesJira{}, func(props *connectors.ConnectorResponseProperties) error { - return props.FromConnectorResponsePropertiesJira(connectors.ConnectorResponsePropertiesJira{}) - }), - generator(".opsgenie", connectors.ConfigPropertiesOpsgenie{}, func(props *connectors.ConnectorResponseProperties) error { - return props.FromConnectorResponsePropertiesOpsgenie(connectors.ConnectorResponsePropertiesOpsgenie{}) - }), - generator(".pagerduty", connectors.ConfigPropertiesPagerduty{}, func(props *connectors.ConnectorResponseProperties) error { - return props.FromConnectorResponsePropertiesPagerduty(connectors.ConnectorResponsePropertiesPagerduty{}) - }), - generator(".resilient", connectors.ConfigPropertiesResilient{}, func(props *connectors.ConnectorResponseProperties) error { - return props.FromConnectorResponsePropertiesResilient(connectors.ConnectorResponsePropertiesResilient{}) - }), - generator(".server-log", map[string]interface{}{}, func(props *connectors.ConnectorResponseProperties) error { - return props.FromConnectorResponsePropertiesServerlog(connectors.ConnectorResponsePropertiesServerlog{ - Config: &map[string]interface{}{}, - }) - }), - generator(".servicenow", connectors.ConfigPropertiesServicenow{}, func(props *connectors.ConnectorResponseProperties) error { - return props.FromConnectorResponsePropertiesServicenow(connectors.ConnectorResponsePropertiesServicenow{}) - }), - generator(".servicenow-itom", connectors.ConfigPropertiesServicenowItom{}, func(props *connectors.ConnectorResponseProperties) error { - return props.FromConnectorResponsePropertiesServicenowItom(connectors.ConnectorResponsePropertiesServicenowItom{}) - }), - generator(".servicenow-sir", connectors.ConfigPropertiesServicenow{}, func(props *connectors.ConnectorResponseProperties) error { - return props.FromConnectorResponsePropertiesServicenowSir(connectors.ConnectorResponsePropertiesServicenowSir{}) - }), - generator(".slack", nil, func(props *connectors.ConnectorResponseProperties) error { - return props.FromConnectorResponsePropertiesSlack(connectors.ConnectorResponsePropertiesSlack{}) - }), - generator(".slack_api", nil, func(props *connectors.ConnectorResponseProperties) error { - return props.FromConnectorResponsePropertiesSlackApi(connectors.ConnectorResponsePropertiesSlackApi{}) - }), - generator(".swimlane", connectors.ConfigPropertiesSwimlane{}, func(props *connectors.ConnectorResponseProperties) error { - return props.FromConnectorResponsePropertiesSwimlane(connectors.ConnectorResponsePropertiesSwimlane{}) - }), - generator(".teams", nil, func(props *connectors.ConnectorResponseProperties) error { - return props.FromConnectorResponsePropertiesTeams(connectors.ConnectorResponsePropertiesTeams{}) - }), - generator(".tines", connectors.ConfigPropertiesTines{}, func(props *connectors.ConnectorResponseProperties) error { - return props.FromConnectorResponsePropertiesTines(connectors.ConnectorResponsePropertiesTines{}) - }), - generator(".webhook", connectors.ConfigPropertiesWebhook{}, func(props *connectors.ConnectorResponseProperties) error { - return props.FromConnectorResponsePropertiesWebhook(connectors.ConnectorResponsePropertiesWebhook{}) - }), - generator(".xmatters", connectors.ConfigPropertiesXmatters{}, func(props *connectors.ConnectorResponseProperties) error { - return props.FromConnectorResponsePropertiesXmatters(connectors.ConnectorResponsePropertiesXmatters{}) - }), - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - model, err := connectorResponseToModel(tt.spaceId, tt.response) - - if tt.expectedError == nil { - require.Nil(t, err) - require.Equal(t, tt.expectedModel, model) - } else { - require.Equal(t, tt.expectedError, err) - } - }) - } -} - -func TestGetConnectorByName(t *testing.T) { - const getConnectorsResponse = `[ - { - "id": "c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad", - "connector_type_id": ".index", - "name": "my-connector", - "config": { - "index": "test-index", - "refresh": false, - "executionTimeField": null - }, - "is_preconfigured": false, - "is_deprecated": false, - "is_missing_secrets": false, - "referenced_by_count": 3 - }, - { - "id": "d55b6eb0-6bad-11eb-9f3b-611eebc6c3ad", - "connector_type_id": ".index", - "name": "doubledup-connector", - "config": { - "index": "test-index", - "refresh": false, - "executionTimeField": null - }, - "is_preconfigured": false, - "is_deprecated": false, - "is_missing_secrets": false, - "referenced_by_count": 3 - }, - { - "id": "855b6eb0-6bad-11eb-9f3b-611eebc6c3ad", - "connector_type_id": ".index", - "name": "doubledup-connector", - "config": { - "index": "test-index", - "refresh": false, - "executionTimeField": null - }, - "is_preconfigured": false, - "is_deprecated": false, - "is_missing_secrets": false, - "referenced_by_count": 0 - } - ]` - - const emptyConnectorsResponse = `[]` - - var requests []*http.Request - var mockResponses []string - var httpStatus int - server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { - requests = append(requests, req) - - if len(mockResponses) > 0 { - r := []byte(mockResponses[0]) - rw.Header().Add("X-Elastic-Product", "Elasticsearch") - rw.Header().Add("Content-Type", "application/json") - rw.WriteHeader(httpStatus) - _, err := rw.Write(r) - require.NoError(t, err) - mockResponses = mockResponses[1:] - } else { - t.Fatalf("Unexpected request: %s %s", req.Method, req.URL.Path) - } - })) - defer server.Close() - - httpStatus = http.StatusOK - mockResponses = append(mockResponses, getConnectorsResponse) - - err := os.Setenv("ELASTICSEARCH_URL", server.URL) - require.NoError(t, err) - err = os.Setenv("KIBANA_ENDPOINT", server.URL) - require.NoError(t, err) - - apiClient, err := clients.NewAcceptanceTestingClient() - require.NoError(t, err) - - connector, diags := SearchConnectors(context.Background(), apiClient, "my-connector", "default", "") - require.Nil(t, diags) - require.NotNil(t, connector) - - mockResponses = append(mockResponses, getConnectorsResponse) - failConnector, diags := SearchConnectors(context.Background(), apiClient, "failwhale", "default", "") - require.Nil(t, diags) - require.Empty(t, failConnector) - - mockResponses = append(mockResponses, getConnectorsResponse) - dupConnector, diags := SearchConnectors(context.Background(), apiClient, "doubledup-connector", "default", "") - require.Nil(t, diags) - require.Len(t, dupConnector, 2) - - mockResponses = append(mockResponses, getConnectorsResponse) - wrongConnectorType, diags := SearchConnectors(context.Background(), apiClient, "my-connector", "default", ".slack") - require.Nil(t, diags) - require.Empty(t, wrongConnectorType) - - mockResponses = append(mockResponses, getConnectorsResponse) - successConnector, diags := SearchConnectors(context.Background(), apiClient, "my-connector", "default", ".index") - require.Nil(t, diags) - require.Len(t, successConnector, 1) - - mockResponses = append(mockResponses, emptyConnectorsResponse) - emptyConnector, diags := SearchConnectors(context.Background(), apiClient, "my-connector", "default", "") - require.Nil(t, diags) - require.Empty(t, emptyConnector) - - httpStatus = http.StatusBadGateway - mockResponses = append(mockResponses, emptyConnectorsResponse) - fail, diags := SearchConnectors(context.Background(), apiClient, "my-connector", "default", "") - require.NotNil(t, diags) - require.Nil(t, fail) - -} diff --git a/internal/clients/kibana_oapi/connector.go b/internal/clients/kibana_oapi/connector.go new file mode 100644 index 000000000..af6177773 --- /dev/null +++ b/internal/clients/kibana_oapi/connector.go @@ -0,0 +1,513 @@ +package kibana_oapi + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "net/http" + "strings" + + "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" + "github.com/elastic/terraform-provider-elasticstack/internal/models" + "github.com/elastic/terraform-provider-elasticstack/internal/utils" + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" +) + +func CreateConnector(ctx context.Context, client *Client, connectorOld models.KibanaActionConnector) (string, diag.Diagnostics) { + body, err := createConnectorRequestBody(connectorOld) + if err != nil { + return "", diag.FromErr(err) + } + + resp, err := client.API.PostActionsConnectorIdWithResponse( + ctx, connectorOld.SpaceID, connectorOld.ConnectorID, body, + // When there isn't an explicit connector ID the request path will include a trailing slash + // Kibana 8.7 and lower return a 404 for such request paths, whilst 8.8+ correctly handle then empty ID parameter + // This request editor ensures that the trailing slash is removed allowing all supported + // Stack versions to correctly create connectors without an explicit ID + func(ctx context.Context, req *http.Request) error { + if connectorOld.ConnectorID == "" { + req.URL.Path = strings.TrimRight(req.URL.Path, "/") + } + return nil + }, + ) + if err != nil { + return "", diag.FromErr(err) + } + + switch resp.StatusCode() { + case http.StatusOK: + return resp.JSON200.Id, nil + default: + return "", reportUnknownErrorSDK(resp.StatusCode(), resp.Body) + } +} + +func UpdateConnector(ctx context.Context, client *Client, connectorOld models.KibanaActionConnector) (string, diag.Diagnostics) { + body, err := updateConnectorRequestBody(connectorOld) + if err != nil { + return "", diag.FromErr(err) + } + + resp, err := client.API.PutActionsConnectorIdWithResponse(ctx, connectorOld.SpaceID, connectorOld.ConnectorID, body) + if err != nil { + return "", diag.Errorf("unable to update connector: [%v]", err) + } + + switch resp.StatusCode() { + case http.StatusOK: + return resp.JSON200.Id, nil + default: + return "", reportUnknownErrorSDK(resp.StatusCode(), resp.Body) + } +} + +func GetConnector(ctx context.Context, client *Client, connectorID, spaceID string) (*models.KibanaActionConnector, diag.Diagnostics) { + resp, err := client.API.GetActionsConnectorIdWithResponse(ctx, spaceID, connectorID) + if err != nil { + return nil, diag.Errorf("unable to get connector: [%v]", err) + } + + switch resp.StatusCode() { + case http.StatusOK: + return ConnectorResponseToModel(spaceID, resp.JSON200) + case http.StatusNotFound: + return nil, nil + default: + return nil, reportUnknownErrorSDK(resp.StatusCode(), resp.Body) + } +} + +func SearchConnectors(ctx context.Context, client *Client, connectorName, spaceID, connectorTypeID string) ([]*models.KibanaActionConnector, diag.Diagnostics) { + resp, err := client.API.GetActionsConnectorsWithResponse(ctx, spaceID) + if err != nil { + return nil, diag.Errorf("unable to get connectors: [%v]", err) + } + + if resp.StatusCode() != http.StatusOK { + return nil, reportUnknownErrorSDK(resp.StatusCode(), resp.Body) + } + + foundConnectors := []*models.KibanaActionConnector{} + for _, connector := range *resp.JSON200 { + if connector.Name != connectorName { + continue + } + + if connectorTypeID != "" && connector.ConnectorTypeId != connectorTypeID { + continue + } + + c, diags := ConnectorResponseToModel(spaceID, &connector) + if diags.HasError() { + return nil, diags + } + + foundConnectors = append(foundConnectors, c) + } + if len(foundConnectors) == 0 { + tflog.Debug(ctx, fmt.Sprintf("no connectors found with name [%s/%s] and type [%s]", spaceID, connectorName, connectorTypeID)) + } + + return foundConnectors, nil +} + +func ConnectorResponseToModel(spaceID string, connector *kbapi.ConnectorResponse) (*models.KibanaActionConnector, diag.Diagnostics) { + if connector == nil { + return nil, diag.Errorf("connector response is nil") + } + + var configJSON []byte + if connector.Config != nil { + configMap := *connector.Config + for k, v := range configMap { + if v == nil { + delete(configMap, k) + } + } + + var err error + configJSON, err = json.Marshal(configMap) + if err != nil { + return nil, diag.Errorf("unable to marshal config: %v", err) + } + + // If we have a specific config type, marshal into and out of that to + // remove any extra fields Kibana may have returned. + handler, ok := connectorConfigHandlers[connector.ConnectorTypeId] + if ok { + configJSONString, err := handler.remarshalConfig(string(configJSON)) + if err != nil { + return nil, diag.Errorf("failed to remarshal config: %v", err) + } + + configJSON = []byte(configJSONString) + } + } + + model := &models.KibanaActionConnector{ + ConnectorID: connector.Id, + SpaceID: spaceID, + Name: connector.Name, + ConfigJSON: string(configJSON), + ConnectorTypeID: connector.ConnectorTypeId, + IsDeprecated: connector.IsDeprecated, + IsPreconfigured: connector.IsPreconfigured, + } + + if connector.IsMissingSecrets != nil { + model.IsMissingSecrets = *connector.IsMissingSecrets + } + + return model, nil +} + +func DeleteConnector(ctx context.Context, client *Client, connectorID string, spaceID string) diag.Diagnostics { + resp, err := client.API.DeleteActionsConnectorIdWithResponse(ctx, spaceID, connectorID) + if err != nil { + return diag.Errorf("unable to delete connector: [%v]", err) + } + + if resp.StatusCode() != http.StatusOK && resp.StatusCode() != http.StatusNoContent { + return reportUnknownErrorSDK(resp.StatusCode(), resp.Body) + } + + return nil +} + +type connectorConfigHandler struct { + defaults func(plan, backend string) (string, error) + remarshalConfig func(config string) (string, error) +} + +var connectorConfigHandlers = map[string]connectorConfigHandler{ + ".cases-webhook": { + defaults: connectorConfigWithDefaultsCasesWebhook, + remarshalConfig: remarshalConfig[kbapi.CasesWebhookConfig], + }, + ".email": { + defaults: connectorConfigWithDefaultsEmail, + remarshalConfig: remarshalConfig[kbapi.EmailConfig], + }, + ".gemini": { + defaults: connectorConfigWithDefaultsGemini, + remarshalConfig: remarshalConfig[kbapi.GeminiConfig], + }, + ".index": { + defaults: connectorConfigWithDefaultsIndex, + remarshalConfig: remarshalConfig[kbapi.IndexConfig], + }, + ".jira": { + defaults: connectorConfigWithDefaultsJira, + remarshalConfig: remarshalConfig[kbapi.JiraConfig], + }, + ".opsgenie": { + defaults: connectorConfigWithDefaultsOpsgenie, + remarshalConfig: remarshalConfig[kbapi.OpsgenieConfig], + }, + ".pagerduty": { + defaults: connectorConfigWithDefaultsPagerduty, + remarshalConfig: remarshalConfig[kbapi.PagerdutyConfig], + }, + ".resilient": { + defaults: connectorConfigWithDefaultsResilient, + remarshalConfig: remarshalConfig[kbapi.ResilientConfig], + }, + ".servicenow": { + defaults: connectorConfigWithDefaultsServicenow, + remarshalConfig: remarshalConfig[kbapi.ServicenowConfig], + }, + ".servicenow-itom": { + defaults: connectorConfigWithDefaultsServicenowItom, + remarshalConfig: remarshalConfig[kbapi.ServicenowItomConfig], + }, + ".servicenow-sir": { + defaults: connectorConfigWithDefaultsServicenowSir, + remarshalConfig: remarshalConfig[kbapi.ServicenowConfig], + }, + ".swimlane": { + defaults: connectorConfigWithDefaultsSwimlane, + remarshalConfig: remarshalConfig[kbapi.SwimlaneConfig], + }, + ".tines": { + defaults: connectorConfigWithDefaultsTines, + remarshalConfig: remarshalConfig[kbapi.TinesConfig], + }, + ".webhook": { + defaults: connectorConfigWithDefaultsWebhook, + remarshalConfig: remarshalConfig[kbapi.WebhookConfig], + }, + ".xmatters": { + defaults: connectorConfigWithDefaultsXmatters, + remarshalConfig: remarshalConfig[kbapi.XmattersConfig], + }, +} + +func ConnectorConfigWithDefaults(connectorTypeID, plan, backend, state string) (string, error) { + handler, ok := connectorConfigHandlers[connectorTypeID] + if !ok { + return plan, errors.New("unknown connector type ID: " + connectorTypeID) + } + + return handler.defaults(plan, backend) +} + +// User can omit optonal fields in config JSON. +// The func adds empty optional fields to the diff. +// Otherwise plan command shows omitted fields as the diff, +// because backend returns all fields. +func remarshalConfig[T any](plan string) (string, error) { + var config T + if err := json.Unmarshal([]byte(plan), &config); err != nil { + return "", err + } + customJSON, err := json.Marshal(config) + if err != nil { + return "", err + } + return string(customJSON), nil +} + +func connectorConfigWithDefaultsCasesWebhook(plan, _ string) (string, error) { + var custom kbapi.CasesWebhookConfig + if err := json.Unmarshal([]byte(plan), &custom); err != nil { + return "", err + } + if custom.CreateIncidentMethod == nil { + custom.CreateIncidentMethod = utils.Pointer(kbapi.CasesWebhookConfigCreateIncidentMethodPost) + } + if custom.HasAuth == nil { + custom.HasAuth = utils.Pointer(true) + } + if custom.UpdateIncidentMethod == nil { + custom.UpdateIncidentMethod = utils.Pointer(kbapi.CasesWebhookConfigUpdateIncidentMethodPut) + } + customJSON, err := json.Marshal(custom) + if err != nil { + return "", err + } + return string(customJSON), nil +} + +func connectorConfigWithDefaultsEmail(plan, _ string) (string, error) { + var custom kbapi.EmailConfig + if err := json.Unmarshal([]byte(plan), &custom); err != nil { + return "", err + } + if custom.HasAuth == nil { + custom.HasAuth = utils.Pointer(true) + } + if custom.Service == nil { + custom.Service = utils.Pointer(kbapi.EmailConfigService("other")) + } + customJSON, err := json.Marshal(custom) + if err != nil { + return "", err + } + return string(customJSON), nil +} + +func connectorConfigWithDefaultsGemini(plan, _ string) (string, error) { + return plan, nil +} + +func connectorConfigWithDefaultsIndex(plan, _ string) (string, error) { + var custom kbapi.IndexConfig + if err := json.Unmarshal([]byte(plan), &custom); err != nil { + return "", err + } + if custom.Refresh == nil { + custom.Refresh = utils.Pointer(false) + } + customJSON, err := json.Marshal(custom) + if err != nil { + return "", err + } + return string(customJSON), nil +} + +func connectorConfigWithDefaultsJira(plan, _ string) (string, error) { + return remarshalConfig[kbapi.JiraConfig](plan) +} + +func connectorConfigWithDefaultsOpsgenie(plan, _ string) (string, error) { + return plan, nil +} + +func connectorConfigWithDefaultsPagerduty(plan, _ string) (string, error) { + return remarshalConfig[kbapi.PagerdutyConfig](plan) +} + +func connectorConfigWithDefaultsResilient(plan, _ string) (string, error) { + return plan, nil +} + +func connectorConfigWithDefaultsServicenow(plan, backend string) (string, error) { + var planConfig kbapi.ServicenowConfig + if err := json.Unmarshal([]byte(plan), &planConfig); err != nil { + return "", err + } + var backendConfig kbapi.ServicenowConfig + if err := json.Unmarshal([]byte(backend), &backendConfig); err != nil { + return "", err + } + if planConfig.IsOAuth == nil && backendConfig.IsOAuth != nil && !*backendConfig.IsOAuth { + planConfig.IsOAuth = utils.Pointer(false) + } + if planConfig.UsesTableApi == nil { + planConfig.UsesTableApi = utils.Pointer(true) + } + customJSON, err := json.Marshal(planConfig) + if err != nil { + return "", err + } + return string(customJSON), nil +} + +func connectorConfigWithDefaultsServicenowItom(plan, _ string) (string, error) { + var custom kbapi.ServicenowItomConfig + if err := json.Unmarshal([]byte(plan), &custom); err != nil { + return "", err + } + if custom.IsOAuth == nil { + custom.IsOAuth = utils.Pointer(false) + } + customJSON, err := json.Marshal(custom) + if err != nil { + return "", err + } + return string(customJSON), nil +} + +func connectorConfigWithDefaultsServicenowSir(plan, backend string) (string, error) { + return connectorConfigWithDefaultsServicenow(plan, backend) +} + +func connectorConfigWithDefaultsSwimlane(plan, _ string) (string, error) { + var custom kbapi.SwimlaneConfig + if err := json.Unmarshal([]byte(plan), &custom); err != nil { + return "", err + } + if custom.Mappings == nil { + custom.Mappings = &struct { + AlertIdConfig *struct { + FieldType string "json:\"fieldType\"" + Id string "json:\"id\"" + Key string "json:\"key\"" + Name string "json:\"name\"" + } "json:\"alertIdConfig,omitempty\"" + CaseIdConfig *struct { + FieldType string "json:\"fieldType\"" + Id string "json:\"id\"" + Key string "json:\"key\"" + Name string "json:\"name\"" + } "json:\"caseIdConfig,omitempty\"" + CaseNameConfig *struct { + FieldType string "json:\"fieldType\"" + Id string "json:\"id\"" + Key string "json:\"key\"" + Name string "json:\"name\"" + } "json:\"caseNameConfig,omitempty\"" + CommentsConfig *struct { + FieldType string "json:\"fieldType\"" + Id string "json:\"id\"" + Key string "json:\"key\"" + Name string "json:\"name\"" + } "json:\"commentsConfig,omitempty\"" + DescriptionConfig *struct { + FieldType string "json:\"fieldType\"" + Id string "json:\"id\"" + Key string "json:\"key\"" + Name string "json:\"name\"" + } "json:\"descriptionConfig,omitempty\"" + RuleNameConfig *struct { + FieldType string "json:\"fieldType\"" + Id string "json:\"id\"" + Key string "json:\"key\"" + Name string "json:\"name\"" + } "json:\"ruleNameConfig,omitempty\"" + SeverityConfig *struct { + FieldType string "json:\"fieldType\"" + Id string "json:\"id\"" + Key string "json:\"key\"" + Name string "json:\"name\"" + } "json:\"severityConfig,omitempty\"" + }{} + } + customJSON, err := json.Marshal(custom) + if err != nil { + return "", err + } + return string(customJSON), nil +} + +func connectorConfigWithDefaultsTines(plan, _ string) (string, error) { + return plan, nil +} + +func connectorConfigWithDefaultsWebhook(plan, _ string) (string, error) { + return plan, nil +} + +func connectorConfigWithDefaultsXmatters(plan, _ string) (string, error) { + var custom kbapi.XmattersConfig + if err := json.Unmarshal([]byte(plan), &custom); err != nil { + return "", err + } + if custom.UsesBasic == nil { + custom.UsesBasic = utils.Pointer(true) + } + customJSON, err := json.Marshal(custom) + if err != nil { + return "", err + } + return string(customJSON), nil +} + +func createConnectorRequestBody(connector models.KibanaActionConnector) (kbapi.PostActionsConnectorIdJSONRequestBody, error) { + req := kbapi.PostActionsConnectorIdJSONRequestBody{ + ConnectorTypeId: connector.ConnectorTypeID, + Name: connector.Name, + Config: &kbapi.CreateConnectorConfig{}, + Secrets: &kbapi.CreateConnectorSecrets{}, + } + + if len(connector.ConfigJSON) > 0 { + if err := json.Unmarshal([]byte(connector.ConfigJSON), &req.Config.AdditionalProperties); err != nil { + return kbapi.PostActionsConnectorIdJSONRequestBody{}, fmt.Errorf("failed to unmarshal [config] attribute: %w", err) + } + } + + if len(connector.SecretsJSON) > 0 { + if err := json.Unmarshal([]byte(connector.SecretsJSON), &req.Secrets.AdditionalProperties); err != nil { + return kbapi.PostActionsConnectorIdJSONRequestBody{}, fmt.Errorf("failed to unmarshal [secrets] attribute: %w", err) + } + } + + return req, nil +} + +func updateConnectorRequestBody(connector models.KibanaActionConnector) (kbapi.PutActionsConnectorIdJSONRequestBody, error) { + req := kbapi.PutActionsConnectorIdJSONRequestBody{ + Name: connector.Name, + Config: &kbapi.UpdateConnectorConfig{}, + Secrets: &kbapi.UpdateConnectorSecrets{}, + } + + if len(connector.ConfigJSON) > 0 { + if err := json.Unmarshal([]byte(connector.ConfigJSON), &req.Config.AdditionalProperties); err != nil { + return kbapi.PutActionsConnectorIdJSONRequestBody{}, fmt.Errorf("failed to unmarshal [config] attribute: %w", err) + } + } + + if len(connector.SecretsJSON) > 0 { + if err := json.Unmarshal([]byte(connector.SecretsJSON), &req.Secrets.AdditionalProperties); err != nil { + return kbapi.PutActionsConnectorIdJSONRequestBody{}, fmt.Errorf("failed to unmarshal [secrets] attribute: %w", err) + } + } + + return req, nil +} diff --git a/internal/clients/kibana_oapi/connector_test.go b/internal/clients/kibana_oapi/connector_test.go new file mode 100644 index 000000000..af45f0a27 --- /dev/null +++ b/internal/clients/kibana_oapi/connector_test.go @@ -0,0 +1,264 @@ +package kibana_oapi_test + +import ( + "context" + "net/http" + "net/http/httptest" + "os" + "testing" + + "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" + "github.com/elastic/terraform-provider-elasticstack/internal/clients" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana_oapi" + "github.com/elastic/terraform-provider-elasticstack/internal/models" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/stretchr/testify/require" +) + +func Test_connectorResponseToModel(t *testing.T) { + type testCase struct { + name string + spaceId string + response *kbapi.ConnectorResponse + expectedModel *models.KibanaActionConnector + expectedError diag.Diagnostics + } + tests := []testCase{ + { + name: "should return an error diag when response is nil", + spaceId: "default", + response: nil, + expectedModel: nil, + expectedError: diag.Errorf("connector response is nil"), + }, + { + name: "should map valid connector response to model", + spaceId: "default", + response: &kbapi.ConnectorResponse{ + Id: "test-id", + ConnectorTypeId: ".slack", + Name: "test-connector", + IsPreconfigured: false, + IsDeprecated: false, + IsMissingSecrets: func() *bool { b := false; return &b }(), + Config: func() *map[string]interface{} { + m := map[string]interface{}{"webhookUrl": "https://hooks.slack.com/services/xxx"} + return &m + }(), + }, + expectedModel: &models.KibanaActionConnector{ + ConnectorID: "test-id", + SpaceID: "default", + Name: "test-connector", + ConnectorTypeID: ".slack", + ConfigJSON: `{"webhookUrl":"https://hooks.slack.com/services/xxx"}`, + IsDeprecated: false, + IsMissingSecrets: false, + IsPreconfigured: false, + }, + expectedError: nil, + }, + { + name: "should handle empty config", + spaceId: "default", + response: &kbapi.ConnectorResponse{ + Id: "empty-id", + ConnectorTypeId: ".webhook", + Name: "empty-connector", + IsPreconfigured: false, + IsDeprecated: false, + IsMissingSecrets: func() *bool { b := false; return &b }(), + Config: nil, + }, + expectedModel: &models.KibanaActionConnector{ + ConnectorID: "empty-id", + SpaceID: "default", + Name: "empty-connector", + ConnectorTypeID: ".webhook", + ConfigJSON: "", + IsDeprecated: false, + IsMissingSecrets: false, + IsPreconfigured: false, + }, + expectedError: nil, + }, + { + name: "should handle missing optional fields", + spaceId: "default", + response: &kbapi.ConnectorResponse{ + Id: "missing-fields", + ConnectorTypeId: ".webhook", + Name: "missing-connector", + }, + expectedModel: &models.KibanaActionConnector{ + ConnectorID: "missing-fields", + SpaceID: "default", + Name: "missing-connector", + ConnectorTypeID: ".webhook", + ConfigJSON: "", + IsDeprecated: false, + IsMissingSecrets: false, + IsPreconfigured: false, + }, + expectedError: nil, + }, + { + name: "should handle non-default spaceId", + spaceId: "custom-space", + response: &kbapi.ConnectorResponse{ + Id: "custom-id", + ConnectorTypeId: ".webhook", + Name: "custom-connector", + IsPreconfigured: true, + IsDeprecated: true, + IsMissingSecrets: func() *bool { b := true; return &b }(), + Config: func() *map[string]interface{} { + m := map[string]interface{}{"url": "https://example.com"} + return &m + }(), + }, + expectedModel: &models.KibanaActionConnector{ + ConnectorID: "custom-id", + SpaceID: "custom-space", + Name: "custom-connector", + ConnectorTypeID: ".webhook", + ConfigJSON: `{"url":"https://example.com"}`, + IsDeprecated: true, + IsMissingSecrets: true, + IsPreconfigured: true, + }, + expectedError: nil, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + model, err := kibana_oapi.ConnectorResponseToModel(tt.spaceId, tt.response) + + if tt.expectedError == nil { + require.Nil(t, err) + require.Equal(t, tt.expectedModel, model) + } else { + require.Equal(t, tt.expectedError, err) + } + }) + } +} + +func TestGetConnectorByName(t *testing.T) { + const getConnectorsResponse = `[ + { + "id": "c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad", + "connector_type_id": ".index", + "name": "my-connector", + "config": { + "index": "test-index", + "refresh": false, + "executionTimeField": null + }, + "is_preconfigured": false, + "is_deprecated": false, + "is_missing_secrets": false, + "referenced_by_count": 3 + }, + { + "id": "d55b6eb0-6bad-11eb-9f3b-611eebc6c3ad", + "connector_type_id": ".index", + "name": "doubledup-connector", + "config": { + "index": "test-index", + "refresh": false, + "executionTimeField": null + }, + "is_preconfigured": false, + "is_deprecated": false, + "is_missing_secrets": false, + "referenced_by_count": 3 + }, + { + "id": "855b6eb0-6bad-11eb-9f3b-611eebc6c3ad", + "connector_type_id": ".index", + "name": "doubledup-connector", + "config": { + "index": "test-index", + "refresh": false, + "executionTimeField": null + }, + "is_preconfigured": false, + "is_deprecated": false, + "is_missing_secrets": false, + "referenced_by_count": 0 + } + ]` + + const emptyConnectorsResponse = `[]` + + var requests []*http.Request + var mockResponses []string + var httpStatus int + server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { + requests = append(requests, req) + + if len(mockResponses) > 0 { + r := []byte(mockResponses[0]) + rw.Header().Add("X-Elastic-Product", "Elasticsearch") + rw.Header().Add("Content-Type", "application/json") + rw.WriteHeader(httpStatus) + _, err := rw.Write(r) + require.NoError(t, err) + mockResponses = mockResponses[1:] + } else { + t.Fatalf("Unexpected request: %s %s", req.Method, req.URL.Path) + } + })) + defer server.Close() + + httpStatus = http.StatusOK + mockResponses = append(mockResponses, getConnectorsResponse) + + err := os.Setenv("ELASTICSEARCH_URL", server.URL) + require.NoError(t, err) + err = os.Setenv("KIBANA_ENDPOINT", server.URL) + require.NoError(t, err) + + apiClient, err := clients.NewAcceptanceTestingClient() + require.NoError(t, err) + + oapiClient, err := apiClient.GetKibanaOapiClient() + require.NoError(t, err) + + connector, diags := kibana_oapi.SearchConnectors(context.Background(), oapiClient, "my-connector", "default", "") + require.Nil(t, diags) + require.NotNil(t, connector) + + mockResponses = append(mockResponses, getConnectorsResponse) + failConnector, diags := kibana_oapi.SearchConnectors(context.Background(), oapiClient, "failwhale", "default", "") + require.Nil(t, diags) + require.Empty(t, failConnector) + + mockResponses = append(mockResponses, getConnectorsResponse) + dupConnector, diags := kibana_oapi.SearchConnectors(context.Background(), oapiClient, "doubledup-connector", "default", "") + require.Nil(t, diags) + require.Len(t, dupConnector, 2) + + mockResponses = append(mockResponses, getConnectorsResponse) + wrongConnectorType, diags := kibana_oapi.SearchConnectors(context.Background(), oapiClient, "my-connector", "default", ".slack") + require.Nil(t, diags) + require.Empty(t, wrongConnectorType) + + mockResponses = append(mockResponses, getConnectorsResponse) + successConnector, diags := kibana_oapi.SearchConnectors(context.Background(), oapiClient, "my-connector", "default", ".index") + require.Nil(t, diags) + require.Len(t, successConnector, 1) + + mockResponses = append(mockResponses, emptyConnectorsResponse) + emptyConnector, diags := kibana_oapi.SearchConnectors(context.Background(), oapiClient, "my-connector", "default", "") + require.Nil(t, diags) + require.Empty(t, emptyConnector) + + httpStatus = http.StatusBadGateway + mockResponses = append(mockResponses, emptyConnectorsResponse) + fail, diags := kibana_oapi.SearchConnectors(context.Background(), oapiClient, "my-connector", "default", "") + require.NotNil(t, diags) + require.Nil(t, fail) +} diff --git a/internal/clients/kibana_oapi/errors.go b/internal/clients/kibana_oapi/errors.go index 08aef219d..d00822fc8 100644 --- a/internal/clients/kibana_oapi/errors.go +++ b/internal/clients/kibana_oapi/errors.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-framework/diag" + sdkdiag "github.com/hashicorp/terraform-plugin-sdk/v2/diag" ) func reportUnknownError(statusCode int, body []byte) diag.Diagnostics { @@ -14,3 +15,13 @@ func reportUnknownError(statusCode int, body []byte) diag.Diagnostics { ), } } + +func reportUnknownErrorSDK(statusCode int, body []byte) sdkdiag.Diagnostics { + return sdkdiag.Diagnostics{ + sdkdiag.Diagnostic{ + Severity: sdkdiag.Error, + Summary: fmt.Sprintf("Unexpected status code from server: got HTTP %d", statusCode), + Detail: string(body), + }, + } +} diff --git a/internal/kibana/connector.go b/internal/kibana/connector.go index 37d86c333..419e1500d 100644 --- a/internal/kibana/connector.go +++ b/internal/kibana/connector.go @@ -4,22 +4,26 @@ import ( "context" "github.com/elastic/terraform-provider-elasticstack/internal/clients" - "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana_oapi" "github.com/elastic/terraform-provider-elasticstack/internal/models" "github.com/elastic/terraform-provider-elasticstack/internal/utils" + "github.com/hashicorp/go-version" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) +var MinVersionSupportingPreconfiguredIDs = version.Must(version.NewVersion("8.8.0")) + func ResourceActionConnector() *schema.Resource { var connectorSchema = map[string]*schema.Schema{ "connector_id": { - Description: "A UUID v1 or v4 to use instead of a randomly generated ID.", - Type: schema.TypeString, - Computed: true, - Optional: true, - ForceNew: true, + Description: "A UUID v1 or v4 to use instead of a randomly generated ID.", + Type: schema.TypeString, + Computed: true, + Optional: true, + ForceNew: true, + ValidateFunc: validation.IsUUID, }, "space_id": { Description: "An identifier for the space. If space_id is not provided, the default space is used.", @@ -116,7 +120,7 @@ func connectorCustomizeDiff(ctx context.Context, rd *schema.ResourceDiff, in int stateJSON := state.AsString() - customJSON, err := kibana.ConnectorConfigWithDefaults(oldTypeID, newJSON, oldJSON, stateJSON) + customJSON, err := kibana_oapi.ConnectorConfigWithDefaults(oldTypeID, newJSON, oldJSON, stateJSON) if err != nil { return err } @@ -129,12 +133,26 @@ func resourceConnectorCreate(ctx context.Context, d *schema.ResourceData, meta i return diags } + oapiClient, err := client.GetKibanaOapiClient() + if err != nil { + return diag.FromErr(err) + } + connectorOld, diags := expandActionConnector(d) if diags.HasError() { return diags } - connectorID, diags := kibana.CreateConnector(ctx, client, connectorOld) + version, diags := client.ServerVersion(ctx) + if diags.HasError() { + return diags + } + + if connectorOld.ConnectorID != "" && version.LessThan(MinVersionSupportingPreconfiguredIDs) { + return diag.Errorf("Preconfigured connector IDs are only supported for Elastic Stack v%s and above. Either remove the `connector_id` attribute or upgrade your target cluster to supported version", MinVersionSupportingPreconfiguredIDs) + } + + connectorID, diags := kibana_oapi.CreateConnector(ctx, oapiClient, connectorOld) if diags.HasError() { return diags @@ -152,6 +170,11 @@ func resourceConnectorUpdate(ctx context.Context, d *schema.ResourceData, meta i return diags } + oapiClient, err := client.GetKibanaOapiClient() + if err != nil { + return diag.FromErr(err) + } + connectorOld, diags := expandActionConnector(d) if diags.HasError() { return diags @@ -163,7 +186,7 @@ func resourceConnectorUpdate(ctx context.Context, d *schema.ResourceData, meta i } connectorOld.ConnectorID = compositeIDold.ResourceId - connectorID, diags := kibana.UpdateConnector(ctx, client, connectorOld) + connectorID, diags := kibana_oapi.UpdateConnector(ctx, oapiClient, connectorOld) if diags.HasError() { return diags @@ -181,12 +204,17 @@ func resourceConnectorRead(ctx context.Context, d *schema.ResourceData, meta int return diags } + oapiClient, err := client.GetKibanaOapiClient() + if err != nil { + return diag.FromErr(err) + } + compositeID, diags := clients.CompositeIdFromStr(d.Id()) if diags.HasError() { return diags } - connector, diags := kibana.GetConnector(ctx, client, compositeID.ResourceId, compositeID.ClusterId) + connector, diags := kibana_oapi.GetConnector(ctx, oapiClient, compositeID.ResourceId, compositeID.ClusterId) if connector == nil && diags == nil { d.SetId("") return diags @@ -204,6 +232,11 @@ func resourceConnectorDelete(ctx context.Context, d *schema.ResourceData, meta i return diags } + oapiClient, err := client.GetKibanaOapiClient() + if err != nil { + return diag.FromErr(err) + } + compositeID, diags := clients.CompositeIdFromStr(d.Id()) if diags.HasError() { return diags @@ -211,7 +244,7 @@ func resourceConnectorDelete(ctx context.Context, d *schema.ResourceData, meta i spaceId := d.Get("space_id").(string) - if diags := kibana.DeleteConnector(ctx, client, compositeID.ResourceId, spaceId); diags.HasError() { + if diags := kibana_oapi.DeleteConnector(ctx, oapiClient, compositeID.ResourceId, spaceId); diags.HasError() { return diags } @@ -223,6 +256,7 @@ func expandActionConnector(d *schema.ResourceData) (models.KibanaActionConnector var diags diag.Diagnostics connector := models.KibanaActionConnector{ + ConnectorID: d.Get("connector_id").(string), SpaceID: d.Get("space_id").(string), Name: d.Get("name").(string), ConnectorTypeID: d.Get("connector_type_id").(string), diff --git a/internal/kibana/connector_data_source.go b/internal/kibana/connector_data_source.go index 03aff8a25..07ec1a249 100644 --- a/internal/kibana/connector_data_source.go +++ b/internal/kibana/connector_data_source.go @@ -4,7 +4,7 @@ import ( "context" "github.com/elastic/terraform-provider-elasticstack/internal/clients" - "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana_oapi" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -66,11 +66,15 @@ func datasourceConnectorRead(ctx context.Context, d *schema.ResourceData, meta i if diags.HasError() { return diags } + oapiClient, err := client.GetKibanaOapiClient() + if err != nil { + return diag.FromErr(err) + } connectorName := d.Get("name").(string) spaceId := d.Get("space_id").(string) connectorType := d.Get("connector_type_id").(string) - foundConnectors, diags := kibana.SearchConnectors(ctx, client, connectorName, spaceId, connectorType) + foundConnectors, diags := kibana_oapi.SearchConnectors(ctx, oapiClient, connectorName, spaceId, connectorType) if diags.HasError() { return diags } diff --git a/internal/kibana/connector_test.go b/internal/kibana/connector_test.go index c98658a16..172b75b78 100644 --- a/internal/kibana/connector_test.go +++ b/internal/kibana/connector_test.go @@ -8,8 +8,10 @@ import ( "github.com/elastic/terraform-provider-elasticstack/internal/acctest" "github.com/elastic/terraform-provider-elasticstack/internal/clients" - "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana_oapi" + "github.com/elastic/terraform-provider-elasticstack/internal/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/versionutils" + "github.com/google/uuid" "github.com/hashicorp/go-version" sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -21,7 +23,11 @@ func TestAccResourceKibanaConnectorCasesWebhook(t *testing.T) { connectorName := sdkacctest.RandStringFromCharSet(22, sdkacctest.CharSetAlphaNum) - create := func(name string) string { + create := func(name, id string) string { + idAttribute := "" + if id != "" { + idAttribute = fmt.Sprintf(`connector_id = "%s"`, id) + } return fmt.Sprintf(` provider "elasticstack" { elasticsearch {} @@ -30,6 +36,7 @@ func TestAccResourceKibanaConnectorCasesWebhook(t *testing.T) { resource "elasticstack_kibana_action_connector" "test" { name = "%s" + %s config = jsonencode({ createIncidentJson = "{}" createIncidentResponseKey = "key" @@ -46,10 +53,14 @@ func TestAccResourceKibanaConnectorCasesWebhook(t *testing.T) { }) connector_type_id = ".cases-webhook" }`, - name) + name, idAttribute) } - update := func(name string) string { + update := func(name, id string) string { + idAttribute := "" + if id != "" { + idAttribute = fmt.Sprintf(`connector_id = "%s"`, id) + } return fmt.Sprintf(` provider "elasticstack" { elasticsearch {} @@ -58,6 +69,7 @@ func TestAccResourceKibanaConnectorCasesWebhook(t *testing.T) { resource "elasticstack_kibana_action_connector" "test" { name = "Updated %s" + %s config = jsonencode({ createIncidentJson = "{}" createIncidentResponseKey = "key" @@ -75,57 +87,81 @@ func TestAccResourceKibanaConnectorCasesWebhook(t *testing.T) { }) connector_type_id = ".cases-webhook" }`, - name) + name, idAttribute) + } + + for _, connectorID := range []string{"", uuid.NewString()} { + t.Run(fmt.Sprintf("with connector ID '%s'", connectorID), func(t *testing.T) { + minVersion := minSupportedVersion + if connectorID != "" { + minVersion = kibana.MinVersionSupportingPreconfiguredIDs + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + CheckDestroy: checkResourceKibanaConnectorDestroy, + ProtoV6ProviderFactories: acctest.Providers, + Steps: []resource.TestStep{ + { + SkipFunc: versionutils.CheckIfVersionIsUnsupported(minVersion), + Config: create(connectorName, connectorID), + Check: resource.ComposeTestCheckFunc( + testCommonAttributes(connectorName, ".cases-webhook"), + + resource.TestCheckResourceAttrWith("elasticstack_kibana_action_connector.test", "connector_id", func(value string) error { + if connectorID == "" { + if _, err := uuid.Parse(value); err != nil { + return fmt.Errorf("expected connector_id to be a uuid: %w", err) + } + + return nil + } + + if connectorID != value { + return fmt.Errorf("expected connector_id to match pre-defined id. '%s' != %s", connectorID, value) + } + + return nil + }), + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"createIncidentJson\":\"{}\"`)), + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"createIncidentResponseKey\":\"key\"`)), + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"createIncidentUrl\":\"https://www\.elastic\.co/\"`)), + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"getIncidentResponseExternalTitleKey\":\"title\"`)), + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"getIncidentUrl\":\"https://www\.elastic\.co/\"`)), + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"updateIncidentJson\":\"{}\"`)), + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"updateIncidentUrl\":\"https://www.elastic\.co/\"`)), + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"viewIncidentUrl\":\"https://www\.elastic\.co/\"`)), + // `post` is the default value that is returned by backend + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`"createIncidentMethod\":\"post\"`)), + + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "secrets", regexp.MustCompile(`\"user\":\"user1\"`)), + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "secrets", regexp.MustCompile(`\"password\":\"password1\"`)), + ), + }, + { + SkipFunc: versionutils.CheckIfVersionIsUnsupported(minVersion), + Config: update(connectorName, connectorID), + Check: resource.ComposeTestCheckFunc( + testCommonAttributes(fmt.Sprintf("Updated %s", connectorName), ".cases-webhook"), + + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"createIncidentJson\":\"{}\"`)), + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"createIncidentResponseKey\":\"key\"`)), + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"createIncidentUrl\":\"https://www\.elastic\.co/\"`)), + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"getIncidentResponseExternalTitleKey\":\"title\"`)), + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"getIncidentUrl\":\"https://www\.elastic\.co/\"`)), + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"updateIncidentJson\":\"{}\"`)), + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"updateIncidentUrl\":\"https://elasticsearch\.com/\"`)), + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"viewIncidentUrl\":\"https://www\.elastic\.co/\"`)), + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`createIncidentMethod\":\"put\"`)), + + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "secrets", regexp.MustCompile(`\"user\":\"user2\"`)), + resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "secrets", regexp.MustCompile(`\"password\":\"password2\"`)), + ), + }, + }, + }) + }) } - - resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, - CheckDestroy: checkResourceKibanaConnectorDestroy, - ProtoV6ProviderFactories: acctest.Providers, - Steps: []resource.TestStep{ - { - SkipFunc: versionutils.CheckIfVersionIsUnsupported(minSupportedVersion), - Config: create(connectorName), - Check: resource.ComposeTestCheckFunc( - testCommonAttributes(connectorName, ".cases-webhook"), - - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"createIncidentJson\":\"{}\"`)), - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"createIncidentResponseKey\":\"key\"`)), - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"createIncidentUrl\":\"https://www\.elastic\.co/\"`)), - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"getIncidentResponseExternalTitleKey\":\"title\"`)), - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"getIncidentUrl\":\"https://www\.elastic\.co/\"`)), - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"updateIncidentJson\":\"{}\"`)), - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"updateIncidentUrl\":\"https://www.elastic\.co/\"`)), - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"viewIncidentUrl\":\"https://www\.elastic\.co/\"`)), - // `post` is the default value that is returned by backend - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`"createIncidentMethod\":\"post\"`)), - - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "secrets", regexp.MustCompile(`\"user\":\"user1\"`)), - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "secrets", regexp.MustCompile(`\"password\":\"password1\"`)), - ), - }, - { - SkipFunc: versionutils.CheckIfVersionIsUnsupported(minSupportedVersion), - Config: update(connectorName), - Check: resource.ComposeTestCheckFunc( - testCommonAttributes(fmt.Sprintf("Updated %s", connectorName), ".cases-webhook"), - - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"createIncidentJson\":\"{}\"`)), - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"createIncidentResponseKey\":\"key\"`)), - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"createIncidentUrl\":\"https://www\.elastic\.co/\"`)), - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"getIncidentResponseExternalTitleKey\":\"title\"`)), - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"getIncidentUrl\":\"https://www\.elastic\.co/\"`)), - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"updateIncidentJson\":\"{}\"`)), - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"updateIncidentUrl\":\"https://elasticsearch\.com/\"`)), - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`\"viewIncidentUrl\":\"https://www\.elastic\.co/\"`)), - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "config", regexp.MustCompile(`createIncidentMethod\":\"put\"`)), - - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "secrets", regexp.MustCompile(`\"user\":\"user2\"`)), - resource.TestMatchResourceAttr("elasticstack_kibana_action_connector.test", "secrets", regexp.MustCompile(`\"password\":\"password2\"`)), - ), - }, - }, - }) } func TestAccResourceKibanaConnectorEmail(t *testing.T) { @@ -1549,13 +1585,18 @@ func checkResourceKibanaConnectorDestroy(s *terraform.State) error { return err } + oapiClient, err := client.GetKibanaOapiClient() + if err != nil { + return err + } + for _, rs := range s.RootModule().Resources { if rs.Type != "elasticstack_kibana_action_connector" { continue } compId, _ := clients.CompositeIdFromStr(rs.Primary.ID) - connector, diags := kibana.GetConnector(context.Background(), client, compId.ResourceId, compId.ClusterId) + connector, diags := kibana_oapi.GetConnector(context.Background(), oapiClient, compId.ResourceId, compId.ClusterId) if diags.HasError() { return fmt.Errorf("Failed to get connector: %v", diags) }