Sha256: 113f1f370799c3b814153791db21a1a5525de742eb0073b6bf1a11eb0b92c58e
Contents?: true
Size: 1.5 KB
Versions: 19
Compression:
Stored size: 1.5 KB
Contents
# {{ scenario.name|wordwrap(width=120)}} {%- set parameters, opts = format_parameters(context.api_request.kwargs, operation_spec, replace_values=context._replace_values, has_body=context.body) %} {%- if context.body %} {%- set body = format_data_with_schema(context.body.value, context.api_request.schema.spec, name_prefix="DatadogAPIClient::{}::".format(version.upper()), replace_values=context._replace_values)%} {%- endif %} require 'datadog_api_client' {%- if context._enable_operations %} DatadogAPIClient.configure do |config| {%- for operation in context._enable_operations %} config.unstable_operations["{{ version }}.{{ operation|snake_case }}".to_sym] = true {%- endfor %} end {%- endif %} api_instance = DatadogAPIClient::{{ version.upper() }}::{{ context.api_instance.name }}API.new {%- for name, values in context._given.items() %} # {{ name }} {%- for value in values|sort %} {{ value }} = ENV["{{ value }}"] {%- endfor %} {%- endfor %} {%- if context.body %} body = {{ body }} {%- endif %} {%- if opts %} opts = { {%- for key, value in opts.items() %} {{ key }}: {{ value }}, {%- endfor %} } {%- endif %} {%- if context.pagination %} api_instance.{{ context.api_request.operation_id|snake_case }}_with_pagination({{ parameters }}) { |item| puts item } {%- else %} {%- if context.status_code != 204 %} p api_instance.{{ context.api_request.operation_id|snake_case }}({{ parameters }}) {%- else %} api_instance.{{ context.api_request.operation_id|snake_case }}({{ parameters }}) {%- endif %} {%- endif %}
Version data entries
19 entries across 19 versions & 1 rubygems