diff --git a/README.md b/README.md index 20745542..8fba7130 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ terraform { required_providers { uptrends = { source = "wasfree/uptrends" - version = "=0.2.0" + version = "=0.2.3" } } } @@ -79,7 +79,7 @@ Further [usage documentation is available on the Terraform website](https://www. ## Developer Requirements * [Terraform](https://www.terraform.io/downloads.html) version 0.15.x + (but 1.x is recommended) -* [Go](https://golang.org/doc/install) version 1.17.x (to build the provider plugin) +* [Go](https://golang.org/doc/install) version 1.19.x (to build the provider plugin) ### On Windows diff --git a/docs/resources/monitor_certificate.md b/docs/resources/monitor_certificate.md index 74dd23ea..6e6f32aa 100644 --- a/docs/resources/monitor_certificate.md +++ b/docs/resources/monitor_certificate.md @@ -49,51 +49,50 @@ resource "uptrends_monitor_certificate" "example" { ### Required -- **name** (String) Display name for the Ping Monitor resource. -- **url** (String) The full URL of the appropriate website, page or service that you want to monitor. The URL should include “https://”, please also include a port number if you are using a non-default port number, e.g. https://your-domain.com:8080/your-page. You can also use a fixed IP address as part of the URL instead of a host name, if your server listens to incoming requests without a host name. +- `name` (String) Display name for the Ping Monitor resource. +- `url` (String) The full URL of the appropriate website, page or service that you want to monitor. The URL should include “https://”, please also include a port number if you are using a non-default port number, e.g. https://your-domain.com:8080/your-page. You can also use a fixed IP address as part of the URL instead of a host name, if your server listens to incoming requests without a host name. ### Optional -- **alert_on_load_time_limit_1** (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_1 threshold. Shows a yellow status in performance monitor. Defaults to `false`. -- **alert_on_load_time_limit_2** (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_2. Shows a red status in performance monitor. Defaults to `false`. -- **auth_type** (String) Specify the username of the appropriate credentials here. Defaults to `None`. -- **cert_expiration_warning_days** (Number) Specify the expiration warning days of the certificate. Defaults to `7` days. -- **cert_fingerprint** (String) Specify the fingerprint of the certificate. Defaults to empty string to not check this field. -- **cert_issuer_company_name** (String) Specify the issuer company name of the certificate. Defaults to empty string to not check this field. -- **cert_issuer_name** (String) Specify the issuer common name of the certificate. Defaults to empty string to not check this field. -- **cert_issuer_org_unit** (String) Specify the issuer org unit of the certificate. Defaults to empty string to not check this field. -- **cert_name** (String) Specify the common name of the certificate. Defaults to empty string to not check this field. -- **cert_org** (String) Specify the organization of the certificate. Defaults to empty string to not check this field. -- **cert_org_unit** (String) Specify the organizational unit of the certificate. Defaults to empty string to not check this field. -- **cert_serial_number** (String) Specify the serial number of the certificate. Defaults to empty string to not check this field. -- **check_cert_errors** (Boolean) An HTTPS check will only pass our checks if the SSL certificate does not cause any errors. Only set this option to `false` if you really want to ignore SSL certificate issues. This parameter takes only effect if `type` has been set to `Https`. -- **check_interval** (Number) Numeric value for the time interval between individual checks, in minutes. The maximum value is 240 (4 hours). The minimum value depends on the type of monitor. Defaults to `5`. -- **generate_alert** (Boolean) When set to false, no alerts will be generated for this monitor in case of an error. Defaults to `true`. -- **id** (String) The ID of this resource. -- **ip_version** (String) IpV4 or IpV6. Indicates which IP version should be used to connect to the server or network address you specify. If you choose IPv6, the monitor will only be executed on checkpoint locations that support IPv6. Defaults to `IpV4`. -- **is_active** (Boolean) Indicates whether the monitor is actively running in the account. Defaults to `true`. -- **load_time_limit_1** (Number) Set threshold time in ms for requires `alert_on_load_time_limit_1` to be enabled. Defaults to `2500`. -- **load_time_limit_2** (Number) Set threshold time in ms for requires `alert_on_load_time_limit_2` to be enabled. Defaults to `5000`. -- **mode** (String) The monitor mode, either Development, Staging or Production. Defaults to `Production`. If monitoring mode is Development `is_active` has to be `false` -- **name_for_phone_alerts** (String) The value for the speech-friendly monitor name, if applicable. This is the monitor name we’ll use in text-to-speech phone alerting, provided that the ‘Use alternate monitor names’ option has been enabled in the phone alert integration. -- **native_ipv6_only** (Boolean) True or False. This setting only applies when you select IpV6 for the IpVersion field. Set this value to true to only execute your monitor on checkpoint servers that support native IPv6 connectivity. Defaults to `false`. -- **notes** (String) Your notes for this monitor. -- **password** (String, Sensitive) See the Username field. Specify the corresponding password value here. -- **primary_checkpoints_only** (Boolean) Only set this to False when you’re sure you want to execute your monitor on non-primary checkpoints. Defaults to `true`. -- **selected_checkpoints** (Block List, Max: 1) (see [below for nested schema](#nestedblock--selected_checkpoints)) -- **username** (String) Specify the username of the appropriate credentials here. +- `alert_on_load_time_limit_1` (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_1 threshold. Shows a yellow status in performance monitor. Defaults to `false`. +- `alert_on_load_time_limit_2` (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_2. Shows a red status in performance monitor. Defaults to `false`. +- `auth_type` (String) Specify the username of the appropriate credentials here. Defaults to `None`. +- `cert_expiration_warning_days` (Number) Specify the expiration warning days of the certificate. Defaults to `7` days. +- `cert_fingerprint` (String) Specify the fingerprint of the certificate. Defaults to empty string to not check this field. +- `cert_issuer_company_name` (String) Specify the issuer company name of the certificate. Defaults to empty string to not check this field. +- `cert_issuer_name` (String) Specify the issuer common name of the certificate. Defaults to empty string to not check this field. +- `cert_issuer_org_unit` (String) Specify the issuer org unit of the certificate. Defaults to empty string to not check this field. +- `cert_name` (String) Specify the common name of the certificate. Defaults to empty string to not check this field. +- `cert_org` (String) Specify the organization of the certificate. Defaults to empty string to not check this field. +- `cert_org_unit` (String) Specify the organizational unit of the certificate. Defaults to empty string to not check this field. +- `cert_serial_number` (String) Specify the serial number of the certificate. Defaults to empty string to not check this field. +- `check_cert_errors` (Boolean) An HTTPS check will only pass our checks if the SSL certificate does not cause any errors. Only set this option to `false` if you really want to ignore SSL certificate issues. This parameter takes only effect if `type` has been set to `Https`. +- `check_interval` (Number) Numeric value for the time interval between individual checks, in minutes. The maximum value is 240 (4 hours). The minimum value depends on the type of monitor. Defaults to `5`. +- `generate_alert` (Boolean) When set to false, no alerts will be generated for this monitor in case of an error. Defaults to `true`. +- `ip_version` (String) IpV4 or IpV6. Indicates which IP version should be used to connect to the server or network address you specify. If you choose IPv6, the monitor will only be executed on checkpoint locations that support IPv6. Defaults to `IpV4`. +- `is_active` (Boolean) Indicates whether the monitor is actively running in the account. Defaults to `true`. +- `load_time_limit_1` (Number) Set threshold time in ms for requires `alert_on_load_time_limit_1` to be enabled. Defaults to `2500`. +- `load_time_limit_2` (Number) Set threshold time in ms for requires `alert_on_load_time_limit_2` to be enabled. Defaults to `5000`. +- `mode` (String) The monitor mode, either Development, Staging or Production. Defaults to `Production`. If monitoring mode is Development `is_active` has to be `false` +- `name_for_phone_alerts` (String) The value for the speech-friendly monitor name, if applicable. This is the monitor name we’ll use in text-to-speech phone alerting, provided that the ‘Use alternate monitor names’ option has been enabled in the phone alert integration. +- `notes` (String) Your notes for this monitor. +- `password` (String, Sensitive) See the Username field. Specify the corresponding password value here. +- `primary_checkpoints_only` (Boolean) Only set this to False when you’re sure you want to execute your monitor on non-primary checkpoints. Defaults to `true`. +- `selected_checkpoints` (Block List, Max: 1) (see [below for nested schema](#nestedblock--selected_checkpoints)) +- `username` (String) Specify the username of the appropriate credentials here. ### Read-Only -- **is_locked** (Boolean) It specifies whether the monitor is currently locked for editing. This happens if the Support team is reviewing your monitor. +- `id` (String) The ID of this resource. +- `is_locked` (Boolean) It specifies whether the monitor is currently locked for editing. This happens if the Support team is reviewing your monitor. ### Nested Schema for `selected_checkpoints` Optional: -- **checkpoints** (Set of String) A checkpoint is a geographic location from which you can have your service uptime and performance checked periodically. Provide checkpoint ids or names. -- **exclude_locations** (Set of String) It is possible to keep an entire region of checkpoints (e.g. Canada) selected (with the benefit of automatically getting new checkpoints as they are added to that region) but have additional control over individual checkpoint locations that you want to skip. Provide checkpoint ids or names. -- **regions** (Set of String) A Region contains one or more checkpoints, just define a region if all checkpoints in a region should be used. Provide region id or name. +- `checkpoints` (Set of String) A checkpoint is a geographic location from which you can have your service uptime and performance checked periodically. Provide checkpoint ids or names. +- `exclude_locations` (Set of String) It is possible to keep an entire region of checkpoints (e.g. Canada) selected (with the benefit of automatically getting new checkpoints as they are added to that region) but have additional control over individual checkpoint locations that you want to skip. Provide checkpoint ids or names. +- `regions` (Set of String) A Region contains one or more checkpoints, just define a region if all checkpoints in a region should be used. Provide region id or name. diff --git a/docs/resources/monitor_database_server.md b/docs/resources/monitor_database_server.md index 7ef82e0b..38d35088 100644 --- a/docs/resources/monitor_database_server.md +++ b/docs/resources/monitor_database_server.md @@ -43,43 +43,42 @@ resource "uptrends_monitor_database_server" "example" { ### Required -- **name** (String) Display name for the Ping Monitor resource. -- **network_address** (String) The network address that should be used to connect to the server or service you want to monitor. -- **port** (Number) The TCP Port for the dns Monitor, has to be between `1` and `65535`. Defaults to `53`. +- `name` (String) Display name for the Ping Monitor resource. +- `network_address` (String) The network address that should be used to connect to the server or service you want to monitor. +- `port` (Number) The TCP Port for the dns Monitor, has to be between `1` and `65535`. Defaults to `53`. ### Optional -- **alert_on_load_time_limit_1** (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_1 threshold. Shows a yellow status in performance monitor. Defaults to `false`. -- **alert_on_load_time_limit_2** (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_2. Shows a red status in performance monitor. Defaults to `false`. -- **check_interval** (Number) Numeric value for the time interval between individual checks, in minutes. The maximum value is 240 (4 hours). The minimum value depends on the type of monitor. Defaults to `5`. -- **db_name** (String) Optionally specify the name of the database you want to connect to. -- **generate_alert** (Boolean) When set to false, no alerts will be generated for this monitor in case of an error. Defaults to `true`. -- **id** (String) The ID of this resource. -- **ip_version** (String) IpV4 or IpV6. Indicates which IP version should be used to connect to the server or network address you specify. If you choose IPv6, the monitor will only be executed on checkpoint locations that support IPv6. Defaults to `IpV4`. -- **is_active** (Boolean) Indicates whether the monitor is actively running in the account. Defaults to `true`. -- **load_time_limit_1** (Number) Set threshold time in ms for requires `alert_on_load_time_limit_1` to be enabled. Defaults to `2500`. -- **load_time_limit_2** (Number) Set threshold time in ms for requires `alert_on_load_time_limit_2` to be enabled. Defaults to `5000`. -- **mode** (String) The monitor mode, either Development, Staging or Production. Defaults to `Production`. If monitoring mode is Development `is_active` has to be `false` -- **name_for_phone_alerts** (String) The value for the speech-friendly monitor name, if applicable. This is the monitor name we’ll use in text-to-speech phone alerting, provided that the ‘Use alternate monitor names’ option has been enabled in the phone alert integration. -- **native_ipv6_only** (Boolean) True or False. This setting only applies when you select IpV6 for the IpVersion field. Set this value to true to only execute your monitor on checkpoint servers that support native IPv6 connectivity. Defaults to `false`. -- **notes** (String) Your notes for this monitor. -- **password** (String, Sensitive) See the Username field. Specify the corresponding password value here. -- **primary_checkpoints_only** (Boolean) Only set this to False when you’re sure you want to execute your monitor on non-primary checkpoints. Defaults to `true`. -- **selected_checkpoints** (Block List, Max: 1) (see [below for nested schema](#nestedblock--selected_checkpoints)) -- **type** (String) Select between `MySQL` and `MSSQL` monitor type. Defaults to `MySQL` -- **username** (String) Specify the username of the appropriate credentials here. +- `alert_on_load_time_limit_1` (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_1 threshold. Shows a yellow status in performance monitor. Defaults to `false`. +- `alert_on_load_time_limit_2` (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_2. Shows a red status in performance monitor. Defaults to `false`. +- `check_interval` (Number) Numeric value for the time interval between individual checks, in minutes. The maximum value is 240 (4 hours). The minimum value depends on the type of monitor. Defaults to `5`. +- `db_name` (String) Optionally specify the name of the database you want to connect to. +- `generate_alert` (Boolean) When set to false, no alerts will be generated for this monitor in case of an error. Defaults to `true`. +- `ip_version` (String) IpV4 or IpV6. Indicates which IP version should be used to connect to the server or network address you specify. If you choose IPv6, the monitor will only be executed on checkpoint locations that support IPv6. Defaults to `IpV4`. +- `is_active` (Boolean) Indicates whether the monitor is actively running in the account. Defaults to `true`. +- `load_time_limit_1` (Number) Set threshold time in ms for requires `alert_on_load_time_limit_1` to be enabled. Defaults to `2500`. +- `load_time_limit_2` (Number) Set threshold time in ms for requires `alert_on_load_time_limit_2` to be enabled. Defaults to `5000`. +- `mode` (String) The monitor mode, either Development, Staging or Production. Defaults to `Production`. If monitoring mode is Development `is_active` has to be `false` +- `name_for_phone_alerts` (String) The value for the speech-friendly monitor name, if applicable. This is the monitor name we’ll use in text-to-speech phone alerting, provided that the ‘Use alternate monitor names’ option has been enabled in the phone alert integration. +- `notes` (String) Your notes for this monitor. +- `password` (String, Sensitive) See the Username field. Specify the corresponding password value here. +- `primary_checkpoints_only` (Boolean) Only set this to False when you’re sure you want to execute your monitor on non-primary checkpoints. Defaults to `true`. +- `selected_checkpoints` (Block List, Max: 1) (see [below for nested schema](#nestedblock--selected_checkpoints)) +- `type` (String) Select between `MySQL` and `MSSQL` monitor type. Defaults to `MySQL` +- `username` (String) Specify the username of the appropriate credentials here. ### Read-Only -- **is_locked** (Boolean) It specifies whether the monitor is currently locked for editing. This happens if the Support team is reviewing your monitor. +- `id` (String) The ID of this resource. +- `is_locked` (Boolean) It specifies whether the monitor is currently locked for editing. This happens if the Support team is reviewing your monitor. ### Nested Schema for `selected_checkpoints` Optional: -- **checkpoints** (Set of String) A checkpoint is a geographic location from which you can have your service uptime and performance checked periodically. Provide checkpoint ids or names. -- **exclude_locations** (Set of String) It is possible to keep an entire region of checkpoints (e.g. Canada) selected (with the benefit of automatically getting new checkpoints as they are added to that region) but have additional control over individual checkpoint locations that you want to skip. Provide checkpoint ids or names. -- **regions** (Set of String) A Region contains one or more checkpoints, just define a region if all checkpoints in a region should be used. Provide region id or name. +- `checkpoints` (Set of String) A checkpoint is a geographic location from which you can have your service uptime and performance checked periodically. Provide checkpoint ids or names. +- `exclude_locations` (Set of String) It is possible to keep an entire region of checkpoints (e.g. Canada) selected (with the benefit of automatically getting new checkpoints as they are added to that region) but have additional control over individual checkpoint locations that you want to skip. Provide checkpoint ids or names. +- `regions` (Set of String) A Region contains one or more checkpoints, just define a region if all checkpoints in a region should be used. Provide region id or name. diff --git a/docs/resources/monitor_dns.md b/docs/resources/monitor_dns.md index 9479f48e..7b9fd1a9 100644 --- a/docs/resources/monitor_dns.md +++ b/docs/resources/monitor_dns.md @@ -42,42 +42,42 @@ resource "uptrends_monitor_dns" "example" { ### Required -- **dns_expected_result** (String) The result you expect to get back from DNS query. -- **dns_query** (String) The Type of DNS query you want to perform. Alloed values are `ARecord`, `CnameRecord`, `MxRecord`, `NsRecord`, `TxtRecord`, `SoaRecord`, `RootServer`, `AaaaRecord`, `SrvRecord`. -- **dns_test_value** (String) The value to test for e.g. example.com. -- **name** (String) Display name for the Ping Monitor resource. +- `dns_expected_result` (String) The result you expect to get back from DNS query. +- `dns_query` (String) The Type of DNS query you want to perform. Alloed values are `ARecord`, `CnameRecord`, `MxRecord`, `NsRecord`, `TxtRecord`, `SoaRecord`, `RootServer`, `AaaaRecord`, `SrvRecord`. +- `dns_test_value` (String) The value to test for e.g. example.com. +- `name` (String) Display name for the Ping Monitor resource. ### Optional -- **alert_on_load_time_limit_1** (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_1 threshold. Shows a yellow status in performance monitor. Defaults to `false`. -- **alert_on_load_time_limit_2** (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_2. Shows a red status in performance monitor. Defaults to `false`. -- **check_interval** (Number) Numeric value for the time interval between individual checks, in minutes. The maximum value is 240 (4 hours). The minimum value depends on the type of monitor. Defaults to `5`. -- **dns_server** (String) The DNS Server that contains the entries you want to test. -- **generate_alert** (Boolean) When set to false, no alerts will be generated for this monitor in case of an error. Defaults to `true`. -- **id** (String) The ID of this resource. -- **ip_version** (String) IpV4 or IpV6. Indicates which IP version should be used to connect to the server or network address you specify. If you choose IPv6, the monitor will only be executed on checkpoint locations that support IPv6. Defaults to `IpV4`. -- **is_active** (Boolean) Indicates whether the monitor is actively running in the account. Defaults to `true`. -- **load_time_limit_1** (Number) Set threshold time in ms for requires `alert_on_load_time_limit_1` to be enabled. Defaults to `2500`. -- **load_time_limit_2** (Number) Set threshold time in ms for requires `alert_on_load_time_limit_2` to be enabled. Defaults to `5000`. -- **mode** (String) The monitor mode, either Development, Staging or Production. Defaults to `Production`. If monitoring mode is Development `is_active` has to be `false` -- **name_for_phone_alerts** (String) The value for the speech-friendly monitor name, if applicable. This is the monitor name we’ll use in text-to-speech phone alerting, provided that the ‘Use alternate monitor names’ option has been enabled in the phone alert integration. -- **native_ipv6_only** (Boolean) True or False. This setting only applies when you select IpV6 for the IpVersion field. Set this value to true to only execute your monitor on checkpoint servers that support native IPv6 connectivity. Defaults to `false`. -- **notes** (String) Your notes for this monitor. -- **port** (Number) The TCP Port for the dns Monitor, has to be between `1` and `65535`. Defaults to `53`. -- **primary_checkpoints_only** (Boolean) Only set this to False when you’re sure you want to execute your monitor on non-primary checkpoints. Defaults to `true`. -- **selected_checkpoints** (Block List, Max: 1) (see [below for nested schema](#nestedblock--selected_checkpoints)) +- `alert_on_load_time_limit_1` (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_1 threshold. Shows a yellow status in performance monitor. Defaults to `false`. +- `alert_on_load_time_limit_2` (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_2. Shows a red status in performance monitor. Defaults to `false`. +- `check_interval` (Number) Numeric value for the time interval between individual checks, in minutes. The maximum value is 240 (4 hours). The minimum value depends on the type of monitor. Defaults to `5`. +- `dns_server` (String) The DNS Server that contains the entries you want to test. +- `generate_alert` (Boolean) When set to false, no alerts will be generated for this monitor in case of an error. Defaults to `true`. +- `ip_version` (String) IpV4 or IpV6. Indicates which IP version should be used to connect to the server or network address you specify. If you choose IPv6, the monitor will only be executed on checkpoint locations that support IPv6. Defaults to `IpV4`. +- `is_active` (Boolean) Indicates whether the monitor is actively running in the account. Defaults to `true`. +- `load_time_limit_1` (Number) Set threshold time in ms for requires `alert_on_load_time_limit_1` to be enabled. Defaults to `2500`. +- `load_time_limit_2` (Number) Set threshold time in ms for requires `alert_on_load_time_limit_2` to be enabled. Defaults to `5000`. +- `mode` (String) The monitor mode, either Development, Staging or Production. Defaults to `Production`. If monitoring mode is Development `is_active` has to be `false` +- `name_for_phone_alerts` (String) The value for the speech-friendly monitor name, if applicable. This is the monitor name we’ll use in text-to-speech phone alerting, provided that the ‘Use alternate monitor names’ option has been enabled in the phone alert integration. +- `native_ipv6_only` (Boolean) True or False. This setting only applies when you select IpV6 for the IpVersion field. Set this value to true to only execute your monitor on checkpoint servers that support native IPv6 connectivity. Defaults to `false`. +- `notes` (String) Your notes for this monitor. +- `port` (Number) The TCP Port for the dns Monitor, has to be between `1` and `65535`. Defaults to `53`. +- `primary_checkpoints_only` (Boolean) Only set this to False when you’re sure you want to execute your monitor on non-primary checkpoints. Defaults to `true`. +- `selected_checkpoints` (Block List, Max: 1) (see [below for nested schema](#nestedblock--selected_checkpoints)) ### Read-Only -- **is_locked** (Boolean) It specifies whether the monitor is currently locked for editing. This happens if the Support team is reviewing your monitor. +- `id` (String) The ID of this resource. +- `is_locked` (Boolean) It specifies whether the monitor is currently locked for editing. This happens if the Support team is reviewing your monitor. ### Nested Schema for `selected_checkpoints` Optional: -- **checkpoints** (Set of String) A checkpoint is a geographic location from which you can have your service uptime and performance checked periodically. Provide checkpoint ids or names. -- **exclude_locations** (Set of String) It is possible to keep an entire region of checkpoints (e.g. Canada) selected (with the benefit of automatically getting new checkpoints as they are added to that region) but have additional control over individual checkpoint locations that you want to skip. Provide checkpoint ids or names. -- **regions** (Set of String) A Region contains one or more checkpoints, just define a region if all checkpoints in a region should be used. Provide region id or name. +- `checkpoints` (Set of String) A checkpoint is a geographic location from which you can have your service uptime and performance checked periodically. Provide checkpoint ids or names. +- `exclude_locations` (Set of String) It is possible to keep an entire region of checkpoints (e.g. Canada) selected (with the benefit of automatically getting new checkpoints as they are added to that region) but have additional control over individual checkpoint locations that you want to skip. Provide checkpoint ids or names. +- `regions` (Set of String) A Region contains one or more checkpoints, just define a region if all checkpoints in a region should be used. Provide region id or name. diff --git a/docs/resources/monitor_fpc.md b/docs/resources/monitor_fpc.md index b14b7780..f95160b0 100644 --- a/docs/resources/monitor_fpc.md +++ b/docs/resources/monitor_fpc.md @@ -74,59 +74,59 @@ resource "uptrends_monitor_fpc" "example" { ### Required -- **name** (String) Display name for the Ping Monitor resource. -- **url** (String) The full URL of the appropriate website, page or service that you want to monitor. The URL should include “http://” or “https://”. If relevant, please also include a port number if you are using a non-default port number, e.g. https://your-domain.com:8080/your-page. You can also use a fixed IP address as part of the URL instead of a host name, if your server listens to incoming requests without a host name. +- `name` (String) Display name for the Ping Monitor resource. +- `url` (String) The full URL of the appropriate website, page or service that you want to monitor. The URL should include “http://” or “https://”. If relevant, please also include a port number if you are using a non-default port number, e.g. https://your-domain.com:8080/your-page. You can also use a fixed IP address as part of the URL instead of a host name, if your server listens to incoming requests without a host name. ### Optional -- **alert_on_load_time_limit_1** (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_1 threshold. Shows a yellow status in performance monitor. Defaults to `false`. -- **alert_on_load_time_limit_2** (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_2. Shows a red status in performance monitor. Defaults to `false`. -- **alert_on_max_bytes** (Boolean) Enable this option if you want to check that the response of the Server not exceed `max_bytes` of bytes. Defaults to `false` -- **alert_on_max_element_bytes** (Boolean) Enable this option if you want to check that any element on your page not exceeds `max_element_bytes` of bytes. Defaults to `false` -- **alert_on_min_bytes** (Boolean) Enable this option if you want to check that the response of the Server contains at least `min_bytes` of bytes. Defaults to `false` -- **alert_on_percentage_fail** (Boolean) Enable this option if you want the time-, size-, or content-checks to generate alerts. -- **auth_type** (String) Specify the username of the appropriate credentials here. Defaults to `None`. -- **block_google_analytics** (Boolean) Enable this option if outgoing monitoring requests should block google analytics. -- **block_uptrends_rum** (Boolean) Enable this option if outgoing monitoring requests should block uptrends rum. -- **block_urls** (Set of String) Set Urls which should be blocked by outgoing monitoring requests. -- **browser_type** (String) The Type of Browser used to Load the Website. Allowed values are `Chrome`, `Firefox`, `IE`, `PhantomJS`, `PhantomJS20` and `Safari`. Defaults to `Chrome`. -- **browser_window_dimensions** (Block List, Max: 1) (see [below for nested schema](#nestedblock--browser_window_dimensions)) -- **check_interval** (Number) Numeric value for the time interval between individual checks, in minutes. The maximum value is 240 (4 hours). The minimum value depends on the type of monitor. Defaults to `5`. -- **failed_object_percentage** (Number) Specify a percentage treshold on which your want to get alerted 0% will report all element load failures -- **generate_alert** (Boolean) When set to false, no alerts will be generated for this monitor in case of an error. Defaults to `true`. -- **id** (String) The ID of this resource. -- **ignore_external_elements** (Boolean) Enable this option if you don't want to include external elements in any error condition that are related to download size. -- **is_active** (Boolean) Indicates whether the monitor is actively running in the account. Defaults to `true`. -- **load_time_limit_1** (Number) Set threshold time in ms for requires `alert_on_load_time_limit_1` to be enabled. Defaults to `2500`. -- **load_time_limit_2** (Number) Set threshold time in ms for requires `alert_on_load_time_limit_2` to be enabled. Defaults to `5000`. -- **match_pattern** (Block List) (see [below for nested schema](#nestedblock--match_pattern)) -- **max_bytes** (Number) Set threshold bytes that the response of the Server must at least contains. Required `alert_on_max_bytes` to be enabled. -- **max_element_bytes** (Number) Set threshold bytes that the response of the Server must at least contains. Required `alert_on_max_element_bytes` to be enabled. -- **min_bytes** (Number) Set threshold bytes that the response of the Server must at least contains. Required `alert_on_min_bytes` to be enabled. -- **mode** (String) The monitor mode, either Development, Staging or Production. Defaults to `Production`. If monitoring mode is Development `is_active` has to be `false` -- **name_for_phone_alerts** (String) The value for the speech-friendly monitor name, if applicable. This is the monitor name we’ll use in text-to-speech phone alerting, provided that the ‘Use alternate monitor names’ option has been enabled in the phone alert integration. -- **notes** (String) Your notes for this monitor. -- **password** (String, Sensitive) See the Username field. Specify the corresponding password value here. -- **primary_checkpoints_only** (Boolean) Only set this to False when you’re sure you want to execute your monitor on non-primary checkpoints. Defaults to `true`. -- **request_headers** (Block List) (see [below for nested schema](#nestedblock--request_headers)) -- **selected_checkpoints** (Block List, Max: 1) (see [below for nested schema](#nestedblock--selected_checkpoints)) -- **user_agent** (String) A string value that identifies which HTTP client is making the HTTP request. A browser typically sends a value that identifies the browser type and version. -- **username** (String) Specify the username of the appropriate credentials here. +- `alert_on_load_time_limit_1` (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_1 threshold. Shows a yellow status in performance monitor. Defaults to `false`. +- `alert_on_load_time_limit_2` (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_2. Shows a red status in performance monitor. Defaults to `false`. +- `alert_on_max_bytes` (Boolean) Enable this option if you want to check that the response of the Server not exceed `max_bytes` of bytes. Defaults to `false` +- `alert_on_max_element_bytes` (Boolean) Enable this option if you want to check that any element on your page not exceeds `max_element_bytes` of bytes. Defaults to `false` +- `alert_on_min_bytes` (Boolean) Enable this option if you want to check that the response of the Server contains at least `min_bytes` of bytes. Defaults to `false` +- `alert_on_percentage_fail` (Boolean) Enable this option if you want the time-, size-, or content-checks to generate alerts. +- `auth_type` (String) Specify the username of the appropriate credentials here. Defaults to `None`. +- `block_google_analytics` (Boolean) Enable this option if outgoing monitoring requests should block google analytics. +- `block_uptrends_rum` (Boolean) Enable this option if outgoing monitoring requests should block uptrends rum. +- `block_urls` (Set of String) Set Urls which should be blocked by outgoing monitoring requests. +- `browser_type` (String) The Type of Browser used to Load the Website. Allowed values are `Chrome`, `Firefox`, `IE`, `PhantomJS`, `PhantomJS20` and `Safari`. Defaults to `Chrome`. +- `browser_window_dimensions` (Block List, Max: 1) (see [below for nested schema](#nestedblock--browser_window_dimensions)) +- `check_interval` (Number) Numeric value for the time interval between individual checks, in minutes. The maximum value is 240 (4 hours). The minimum value depends on the type of monitor. Defaults to `5`. +- `failed_object_percentage` (Number) Specify a percentage treshold on which your want to get alerted 0% will report all element load failures +- `generate_alert` (Boolean) When set to false, no alerts will be generated for this monitor in case of an error. Defaults to `true`. +- `ignore_external_elements` (Boolean) Enable this option if you don't want to include external elements in any error condition that are related to download size. +- `is_active` (Boolean) Indicates whether the monitor is actively running in the account. Defaults to `true`. +- `load_time_limit_1` (Number) Set threshold time in ms for requires `alert_on_load_time_limit_1` to be enabled. Defaults to `2500`. +- `load_time_limit_2` (Number) Set threshold time in ms for requires `alert_on_load_time_limit_2` to be enabled. Defaults to `5000`. +- `match_pattern` (Block List) (see [below for nested schema](#nestedblock--match_pattern)) +- `max_bytes` (Number) Set threshold bytes that the response of the Server must at least contains. Required `alert_on_max_bytes` to be enabled. +- `max_element_bytes` (Number) Set threshold bytes that the response of the Server must at least contains. Required `alert_on_max_element_bytes` to be enabled. +- `min_bytes` (Number) Set threshold bytes that the response of the Server must at least contains. Required `alert_on_min_bytes` to be enabled. +- `mode` (String) The monitor mode, either Development, Staging or Production. Defaults to `Production`. If monitoring mode is Development `is_active` has to be `false` +- `name_for_phone_alerts` (String) The value for the speech-friendly monitor name, if applicable. This is the monitor name we’ll use in text-to-speech phone alerting, provided that the ‘Use alternate monitor names’ option has been enabled in the phone alert integration. +- `notes` (String) Your notes for this monitor. +- `password` (String, Sensitive) See the Username field. Specify the corresponding password value here. +- `primary_checkpoints_only` (Boolean) Only set this to False when you’re sure you want to execute your monitor on non-primary checkpoints. Defaults to `true`. +- `request_headers` (Block List) (see [below for nested schema](#nestedblock--request_headers)) +- `selected_checkpoints` (Block List, Max: 1) (see [below for nested schema](#nestedblock--selected_checkpoints)) +- `user_agent` (String) A string value that identifies which HTTP client is making the HTTP request. A browser typically sends a value that identifies the browser type and version. +- `username` (String) Specify the username of the appropriate credentials here. ### Read-Only -- **is_locked** (Boolean) It specifies whether the monitor is currently locked for editing. This happens if the Support team is reviewing your monitor. +- `id` (String) The ID of this resource. +- `is_locked` (Boolean) It specifies whether the monitor is currently locked for editing. This happens if the Support team is reviewing your monitor. ### Nested Schema for `browser_window_dimensions` Optional: -- **height** (Number) Set the height for resolution size. -- **is_mobile** (Boolean) Enable for Mobile simulation. -- **mobile_device** (String) Define the mobile device if `is_mobile` set to true. -- **pixel_ratio** (Number) The device pixel ratio is the ratio between physical pixels and logical pixels. -- **width** (Number) Set the width for resolution size. +- `height` (Number) Set the height for resolution size. +- `is_mobile` (Boolean) Enable for Mobile simulation. +- `mobile_device` (String) Define the mobile device if `is_mobile` set to true. +- `pixel_ratio` (Number) The device pixel ratio is the ratio between physical pixels and logical pixels. +- `width` (Number) Set the width for resolution size. @@ -134,8 +134,8 @@ Optional: Required: -- **is_positive** (Boolean) Set this value to `true` if you want to verify that your web page contains `pattern`. Set to false if you want to verify that your web page does not contain that text. -- **pattern** (String) Insert a word or phrase if you want to verify that your web page contains that text. +- `is_positive` (Boolean) Set this value to `true` if you want to verify that your web page contains `pattern`. Set to false if you want to verify that your web page does not contain that text. +- `pattern` (String) Insert a word or phrase if you want to verify that your web page contains that text. @@ -143,8 +143,8 @@ Required: Required: -- **name** (String) Specify an HTTP header name used by your requests. -- **value** (String) Specify an HTTP header value used by your requests. +- `name` (String) Specify an HTTP header name used by your requests. +- `value` (String) Specify an HTTP header value used by your requests. @@ -152,8 +152,8 @@ Required: Optional: -- **checkpoints** (Set of String) A checkpoint is a geographic location from which you can have your service uptime and performance checked periodically. Provide checkpoint ids or names. -- **exclude_locations** (Set of String) It is possible to keep an entire region of checkpoints (e.g. Canada) selected (with the benefit of automatically getting new checkpoints as they are added to that region) but have additional control over individual checkpoint locations that you want to skip. Provide checkpoint ids or names. -- **regions** (Set of String) A Region contains one or more checkpoints, just define a region if all checkpoints in a region should be used. Provide region id or name. +- `checkpoints` (Set of String) A checkpoint is a geographic location from which you can have your service uptime and performance checked periodically. Provide checkpoint ids or names. +- `exclude_locations` (Set of String) It is possible to keep an entire region of checkpoints (e.g. Canada) selected (with the benefit of automatically getting new checkpoints as they are added to that region) but have additional control over individual checkpoint locations that you want to skip. Provide checkpoint ids or names. +- `regions` (Set of String) A Region contains one or more checkpoints, just define a region if all checkpoints in a region should be used. Provide region id or name. diff --git a/docs/resources/monitor_group.md b/docs/resources/monitor_group.md index 69e76d17..5714c70c 100644 --- a/docs/resources/monitor_group.md +++ b/docs/resources/monitor_group.md @@ -23,14 +23,11 @@ resource "uptrends_monitor_group" "example" { ### Required -- **description** (String) Set an descriptive name for the Monitor Group resource. - -### Optional - -- **id** (String) The ID of this resource. +- `description` (String) Set an descriptive name for the Monitor Group resource. ### Read-Only -- **is_all** (Boolean) Indicates whether this group is the `All Monitors` system group. +- `id` (String) The ID of this resource. +- `is_all` (Boolean) Indicates whether this group is the `All Monitors` system group. diff --git a/docs/resources/monitor_network.md b/docs/resources/monitor_network.md index 5a671e31..f1fedeed 100644 --- a/docs/resources/monitor_network.md +++ b/docs/resources/monitor_network.md @@ -36,40 +36,39 @@ resource "uptrends_monitor_network" "example" { ### Required -- **name** (String) Display name for the Ping Monitor resource. -- **network_address** (String) The network address that should be used to connect to the server or service you want to monitor. +- `name` (String) Display name for the Ping Monitor resource. +- `network_address` (String) The network address that should be used to connect to the server or service you want to monitor. ### Optional -- **alert_on_load_time_limit_1** (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_1 threshold. Shows a yellow status in performance monitor. Defaults to `false`. -- **alert_on_load_time_limit_2** (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_2. Shows a red status in performance monitor. Defaults to `false`. -- **check_interval** (Number) Numeric value for the time interval between individual checks, in minutes. The maximum value is 240 (4 hours). The minimum value depends on the type of monitor. Defaults to `5`. -- **generate_alert** (Boolean) When set to false, no alerts will be generated for this monitor in case of an error. Defaults to `true`. -- **id** (String) The ID of this resource. -- **ip_version** (String) IpV4 or IpV6. Indicates which IP version should be used to connect to the server or network address you specify. If you choose IPv6, the monitor will only be executed on checkpoint locations that support IPv6. Defaults to `IpV4`. -- **is_active** (Boolean) Indicates whether the monitor is actively running in the account. Defaults to `true`. -- **load_time_limit_1** (Number) Set threshold time in ms for requires `alert_on_load_time_limit_1` to be enabled. Defaults to `2500`. -- **load_time_limit_2** (Number) Set threshold time in ms for requires `alert_on_load_time_limit_2` to be enabled. Defaults to `5000`. -- **mode** (String) The monitor mode, either Development, Staging or Production. Defaults to `Production`. If monitoring mode is Development `is_active` has to be `false` -- **name_for_phone_alerts** (String) The value for the speech-friendly monitor name, if applicable. This is the monitor name we’ll use in text-to-speech phone alerting, provided that the ‘Use alternate monitor names’ option has been enabled in the phone alert integration. -- **native_ipv6_only** (Boolean) True or False. This setting only applies when you select IpV6 for the IpVersion field. Set this value to true to only execute your monitor on checkpoint servers that support native IPv6 connectivity. Defaults to `false`. -- **notes** (String) Your notes for this monitor. -- **port** (Number) The TCP Port for the connect Monitor. Only used by connect Monitor, has to be between `1` and `65535`. -- **primary_checkpoints_only** (Boolean) Only set this to False when you’re sure you want to execute your monitor on non-primary checkpoints. Defaults to `true`. -- **selected_checkpoints** (Block List, Max: 1) (see [below for nested schema](#nestedblock--selected_checkpoints)) -- **type** (String) Select between `Ping` and `Connect` monitor type. Defaults to `Ping` +- `alert_on_load_time_limit_1` (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_1 threshold. Shows a yellow status in performance monitor. Defaults to `false`. +- `alert_on_load_time_limit_2` (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_2. Shows a red status in performance monitor. Defaults to `false`. +- `check_interval` (Number) Numeric value for the time interval between individual checks, in minutes. The maximum value is 240 (4 hours). The minimum value depends on the type of monitor. Defaults to `5`. +- `generate_alert` (Boolean) When set to false, no alerts will be generated for this monitor in case of an error. Defaults to `true`. +- `ip_version` (String) IpV4 or IpV6. Indicates which IP version should be used to connect to the server or network address you specify. If you choose IPv6, the monitor will only be executed on checkpoint locations that support IPv6. Defaults to `IpV4`. +- `is_active` (Boolean) Indicates whether the monitor is actively running in the account. Defaults to `true`. +- `load_time_limit_1` (Number) Set threshold time in ms for requires `alert_on_load_time_limit_1` to be enabled. Defaults to `2500`. +- `load_time_limit_2` (Number) Set threshold time in ms for requires `alert_on_load_time_limit_2` to be enabled. Defaults to `5000`. +- `mode` (String) The monitor mode, either Development, Staging or Production. Defaults to `Production`. If monitoring mode is Development `is_active` has to be `false` +- `name_for_phone_alerts` (String) The value for the speech-friendly monitor name, if applicable. This is the monitor name we’ll use in text-to-speech phone alerting, provided that the ‘Use alternate monitor names’ option has been enabled in the phone alert integration. +- `notes` (String) Your notes for this monitor. +- `port` (Number) The TCP Port for the connect Monitor. Only used by connect Monitor, has to be between `1` and `65535`. +- `primary_checkpoints_only` (Boolean) Only set this to False when you’re sure you want to execute your monitor on non-primary checkpoints. Defaults to `true`. +- `selected_checkpoints` (Block List, Max: 1) (see [below for nested schema](#nestedblock--selected_checkpoints)) +- `type` (String) Select between `Ping` and `Connect` monitor type. Defaults to `Ping` ### Read-Only -- **is_locked** (Boolean) It specifies whether the monitor is currently locked for editing. This happens if the Support team is reviewing your monitor. +- `id` (String) The ID of this resource. +- `is_locked` (Boolean) It specifies whether the monitor is currently locked for editing. This happens if the Support team is reviewing your monitor. ### Nested Schema for `selected_checkpoints` Optional: -- **checkpoints** (Set of String) A checkpoint is a geographic location from which you can have your service uptime and performance checked periodically. Provide checkpoint ids or names. -- **exclude_locations** (Set of String) It is possible to keep an entire region of checkpoints (e.g. Canada) selected (with the benefit of automatically getting new checkpoints as they are added to that region) but have additional control over individual checkpoint locations that you want to skip. Provide checkpoint ids or names. -- **regions** (Set of String) A Region contains one or more checkpoints, just define a region if all checkpoints in a region should be used. Provide region id or name. +- `checkpoints` (Set of String) A checkpoint is a geographic location from which you can have your service uptime and performance checked periodically. Provide checkpoint ids or names. +- `exclude_locations` (Set of String) It is possible to keep an entire region of checkpoints (e.g. Canada) selected (with the benefit of automatically getting new checkpoints as they are added to that region) but have additional control over individual checkpoint locations that you want to skip. Provide checkpoint ids or names. +- `regions` (Set of String) A Region contains one or more checkpoints, just define a region if all checkpoints in a region should be used. Provide region id or name. diff --git a/docs/resources/monitor_web.md b/docs/resources/monitor_web.md index 89f542aa..a9c67c88 100644 --- a/docs/resources/monitor_web.md +++ b/docs/resources/monitor_web.md @@ -47,53 +47,53 @@ resource "uptrends_monitor_web" "test" { ### Required -- **name** (String) Display name for the Ping Monitor resource. -- **url** (String) The full URL of the appropriate website, page or service that you want to monitor. The URL should include “http://” or “https://”. If relevant, please also include a port number if you are using a non-default port number, e.g. https://your-domain.com:8080/your-page. You can also use a fixed IP address as part of the URL instead of a host name, if your server listens to incoming requests without a host name. +- `name` (String) Display name for the Ping Monitor resource. +- `url` (String) The full URL of the appropriate website, page or service that you want to monitor. The URL should include “http://” or “https://”. If relevant, please also include a port number if you are using a non-default port number, e.g. https://your-domain.com:8080/your-page. You can also use a fixed IP address as part of the URL instead of a host name, if your server listens to incoming requests without a host name. ### Optional -- **alert_on_load_time_limit_1** (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_1 threshold. Shows a yellow status in performance monitor. Defaults to `false`. -- **alert_on_load_time_limit_2** (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_2. Shows a red status in performance monitor. Defaults to `false`. -- **alert_on_min_bytes** (Boolean) Enable this option if you want to check that the response of the Server contains at least `min_bytes` of bytes. Defaults to `false` -- **auth_type** (String) Specify the username of the appropriate credentials here. Defaults to `None`. -- **check_cert_errors** (Boolean) An HTTPS check will only pass our checks if the SSL certificate does not cause any errors. Only set this option to `false` if you really want to ignore SSL certificate issues. This parameter takes only effect if `type` has been set to `Https`. -- **check_interval** (Number) Numeric value for the time interval between individual checks, in minutes. The maximum value is 240 (4 hours). The minimum value depends on the type of monitor. Defaults to `5`. -- **expected_http_status_code** (Number) Check for specific HTTP status code, any other than the specified status code, will generate an error. -- **generate_alert** (Boolean) When set to false, no alerts will be generated for this monitor in case of an error. Defaults to `true`. -- **http_method** (String) Specifies the HTTP methode for your monitor. Defaults to `GET`. -- **id** (String) The ID of this resource. -- **ip_version** (String) IpV4 or IpV6. Indicates which IP version should be used to connect to the server or network address you specify. If you choose IPv6, the monitor will only be executed on checkpoint locations that support IPv6. Defaults to `IpV4`. -- **is_active** (Boolean) Indicates whether the monitor is actively running in the account. Defaults to `true`. -- **load_time_limit_1** (Number) Set threshold time in ms for requires `alert_on_load_time_limit_1` to be enabled. Defaults to `2500`. -- **load_time_limit_2** (Number) Set threshold time in ms for requires `alert_on_load_time_limit_2` to be enabled. Defaults to `5000`. -- **match_pattern** (Block List) (see [below for nested schema](#nestedblock--match_pattern)) -- **min_bytes** (Number) Set threshold bytes that the response of the Server must at least contains. Required `alert_on_min_bytes` to be enabled. -- **mode** (String) The monitor mode, either Development, Staging or Production. Defaults to `Production`. If monitoring mode is Development `is_active` has to be `false` -- **name_for_phone_alerts** (String) The value for the speech-friendly monitor name, if applicable. This is the monitor name we’ll use in text-to-speech phone alerting, provided that the ‘Use alternate monitor names’ option has been enabled in the phone alert integration. -- **native_ipv6_only** (Boolean) True or False. This setting only applies when you select IpV6 for the IpVersion field. Set this value to true to only execute your monitor on checkpoint servers that support native IPv6 connectivity. Defaults to `false`. -- **notes** (String) Your notes for this monitor. -- **password** (String, Sensitive) See the Username field. Specify the corresponding password value here. -- **primary_checkpoints_only** (Boolean) Only set this to False when you’re sure you want to execute your monitor on non-primary checkpoints. Defaults to `true`. -- **request_body** (String) When posting a form, fill in the form variables, every form variable has to be on separated line e.g. `foo=bar +- `alert_on_load_time_limit_1` (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_1 threshold. Shows a yellow status in performance monitor. Defaults to `false`. +- `alert_on_load_time_limit_2` (Boolean) Set this value to true, if you want to receive alerts if your server response is slower than load_time_limit_2. Shows a red status in performance monitor. Defaults to `false`. +- `alert_on_min_bytes` (Boolean) Enable this option if you want to check that the response of the Server contains at least `min_bytes` of bytes. Defaults to `false` +- `auth_type` (String) Specify the username of the appropriate credentials here. Defaults to `None`. +- `check_cert_errors` (Boolean) An HTTPS check will only pass our checks if the SSL certificate does not cause any errors. Only set this option to `false` if you really want to ignore SSL certificate issues. This parameter takes only effect if `type` has been set to `Https`. +- `check_interval` (Number) Numeric value for the time interval between individual checks, in minutes. The maximum value is 240 (4 hours). The minimum value depends on the type of monitor. Defaults to `5`. +- `expected_http_status_code` (Number) Check for specific HTTP status code, any other than the specified status code, will generate an error. +- `generate_alert` (Boolean) When set to false, no alerts will be generated for this monitor in case of an error. Defaults to `true`. +- `http_method` (String) Specifies the HTTP methode for your monitor. Defaults to `GET`. +- `ip_version` (String) IpV4 or IpV6. Indicates which IP version should be used to connect to the server or network address you specify. If you choose IPv6, the monitor will only be executed on checkpoint locations that support IPv6. Defaults to `IpV4`. +- `is_active` (Boolean) Indicates whether the monitor is actively running in the account. Defaults to `true`. +- `load_time_limit_1` (Number) Set threshold time in ms for requires `alert_on_load_time_limit_1` to be enabled. Defaults to `2500`. +- `load_time_limit_2` (Number) Set threshold time in ms for requires `alert_on_load_time_limit_2` to be enabled. Defaults to `5000`. +- `match_pattern` (Block List) (see [below for nested schema](#nestedblock--match_pattern)) +- `min_bytes` (Number) Set threshold bytes that the response of the Server must at least contains. Required `alert_on_min_bytes` to be enabled. +- `mode` (String) The monitor mode, either Development, Staging or Production. Defaults to `Production`. If monitoring mode is Development `is_active` has to be `false` +- `name_for_phone_alerts` (String) The value for the speech-friendly monitor name, if applicable. This is the monitor name we’ll use in text-to-speech phone alerting, provided that the ‘Use alternate monitor names’ option has been enabled in the phone alert integration. +- `native_ipv6_only` (Boolean) True or False. This setting only applies when you select IpV6 for the IpVersion field. Set this value to true to only execute your monitor on checkpoint servers that support native IPv6 connectivity. Defaults to `false`. +- `notes` (String) Your notes for this monitor. +- `password` (String, Sensitive) See the Username field. Specify the corresponding password value here. +- `primary_checkpoints_only` (Boolean) Only set this to False when you’re sure you want to execute your monitor on non-primary checkpoints. Defaults to `true`. +- `request_body` (String) When posting a form, fill in the form variables, every form variable has to be on separated line e.g. `foo=bar bar=foo `. Requires `http_method` to be set to `Post`. -- **request_headers** (Block List) (see [below for nested schema](#nestedblock--request_headers)) -- **selected_checkpoints** (Block List, Max: 1) (see [below for nested schema](#nestedblock--selected_checkpoints)) -- **type** (String) Select between `Http`, `Https`, `WebserviceHttp` and `WebserviceHttps` monitor type. Defaults to `Http` -- **user_agent** (String) A string value that identifies which HTTP client is making the HTTP request. A browser typically sends a value that identifies the browser type and version. -- **username** (String) Specify the username of the appropriate credentials here. +- `request_headers` (Block List) (see [below for nested schema](#nestedblock--request_headers)) +- `selected_checkpoints` (Block List, Max: 1) (see [below for nested schema](#nestedblock--selected_checkpoints)) +- `type` (String) Select between `Http`, `Https`, `WebserviceHttp` and `WebserviceHttps` monitor type. Defaults to `Http` +- `user_agent` (String) A string value that identifies which HTTP client is making the HTTP request. A browser typically sends a value that identifies the browser type and version. +- `username` (String) Specify the username of the appropriate credentials here. ### Read-Only -- **is_locked** (Boolean) It specifies whether the monitor is currently locked for editing. This happens if the Support team is reviewing your monitor. +- `id` (String) The ID of this resource. +- `is_locked` (Boolean) It specifies whether the monitor is currently locked for editing. This happens if the Support team is reviewing your monitor. ### Nested Schema for `match_pattern` Required: -- **is_positive** (Boolean) Set this value to `true` if you want to verify that your web page contains `pattern`. Set to false if you want to verify that your web page does not contain that text. -- **pattern** (String) Insert a word or phrase if you want to verify that your web page contains that text. +- `is_positive` (Boolean) Set this value to `true` if you want to verify that your web page contains `pattern`. Set to false if you want to verify that your web page does not contain that text. +- `pattern` (String) Insert a word or phrase if you want to verify that your web page contains that text. @@ -101,8 +101,8 @@ Required: Required: -- **name** (String) Specify an HTTP header name used by your requests. -- **value** (String) Specify an HTTP header value used by your requests. +- `name` (String) Specify an HTTP header name used by your requests. +- `value` (String) Specify an HTTP header value used by your requests. @@ -110,8 +110,8 @@ Required: Optional: -- **checkpoints** (Set of String) A checkpoint is a geographic location from which you can have your service uptime and performance checked periodically. Provide checkpoint ids or names. -- **exclude_locations** (Set of String) It is possible to keep an entire region of checkpoints (e.g. Canada) selected (with the benefit of automatically getting new checkpoints as they are added to that region) but have additional control over individual checkpoint locations that you want to skip. Provide checkpoint ids or names. -- **regions** (Set of String) A Region contains one or more checkpoints, just define a region if all checkpoints in a region should be used. Provide region id or name. +- `checkpoints` (Set of String) A checkpoint is a geographic location from which you can have your service uptime and performance checked periodically. Provide checkpoint ids or names. +- `exclude_locations` (Set of String) It is possible to keep an entire region of checkpoints (e.g. Canada) selected (with the benefit of automatically getting new checkpoints as they are added to that region) but have additional control over individual checkpoint locations that you want to skip. Provide checkpoint ids or names. +- `regions` (Set of String) A Region contains one or more checkpoints, just define a region if all checkpoints in a region should be used. Provide region id or name. diff --git a/docs/resources/operator_account.md b/docs/resources/operator_account.md index 5ea94c0d..b342a4fc 100644 --- a/docs/resources/operator_account.md +++ b/docs/resources/operator_account.md @@ -31,27 +31,27 @@ resource "uptrends_operator_account" "example" { ### Required -- **email** (String) Set the email of the operator account owner. -- **full_name** (String) Set the full name of the operator account owner. -- **password** (String, Sensitive) Specify the corresponding password value here. +- `email` (String) Set the email of the operator account owner. +- `full_name` (String) Set the full name of the operator account owner. +- `password` (String, Sensitive) Specify the corresponding password value here. ### Optional -- **allow_native_login** (Boolean) Should native login be enabled on the uptrends ui? -- **allow_single_signon** (Boolean) Should single signon be enabled on the uptrends ui? -- **backup_email** (String) Set the backup email of the operator account owner. -- **culture_name** (String) Set the locale which should be used for language, date/time and number. -- **default_dashboard** (String) Specify the dashboard that will be displayed after login. -- **id** (String) The ID of this resource. -- **is_on_duty** (Boolean) Set to true if this account should be on-duty. -- **mobile_phone** (String) Specify the mobile number of the Operator Account owner. Has to start with (+) followed by country code. -- **outgoing_phone_number_id** (Number) Define the ID for outgoing phone number which should be used by Phone provider. -- **sms_provider** (String) Define the sms provider that will be used sending alerts. -- **time_zone_id** (Number) Define the ID for timezone which should be used for this account. -- **use_numeric_sender** (Boolean) Define if the sms sender should be numeric. +- `allow_native_login` (Boolean) Should native login be enabled on the uptrends ui? +- `allow_single_signon` (Boolean) Should single signon be enabled on the uptrends ui? +- `backup_email` (String) Set the backup email of the operator account owner. +- `culture_name` (String) Set the locale which should be used for language, date/time and number. +- `default_dashboard` (String) Specify the dashboard that will be displayed after login. +- `is_on_duty` (Boolean) Set to true if this account should be on-duty. +- `mobile_phone` (String) Specify the mobile number of the Operator Account owner. Has to start with (+) followed by country code. +- `outgoing_phone_number_id` (Number) Define the ID for outgoing phone number which should be used by Phone provider. +- `sms_provider` (String) Define the sms provider that will be used sending alerts. +- `time_zone_id` (Number) Define the ID for timezone which should be used for this account. +- `use_numeric_sender` (Boolean) Define if the sms sender should be numeric. ### Read-Only -- **is_account_admin** (Boolean) Indicates whether the operator is account administrator or not. +- `id` (String) The ID of this resource. +- `is_account_admin` (Boolean) Indicates whether the operator is account administrator or not. diff --git a/go.mod b/go.mod index 6bd38711..0fc04df7 100644 --- a/go.mod +++ b/go.mod @@ -4,15 +4,15 @@ go 1.19 require ( github.com/hashicorp/terraform-plugin-docs v0.13.0 - github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1 github.com/stretchr/testify v1.8.1 - github.com/wasfree/uptrends-go-sdk v1.1.0 + github.com/wasfree/uptrends-go-sdk v1.2.0 ) require ( github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.1.1 // indirect - github.com/Masterminds/sprig/v3 v3.2.2 // indirect + github.com/Masterminds/semver/v3 v3.2.0 // indirect + github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/agext/levenshtein v1.2.3 // indirect github.com/apparentlymart/go-cidr v1.1.0 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect @@ -33,16 +33,16 @@ require ( github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/hc-install v0.4.0 // indirect - github.com/hashicorp/hcl/v2 v2.14.1 // indirect + github.com/hashicorp/hcl/v2 v2.15.0 // indirect github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.17.3 // indirect github.com/hashicorp/terraform-json v0.14.0 // indirect - github.com/hashicorp/terraform-plugin-go v0.14.1 // indirect + github.com/hashicorp/terraform-plugin-go v0.14.2 // indirect github.com/hashicorp/terraform-plugin-log v0.7.0 // indirect - github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c // indirect + github.com/hashicorp/terraform-registry-address v0.1.0 // indirect github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect github.com/hashicorp/yamux v0.1.1 // indirect - github.com/huandu/xstrings v1.3.3 // indirect + github.com/huandu/xstrings v1.4.0 // indirect github.com/imdario/mergo v0.3.13 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.16 // indirect @@ -62,14 +62,14 @@ require ( github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect github.com/vmihailenco/tagparser v0.1.2 // indirect github.com/zclconf/go-cty v1.12.1 // indirect - golang.org/x/crypto v0.1.0 // indirect + golang.org/x/crypto v0.3.0 // indirect golang.org/x/net v0.2.0 // indirect - golang.org/x/oauth2 v0.1.0 // indirect - golang.org/x/sys v0.2.0 // indirect - golang.org/x/text v0.4.0 // indirect + golang.org/x/oauth2 v0.2.0 // indirect + golang.org/x/sys v0.3.0 // indirect + golang.org/x/text v0.5.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20221109142239-94d6d90a7d66 // indirect - google.golang.org/grpc v1.50.1 // indirect + google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd // indirect + google.golang.org/grpc v1.51.0 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index e2be4dbd..7126521d 100644 --- a/go.sum +++ b/go.sum @@ -1,396 +1,25 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= -cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= -cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= -cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= -cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= -cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= -cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= -cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= -cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= -cloud.google.com/go/accesscontextmanager v1.4.0/go.mod h1:/Kjh7BBu/Gh83sv+K60vN9QE5NJcd80sU33vIe2IFPE= -cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= -cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= -cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= -cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= -cloud.google.com/go/apigateway v1.3.0/go.mod h1:89Z8Bhpmxu6AmUxuVRg/ECRGReEdiP3vQtk4Z1J9rJk= -cloud.google.com/go/apigateway v1.4.0/go.mod h1:pHVY9MKGaH9PQ3pJ4YLzoj6U5FUDeDFBllIz7WmzJoc= -cloud.google.com/go/apigeeconnect v1.3.0/go.mod h1:G/AwXFAKo0gIXkPTVfZDd2qA1TxBXJ3MgMRBQkIi9jc= -cloud.google.com/go/apigeeconnect v1.4.0/go.mod h1:kV4NwOKqjvt2JYR0AoIWo2QGfoRtn/pkS3QlHp0Ni04= -cloud.google.com/go/appengine v1.4.0/go.mod h1:CS2NhuBuDXM9f+qscZ6V86m1MIIqPj3WC/UoEuR1Sno= -cloud.google.com/go/appengine v1.5.0/go.mod h1:TfasSozdkFI0zeoxW3PTBLiNqRmzraodCWatWI9Dmak= -cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= -cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= -cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= -cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= -cloud.google.com/go/artifactregistry v1.8.0/go.mod h1:w3GQXkJX8hiKN0v+at4b0qotwijQbYUqF2GWkZzAhC0= -cloud.google.com/go/artifactregistry v1.9.0/go.mod h1:2K2RqvA2CYvAeARHRkLDhMDJ3OXy26h3XW+3/Jh2uYc= -cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= -cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= -cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0= -cloud.google.com/go/asset v1.9.0/go.mod h1:83MOE6jEJBMqFKadM9NLRcs80Gdw76qGuHn8m3h8oHQ= -cloud.google.com/go/asset v1.10.0/go.mod h1:pLz7uokL80qKhzKr4xXGvBQXnzHn5evJAEAtZiIb0wY= -cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= -cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= -cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= -cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo= -cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= -cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= -cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= -cloud.google.com/go/automl v1.7.0/go.mod h1:RL9MYCCsJEOmt0Wf3z9uzG0a7adTT1fe+aObgSpkCt8= -cloud.google.com/go/automl v1.8.0/go.mod h1:xWx7G/aPEe/NP+qzYXktoBSDfjO+vnKMGgsApGJJquM= -cloud.google.com/go/baremetalsolution v0.3.0/go.mod h1:XOrocE+pvK1xFfleEnShBlNAXf+j5blPPxrhjKgnIFc= -cloud.google.com/go/baremetalsolution v0.4.0/go.mod h1:BymplhAadOO/eBa7KewQ0Ppg4A4Wplbn+PsFKRLo0uI= -cloud.google.com/go/batch v0.3.0/go.mod h1:TR18ZoAekj1GuirsUsR1ZTKN3FC/4UDnScjT8NXImFE= -cloud.google.com/go/batch v0.4.0/go.mod h1:WZkHnP43R/QCGQsZ+0JyG4i79ranE2u8xvjq/9+STPE= -cloud.google.com/go/beyondcorp v0.2.0/go.mod h1:TB7Bd+EEtcw9PCPQhCJtJGjk/7TC6ckmnSFS+xwTfm4= -cloud.google.com/go/beyondcorp v0.3.0/go.mod h1:E5U5lcrcXMsCuoDNyGrpyTm/hn7ne941Jz2vmksAxW8= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= -cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw= -cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= -cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= -cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI= -cloud.google.com/go/billing v1.7.0/go.mod h1:q457N3Hbj9lYwwRbnlD7vUpyjq6u5U1RAOArInEiD5Y= -cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= -cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= -cloud.google.com/go/binaryauthorization v1.3.0/go.mod h1:lRZbKgjDIIQvzYQS1p99A7/U1JqvqeZg0wiI5tp6tg0= -cloud.google.com/go/binaryauthorization v1.4.0/go.mod h1:tsSPQrBd77VLplV70GUhBf/Zm3FsKmgSqgm4UmiDItk= -cloud.google.com/go/certificatemanager v1.3.0/go.mod h1:n6twGDvcUBFu9uBgt4eYvvf3sQ6My8jADcOVwHmzadg= -cloud.google.com/go/certificatemanager v1.4.0/go.mod h1:vowpercVFyqs8ABSmrdV+GiFf2H/ch3KyudYQEMM590= -cloud.google.com/go/channel v1.8.0/go.mod h1:W5SwCXDJsq/rg3tn3oG0LOxpAo6IMxNa09ngphpSlnk= -cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL8yBMbKUk= -cloud.google.com/go/cloudbuild v1.3.0/go.mod h1:WequR4ULxlqvMsjDEEEFnOG5ZSRSgWOywXYDb1vPE6U= -cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA= -cloud.google.com/go/clouddms v1.3.0/go.mod h1:oK6XsCDdW4Ib3jCCBugx+gVjevp2TMXFtgxvPSee3OM= -cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk= -cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= -cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= -cloud.google.com/go/cloudtasks v1.7.0/go.mod h1:ImsfdYWwlWNJbdgPIIGJWC+gemEGTBK/SunNQQNCAb4= -cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI= -cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= -cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= -cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= -cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= -cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= -cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= -cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.12.0/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= -cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= -cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= -cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= -cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= -cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= -cloud.google.com/go/container v1.6.0/go.mod h1:Xazp7GjJSeUYo688S+6J5V+n/t+G5sKBTFkKNudGRxg= -cloud.google.com/go/container v1.7.0/go.mod h1:Dp5AHtmothHGX3DwwIHPgq45Y8KmNsgN3amoYfxVkLo= -cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= -cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= -cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= -cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= -cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= -cloud.google.com/go/datacatalog v1.7.0/go.mod h1:9mEl4AuDYWw81UGc41HonIHH7/sn52H0/tc8f8ZbZIE= -cloud.google.com/go/datacatalog v1.8.0/go.mod h1:KYuoVOv9BM8EYz/4eMFxrr4DUKhGIOXxZoKYF5wdISM= -cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= -cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= -cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= -cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= -cloud.google.com/go/dataform v0.5.0/go.mod h1:GFUYRe8IBa2hcomWplodVmUx/iTL0FrsauObOM3Ipr0= -cloud.google.com/go/datafusion v1.4.0/go.mod h1:1Zb6VN+W6ALo85cXnM1IKiPw+yQMKMhB9TsTSRDo/38= -cloud.google.com/go/datafusion v1.5.0/go.mod h1:Kz+l1FGHB0J+4XF2fud96WMmRiq/wj8N9u007vyXZ2w= -cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= -cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= -cloud.google.com/go/dataplex v1.3.0/go.mod h1:hQuRtDg+fCiFgC8j0zV222HvzFQdRd+SVX8gdmFcZzA= -cloud.google.com/go/dataplex v1.4.0/go.mod h1:X51GfLXEMVJ6UN47ESVqvlsRplbLhcsAt0kZCCKsU0A= -cloud.google.com/go/dataproc v1.7.0/go.mod h1:CKAlMjII9H90RXaMpSxQ8EU6dQx6iAYNPcYPOkSbi8s= -cloud.google.com/go/dataproc v1.8.0/go.mod h1:5OW+zNAH0pMpw14JVrPONsxMQYMBqJuzORhIBfBn9uI= -cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= -cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= -cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= -cloud.google.com/go/datastream v1.4.0/go.mod h1:h9dpzScPhDTs5noEMQVWP8Wx8AFBRyS0s8KWPx/9r0g= -cloud.google.com/go/datastream v1.5.0/go.mod h1:6TZMMNPwjUqZHBKPQ1wwXpb0d5VDVPl2/XoS5yi88q4= -cloud.google.com/go/deploy v1.4.0/go.mod h1:5Xghikd4VrmMLNaF6FiRFDlHb59VM59YoDQnOUdsH/c= -cloud.google.com/go/deploy v1.5.0/go.mod h1:ffgdD0B89tToyW/U/D2eL0jN2+IEV/3EMuXHA0l4r+s= -cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= -cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= -cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8= -cloud.google.com/go/dialogflow v1.18.0/go.mod h1:trO7Zu5YdyEuR+BhSNOqJezyFQ3aUzz0njv7sMx/iek= -cloud.google.com/go/dialogflow v1.19.0/go.mod h1:JVmlG1TwykZDtxtTXujec4tQ+D8SBFMoosgy+6Gn0s0= -cloud.google.com/go/dlp v1.6.0/go.mod h1:9eyB2xIhpU0sVwUixfBubDoRwP+GjeUoxxeueZmqvmM= -cloud.google.com/go/dlp v1.7.0/go.mod h1:68ak9vCiMBjbasxeVD17hVPxDEck+ExiHavX8kiHG+Q= -cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= -cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= -cloud.google.com/go/documentai v1.9.0/go.mod h1:FS5485S8R00U10GhgBC0aNGrJxBP8ZVpEeJ7PQDZd6k= -cloud.google.com/go/documentai v1.10.0/go.mod h1:vod47hKQIPeCfN2QS/jULIvQTugbmdc0ZvxxfQY1bg4= -cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= -cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= -cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= -cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= -cloud.google.com/go/essentialcontacts v1.3.0/go.mod h1:r+OnHa5jfj90qIfZDO/VztSFqbQan7HV75p8sA+mdGI= -cloud.google.com/go/essentialcontacts v1.4.0/go.mod h1:8tRldvHYsmnBCHdFpvU+GL75oWiBKl80BiqlFh9tp+8= -cloud.google.com/go/eventarc v1.7.0/go.mod h1:6ctpF3zTnaQCxUjHUdcfgcA1A2T309+omHZth7gDfmc= -cloud.google.com/go/eventarc v1.8.0/go.mod h1:imbzxkyAU4ubfsaKYdQg04WS1NvncblHEup4kvF+4gw= -cloud.google.com/go/filestore v1.3.0/go.mod h1:+qbvHGvXU1HaKX2nD0WEPo92TP/8AQuCVEBXNY9z0+w= -cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI= -cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= -cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= -cloud.google.com/go/functions v1.8.0/go.mod h1:RTZ4/HsQjIqIYP9a9YPbU+QFoQsAlYgrwOXJWHn1POY= -cloud.google.com/go/functions v1.9.0/go.mod h1:Y+Dz8yGguzO3PpIjhLTbnqV1CWmgQ5UwtlpzoyquQ08= -cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= -cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= -cloud.google.com/go/gaming v1.7.0/go.mod h1:LrB8U7MHdGgFG851iHAfqUdLcKBdQ55hzXy9xBJz0+w= -cloud.google.com/go/gaming v1.8.0/go.mod h1:xAqjS8b7jAVW0KFYeRUxngo9My3f33kFmua++Pi+ggM= -cloud.google.com/go/gkebackup v0.2.0/go.mod h1:XKvv/4LfG829/B8B7xRkk8zRrOEbKtEam6yNfuQNH60= -cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2HDlj4TsBRAo= -cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= -cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= -cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= -cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= -cloud.google.com/go/gkemulticloud v0.3.0/go.mod h1:7orzy7O0S+5kq95e4Hpn7RysVA7dPs8W/GgfUtsPbrA= -cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI= -cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= -cloud.google.com/go/gsuiteaddons v1.3.0/go.mod h1:EUNK/J1lZEZO8yPtykKxLXI6JSVN2rg9bN8SXOa0bgM= -cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o= -cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= -cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= -cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= -cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= -cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= -cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= -cloud.google.com/go/ids v1.2.0/go.mod h1:5WXvp4n25S0rA/mQWAg1YEEBBq6/s+7ml1RDCW1IrcY= -cloud.google.com/go/iot v1.3.0/go.mod h1:r7RGh2B61+B8oz0AGE+J72AhA0G7tdXItODWsaA2oLs= -cloud.google.com/go/iot v1.4.0/go.mod h1:dIDxPOn0UvNDUMD8Ger7FIaTuvMkj+aGk94RPP0iV+g= -cloud.google.com/go/kms v1.5.0/go.mod h1:QJS2YY0eJGBg3mnDfuaCyLauWwBJiHRboYxJ++1xJNg= -cloud.google.com/go/kms v1.6.0/go.mod h1:Jjy850yySiasBUDi6KFUwUv2n1+o7QZFyuUJg6OgjA0= -cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= -cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= -cloud.google.com/go/language v1.7.0/go.mod h1:DJ6dYN/W+SQOjF8e1hLQXMF21AkH2w9wiPzPCJa2MIE= -cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEyygwpgVKB8= -cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= -cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= -cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= -cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= -cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= -cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= -cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= -cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= -cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= -cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= -cloud.google.com/go/memcache v1.6.0/go.mod h1:XS5xB0eQZdHtTuTF9Hf8eJkKtR3pVRCcvJwtm68T3rA= -cloud.google.com/go/memcache v1.7.0/go.mod h1:ywMKfjWhNtkQTxrWxCkCFkoPjLHPW6A7WOTVI8xy3LY= -cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= -cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= -cloud.google.com/go/metastore v1.7.0/go.mod h1:s45D0B4IlsINu87/AsWiEVYbLaIMeUSoxlKKDqBGFS8= -cloud.google.com/go/metastore v1.8.0/go.mod h1:zHiMc4ZUpBiM7twCIFQmJ9JMEkDSyZS9U12uf7wHqSI= -cloud.google.com/go/monitoring v1.7.0/go.mod h1:HpYse6kkGo//7p6sT0wsIC6IBDET0RhIsnmlA53dvEk= -cloud.google.com/go/monitoring v1.8.0/go.mod h1:E7PtoMJ1kQXWxPjB6mv2fhC5/15jInuulFdYYtlcvT4= -cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= -cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= -cloud.google.com/go/networkconnectivity v1.6.0/go.mod h1:OJOoEXW+0LAxHh89nXd64uGG+FbQoeH8DtxCHVOMlaM= -cloud.google.com/go/networkconnectivity v1.7.0/go.mod h1:RMuSbkdbPwNMQjB5HBWD5MpTBnNm39iAVpC3TmsExt8= -cloud.google.com/go/networkmanagement v1.4.0/go.mod h1:Q9mdLLRn60AsOrPc8rs8iNV6OHXaGcDdsIQe1ohekq8= -cloud.google.com/go/networkmanagement v1.5.0/go.mod h1:ZnOeZ/evzUdUsnvRt792H0uYEnHQEMaz+REhhzJRcf4= -cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= -cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= -cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= -cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= -cloud.google.com/go/notebooks v1.4.0/go.mod h1:4QPMngcwmgb6uw7Po99B2xv5ufVoIQ7nOGDyL4P8AgA= -cloud.google.com/go/notebooks v1.5.0/go.mod h1:q8mwhnP9aR8Hpfnrc5iN5IBhrXUy8S2vuYs+kBJ/gu0= -cloud.google.com/go/optimization v1.1.0/go.mod h1:5po+wfvX5AQlPznyVEZjGJTMr4+CAkJf2XSTQOOl9l4= -cloud.google.com/go/optimization v1.2.0/go.mod h1:Lr7SOHdRDENsh+WXVmQhQTrzdu9ybg0NecjHidBq6xs= -cloud.google.com/go/orchestration v1.3.0/go.mod h1:Sj5tq/JpWiB//X/q3Ngwdl5K7B7Y0KZ7bfv0wL6fqVA= -cloud.google.com/go/orchestration v1.4.0/go.mod h1:6W5NLFWs2TlniBphAViZEVhrXRSMgUGDfW7vrWKvsBk= -cloud.google.com/go/orgpolicy v1.4.0/go.mod h1:xrSLIV4RePWmP9P3tBl8S93lTmlAxjm06NSm2UTmKvE= -cloud.google.com/go/orgpolicy v1.5.0/go.mod h1:hZEc5q3wzwXJaKrsx5+Ewg0u1LxJ51nNFlext7Tanwc= -cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= -cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= -cloud.google.com/go/osconfig v1.9.0/go.mod h1:Yx+IeIZJ3bdWmzbQU4fxNl8xsZ4amB+dygAwFPlvnNo= -cloud.google.com/go/osconfig v1.10.0/go.mod h1:uMhCzqC5I8zfD9zDEAfvgVhDS8oIjySWh+l4WK6GnWw= -cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= -cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= -cloud.google.com/go/oslogin v1.6.0/go.mod h1:zOJ1O3+dTU8WPlGEkFSh7qeHPPSoxrcMbbK1Nm2iX70= -cloud.google.com/go/oslogin v1.7.0/go.mod h1:e04SN0xO1UNJ1M5GP0vzVBFicIe4O53FOfcixIqTyXo= -cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= -cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= -cloud.google.com/go/policytroubleshooter v1.3.0/go.mod h1:qy0+VwANja+kKrjlQuOzmlvscn4RNsAc0e15GGqfMxg= -cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LKtPa8lKeCByYeKTIf/vxdE= -cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= -cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= -cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= -cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= -cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo= -cloud.google.com/go/recaptchaenterprise/v2 v2.4.0/go.mod h1:Am3LHfOuBstrLrNCBrlI5sbwx9LBg3te2N6hGvHn2mE= -cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U= -cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= -cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= -cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= -cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= -cloud.google.com/go/recommender v1.7.0/go.mod h1:XLHs/W+T8olwlGOgfQenXBTbIseGclClff6lhFVe9Bs= -cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70= -cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= -cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= -cloud.google.com/go/redis v1.9.0/go.mod h1:HMYQuajvb2D0LvMgZmLDZW8V5aOC/WxstZHiy4g8OiA= -cloud.google.com/go/redis v1.10.0/go.mod h1:ThJf3mMBQtW18JzGgh41/Wld6vnDDc/F/F35UolRZPM= -cloud.google.com/go/resourcemanager v1.3.0/go.mod h1:bAtrTjZQFJkiWTPDb1WBjzvc6/kifjj4QBYuKCCoqKA= -cloud.google.com/go/resourcemanager v1.4.0/go.mod h1:MwxuzkumyTX7/a3n37gmsT3py7LIXwrShilPh3P1tR0= -cloud.google.com/go/resourcesettings v1.3.0/go.mod h1:lzew8VfESA5DQ8gdlHwMrqZs1S9V87v3oCnKCWoOuQU= -cloud.google.com/go/resourcesettings v1.4.0/go.mod h1:ldiH9IJpcrlC3VSuCGvjR5of/ezRrOxFtpJoJo5SmXg= -cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= -cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= -cloud.google.com/go/retail v1.10.0/go.mod h1:2gDk9HsL4HMS4oZwz6daui2/jmKvqShXKQuB2RZ+cCc= -cloud.google.com/go/retail v1.11.0/go.mod h1:MBLk1NaWPmh6iVFSz9MeKG/Psyd7TAgm6y/9L2B4x9Y= -cloud.google.com/go/run v0.2.0/go.mod h1:CNtKsTA1sDcnqqIFR3Pb5Tq0usWxJJvsWOCPldRU3Do= -cloud.google.com/go/run v0.3.0/go.mod h1:TuyY1+taHxTjrD0ZFk2iAR+xyOXEA0ztb7U3UNA0zBo= -cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= -cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= -cloud.google.com/go/scheduler v1.6.0/go.mod h1:SgeKVM7MIwPn3BqtcBntpLyrIJftQISRrYB5ZtT+KOk= -cloud.google.com/go/scheduler v1.7.0/go.mod h1:jyCiBqWW956uBjjPMMuX09n3x37mtyPJegEWKxRsn44= -cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= -cloud.google.com/go/secretmanager v1.8.0/go.mod h1:hnVgi/bN5MYHd3Gt0SPuTPPp5ENina1/LxM+2W9U9J4= -cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4= -cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= -cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= -cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= -cloud.google.com/go/security v1.9.0/go.mod h1:6Ta1bO8LXI89nZnmnsZGp9lVoVWXqsVbIq/t9dzI+2Q= -cloud.google.com/go/security v1.10.0/go.mod h1:QtOMZByJVlibUT2h9afNDWRZ1G96gVywH8T5GUSb9IA= -cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= -cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= -cloud.google.com/go/securitycenter v1.15.0/go.mod h1:PeKJ0t8MoFmmXLXWm41JidyzI3PJjd8sXWaVqg43WWk= -cloud.google.com/go/securitycenter v1.16.0/go.mod h1:Q9GMaLQFUD+5ZTabrbujNWLtSLZIZF7SAR0wWECrjdk= -cloud.google.com/go/servicecontrol v1.4.0/go.mod h1:o0hUSJ1TXJAmi/7fLJAedOovnujSEvjKCAFNXPQ1RaU= -cloud.google.com/go/servicecontrol v1.5.0/go.mod h1:qM0CnXHhyqKVuiZnGKrIurvVImCs8gmqWsDoqe9sU1s= -cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= -cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= -cloud.google.com/go/servicedirectory v1.6.0/go.mod h1:pUlbnWsLH9c13yGkxCmfumWEPjsRs1RlmJ4pqiNjVL4= -cloud.google.com/go/servicedirectory v1.7.0/go.mod h1:5p/U5oyvgYGYejufvxhgwjL8UVXjkuw7q5XcG10wx1U= -cloud.google.com/go/servicemanagement v1.4.0/go.mod h1:d8t8MDbezI7Z2R1O/wu8oTggo3BI2GKYbdG4y/SJTco= -cloud.google.com/go/servicemanagement v1.5.0/go.mod h1:XGaCRe57kfqu4+lRxaFEAuqmjzF0r+gWHjWqKqBvKFo= -cloud.google.com/go/serviceusage v1.3.0/go.mod h1:Hya1cozXM4SeSKTAgGXgj97GlqUvF5JaoXacR1JTP/E= -cloud.google.com/go/serviceusage v1.4.0/go.mod h1:SB4yxXSaYVuUBYUml6qklyONXNLt83U0Rb+CXyhjEeU= -cloud.google.com/go/shell v1.3.0/go.mod h1:VZ9HmRjZBsjLGXusm7K5Q5lzzByZmJHf1d0IWHEN5X4= -cloud.google.com/go/shell v1.4.0/go.mod h1:HDxPzZf3GkDdhExzD/gs8Grqk+dmYcEjGShZgYa9URw= -cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= -cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= -cloud.google.com/go/speech v1.8.0/go.mod h1:9bYIl1/tjsAnMgKGHKmBZzXKEkGgtU+MpdDPTE9f7y0= -cloud.google.com/go/speech v1.9.0/go.mod h1:xQ0jTcmnRFFM2RfX/U+rk6FQNUF6DQlydUSyoooSpco= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= -cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= -cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= -cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= -cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= -cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= -cloud.google.com/go/talent v1.3.0/go.mod h1:CmcxwJ/PKfRgd1pBjQgU6W3YBwiewmUzQYH5HHmSCmM= -cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA= -cloud.google.com/go/texttospeech v1.4.0/go.mod h1:FX8HQHA6sEpJ7rCMSfXuzBcysDAuWusNNNvN9FELDd8= -cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4= -cloud.google.com/go/tpu v1.3.0/go.mod h1:aJIManG0o20tfDQlRIej44FcwGGl/cD0oiRyMKG19IQ= -cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg= -cloud.google.com/go/trace v1.3.0/go.mod h1:FFUE83d9Ca57C+K8rDl/Ih8LwOzWIV1krKgxg6N0G28= -cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1rshXG+Y= -cloud.google.com/go/translate v1.3.0/go.mod h1:gzMUwRjvOqj5i69y/LYLd8RrNQk+hOmIXTi9+nb3Djs= -cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= -cloud.google.com/go/video v1.8.0/go.mod h1:sTzKFc0bUSByE8Yoh8X0mn8bMymItVGPfTuUBUyRgxk= -cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= -cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= -cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= -cloud.google.com/go/videointelligence v1.8.0/go.mod h1:dIcCn4gVDdS7yte/w+koiXn5dWVplOZkE+xwG9FgK+M= -cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= -cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= -cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= -cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= -cloud.google.com/go/vision/v2 v2.4.0/go.mod h1:VtI579ll9RpVTrdKdkMzckdnwMyX2JILb+MhPqRbPsY= -cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E= -cloud.google.com/go/vmmigration v1.2.0/go.mod h1:IRf0o7myyWFSmVR1ItrBSFLFD/rJkfDCUTO4vLlJvsE= -cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g= -cloud.google.com/go/vpcaccess v1.4.0/go.mod h1:aQHVbTWDYUR1EbTApSVvMq1EnT57ppDmQzZ3imqIk4w= -cloud.google.com/go/vpcaccess v1.5.0/go.mod h1:drmg4HLk9NkZpGfCmZ3Tz0Bwnm2+DKqViEpeEpOq0m8= -cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= -cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= -cloud.google.com/go/webrisk v1.6.0/go.mod h1:65sW9V9rOosnc9ZY7A7jsy1zoHS5W9IAXv6dGqhMQMc= -cloud.google.com/go/webrisk v1.7.0/go.mod h1:mVMHgEYH0r337nmt1JyLthzMr6YxwN1aAIEc2fTcq7A= -cloud.google.com/go/websecurityscanner v1.3.0/go.mod h1:uImdKm2wyeXQevQJXeh8Uun/Ym1VqworNDlBXQevGMo= -cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S8CzdTkAS77oDsiSqYWQ= -cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= -cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= -cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/sprig/v3 v3.2.0/go.mod h1:tWhwTbUTndesPNeF0C900vKoq283u6zp4APT9vaF3SI= +github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= +github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/Masterminds/sprig/v3 v3.2.1/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= -github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8= -github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= +github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= +github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ= github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= -github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4tdgBZjnU= github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= -github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= -github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= -github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= @@ -401,45 +30,17 @@ github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgI github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= -github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= @@ -449,99 +50,24 @@ github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= -github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= -github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= -github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= -github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= -github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= -github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= -github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -553,14 +79,11 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= -github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.2.1/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-hclog v1.3.1 h1:vDwF1DFNZhntP4DAjuTpOw3uEgMUpXh1pB5fW9DqHpo= github.com/hashicorp/go-hclog v1.3.1/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.4.4/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-plugin v1.4.6 h1:MDV3UrKQBM3du3G7MApDGvOsMYy3JQJ4exhSoKBAeVA= github.com/hashicorp/go-plugin v1.4.6/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -570,42 +93,35 @@ github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go-version v1.5.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hc-install v0.4.0 h1:cZkRFr1WVa0Ty6x5fTvL1TuO1flul231rWkGH92oYYk= github.com/hashicorp/hc-install v0.4.0/go.mod h1:5d155H8EC5ewegao9A4PUTMNPZaq+TbOzkJJZ4vrXeI= -github.com/hashicorp/hcl/v2 v2.14.1 h1:x0BpjfZ+CYdbiz+8yZTQ+gdLO7IXvOut7Da+XJayx34= -github.com/hashicorp/hcl/v2 v2.14.1/go.mod h1:e4z5nxYlWNPdDSNYX+ph14EvWYMFm3eP0zIUqPc2jr0= +github.com/hashicorp/hcl/v2 v2.15.0 h1:CPDXO6+uORPjKflkWCCwoWc9uRp+zSIPcCQ+BrxV7m8= +github.com/hashicorp/hcl/v2 v2.15.0/go.mod h1:JRmR89jycNkrrqnMmvPDMd56n1rQJ2Q6KocSLCMCXng= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-exec v0.17.2/go.mod h1:tuIbsL2l4MlwwIZx9HPM+LOV9vVyEfBYu2GsO1uH3/8= github.com/hashicorp/terraform-exec v0.17.3 h1:MX14Kvnka/oWGmIkyuyvL6POx25ZmKrjlaclkx3eErU= github.com/hashicorp/terraform-exec v0.17.3/go.mod h1:+NELG0EqQekJzhvikkeQsOAZpsw0cv/03rbeQJqscAI= github.com/hashicorp/terraform-json v0.14.0 h1:sh9iZ1Y8IFJLx+xQiKHGud6/TSUCM0N8e17dKDpqV7s= github.com/hashicorp/terraform-json v0.14.0/go.mod h1:5A9HIWPkk4e5aeeXIBbkcOvaZbIYnAIkEyqP2pNSckM= github.com/hashicorp/terraform-plugin-docs v0.13.0 h1:6e+VIWsVGb6jYJewfzq2ok2smPzZrt1Wlm9koLeKazY= github.com/hashicorp/terraform-plugin-docs v0.13.0/go.mod h1:W0oCmHAjIlTHBbvtppWHe8fLfZ2BznQbuv8+UD8OucQ= -github.com/hashicorp/terraform-plugin-go v0.14.0/go.mod h1:2nNCBeRLaenyQEi78xrGrs9hMbulveqG/zDMQSvVJTE= -github.com/hashicorp/terraform-plugin-go v0.14.1 h1:cwZzPYla82XwAqpLhSzdVsOMU+6H29tczAwrB0z9Zek= -github.com/hashicorp/terraform-plugin-go v0.14.1/go.mod h1:Bc/K6K26BQ2FHqIELPbpKtt2CzzbQou+0UQF3/0NsCQ= +github.com/hashicorp/terraform-plugin-go v0.14.2 h1:rhsVEOGCnY04msNymSvbUsXfRLKh9znXZmHlf5e8mhE= +github.com/hashicorp/terraform-plugin-go v0.14.2/go.mod h1:Q12UjumPNGiFsZffxOsA40Tlz1WVXt2Evh865Zj0+UA= github.com/hashicorp/terraform-plugin-log v0.7.0 h1:SDxJUyT8TwN4l5b5/VkiTIaQgY6R+Y2BQ0sRZftGKQs= github.com/hashicorp/terraform-plugin-log v0.7.0/go.mod h1:p4R1jWBXRTvL4odmEkFfDdhUjHf9zcs/BCoNHAc7IK4= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0 h1:FtCLTiTcykdsURXPt/ku7fYXm3y19nbzbZcUxHx9RbI= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0/go.mod h1:80wf5oad1tW+oLnbXS4UTYmDCrl7BuN1Q+IA91X1a4Y= -github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c h1:D8aRO6+mTqHfLsK/BC3j5OAoogv1WLRWzY1AaTo3rBg= -github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c/go.mod h1:Wn3Na71knbXc1G8Lh+yu/dQWWJeFQEpDeJMtWMtlmNI= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1 h1:zHcMbxY0+rFO9gY99elV/XC/UnQVg7FhRCbj1i5b7vM= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1/go.mod h1:+tNlb0wkfdsDJ7JEiERLz4HzM19HyiuIoGzTsM7rPpw= +github.com/hashicorp/terraform-registry-address v0.1.0 h1:W6JkV9wbum+m516rCl5/NjKxCyTVaaUBbzYcMzBDO3U= +github.com/hashicorp/terraform-registry-address v0.1.0/go.mod h1:EnyO2jYO6j29DTHbJcm00E5nQTFeTtyZH3H5ycydQ5A= github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= +github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= @@ -614,39 +130,29 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= -github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mitchellh/cli v1.1.4/go.mod h1:vTLESy5mRhKOs9KDp0/RATawxP1UqBmdrpVRMnpcvKQ= github.com/mitchellh/cli v1.1.5 h1:OxRIeJXpAMztws/XHlN2vu6imG5Dpq+j61AzAX5fLng= github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2cLtRR4= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= @@ -654,11 +160,8 @@ github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa1 github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= -github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= @@ -667,9 +170,6 @@ github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758= -github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -679,27 +179,19 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= -github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= -github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -723,558 +215,99 @@ github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+ github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vbd1qPqc= github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/wasfree/uptrends-go-sdk v1.1.0 h1:shKu7qN5bYYEP9GKdonpf1q+J+Bsf9GEPcA4xp1NLK0= -github.com/wasfree/uptrends-go-sdk v1.1.0/go.mod h1:gytp4Alv3kYuxS2GtPr8q8G4SBXb5sN69IieSw8QRF0= +github.com/wasfree/uptrends-go-sdk v1.2.0 h1:KczVWO0bBv5y4yT1sFwxbKqGiaX4oUkJlEdi3bHnHug= +github.com/wasfree/uptrends-go-sdk v1.2.0/go.mod h1:M4QVh4XHZCqNS37wCf8uWYYXixrR9u+gXn4XhFdnnbU= github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= -github.com/zclconf/go-cty v1.11.0/go.mod h1:s9IfD1LK5ccNMSWCVFCE2rJfHiZgi7JijgeWIMfhLvA= github.com/zclconf/go-cty v1.12.1 h1:PcupnljUm9EIvbgSHQnHhUr3fO6oFmkOrvs2BAFNXXY= github.com/zclconf/go-cty v1.12.1/go.mod h1:s9IfD1LK5ccNMSWCVFCE2rJfHiZgi7JijgeWIMfhLvA= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/crypto v0.3.0 h1:a06MkbcxBrEFc0w0QIZWXrH/9cCX6KJyWbBOIwAn+7A= +golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.1.0 h1:isLCZuhj4v+tYv7eskaN4v/TM+A1begWWgyVJDdl1+Y= -golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= +golang.org/x/oauth2 v0.2.0 h1:GtQkldQ9m7yvzCL1V+LrYow3Khe0eJH0w7RbX/VbaIU= +golang.org/x/oauth2 v0.2.0/go.mod h1:Cwn6afJ8jrQwYMxQDTpISoXmXW9I6qF6vDeuuoX3Ibs= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= -google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= -google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= -google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= -google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= -google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= -google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= -google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= -google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= -google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= -google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91A08= -google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= -google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= -google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220817144833-d7fd3f11b9b1/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220829144015-23454907ede3/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220919141832-68c03719ef51/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw= -google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= -google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= -google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= -google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= -google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= -google.golang.org/genproto v0.0.0-20221024153911-1573dae28c9c/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= -google.golang.org/genproto v0.0.0-20221107162902-2d387536bcdd h1:1eV6KuDTxraYYsYGWksp1thEGP+8dtX/TINL9h+ppiI= -google.golang.org/genproto v0.0.0-20221107162902-2d387536bcdd/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221109142239-94d6d90a7d66 h1:wx7sJ5GRBQLRcslTNcrTklsHhHevQvxgztW18txbbZM= -google.golang.org/genproto v0.0.0-20221109142239-94d6d90a7d66/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY= -google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0/go.mod h1:DNq5QpG7LJqD2AamLZ7zvKE0DEpVl2BSEVjFycAAjRY= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd h1:OjndDrsik+Gt+e6fs45z9AxiewiKyLKYpA45W5Kpkks= +google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= +google.golang.org/grpc v1.51.0 h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U= +google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1283,24 +316,12 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/uptrends/constants.go b/uptrends/constants.go index 009987ed..afb6aaac 100644 --- a/uptrends/constants.go +++ b/uptrends/constants.go @@ -356,7 +356,7 @@ func CheckpointID(input string) string { return input } -func DeduplicateCheckpointIDs(input []interface{}) *[]int32 { +func DeduplicateCheckpointIDs(input []interface{}) []int32 { ids := make([]int32, 0) keys := make(map[int]bool) @@ -368,7 +368,7 @@ func DeduplicateCheckpointIDs(input []interface{}) *[]int32 { } } - return &ids + return ids } func RegionID(idOrName string) string { @@ -378,7 +378,7 @@ func RegionID(idOrName string) string { return idOrName } -func DeduplicateRegionIDs(input []interface{}) *[]int32 { +func DeduplicateRegionIDs(input []interface{}) []int32 { ids := make([]int32, 0) keys := make(map[int]bool) @@ -390,5 +390,5 @@ func DeduplicateRegionIDs(input []interface{}) *[]int32 { } } - return &ids + return ids } diff --git a/uptrends/constants_test.go b/uptrends/constants_test.go index e8eaeed8..767eff3c 100644 --- a/uptrends/constants_test.go +++ b/uptrends/constants_test.go @@ -20,5 +20,5 @@ func TestCheckpointID(t *testing.T) { func TestDeduplicateCheckpointIDs(t *testing.T) { ckpts := []interface{}{"New York", "New York", "8", "Vancouver", "Gloucester", "10", "10"} ids := DeduplicateCheckpointIDs(ckpts) - assert.Equal(t, []int32{8, 14, 17, 10}, *ids, "expect to return list without duplicate ids") + assert.Equal(t, []int32{8, 14, 17, 10}, ids, "expect to return list without duplicate ids") } diff --git a/uptrends/monitor_certificate_resource.go b/uptrends/monitor_certificate_resource.go index 5cdbf01c..e8bcea04 100644 --- a/uptrends/monitor_certificate_resource.go +++ b/uptrends/monitor_certificate_resource.go @@ -40,12 +40,6 @@ func ResourceMonitorCertificateSchema() *schema.Resource { string(uptrends.IPVERSION_IP_V6)}, false), }, - "native_ipv6_only": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "True or False. This setting only applies when you select IpV6 for the IpVersion field. Set this value to true to only execute your monitor on checkpoint servers that support native IPv6 connectivity. Defaults to `false`.", - }, "auth_type": { Type: schema.TypeString, Optional: true, @@ -160,7 +154,7 @@ func monitorCertificateRead(ctx context.Context, d *schema.ResourceData, meta in return diag.FromErr(err) } - return readMonitorCertificateStruct(&resp, d) + return readMonitorCertificateStruct(resp, d) } func monitorCertificateUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { @@ -213,7 +207,6 @@ func buildMonitorCertificateStruct(d *schema.ResourceData) (*uptrends.Monitor, e m.MonitorType = &monitorCertificateType m.Url = String(d.Get("url").(string)) m.IpVersion = (*uptrends.IpVersion)(String(d.Get("ip_version").(string))) - m.NativeIPv6Only = Bool(d.Get("native_ipv6_only").(bool)) m.AuthenticationType = (*uptrends.ApiHttpAuthenticationType)(String(d.Get("auth_type").(string))) m.Username = String(d.Get("username").(string)) m.CertificateName = String(d.Get("cert_name").(string)) @@ -251,9 +244,6 @@ func readMonitorCertificateStruct(m *uptrends.Monitor, d *schema.ResourceData) d if err := d.Set("auth_type", m.AuthenticationType); err != nil { return diag.FromErr(err) } - if err := d.Set("native_ipv6_only", m.NativeIPv6Only); err != nil { - return diag.FromErr(err) - } if err := d.Set("username", m.Username); err != nil { return diag.FromErr(err) } diff --git a/uptrends/monitor_database_server_resource.go b/uptrends/monitor_database_server_resource.go index c4a055a7..8b7070d7 100644 --- a/uptrends/monitor_database_server_resource.go +++ b/uptrends/monitor_database_server_resource.go @@ -41,12 +41,6 @@ func ResourceMonitorDatabaseServerSchema() *schema.Resource { string(uptrends.IPVERSION_IP_V6)}, false), }, - "native_ipv6_only": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "True or False. This setting only applies when you select IpV6 for the IpVersion field. Set this value to true to only execute your monitor on checkpoint servers that support native IPv6 connectivity. Defaults to `false`.", - }, "network_address": { Type: schema.TypeString, Required: true, @@ -113,7 +107,7 @@ func monitorDatabaseServerRead(ctx context.Context, d *schema.ResourceData, meta return diag.FromErr(err) } - return readMonitorDatabaseServerStruct(&resp, d) + return readMonitorDatabaseServerStruct(resp, d) } func monitorDatabaseServerUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { @@ -166,7 +160,6 @@ func buildMonitorDatabaseServerStruct(d *schema.ResourceData) (*uptrends.Monitor m.MonitorType = (*uptrends.MonitorType)(String(d.Get("type").(string))) m.Port = Int32(int32(d.Get("port").(int))) m.IpVersion = (*uptrends.IpVersion)(String(d.Get("ip_version").(string))) - m.NativeIPv6Only = Bool(d.Get("native_ipv6_only").(bool)) m.NetworkAddress = String(d.Get("network_address").(string)) m.DatabaseName = String(d.Get("db_name").(string)) @@ -190,9 +183,6 @@ func readMonitorDatabaseServerStruct(m *uptrends.Monitor, d *schema.ResourceData if err := d.Set("ip_version", m.IpVersion); err != nil { return diag.FromErr(err) } - if err := d.Set("native_ipv6_only", m.NativeIPv6Only); err != nil { - return diag.FromErr(err) - } if err := d.Set("network_address", m.NetworkAddress); err != nil { return diag.FromErr(err) } diff --git a/uptrends/monitor_dns_resource.go b/uptrends/monitor_dns_resource.go index 12f914bc..9a03dd27 100644 --- a/uptrends/monitor_dns_resource.go +++ b/uptrends/monitor_dns_resource.go @@ -104,7 +104,7 @@ func monitorDnsRead(ctx context.Context, d *schema.ResourceData, meta interface{ return diag.FromErr(err) } - return readMonitorDnsStruct(&resp, d) + return readMonitorDnsStruct(resp, d) } func monitorDnsUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { @@ -153,7 +153,6 @@ func buildMonitorDnsStruct(d *schema.ResourceData) (*uptrends.Monitor, error) { m.MonitorType = &monitorDnsType m.Port = Int32(int32(d.Get("port").(int))) m.IpVersion = (*uptrends.IpVersion)(String(d.Get("ip_version").(string))) - m.NativeIPv6Only = Bool(d.Get("native_ipv6_only").(bool)) m.DnsServer = String(d.Get("dns_server").(string)) m.DnsQuery = (*uptrends.DnsQuery)(String(d.Get("dns_query").(string))) m.DnsTestValue = String(d.Get("dns_test_value").(string)) @@ -175,9 +174,6 @@ func readMonitorDnsStruct(m *uptrends.Monitor, d *schema.ResourceData) diag.Diag if err := d.Set("ip_version", m.IpVersion); err != nil { return diag.FromErr(err) } - if err := d.Set("native_ipv6_only", m.NativeIPv6Only); err != nil { - return diag.FromErr(err) - } if err := d.Set("dns_server", m.DnsServer); err != nil { return diag.FromErr(err) } diff --git a/uptrends/monitor_fpc_resource.go b/uptrends/monitor_fpc_resource.go index dcfaf5b8..b61e5411 100644 --- a/uptrends/monitor_fpc_resource.go +++ b/uptrends/monitor_fpc_resource.go @@ -258,7 +258,7 @@ func monitorFullPageCheckRead(ctx context.Context, d *schema.ResourceData, meta return diag.FromErr(err) } - return readMonitorFullPageCheckStruct(&resp, d) + return readMonitorFullPageCheckStruct(resp, d) } func monitorFullPageCheckUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { @@ -399,13 +399,13 @@ func readMonitorFullPageCheckStruct(m *uptrends.Monitor, d *schema.ResourceData) if err := d.Set("block_uptrends_rum", m.BlockUptrendsRum); err != nil { return diag.FromErr(err) } - if err := d.Set("block_urls", SliceStringToSliceInterface(m.BlockUrls)); err != nil { + if err := d.Set("block_urls", SliceStringToSliceInterface(&m.BlockUrls)); err != nil { return diag.FromErr(err) } - if err := d.Set("request_headers", flattenRequestHeader(m.RequestHeaders)); err != nil { + if err := d.Set("request_headers", flattenRequestHeader(&m.RequestHeaders)); err != nil { return diag.FromErr(err) } - if err := d.Set("match_pattern", flattenPatternMatch(m.MatchPatterns)); err != nil { + if err := d.Set("match_pattern", flattenPatternMatch(&m.MatchPatterns)); err != nil { return diag.FromErr(err) } if err := d.Set("browser_window_dimensions", flattenBrowserWindowDimensions(m.BrowserWindowDimensions)); err != nil { diff --git a/uptrends/monitor_group_resource.go b/uptrends/monitor_group_resource.go index 6ae13535..fae1b28d 100644 --- a/uptrends/monitor_group_resource.go +++ b/uptrends/monitor_group_resource.go @@ -90,7 +90,7 @@ func monitorGroupUpdate(ctx context.Context, d *schema.ResourceData, meta interf monitorGroup.Description = String(d.Get("description").(string)) } - _, err := client.MonitorGroupUpdateMonitorGroup(auth, id).Item(monitorGroup).Execute() + _, err := client.MonitorGroupUpdateMonitorGroup(auth, id).MonitorGroup(monitorGroup).Execute() if err != nil { return diag.FromErr(err) } diff --git a/uptrends/monitor_network_resource.go b/uptrends/monitor_network_resource.go index 100a08ab..ebc5dc1a 100644 --- a/uptrends/monitor_network_resource.go +++ b/uptrends/monitor_network_resource.go @@ -53,12 +53,6 @@ func ResourceMonitorNetworkSchema() *schema.Resource { string(uptrends.IPVERSION_IP_V6)}, false), }, - "native_ipv6_only": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "True or False. This setting only applies when you select IpV6 for the IpVersion field. Set this value to true to only execute your monitor on checkpoint servers that support native IPv6 connectivity. Defaults to `false`.", - }, }), } } @@ -93,7 +87,7 @@ func monitorNetworkRead(ctx context.Context, d *schema.ResourceData, meta interf return diag.FromErr(err) } - return readMonitorNetworkStruct(&resp, d) + return readMonitorNetworkStruct(resp, d) } func monitorNetworkUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { @@ -142,7 +136,6 @@ func buildMonitorNetworkStruct(d *schema.ResourceData) (*uptrends.Monitor, error m.MonitorType = (*uptrends.MonitorType)(String(d.Get("type").(string))) m.NetworkAddress = String(d.Get("network_address").(string)) m.IpVersion = (*uptrends.IpVersion)(String(d.Get("ip_version").(string))) - m.NativeIPv6Only = Bool(d.Get("native_ipv6_only").(bool)) if *m.MonitorType == uptrends.MONITORTYPE_CONNECT { m.Port = Int32(int32(d.Get("port").(int))) @@ -164,9 +157,6 @@ func readMonitorNetworkStruct(m *uptrends.Monitor, d *schema.ResourceData) diag. if err := d.Set("ip_version", m.IpVersion); err != nil { return diag.FromErr(err) } - if err := d.Set("native_ipv6_only", m.NativeIPv6Only); err != nil { - return diag.FromErr(err) - } if *m.MonitorType == uptrends.MONITORTYPE_CONNECT { if err := d.Set("port", m.Port); err != nil { return diag.FromErr(err) diff --git a/uptrends/monitor_web_resource.go b/uptrends/monitor_web_resource.go index a6477807..3161c3a2 100644 --- a/uptrends/monitor_web_resource.go +++ b/uptrends/monitor_web_resource.go @@ -200,7 +200,7 @@ func monitorWebRead(ctx context.Context, d *schema.ResourceData, meta interface{ return diag.FromErr(err) } - return readMonitorWebStruct(&resp, d) + return readMonitorWebStruct(resp, d) } func monitorWebUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { @@ -252,7 +252,6 @@ func buildMonitorWebStruct(d *schema.ResourceData) (*uptrends.Monitor, error) { m.MonitorType = (*uptrends.MonitorType)(String(d.Get("type").(string))) m.IpVersion = (*uptrends.IpVersion)(String(d.Get("ip_version").(string))) - m.NativeIPv6Only = Bool(d.Get("native_ipv6_only").(bool)) m.Url = String(d.Get("url").(string)) m.HttpMethod = (*uptrends.HttpMethod)(String(d.Get("http_method").(string))) m.RequestBody = String(d.Get("request_body").(string)) @@ -303,9 +302,6 @@ func readMonitorWebStruct(m *uptrends.Monitor, d *schema.ResourceData) diag.Diag if err := d.Set("username", m.Username); err != nil { return diag.FromErr(err) } - if err := d.Set("native_ipv6_only", m.NativeIPv6Only); err != nil { - return diag.FromErr(err) - } if err := d.Set("url", m.Url); err != nil { return diag.FromErr(err) } @@ -321,10 +317,10 @@ func readMonitorWebStruct(m *uptrends.Monitor, d *schema.ResourceData) diag.Diag if err := d.Set("min_bytes", m.MinimumBytes); err != nil { return diag.FromErr(err) } - if err := d.Set("request_headers", flattenRequestHeader(m.RequestHeaders)); err != nil { + if err := d.Set("request_headers", flattenRequestHeader(&m.RequestHeaders)); err != nil { return diag.FromErr(err) } - if err := d.Set("match_pattern", flattenPatternMatch(m.MatchPatterns)); err != nil { + if err := d.Set("match_pattern", flattenPatternMatch(&m.MatchPatterns)); err != nil { return diag.FromErr(err) } if *m.MonitorType == uptrends.MONITORTYPE_HTTPS { diff --git a/uptrends/monitor_web_resource_test.go b/uptrends/monitor_web_resource_test.go index 4cd0e5a3..674287d4 100644 --- a/uptrends/monitor_web_resource_test.go +++ b/uptrends/monitor_web_resource_test.go @@ -131,7 +131,7 @@ resource "uptrends_monitor_web" "webservice_http" { resource "uptrends_monitor_web" "webservice_https" { name = "acctest-uptrends-monitor-webservice-https-%d" type = "WebserviceHttps" - url = "http://api.uptrends.com/v4/Checkpoint/Server/Ipv4" + url = "https://api.uptrends.com/v4/Checkpoint/Server/Ipv4" request_headers { name = "accept" diff --git a/uptrends/operator_account_resource.go b/uptrends/operator_account_resource.go index cc13dd98..c089b14e 100644 --- a/uptrends/operator_account_resource.go +++ b/uptrends/operator_account_resource.go @@ -147,7 +147,7 @@ func monitorOperatorAccountRead(ctx context.Context, d *schema.ResourceData, met return diag.FromErr(err) } - return readMonitorOperatorAccountStruct(&resp, d) + return readMonitorOperatorAccountStruct(resp, d) } func monitorOperatorAccountUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/uptrends/schema_monitor_generic.go b/uptrends/schema_monitor_generic.go index df5fcf0b..341b0edd 100644 --- a/uptrends/schema_monitor_generic.go +++ b/uptrends/schema_monitor_generic.go @@ -2,6 +2,7 @@ package uptrends import ( "errors" + "reflect" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" @@ -138,15 +139,15 @@ func flattenSelectedCheckpoints(input *uptrends.SelectedCheckpoints) []interface selectedCheckpoints := make(map[string]interface{}) if v := input.Checkpoints; v != nil { - selectedCheckpoints["checkpoints"] = SliceInt32ToSliceString(*v) + selectedCheckpoints["checkpoints"] = SliceInt32ToSliceString(v) } if v := input.Regions; v != nil { - selectedCheckpoints["regions"] = SliceInt32ToSliceString(*v) + selectedCheckpoints["regions"] = SliceInt32ToSliceString(v) } if v := input.ExcludeLocations; v != nil { - selectedCheckpoints["exclude_locations"] = SliceInt32ToSliceString(*v) + selectedCheckpoints["exclude_locations"] = SliceInt32ToSliceString(v) } return []interface{}{selectedCheckpoints} @@ -203,7 +204,7 @@ func readMonitorGenericStruct(m *uptrends.Monitor, d *schema.ResourceData) error if err := d.Set("name_for_phone_alerts", m.NameForPhoneAlerts); err != nil { return err } - if sc := m.SelectedCheckpoints; *sc != (uptrends.SelectedCheckpoints{}) { + if reflect.DeepEqual(m.SelectedCheckpoints, uptrends.SelectedCheckpoints{}) { if err := d.Set("selected_checkpoints", flattenSelectedCheckpoints(m.SelectedCheckpoints)); err != nil { return err } diff --git a/uptrends/util.go b/uptrends/util.go index 39b3b4d9..7c2bc5cb 100644 --- a/uptrends/util.go +++ b/uptrends/util.go @@ -48,15 +48,15 @@ func SliceInterfaceToSliceInt32(input []interface{}) *[]int32 { return &ret } -// SliceInterfaceToSliceString convert []interface{} to *[]string -func SliceInterfaceToSliceString(input []interface{}) *[]string { +// SliceInterfaceToSliceString convert []interface{} to []string +func SliceInterfaceToSliceString(input []interface{}) []string { ret := make([]string, len(input)) for i, x := range input { ret[i] = string(x.(string)) } - return &ret + return ret } // SliceStringToSliceInterface convert *[]string to []interface{} @@ -110,8 +110,8 @@ func MergeSchema(input ...map[string]*schema.Schema) map[string]*schema.Schema { // structure.go -// expandRequestHeader converts values from []interface{} to *[]uptrends.RequestHeader -func expandRequestHeader(input []interface{}) *[]uptrends.RequestHeader { +// expandRequestHeader converts values from []interface{} to []uptrends.RequestHeader +func expandRequestHeader(input []interface{}) []uptrends.RequestHeader { headers := []uptrends.RequestHeader{} for _, v := range input { newHeader := uptrends.NewRequestHeader() @@ -120,7 +120,7 @@ func expandRequestHeader(input []interface{}) *[]uptrends.RequestHeader { newHeader.SetValue(header["value"].(string)) headers = append(headers, *newHeader) } - return &headers + return headers } // flattenRequestHeader converts values from []uptrends.RequestHeader to []interface{} @@ -135,8 +135,8 @@ func flattenRequestHeader(input *[]uptrends.RequestHeader) []interface{} { return headers } -// expandPatternMatch converts values from []interface{} to *[]uptrends.PatternMatch -func expandPatternMatch(input []interface{}) *[]uptrends.PatternMatch { +// expandPatternMatch converts values from []interface{} to []uptrends.PatternMatch +func expandPatternMatch(input []interface{}) []uptrends.PatternMatch { patterns := []uptrends.PatternMatch{} for _, v := range input { pattern := v.(map[string]interface{}) @@ -144,7 +144,7 @@ func expandPatternMatch(input []interface{}) *[]uptrends.PatternMatch { newPattern.SetPattern(pattern["pattern"].(string)) patterns = append(patterns, *newPattern) } - return &patterns + return patterns } // flattenPatternMatch converts values from []uptrends.PatternMatch to []interface{} diff --git a/uptrends/util_test.go b/uptrends/util_test.go index 2d481ff9..16fbfb07 100644 --- a/uptrends/util_test.go +++ b/uptrends/util_test.go @@ -63,7 +63,7 @@ func TestRequestHeaderHelpers(t *testing.T) { t.Run("Test expandRequestHeader", func(t *testing.T) { headers := expandRequestHeader(requestHeaderInterfaceTestData) - assert.Equal(t, &requestHeaderTestData, headers) + assert.Equal(t, requestHeaderTestData, headers) }) t.Run("Test flattenRequestHeader", func(t *testing.T) { headers := flattenRequestHeader(&requestHeaderTestData) @@ -87,7 +87,7 @@ func TestPatternMatchHelper(t *testing.T) { t.Run("Test expandPatternMatch", func(t *testing.T) { patterns := expandPatternMatch(patternMatchInterfaceTestData) - assert.Equal(t, &patternMatchTestData, patterns) + assert.Equal(t, patternMatchTestData, patterns) }) t.Run("Test flattenPatternMatch", func(t *testing.T) { patterns := flattenPatternMatch(&patternMatchTestData) diff --git a/vendor/github.com/Masterminds/semver/v3/.golangci.yml b/vendor/github.com/Masterminds/semver/v3/.golangci.yml index fdbdf144..c87d1c4b 100644 --- a/vendor/github.com/Masterminds/semver/v3/.golangci.yml +++ b/vendor/github.com/Masterminds/semver/v3/.golangci.yml @@ -4,23 +4,27 @@ run: linters: disable-all: true enable: + - misspell + - structcheck + - govet + - staticcheck - deadcode - - dupl - errcheck - - gofmt - - goimports - - golint - - gosimple - - govet + - varcheck + - unparam - ineffassign - - misspell - nakedret - - structcheck + - gocyclo + - dupl + - goimports + - revive + - gosec + - gosimple + - typecheck - unused - - varcheck linters-settings: gofmt: simplify: true dupl: - threshold: 400 + threshold: 600 diff --git a/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md b/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md index 1f90c38d..f1262642 100644 --- a/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md +++ b/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## 3.2.0 (2022-11-28) + +### Added + +- #190: Added text marshaling and unmarshaling +- #167: Added JSON marshalling for constraints (thanks @SimonTheLeg) +- #173: Implement encoding.TextMarshaler and encoding.TextUnmarshaler on Version (thanks @MarkRosemaker) +- #179: Added New() version constructor (thanks @kazhuravlev) + +### Changed + +- #182/#183: Updated CI testing setup + +### Fixed + +- #186: Fixing issue where validation of constraint section gave false positives +- #176: Fix constraints check with *-0 (thanks @mtt0) +- #181: Fixed Caret operator (^) gives unexpected results when the minor version in constraint is 0 (thanks @arshchimni) +- #161: Fixed godoc (thanks @afirth) + ## 3.1.1 (2020-11-23) ### Fixed diff --git a/vendor/github.com/Masterminds/semver/v3/constraints.go b/vendor/github.com/Masterminds/semver/v3/constraints.go index 547613f0..203072e4 100644 --- a/vendor/github.com/Masterminds/semver/v3/constraints.go +++ b/vendor/github.com/Masterminds/semver/v3/constraints.go @@ -134,6 +134,23 @@ func (cs Constraints) String() string { return strings.Join(buf, " || ") } +// UnmarshalText implements the encoding.TextUnmarshaler interface. +func (cs *Constraints) UnmarshalText(text []byte) error { + temp, err := NewConstraint(string(text)) + if err != nil { + return err + } + + *cs = *temp + + return nil +} + +// MarshalText implements the encoding.TextMarshaler interface. +func (cs Constraints) MarshalText() ([]byte, error) { + return []byte(cs.String()), nil +} + var constraintOps map[string]cfunc var constraintRegex *regexp.Regexp var constraintRangeRegex *regexp.Regexp @@ -180,8 +197,13 @@ func init() { ops, cvRegex)) + // The first time a constraint shows up will look slightly different from + // future times it shows up due to a leading space or comma in a given + // string. validConstraintRegex = regexp.MustCompile(fmt.Sprintf( - `^(\s*(%s)\s*(%s)\s*\,?)+$`, + `^(\s*(%s)\s*(%s)\s*)((?:\s+|,\s*)(%s)\s*(%s)\s*)*$`, + ops, + cvRegex, ops, cvRegex)) } @@ -233,7 +255,7 @@ func parseConstraint(c string) (*constraint, error) { patchDirty := false dirty := false if isX(m[3]) || m[3] == "" { - ver = "0.0.0" + ver = fmt.Sprintf("0.0.0%s", m[6]) dirty = true } else if isX(strings.TrimPrefix(m[4], ".")) || m[4] == "" { minorDirty = true @@ -534,6 +556,10 @@ func constraintCaret(v *Version, c *constraint) (bool, error) { } return false, fmt.Errorf("%s does not have same minor version as %s. Expected minor versions to match when constraint major version is 0", v, c.orig) } + // ^ when the minor is 0 and minor > 0 is =0.0.z + if c.con.Minor() == 0 && v.Minor() > 0 { + return false, fmt.Errorf("%s does not have same minor version as %s", v, c.orig) + } // At this point the major is 0 and the minor is 0 and not dirty. The patch // is not dirty so we need to check if they are equal. If they are not equal diff --git a/vendor/github.com/Masterminds/semver/v3/doc.go b/vendor/github.com/Masterminds/semver/v3/doc.go index 391aa46b..74f97caa 100644 --- a/vendor/github.com/Masterminds/semver/v3/doc.go +++ b/vendor/github.com/Masterminds/semver/v3/doc.go @@ -3,12 +3,12 @@ Package semver provides the ability to work with Semantic Versions (http://semve Specifically it provides the ability to: - * Parse semantic versions - * Sort semantic versions - * Check if a semantic version fits within a set of constraints - * Optionally work with a `v` prefix + - Parse semantic versions + - Sort semantic versions + - Check if a semantic version fits within a set of constraints + - Optionally work with a `v` prefix -Parsing Semantic Versions +# Parsing Semantic Versions There are two functions that can parse semantic versions. The `StrictNewVersion` function only parses valid version 2 semantic versions as outlined in the @@ -21,48 +21,48 @@ that can be sorted, compared, and used in constraints. When parsing a version an optional error can be returned if there is an issue parsing the version. For example, - v, err := semver.NewVersion("1.2.3-beta.1+b345") + v, err := semver.NewVersion("1.2.3-beta.1+b345") The version object has methods to get the parts of the version, compare it to other versions, convert the version back into a string, and get the original string. For more details please see the documentation at https://godoc.org/github.com/Masterminds/semver. -Sorting Semantic Versions +# Sorting Semantic Versions A set of versions can be sorted using the `sort` package from the standard library. For example, - raw := []string{"1.2.3", "1.0", "1.3", "2", "0.4.2",} - vs := make([]*semver.Version, len(raw)) - for i, r := range raw { - v, err := semver.NewVersion(r) - if err != nil { - t.Errorf("Error parsing version: %s", err) - } + raw := []string{"1.2.3", "1.0", "1.3", "2", "0.4.2",} + vs := make([]*semver.Version, len(raw)) + for i, r := range raw { + v, err := semver.NewVersion(r) + if err != nil { + t.Errorf("Error parsing version: %s", err) + } - vs[i] = v - } + vs[i] = v + } - sort.Sort(semver.Collection(vs)) + sort.Sort(semver.Collection(vs)) -Checking Version Constraints and Comparing Versions +# Checking Version Constraints and Comparing Versions There are two methods for comparing versions. One uses comparison methods on `Version` instances and the other is using Constraints. There are some important differences to notes between these two methods of comparison. -1. When two versions are compared using functions such as `Compare`, `LessThan`, - and others it will follow the specification and always include prereleases - within the comparison. It will provide an answer valid with the comparison - spec section at https://semver.org/#spec-item-11 -2. When constraint checking is used for checks or validation it will follow a - different set of rules that are common for ranges with tools like npm/js - and Rust/Cargo. This includes considering prereleases to be invalid if the - ranges does not include on. If you want to have it include pre-releases a - simple solution is to include `-0` in your range. -3. Constraint ranges can have some complex rules including the shorthard use of - ~ and ^. For more details on those see the options below. + 1. When two versions are compared using functions such as `Compare`, `LessThan`, + and others it will follow the specification and always include prereleases + within the comparison. It will provide an answer valid with the comparison + spec section at https://semver.org/#spec-item-11 + 2. When constraint checking is used for checks or validation it will follow a + different set of rules that are common for ranges with tools like npm/js + and Rust/Cargo. This includes considering prereleases to be invalid if the + ranges does not include on. If you want to have it include pre-releases a + simple solution is to include `-0` in your range. + 3. Constraint ranges can have some complex rules including the shorthard use of + ~ and ^. For more details on those see the options below. There are differences between the two methods or checking versions because the comparison methods on `Version` follow the specification while comparison ranges @@ -76,19 +76,19 @@ patters with their versions. Checking a version against version constraints is one of the most featureful parts of the package. - c, err := semver.NewConstraint(">= 1.2.3") - if err != nil { - // Handle constraint not being parsable. - } + c, err := semver.NewConstraint(">= 1.2.3") + if err != nil { + // Handle constraint not being parsable. + } - v, err := semver.NewVersion("1.3") - if err != nil { - // Handle version not being parsable. - } - // Check if the version meets the constraints. The a variable will be true. - a := c.Check(v) + v, err := semver.NewVersion("1.3") + if err != nil { + // Handle version not being parsable. + } + // Check if the version meets the constraints. The a variable will be true. + a := c.Check(v) -Basic Comparisons +# Basic Comparisons There are two elements to the comparisons. First, a comparison string is a list of comma or space separated AND comparisons. These are then separated by || (OR) @@ -99,31 +99,31 @@ greater than or equal to 4.2.3. This can also be written as The basic comparisons are: - * `=`: equal (aliased to no operator) - * `!=`: not equal - * `>`: greater than - * `<`: less than - * `>=`: greater than or equal to - * `<=`: less than or equal to + - `=`: equal (aliased to no operator) + - `!=`: not equal + - `>`: greater than + - `<`: less than + - `>=`: greater than or equal to + - `<=`: less than or equal to -Hyphen Range Comparisons +# Hyphen Range Comparisons There are multiple methods to handle ranges and the first is hyphens ranges. These look like: - * `1.2 - 1.4.5` which is equivalent to `>= 1.2, <= 1.4.5` - * `2.3.4 - 4.5` which is equivalent to `>= 2.3.4 <= 4.5` + - `1.2 - 1.4.5` which is equivalent to `>= 1.2, <= 1.4.5` + - `2.3.4 - 4.5` which is equivalent to `>= 2.3.4 <= 4.5` -Wildcards In Comparisons +# Wildcards In Comparisons The `x`, `X`, and `*` characters can be used as a wildcard character. This works for all comparison operators. When used on the `=` operator it falls back to the tilde operation. For example, - * `1.2.x` is equivalent to `>= 1.2.0 < 1.3.0` - * `>= 1.2.x` is equivalent to `>= 1.2.0` - * `<= 2.x` is equivalent to `<= 3` - * `*` is equivalent to `>= 0.0.0` + - `1.2.x` is equivalent to `>= 1.2.0 < 1.3.0` + - `>= 1.2.x` is equivalent to `>= 1.2.0` + - `<= 2.x` is equivalent to `<= 3` + - `*` is equivalent to `>= 0.0.0` Tilde Range Comparisons (Patch) @@ -131,11 +131,11 @@ The tilde (`~`) comparison operator is for patch level ranges when a minor version is specified and major level changes when the minor number is missing. For example, - * `~1.2.3` is equivalent to `>= 1.2.3 < 1.3.0` - * `~1` is equivalent to `>= 1, < 2` - * `~2.3` is equivalent to `>= 2.3 < 2.4` - * `~1.2.x` is equivalent to `>= 1.2.0 < 1.3.0` - * `~1.x` is equivalent to `>= 1 < 2` + - `~1.2.3` is equivalent to `>= 1.2.3 < 1.3.0` + - `~1` is equivalent to `>= 1, < 2` + - `~2.3` is equivalent to `>= 2.3 < 2.4` + - `~1.2.x` is equivalent to `>= 1.2.0 < 1.3.0` + - `~1.x` is equivalent to `>= 1 < 2` Caret Range Comparisons (Major) @@ -144,41 +144,41 @@ The caret (`^`) comparison operator is for major level changes once a stable as the API stability level. This is useful when comparisons of API versions as a major change is API breaking. For example, - * `^1.2.3` is equivalent to `>= 1.2.3, < 2.0.0` - * `^1.2.x` is equivalent to `>= 1.2.0, < 2.0.0` - * `^2.3` is equivalent to `>= 2.3, < 3` - * `^2.x` is equivalent to `>= 2.0.0, < 3` - * `^0.2.3` is equivalent to `>=0.2.3 <0.3.0` - * `^0.2` is equivalent to `>=0.2.0 <0.3.0` - * `^0.0.3` is equivalent to `>=0.0.3 <0.0.4` - * `^0.0` is equivalent to `>=0.0.0 <0.1.0` - * `^0` is equivalent to `>=0.0.0 <1.0.0` + - `^1.2.3` is equivalent to `>= 1.2.3, < 2.0.0` + - `^1.2.x` is equivalent to `>= 1.2.0, < 2.0.0` + - `^2.3` is equivalent to `>= 2.3, < 3` + - `^2.x` is equivalent to `>= 2.0.0, < 3` + - `^0.2.3` is equivalent to `>=0.2.3 <0.3.0` + - `^0.2` is equivalent to `>=0.2.0 <0.3.0` + - `^0.0.3` is equivalent to `>=0.0.3 <0.0.4` + - `^0.0` is equivalent to `>=0.0.0 <0.1.0` + - `^0` is equivalent to `>=0.0.0 <1.0.0` -Validation +# Validation In addition to testing a version against a constraint, a version can be validated against a constraint. When validation fails a slice of errors containing why a version didn't meet the constraint is returned. For example, - c, err := semver.NewConstraint("<= 1.2.3, >= 1.4") - if err != nil { - // Handle constraint not being parseable. - } - - v, _ := semver.NewVersion("1.3") - if err != nil { - // Handle version not being parseable. - } - - // Validate a version against a constraint. - a, msgs := c.Validate(v) - // a is false - for _, m := range msgs { - fmt.Println(m) - - // Loops over the errors which would read - // "1.3 is greater than 1.2.3" - // "1.3 is less than 1.4" - } + c, err := semver.NewConstraint("<= 1.2.3, >= 1.4") + if err != nil { + // Handle constraint not being parseable. + } + + v, _ := semver.NewVersion("1.3") + if err != nil { + // Handle version not being parseable. + } + + // Validate a version against a constraint. + a, msgs := c.Validate(v) + // a is false + for _, m := range msgs { + fmt.Println(m) + + // Loops over the errors which would read + // "1.3 is greater than 1.2.3" + // "1.3 is less than 1.4" + } */ package semver diff --git a/vendor/github.com/Masterminds/semver/v3/version.go b/vendor/github.com/Masterminds/semver/v3/version.go index d6b9cda3..7c4bed33 100644 --- a/vendor/github.com/Masterminds/semver/v3/version.go +++ b/vendor/github.com/Masterminds/semver/v3/version.go @@ -55,14 +55,16 @@ func init() { versionRegex = regexp.MustCompile("^" + semVerRegex + "$") } -const num string = "0123456789" -const allowed string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-" + num +const ( + num string = "0123456789" + allowed string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-" + num +) // StrictNewVersion parses a given version and returns an instance of Version or // an error if unable to parse the version. Only parses valid semantic versions. // Performs checking that can find errors within the version. -// If you want to coerce a version, such as 1 or 1.2, and perse that as the 1.x -// releases of semver provided use the NewSemver() function. +// If you want to coerce a version such as 1 or 1.2 and parse it as the 1.x +// releases of semver did, use the NewVersion() function. func StrictNewVersion(v string) (*Version, error) { // Parsing here does not use RegEx in order to increase performance and reduce // allocations. @@ -207,6 +209,23 @@ func NewVersion(v string) (*Version, error) { return sv, nil } +// New creates a new instance of Version with each of the parts passed in as +// arguments instead of parsing a version string. +func New(major, minor, patch uint64, pre, metadata string) *Version { + v := Version{ + major: major, + minor: minor, + patch: patch, + pre: pre, + metadata: metadata, + original: "", + } + + v.original = v.String() + + return &v +} + // MustParse parses a given version and panics on error. func MustParse(v string) *Version { sv, err := NewVersion(v) @@ -267,7 +286,6 @@ func (v Version) Metadata() string { // originalVPrefix returns the original 'v' prefix if any. func (v Version) originalVPrefix() string { - // Note, only lowercase v is supported as a prefix by the parser. if v.original != "" && v.original[:1] == "v" { return v.original[:1] @@ -436,6 +454,23 @@ func (v Version) MarshalJSON() ([]byte, error) { return json.Marshal(v.String()) } +// UnmarshalText implements the encoding.TextUnmarshaler interface. +func (v *Version) UnmarshalText(text []byte) error { + temp, err := NewVersion(string(text)) + if err != nil { + return err + } + + *v = *temp + + return nil +} + +// MarshalText implements the encoding.TextMarshaler interface. +func (v Version) MarshalText() ([]byte, error) { + return []byte(v.String()), nil +} + // Scan implements the SQL.Scanner interface. func (v *Version) Scan(value interface{}) error { var s string @@ -470,7 +505,6 @@ func compareSegment(v, o uint64) int { } func comparePrerelease(v, o string) int { - // split the prelease versions by their part. The separator, per the spec, // is a . sparts := strings.Split(v, ".") @@ -562,7 +596,6 @@ func comparePrePart(s, o string) int { return 1 } return -1 - } // Like strings.ContainsAny but does an only instead of any. diff --git a/vendor/github.com/Masterminds/sprig/v3/CHANGELOG.md b/vendor/github.com/Masterminds/sprig/v3/CHANGELOG.md index fcdd4e88..2ce45dd4 100644 --- a/vendor/github.com/Masterminds/sprig/v3/CHANGELOG.md +++ b/vendor/github.com/Masterminds/sprig/v3/CHANGELOG.md @@ -1,8 +1,21 @@ # Changelog +## Release 3.2.3 (2022-11-29) + +### Changed + +- Updated docs (thanks @book987 @aJetHorn @neelayu @pellizzetti @apricote @SaigyoujiYuyuko233 @AlekSi) +- #348: Updated huandu/xstrings which fixed a snake case bug (thanks @yxxhero) +- #353: Updated masterminds/semver which included bug fixes +- #354: Updated golang.org/x/crypto which included bug fixes + +## Release 3.2.2 (2021-02-04) + +This is a re-release of 3.2.1 to satisfy something with the Go module system. + ## Release 3.2.1 (2021-02-04) -### Changed +### Changed - Upgraded `Masterminds/goutils` to `v1.1.1`. see the [Security Advisory](https://github.com/Masterminds/goutils/security/advisories/GHSA-xg2h-wx96-xgxr) diff --git a/vendor/github.com/Masterminds/sprig/v3/README.md b/vendor/github.com/Masterminds/sprig/v3/README.md index c37ba01c..3e22c60e 100644 --- a/vendor/github.com/Masterminds/sprig/v3/README.md +++ b/vendor/github.com/Masterminds/sprig/v3/README.md @@ -17,10 +17,9 @@ JavaScript libraries, such as [underscore.js](http://underscorejs.org/). ## IMPORTANT NOTES Sprig leverages [mergo](https://github.com/imdario/mergo) to handle merges. In -its v0.3.9 release there was a behavior change that impacts merging template -functions in sprig. It is currently recommended to use v0.3.8 of that package. -Using v0.3.9 will cause sprig tests to fail. The issue in mergo is tracked at -https://github.com/imdario/mergo/issues/139. +its v0.3.9 release, there was a behavior change that impacts merging template +functions in sprig. It is currently recommended to use v0.3.10 or later of that package. +Using v0.3.9 will cause sprig tests to fail. ## Package Versions @@ -51,7 +50,7 @@ To load the Sprig `FuncMap`: ```go import ( - "github.com/Masterminds/sprig" + "github.com/Masterminds/sprig/v3" "html/template" ) diff --git a/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md b/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md index 94ee82e3..8bcfd834 100644 --- a/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md +++ b/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md @@ -1,5 +1,17 @@ # HCL Changelog +## v2.15.0 (November 10, 2022) + +### Bugs Fixed + +* ext/typeexpr: Skip null objects when applying defaults. This prevents crashes when null objects are creating inside collections, and stops incomplete objects being created with only optional attributes set. ([#567](https://github.com/hashicorp/hcl/pull/567)) +* ext/typeexpr: Ensure default values do not have optional metadata attached. This prevents crashes when default values are inserted into concrete go-cty values that have also been stripped of their optional metadata. ([#568](https://github.com/hashicorp/hcl/pull/568)) + +### Enhancements + +* ext/typeexpr: With the [go-cty](https://github.com/zclconf/go-cty) upstream depenendency updated to v1.12.0, the `Defaults` struct and associated functions can apply additional and more flexible 'unsafe' conversions (examples include tuples into collections such as lists and sets, and additional safety around null and dynamic values). ([#564](https://github.com/hashicorp/hcl/pull/564)) +* ext/typeexpr: With the [go-cty](https://github.com/zclconf/go-cty) upstream depenendency updated to v1.12.0, users should now apply the go-cty convert functionality *before* setting defaults on a given `cty.Value`, rather than after, if they require a specific `cty.Type`. ([#564](https://github.com/hashicorp/hcl/pull/564)) + ## v2.14.1 (September 23, 2022) ### Bugs Fixed diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/spec.md b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/spec.md index 33c152da..3201f54a 100644 --- a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/spec.md +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/spec.md @@ -84,7 +84,7 @@ Comments serve as program documentation and come in two forms: sequence, and may have any characters within except the ending sequence. An inline comments is considered equivalent to a whitespace sequence. -Comments and whitespace cannot begin within within other comments, or within +Comments and whitespace cannot begin within other comments, or within template literals except inside an interpolation sequence or template directive. ### Identifiers diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto/diagnostic.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto/diagnostic.go index 979896f7..81d692ce 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto/diagnostic.go +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto/diagnostic.go @@ -1,6 +1,8 @@ package toproto import ( + "unicode/utf8" + "github.com/hashicorp/terraform-plugin-go/tfprotov5" "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5" ) @@ -8,8 +10,8 @@ import ( func Diagnostic(in *tfprotov5.Diagnostic) (*tfplugin5.Diagnostic, error) { diag := &tfplugin5.Diagnostic{ Severity: Diagnostic_Severity(in.Severity), - Summary: in.Summary, - Detail: in.Detail, + Summary: forceValidUTF8(in.Summary), + Detail: forceValidUTF8(in.Detail), } if in.Attribute != nil { attr, err := AttributePath(in.Attribute) @@ -41,6 +43,59 @@ func Diagnostics(in []*tfprotov5.Diagnostic) ([]*tfplugin5.Diagnostic, error) { return diagnostics, nil } +// forceValidUTF8 returns a string guaranteed to be valid UTF-8 even if the +// input isn't, by replacing any invalid bytes with a valid UTF-8 encoding of +// the Unicode Replacement Character (\uFFFD). +// +// The protobuf serialization library will reject invalid UTF-8 with an +// unhelpful error message: +// +// string field contains invalid UTF-8 +// +// Passing a string result through this function makes invalid UTF-8 instead +// emerge as placeholder characters on the other side of the wire protocol, +// giving a better chance of still returning a partially-legible message +// instead of a generic character encoding error. +// +// This is intended for user-facing messages such as diagnostic summary and +// detail messages, where Terraform will just treat the value as opaque and +// it's ultimately up to the user and their terminal or web browser to +// interpret the result. Don't use this for strings that have machine-readable +// meaning. +func forceValidUTF8(s string) string { + // Most strings that pass through here will already be valid UTF-8 and + // utf8.ValidString has a fast path which will beat our rune-by-rune + // analysis below, so it's worth the cost of walking the string twice + // in the rarer invalid case. + if utf8.ValidString(s) { + return s + } + + // If we get down here then we know there's at least one invalid UTF-8 + // sequence in the string, so in this slow path we'll reconstruct the + // string one rune at a time, guaranteeing that we'll only write valid + // UTF-8 sequences into the resulting buffer. + // + // Any invalid string will grow at least a little larger as a result of + // this operation because we'll be replacing each invalid byte with + // the three-byte sequence \xEF\xBF\xBD, which is the UTF-8 encoding of + // the replacement character \uFFFD. 9 is a magic number giving room for + // three such expansions without any further allocation. + ret := make([]byte, 0, len(s)+9) + for { + // If the first byte in s is not the start of a valid UTF-8 sequence + // then the following will return utf8.RuneError, 1, where + // utf8.RuneError is the unicode replacement character. + r, advance := utf8.DecodeRuneInString(s) + if advance == 0 { + break + } + s = s[advance:] + ret = utf8.AppendRune(ret, r) + } + return string(ret) +} + // we have to say this next thing to get golint to stop yelling at us about the // underscores in the function names. We want the function names to match // actually-generated code, so it feels like fair play. It's just a shame we diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/diagnostic.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/diagnostic.go index 26ce3e9d..4144222c 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/diagnostic.go +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/diagnostic.go @@ -1,6 +1,8 @@ package toproto import ( + "unicode/utf8" + "github.com/hashicorp/terraform-plugin-go/tfprotov6" "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" ) @@ -8,8 +10,8 @@ import ( func Diagnostic(in *tfprotov6.Diagnostic) (*tfplugin6.Diagnostic, error) { diag := &tfplugin6.Diagnostic{ Severity: Diagnostic_Severity(in.Severity), - Summary: in.Summary, - Detail: in.Detail, + Summary: forceValidUTF8(in.Summary), + Detail: forceValidUTF8(in.Detail), } if in.Attribute != nil { attr, err := AttributePath(in.Attribute) @@ -41,6 +43,59 @@ func Diagnostics(in []*tfprotov6.Diagnostic) ([]*tfplugin6.Diagnostic, error) { return diagnostics, nil } +// forceValidUTF8 returns a string guaranteed to be valid UTF-8 even if the +// input isn't, by replacing any invalid bytes with a valid UTF-8 encoding of +// the Unicode Replacement Character (\uFFFD). +// +// The protobuf serialization library will reject invalid UTF-8 with an +// unhelpful error message: +// +// string field contains invalid UTF-8 +// +// Passing a string result through this function makes invalid UTF-8 instead +// emerge as placeholder characters on the other side of the wire protocol, +// giving a better chance of still returning a partially-legible message +// instead of a generic character encoding error. +// +// This is intended for user-facing messages such as diagnostic summary and +// detail messages, where Terraform will just treat the value as opaque and +// it's ultimately up to the user and their terminal or web browser to +// interpret the result. Don't use this for strings that have machine-readable +// meaning. +func forceValidUTF8(s string) string { + // Most strings that pass through here will already be valid UTF-8 and + // utf8.ValidString has a fast path which will beat our rune-by-rune + // analysis below, so it's worth the cost of walking the string twice + // in the rarer invalid case. + if utf8.ValidString(s) { + return s + } + + // If we get down here then we know there's at least one invalid UTF-8 + // sequence in the string, so in this slow path we'll reconstruct the + // string one rune at a time, guaranteeing that we'll only write valid + // UTF-8 sequences into the resulting buffer. + // + // Any invalid string will grow at least a little larger as a result of + // this operation because we'll be replacing each invalid byte with + // the three-byte sequence \xEF\xBF\xBD, which is the UTF-8 encoding of + // the replacement character \uFFFD. 9 is a magic number giving room for + // three such expansions without any further allocation. + ret := make([]byte, 0, len(s)+9) + for { + // If the first byte in s is not the start of a valid UTF-8 sequence + // then the following will return utf8.RuneError, 1, where + // utf8.RuneError is the unicode replacement character. + r, advance := utf8.DecodeRuneInString(s) + if advance == 0 { + break + } + s = s[advance:] + ret = utf8.AppendRune(ret, r) + } + return string(ret) +} + // we have to say this next thing to get golint to stop yelling at us about the // underscores in the function names. We want the function names to match // actually-generated code, so it feels like fair play. It's just a shame we diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging/logging.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging/logging.go index 235586ae..74eb7f66 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging/logging.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging/logging.go @@ -3,7 +3,6 @@ package logging import ( "fmt" "io" - "io/ioutil" "log" "os" "strings" @@ -32,7 +31,7 @@ var ValidLevels = []logutils.LogLevel{"TRACE", "DEBUG", "INFO", "WARN", "ERROR"} // environment variable. Calls to tflog.* will have their output managed by the // tfsdklog sink. func LogOutput(t testing.T) (logOutput io.Writer, err error) { - logOutput = ioutil.Discard + logOutput = io.Discard logLevel := LogLevel() if logLevel == "" { @@ -88,7 +87,7 @@ func LogOutput(t testing.T) (logOutput io.Writer, err error) { // SetOutput checks for a log destination with LogOutput, and calls // log.SetOutput with the result. If LogOutput returns nil, SetOutput uses -// ioutil.Discard. Any error from LogOutout is fatal. +// io.Discard. Any error from LogOutout is fatal. func SetOutput(t testing.T) { out, err := LogOutput(t) if err != nil { @@ -96,7 +95,7 @@ func SetOutput(t testing.T) { } if out == nil { - out = ioutil.Discard + out = io.Discard } log.SetOutput(out) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/plugin.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/plugin.go index 9e52348d..120f0427 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/plugin.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/plugin.go @@ -3,7 +3,7 @@ package resource import ( "context" "fmt" - "io/ioutil" + "io" "os" "strings" "sync" @@ -157,6 +157,13 @@ func runProviderCommand(ctx context.Context, t testing.T, f func() error, wd *pl host = v } + // schema.Provider have a global stop context that is created outside + // the server context and have their own associated goroutine. Since + // Terraform does not call the StopProvider RPC to stop the server in + // reattach mode, ensure that we save these servers to later call that + // RPC and end those goroutines. + legacyProviderServers := make([]*schema.GRPCProviderServer, 0, len(factories.legacy)) + // Spin up gRPC servers for every provider factory, start a // WaitGroup to listen for all of the close channels. var wg sync.WaitGroup @@ -180,18 +187,24 @@ func runProviderCommand(ctx context.Context, t testing.T, f func() error, wd *pl // shut down. wg.Add(1) + grpcProviderServer := schema.NewGRPCProviderServer(provider) + legacyProviderServers = append(legacyProviderServers, grpcProviderServer) + + // Ensure StopProvider is always called when returning early. + defer grpcProviderServer.StopProvider(ctx, nil) //nolint:errcheck // does not return errors + // configure the settings our plugin will be served with // the GRPCProviderFunc wraps a non-gRPC provider server // into a gRPC interface, and the logger just discards logs // from go-plugin. opts := &plugin.ServeOpts{ GRPCProviderFunc: func() tfprotov5.ProviderServer { - return schema.NewGRPCProviderServer(provider) + return grpcProviderServer }, Logger: hclog.New(&hclog.LoggerOptions{ Name: "plugintest", Level: hclog.Trace, - Output: ioutil.Discard, + Output: io.Discard, }), NoLogOutputOverride: true, UseTFLogSink: t, @@ -279,7 +292,7 @@ func runProviderCommand(ctx context.Context, t testing.T, f func() error, wd *pl Logger: hclog.New(&hclog.LoggerOptions{ Name: "plugintest", Level: hclog.Trace, - Output: ioutil.Discard, + Output: io.Discard, }), NoLogOutputOverride: true, UseTFLogSink: t, @@ -364,7 +377,7 @@ func runProviderCommand(ctx context.Context, t testing.T, f func() error, wd *pl Logger: hclog.New(&hclog.LoggerOptions{ Name: "plugintest", Level: hclog.Trace, - Output: ioutil.Discard, + Output: io.Discard, }), NoLogOutputOverride: true, UseTFLogSink: t, @@ -430,6 +443,12 @@ func runProviderCommand(ctx context.Context, t testing.T, f func() error, wd *pl // get closed, and we'll hang here. cancel() + // For legacy providers, call the StopProvider RPC so the StopContext + // goroutine is cleaned up properly. + for _, legacyProviderServer := range legacyProviderServers { + legacyProviderServer.StopProvider(ctx, nil) //nolint:errcheck // does not return errors + } + logging.HelperResourceTrace(ctx, "Waiting for providers to stop") // wait for the servers to actually shut down; it may take a moment for diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/testcase_providers.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/testcase_providers.go index c09e4657..19a548cd 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/testcase_providers.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/testcase_providers.go @@ -9,7 +9,7 @@ import ( // providerConfig takes the list of providers in a TestCase and returns a // config with only empty provider blocks. This is useful for Import, where no // config is provided, but the providers must be defined. -func (c TestCase) providerConfig(_ context.Context) string { +func (c TestCase) providerConfig(_ context.Context, skipProviderBlock bool) string { var providerBlocks, requiredProviderBlocks strings.Builder // [BF] The Providers field handling predates the logic being moved to this @@ -21,7 +21,9 @@ func (c TestCase) providerConfig(_ context.Context) string { } for name, externalProvider := range c.ExternalProviders { - providerBlocks.WriteString(fmt.Sprintf("provider %q {}\n", name)) + if !skipProviderBlock { + providerBlocks.WriteString(fmt.Sprintf("provider %q {}\n", name)) + } if externalProvider.Source == "" && externalProvider.VersionConstraint == "" { continue diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/testing.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/testing.go index c77f0629..caadc3dd 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/testing.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/testing.go @@ -551,6 +551,16 @@ type TestStep struct { // ImportStateCheck checks the results of ImportState. It should be // used to verify that the resulting value of ImportState has the // proper resources, IDs, and attributes. + // + // Prefer ImportStateVerify over ImportStateCheck, unless the resource + // import explicitly is expected to create multiple resources (not a + // recommended resource implementation) or if attributes are imported with + // syntactically different but semantically/functionally equivalent values + // where special logic is needed. + // + // Terraform versions 1.3 and later can include data source states during + // import, which the testing framework will skip to prevent the need for + // Terraform version specific logic in provider testing. ImportStateCheck ImportStateCheckFunc // ImportStateVerify, if true, will also check that the state values diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/testing_new.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/testing_new.go index 6fa78c23..007ab66c 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/testing_new.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/testing_new.go @@ -89,7 +89,7 @@ func runNewTest(ctx context.Context, t testing.T, c TestCase, helper *plugintest }() if c.hasProviders(ctx) { - err := wd.SetConfig(ctx, c.providerConfig(ctx)) + err := wd.SetConfig(ctx, c.providerConfig(ctx, false)) if err != nil { logging.HelperResourceError(ctx, @@ -170,7 +170,7 @@ func runNewTest(ctx context.Context, t testing.T, c TestCase, helper *plugintest protov6: protov6ProviderFactories(c.ProtoV6ProviderFactories).merge(step.ProtoV6ProviderFactories), } - providerCfg := step.providerConfig(ctx) + providerCfg := step.providerConfig(ctx, step.configHasProviderBlock(ctx)) err := wd.SetConfig(ctx, providerCfg) @@ -371,7 +371,7 @@ func testIDRefresh(ctx context.Context, t testing.T, c TestCase, wd *plugintest. // Temporarily set the config to a minimal provider config for the refresh // test. After the refresh we can reset it. - err := wd.SetConfig(ctx, c.providerConfig(ctx)) + err := wd.SetConfig(ctx, c.providerConfig(ctx, step.configHasProviderBlock(ctx))) if err != nil { t.Fatalf("Error setting import test config: %s", err) } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/testing_new_import_state.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/testing_new_import_state.go index 17b4c2ad..0ec00716 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/testing_new_import_state.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/testing_new_import_state.go @@ -137,12 +137,18 @@ func testStepNewImportState(ctx context.Context, t testing.T, helper *plugintest logging.HelperResourceTrace(ctx, "Using TestStep ImportStateCheck") var states []*terraform.InstanceState - for _, r := range importState.RootModule().Resources { - if r.Primary != nil { - is := r.Primary.DeepCopy() - is.Ephemeral.Type = r.Type // otherwise the check function cannot see the type - states = append(states, is) + for address, r := range importState.RootModule().Resources { + if strings.HasPrefix(address, "data.") { + continue } + + if r.Primary == nil { + continue + } + + is := r.Primary.DeepCopy() + is.Ephemeral.Type = r.Type // otherwise the check function cannot see the type + states = append(states, is) } logging.HelperResourceDebug(ctx, "Calling TestStep ImportStateCheck") diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/teststep_providers.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/teststep_providers.go index b3c71b8c..757f8f63 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/teststep_providers.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/teststep_providers.go @@ -3,9 +3,24 @@ package resource import ( "context" "fmt" + "regexp" "strings" ) +var configProviderBlockRegex = regexp.MustCompile(`provider "?[a-zA-Z0-9_-]+"? {`) + +// configHasProviderBlock returns true if the Config has declared a provider +// configuration block, e.g. provider "examplecloud" {...} +func (s TestStep) configHasProviderBlock(_ context.Context) bool { + return configProviderBlockRegex.MatchString(s.Config) +} + +// configHasTerraformBlock returns true if the Config has declared a terraform +// configuration block, e.g. terraform {...} +func (s TestStep) configHasTerraformBlock(_ context.Context) bool { + return strings.Contains(s.Config, "terraform {") +} + // mergedConfig prepends any necessary terraform configuration blocks to the // TestStep Config. // @@ -18,12 +33,16 @@ func (s TestStep) mergedConfig(ctx context.Context, testCase TestCase) string { // Prevent issues with existing configurations containing the terraform // configuration block. - if !strings.Contains(s.Config, "terraform {") { - if testCase.hasProviders(ctx) { - config.WriteString(testCase.providerConfig(ctx)) - } else { - config.WriteString(s.providerConfig(ctx)) - } + if s.configHasTerraformBlock(ctx) { + config.WriteString(s.Config) + + return config.String() + } + + if testCase.hasProviders(ctx) { + config.WriteString(testCase.providerConfig(ctx, s.configHasProviderBlock(ctx))) + } else { + config.WriteString(s.providerConfig(ctx, s.configHasProviderBlock(ctx))) } config.WriteString(s.Config) @@ -34,11 +53,13 @@ func (s TestStep) mergedConfig(ctx context.Context, testCase TestCase) string { // providerConfig takes the list of providers in a TestStep and returns a // config with only empty provider blocks. This is useful for Import, where no // config is provided, but the providers must be defined. -func (s TestStep) providerConfig(_ context.Context) string { +func (s TestStep) providerConfig(_ context.Context, skipProviderBlock bool) string { var providerBlocks, requiredProviderBlocks strings.Builder for name, externalProvider := range s.ExternalProviders { - providerBlocks.WriteString(fmt.Sprintf("provider %q {}\n", name)) + if !skipProviderBlock { + providerBlocks.WriteString(fmt.Sprintf("provider %q {}\n", name)) + } if externalProvider.Source == "" && externalProvider.VersionConstraint == "" { continue diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugintest/config.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugintest/config.go index c238145a..920c4716 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugintest/config.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugintest/config.go @@ -3,7 +3,6 @@ package plugintest import ( "context" "fmt" - "io/ioutil" "os" "strings" @@ -35,7 +34,7 @@ func DiscoverConfig(ctx context.Context, sourceDir string) (*Config, error) { tfPath := os.Getenv(EnvTfAccTerraformPath) tempDir := os.Getenv(EnvTfAccTempDir) - tfDir, err := ioutil.TempDir(tempDir, "plugintest-terraform") + tfDir, err := os.MkdirTemp(tempDir, "plugintest-terraform") if err != nil { return nil, fmt.Errorf("failed to create temp dir: %w", err) } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugintest/helper.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugintest/helper.go index 0411eae0..bfe89e1b 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugintest/helper.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugintest/helper.go @@ -4,7 +4,6 @@ import ( "context" "errors" "fmt" - "io/ioutil" "os" "strings" @@ -70,7 +69,7 @@ func AutoInitHelper(ctx context.Context, sourceDir string) (*Helper, error) { // automatically clean those up. func InitHelper(ctx context.Context, config *Config) (*Helper, error) { tempDir := os.Getenv(EnvTfAccTempDir) - baseDir, err := ioutil.TempDir(tempDir, "plugintest") + baseDir, err := os.MkdirTemp(tempDir, "plugintest") if err != nil { return nil, fmt.Errorf("failed to create temporary directory for test helper: %s", err) } @@ -105,7 +104,7 @@ func (h *Helper) Close() error { // program exits, the Close method on the helper itself will attempt to // delete it. func (h *Helper) NewWorkingDir(ctx context.Context, t TestControl) (*WorkingDir, error) { - dir, err := ioutil.TempDir(h.baseDir, "work") + dir, err := os.MkdirTemp(h.baseDir, "work") if err != nil { return nil, err } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugintest/working_dir.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugintest/working_dir.go index 123a7ed1..15939935 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugintest/working_dir.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugintest/working_dir.go @@ -1,11 +1,9 @@ package plugintest import ( - "bytes" "context" "encoding/json" "fmt" - "io/ioutil" "os" "path/filepath" @@ -87,7 +85,7 @@ func (wd *WorkingDir) SetConfig(ctx context.Context, cfg string) error { if err := os.Remove(rmFilename); err != nil && !os.IsNotExist(err) { return fmt.Errorf("unable to remove %q: %w", rmFilename, err) } - err := ioutil.WriteFile(outFilename, bCfg, 0700) + err := os.WriteFile(outFilename, bCfg, 0700) if err != nil { return err } @@ -281,11 +279,11 @@ func (wd *WorkingDir) SavedPlan(ctx context.Context) (*tfjson.Plan, error) { return nil, fmt.Errorf("there is no current saved plan") } - logging.HelperResourceTrace(ctx, "Calling Terraform CLI apply command") + logging.HelperResourceTrace(ctx, "Calling Terraform CLI show command for JSON plan") plan, err := wd.tf.ShowPlanFile(context.Background(), wd.planFilename(), tfexec.Reattach(wd.reattachInfo)) - logging.HelperResourceTrace(ctx, "Calling Terraform CLI apply command") + logging.HelperResourceTrace(ctx, "Calling Terraform CLI show command for JSON plan") return plan, err } @@ -299,22 +297,17 @@ func (wd *WorkingDir) SavedPlanRawStdout(ctx context.Context) (string, error) { return "", fmt.Errorf("there is no current saved plan") } - var ret bytes.Buffer - - wd.tf.SetStdout(&ret) - defer wd.tf.SetStdout(ioutil.Discard) - - logging.HelperResourceTrace(ctx, "Calling Terraform CLI show command") + logging.HelperResourceTrace(ctx, "Calling Terraform CLI show command for stdout plan") - _, err := wd.tf.ShowPlanFileRaw(context.Background(), wd.planFilename(), tfexec.Reattach(wd.reattachInfo)) + stdout, err := wd.tf.ShowPlanFileRaw(context.Background(), wd.planFilename(), tfexec.Reattach(wd.reattachInfo)) - logging.HelperResourceTrace(ctx, "Called Terraform CLI show command") + logging.HelperResourceTrace(ctx, "Called Terraform CLI show command for stdout plan") if err != nil { return "", err } - return ret.String(), nil + return stdout, nil } // State returns an object describing the current state. @@ -322,11 +315,11 @@ func (wd *WorkingDir) SavedPlanRawStdout(ctx context.Context) (string, error) { // If the state cannot be read, State returns an error. func (wd *WorkingDir) State(ctx context.Context) (*tfjson.State, error) { - logging.HelperResourceTrace(ctx, "Calling Terraform CLI show command") + logging.HelperResourceTrace(ctx, "Calling Terraform CLI show command for JSON state") state, err := wd.tf.Show(context.Background(), tfexec.Reattach(wd.reattachInfo)) - logging.HelperResourceTrace(ctx, "Called Terraform CLI show command") + logging.HelperResourceTrace(ctx, "Called Terraform CLI show command for JSON state") return state, err } diff --git a/vendor/github.com/hashicorp/terraform-registry-address/LICENSE b/vendor/github.com/hashicorp/terraform-registry-address/LICENSE index c33dcc7c..84cd0643 100644 --- a/vendor/github.com/hashicorp/terraform-registry-address/LICENSE +++ b/vendor/github.com/hashicorp/terraform-registry-address/LICENSE @@ -1,3 +1,5 @@ +Copyright (c) 2021 HashiCorp, Inc. + Mozilla Public License, version 2.0 1. Definitions diff --git a/vendor/github.com/huandu/xstrings/convert.go b/vendor/github.com/huandu/xstrings/convert.go index 151c3151..cba0d072 100644 --- a/vendor/github.com/huandu/xstrings/convert.go +++ b/vendor/github.com/huandu/xstrings/convert.go @@ -12,11 +12,12 @@ import ( // ToCamelCase is to convert words separated by space, underscore and hyphen to camel case. // // Some samples. -// "some_words" => "SomeWords" -// "http_server" => "HttpServer" -// "no_https" => "NoHttps" -// "_complex__case_" => "_Complex_Case_" -// "some words" => "SomeWords" +// +// "some_words" => "SomeWords" +// "http_server" => "HttpServer" +// "no_https" => "NoHttps" +// "_complex__case_" => "_Complex_Case_" +// "some words" => "SomeWords" func ToCamelCase(str string) string { if len(str) == 0 { return "" @@ -61,7 +62,6 @@ func ToCamelCase(str string) string { if isConnector(r1) { r0 = unicode.ToUpper(r0) } else { - r0 = unicode.ToLower(r0) buf.WriteRune(r1) } } @@ -74,16 +74,17 @@ func ToCamelCase(str string) string { // snake case format. // // Some samples. -// "FirstName" => "first_name" -// "HTTPServer" => "http_server" -// "NoHTTPS" => "no_https" -// "GO_PATH" => "go_path" -// "GO PATH" => "go_path" // space is converted to underscore. -// "GO-PATH" => "go_path" // hyphen is converted to underscore. -// "http2xx" => "http_2xx" // insert an underscore before a number and after an alphabet. -// "HTTP20xOK" => "http_20x_ok" -// "Duration2m3s" => "duration_2m3s" -// "Bld4Floor3rd" => "bld4_floor_3rd" +// +// "FirstName" => "first_name" +// "HTTPServer" => "http_server" +// "NoHTTPS" => "no_https" +// "GO_PATH" => "go_path" +// "GO PATH" => "go_path" // space is converted to underscore. +// "GO-PATH" => "go_path" // hyphen is converted to underscore. +// "http2xx" => "http_2xx" // insert an underscore before a number and after an alphabet. +// "HTTP20xOK" => "http_20x_ok" +// "Duration2m3s" => "duration_2m3s" +// "Bld4Floor3rd" => "bld4_floor_3rd" func ToSnakeCase(str string) string { return camelCaseToLowerCase(str, '_') } @@ -92,16 +93,17 @@ func ToSnakeCase(str string) string { // kebab case format. // // Some samples. -// "FirstName" => "first-name" -// "HTTPServer" => "http-server" -// "NoHTTPS" => "no-https" -// "GO_PATH" => "go-path" -// "GO PATH" => "go-path" // space is converted to '-'. -// "GO-PATH" => "go-path" // hyphen is converted to '-'. -// "http2xx" => "http-2xx" // insert an underscore before a number and after an alphabet. -// "HTTP20xOK" => "http-20x-ok" -// "Duration2m3s" => "duration-2m3s" -// "Bld4Floor3rd" => "bld4-floor-3rd" +// +// "FirstName" => "first-name" +// "HTTPServer" => "http-server" +// "NoHTTPS" => "no-https" +// "GO_PATH" => "go-path" +// "GO PATH" => "go-path" // space is converted to '-'. +// "GO-PATH" => "go-path" // hyphen is converted to '-'. +// "http2xx" => "http-2xx" // insert an underscore before a number and after an alphabet. +// "HTTP20xOK" => "http-20x-ok" +// "Duration2m3s" => "duration-2m3s" +// "Bld4Floor3rd" => "bld4-floor-3rd" func ToKebabCase(str string) string { return camelCaseToLowerCase(str, '-') } @@ -510,17 +512,18 @@ func ShuffleSource(str string, src rand.Source) string { // regardless whether the result is a valid rune or not. // // Only following characters are alphanumeric. -// * a - z -// * A - Z -// * 0 - 9 +// - a - z +// - A - Z +// - 0 - 9 // // Samples (borrowed from ruby's String#succ document): -// "abcd" => "abce" -// "THX1138" => "THX1139" -// "<>" => "<>" -// "1999zzz" => "2000aaa" -// "ZZZ9999" => "AAAA0000" -// "***" => "**+" +// +// "abcd" => "abce" +// "THX1138" => "THX1139" +// "<>" => "<>" +// "1999zzz" => "2000aaa" +// "ZZZ9999" => "AAAA0000" +// "***" => "**+" func Successor(str string) string { if str == "" { return str diff --git a/vendor/github.com/huandu/xstrings/format.go b/vendor/github.com/huandu/xstrings/format.go index 8cd76c52..b32219bb 100644 --- a/vendor/github.com/huandu/xstrings/format.go +++ b/vendor/github.com/huandu/xstrings/format.go @@ -17,9 +17,10 @@ import ( // If tabSize <= 0, ExpandTabs panics with error. // // Samples: -// ExpandTabs("a\tbc\tdef\tghij\tk", 4) => "a bc def ghij k" -// ExpandTabs("abcdefg\thij\nk\tl", 4) => "abcdefg hij\nk l" -// ExpandTabs("z中\t文\tw", 4) => "z中 文 w" +// +// ExpandTabs("a\tbc\tdef\tghij\tk", 4) => "a bc def ghij k" +// ExpandTabs("abcdefg\thij\nk\tl", 4) => "abcdefg hij\nk l" +// ExpandTabs("z中\t文\tw", 4) => "z中 文 w" func ExpandTabs(str string, tabSize int) string { if tabSize <= 0 { panic("tab size must be positive") @@ -74,9 +75,10 @@ func ExpandTabs(str string, tabSize int) string { // If pad is an empty string, str will be returned. // // Samples: -// LeftJustify("hello", 4, " ") => "hello" -// LeftJustify("hello", 10, " ") => "hello " -// LeftJustify("hello", 10, "123") => "hello12312" +// +// LeftJustify("hello", 4, " ") => "hello" +// LeftJustify("hello", 10, " ") => "hello " +// LeftJustify("hello", 10, "123") => "hello12312" func LeftJustify(str string, length int, pad string) string { l := Len(str) @@ -100,9 +102,10 @@ func LeftJustify(str string, length int, pad string) string { // If pad is an empty string, str will be returned. // // Samples: -// RightJustify("hello", 4, " ") => "hello" -// RightJustify("hello", 10, " ") => " hello" -// RightJustify("hello", 10, "123") => "12312hello" +// +// RightJustify("hello", 4, " ") => "hello" +// RightJustify("hello", 10, " ") => " hello" +// RightJustify("hello", 10, "123") => "12312hello" func RightJustify(str string, length int, pad string) string { l := Len(str) @@ -126,9 +129,10 @@ func RightJustify(str string, length int, pad string) string { // If pad is an empty string, str will be returned. // // Samples: -// Center("hello", 4, " ") => "hello" -// Center("hello", 10, " ") => " hello " -// Center("hello", 10, "123") => "12hello123" +// +// Center("hello", 4, " ") => "hello" +// Center("hello", 10, " ") => " hello " +// Center("hello", 10, "123") => "12hello123" func Center(str string, length int, pad string) string { l := Len(str) diff --git a/vendor/github.com/huandu/xstrings/manipulate.go b/vendor/github.com/huandu/xstrings/manipulate.go index 64075f9b..ab42fe0f 100644 --- a/vendor/github.com/huandu/xstrings/manipulate.go +++ b/vendor/github.com/huandu/xstrings/manipulate.go @@ -79,10 +79,12 @@ func Slice(str string, start, end int) string { // The return value is a slice of strings with head, match and tail. // // If str contains sep, for example "hello" and "l", Partition returns -// "he", "l", "lo" +// +// "he", "l", "lo" // // If str doesn't contain sep, for example "hello" and "x", Partition returns -// "hello", "", "" +// +// "hello", "", "" func Partition(str, sep string) (head, match, tail string) { index := strings.Index(str, sep) @@ -101,10 +103,12 @@ func Partition(str, sep string) (head, match, tail string) { // The return value is a slice of strings with head, match and tail. // // If str contains sep, for example "hello" and "l", LastPartition returns -// "hel", "l", "o" +// +// "hel", "l", "o" // // If str doesn't contain sep, for example "hello" and "x", LastPartition returns -// "", "", "hello" +// +// "", "", "hello" func LastPartition(str, sep string) (head, match, tail string) { index := strings.LastIndex(str, sep) diff --git a/vendor/github.com/huandu/xstrings/stringbuilder.go b/vendor/github.com/huandu/xstrings/stringbuilder.go index bb0919d3..06812fea 100644 --- a/vendor/github.com/huandu/xstrings/stringbuilder.go +++ b/vendor/github.com/huandu/xstrings/stringbuilder.go @@ -1,4 +1,5 @@ -//+build go1.10 +//go:build go1.10 +// +build go1.10 package xstrings diff --git a/vendor/github.com/huandu/xstrings/stringbuilder_go110.go b/vendor/github.com/huandu/xstrings/stringbuilder_go110.go index dac389d1..ccaa5aed 100644 --- a/vendor/github.com/huandu/xstrings/stringbuilder_go110.go +++ b/vendor/github.com/huandu/xstrings/stringbuilder_go110.go @@ -1,4 +1,5 @@ -//+build !go1.10 +//go:build !go1.10 +// +build !go1.10 package xstrings diff --git a/vendor/github.com/huandu/xstrings/translate.go b/vendor/github.com/huandu/xstrings/translate.go index 42e694fb..1fac6a00 100644 --- a/vendor/github.com/huandu/xstrings/translate.go +++ b/vendor/github.com/huandu/xstrings/translate.go @@ -416,14 +416,16 @@ func (tr *Translator) HasPattern() bool { // // From and to are patterns representing a set of characters. Pattern is defined as following. // -// * Special characters -// * '-' means a range of runes, e.g. -// * "a-z" means all characters from 'a' to 'z' inclusive; -// * "z-a" means all characters from 'z' to 'a' inclusive. -// * '^' as first character means a set of all runes excepted listed, e.g. -// * "^a-z" means all characters except 'a' to 'z' inclusive. -// * '\' escapes special characters. -// * Normal character represents itself, e.g. "abc" is a set including 'a', 'b' and 'c'. +// Special characters: +// +// 1. '-' means a range of runes, e.g. +// "a-z" means all characters from 'a' to 'z' inclusive; +// "z-a" means all characters from 'z' to 'a' inclusive. +// 2. '^' as first character means a set of all runes excepted listed, e.g. +// "^a-z" means all characters except 'a' to 'z' inclusive. +// 3. '\' escapes special characters. +// +// Normal character represents itself, e.g. "abc" is a set including 'a', 'b' and 'c'. // // Translate will try to find a 1:1 mapping from from to to. // If to is smaller than from, last rune in to will be used to map "out of range" characters in from. @@ -433,12 +435,13 @@ func (tr *Translator) HasPattern() bool { // If the to pattern is an empty string, Translate works exactly the same as Delete. // // Samples: -// Translate("hello", "aeiou", "12345") => "h2ll4" -// Translate("hello", "a-z", "A-Z") => "HELLO" -// Translate("hello", "z-a", "a-z") => "svool" -// Translate("hello", "aeiou", "*") => "h*ll*" -// Translate("hello", "^l", "*") => "**ll*" -// Translate("hello ^ world", `\^lo`, "*") => "he*** * w*r*d" +// +// Translate("hello", "aeiou", "12345") => "h2ll4" +// Translate("hello", "a-z", "A-Z") => "HELLO" +// Translate("hello", "z-a", "a-z") => "svool" +// Translate("hello", "aeiou", "*") => "h*ll*" +// Translate("hello", "^l", "*") => "**ll*" +// Translate("hello ^ world", `\^lo`, "*") => "he*** * w*r*d" func Translate(str, from, to string) string { tr := NewTranslator(from, to) return tr.Translate(str) @@ -448,9 +451,10 @@ func Translate(str, from, to string) string { // Pattern is defined in Translate function. // // Samples: -// Delete("hello", "aeiou") => "hll" -// Delete("hello", "a-k") => "llo" -// Delete("hello", "^a-k") => "he" +// +// Delete("hello", "aeiou") => "hll" +// Delete("hello", "a-k") => "llo" +// Delete("hello", "^a-k") => "he" func Delete(str, pattern string) string { tr := NewTranslator(pattern, "") return tr.Translate(str) @@ -460,9 +464,10 @@ func Delete(str, pattern string) string { // Pattern is defined in Translate function. // // Samples: -// Count("hello", "aeiou") => 3 -// Count("hello", "a-k") => 3 -// Count("hello", "^a-k") => 2 +// +// Count("hello", "aeiou") => 3 +// Count("hello", "a-k") => 3 +// Count("hello", "^a-k") => 2 func Count(str, pattern string) int { if pattern == "" || str == "" { return 0 @@ -491,9 +496,10 @@ func Count(str, pattern string) int { // If pattern is not empty, only runes matching the pattern will be squeezed. // // Samples: -// Squeeze("hello", "") => "helo" -// Squeeze("hello", "m-z") => "hello" -// Squeeze("hello world", " ") => "hello world" +// +// Squeeze("hello", "") => "helo" +// Squeeze("hello", "m-z") => "hello" +// Squeeze("hello world", " ") => "hello world" func Squeeze(str, pattern string) string { var last, r rune var size int diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/README.md b/vendor/github.com/wasfree/uptrends-go-sdk/README.md index 3dd3c209..8dbe558b 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/README.md +++ b/vendor/github.com/wasfree/uptrends-go-sdk/README.md @@ -9,10 +9,11 @@ For more information, please visit https://www.uptrends.com/api. openapi-generator generate -i ./swagger.json -g go -o . --package-name=uptrends -p enumClassPrefix=true docker run --rm \ - -v ${PWD}:/local openapitools/openapi-generator-cli:v5.2.1 generate \ + -v ${PWD}:/local openapitools/openapi-generator-cli:v6.2.1 generate \ -i https://api.uptrends.com/v4/swagger/v1/swagger.json \ -g go \ -o /local/ \ + --skip-validate-spec \ --package-name=uptrends \ -p enumClassPrefix=true @@ -36,7 +37,7 @@ go get golang.org/x/net/context Put the package under your project folder and add the following in import: ```golang -import sw "./uptrends" +import uptrends "github.com/GIT_USER_ID/GIT_REPO_ID" ``` To use a proxy, set the environment variable `HTTP_PROXY`: @@ -54,7 +55,7 @@ Default configuration comes with `Servers` field that contains server objects as For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. ```golang -ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) +ctx := context.WithValue(context.Background(), uptrends.ContextServerIndex, 1) ``` ### Templated Server URL @@ -62,7 +63,7 @@ ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. ```golang -ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{ +ctx := context.WithValue(context.Background(), uptrends.ContextServerVariables, map[string]string{ "basePath": "v2", }) ``` @@ -72,14 +73,14 @@ Note, enum values are always validated and all unused variables are silently ign ### URLs Configuration per Operation Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. -An operation is uniquely identifield by `"{classname}Service.{nickname}"` string. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. -``` -ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{ +```golang +ctx := context.WithValue(context.Background(), uptrends.ContextOperationServerIndices, map[string]int{ "{classname}Service.{nickname}": 2, }) -ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{ +ctx = context.WithValue(context.Background(), uptrends.ContextOperationServerVariables, map[string]map[string]string{ "{classname}Service.{nickname}": { "port": "8443", }, @@ -93,6 +94,7 @@ All URIs are relative to *https://api.uptrends.com/v4* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AccountApi* | [**AccountGetAccountStatistics**](docs/AccountApi.md#accountgetaccountstatistics) | **Get** /Account | Returns the account statistics. +*AccountApi* | [**AccountGetSettings**](docs/AccountApi.md#accountgetsettings) | **Get** /Account/Settings | Returns account general settings. *AlertApi* | [**AlertGetMonitorAlerts**](docs/AlertApi.md#alertgetmonitoralerts) | **Get** /Alert/Monitor/{monitorGuid} | Returns alerts for a specific monitor. *AlertApi* | [**AlertGetMonitorGroupAlerts**](docs/AlertApi.md#alertgetmonitorgroupalerts) | **Get** /Alert/MonitorGroup/{monitorGroupGuid} | Returns alerts for a specific monitor group. *AlertDefinitionApi* | [**AlertDefinitionAddIntegrationToEscalationLevel**](docs/AlertDefinitionApi.md#alertdefinitionaddintegrationtoescalationlevel) | **Post** /AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}/Integration | Adds an integration to a specified escalation level. @@ -101,11 +103,14 @@ Class | Method | HTTP request | Description *AlertDefinitionApi* | [**AlertDefinitionAddOperatorGroupToEscalationLevel**](docs/AlertDefinitionApi.md#alertdefinitionaddoperatorgrouptoescalationlevel) | **Post** /AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}/Member/OperatorGroup/{operatorGroupGuid} | Adds an operator group to the specified escalation level. *AlertDefinitionApi* | [**AlertDefinitionAddOperatorToEscalationLevel**](docs/AlertDefinitionApi.md#alertdefinitionaddoperatortoescalationlevel) | **Post** /AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}/Member/Operator/{operatorGuid} | Adds an operator to the specified escalation level. *AlertDefinitionApi* | [**AlertDefinitionCreateAlertDefinition**](docs/AlertDefinitionApi.md#alertdefinitioncreatealertdefinition) | **Post** /AlertDefinition | Creates a new alert definition. +*AlertDefinitionApi* | [**AlertDefinitionCreateAuthorizationForAlertDefinition**](docs/AlertDefinitionApi.md#alertdefinitioncreateauthorizationforalertdefinition) | **Post** /AlertDefinition/{alertDefinitionGuid}/Authorizations | Create authorizations for alert definition If the wanted authorizations requires other authorizations, these will be added as well *AlertDefinitionApi* | [**AlertDefinitionDeleteAlertDefinition**](docs/AlertDefinitionApi.md#alertdefinitiondeletealertdefinition) | **Delete** /AlertDefinition/{alertDefinitionGuid} | Deletes an existing alert definition. +*AlertDefinitionApi* | [**AlertDefinitionDeleteAuthorizationForAlertDefinition**](docs/AlertDefinitionApi.md#alertdefinitiondeleteauthorizationforalertdefinition) | **Delete** /AlertDefinition/{alertDefinitionGuid}/Authorizations/{authorizationGuid} | Delete alert definition authorization for alert definition *AlertDefinitionApi* | [**AlertDefinitionGetAllAlertDefinitions**](docs/AlertDefinitionApi.md#alertdefinitiongetallalertdefinitions) | **Get** /AlertDefinition | Gets a list of all alert definitions. *AlertDefinitionApi* | [**AlertDefinitionGetAllEscalationLevelIntegrations**](docs/AlertDefinitionApi.md#alertdefinitiongetallescalationlevelintegrations) | **Get** /AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}/Integration | Gets all integrations for a specified escalation level. *AlertDefinitionApi* | [**AlertDefinitionGetAllEscalationLevels**](docs/AlertDefinitionApi.md#alertdefinitiongetallescalationlevels) | **Get** /AlertDefinition/{alertDefinitionGuid}/EscalationLevel | Gets all escalation level information for the specified alert definition. *AlertDefinitionApi* | [**AlertDefinitionGetAllMembers**](docs/AlertDefinitionApi.md#alertdefinitiongetallmembers) | **Get** /AlertDefinition/{alertDefinitionGuid}/Member | Gets a list of all monitor and monitor group guids for the specified alert definition. +*AlertDefinitionApi* | [**AlertDefinitionGetAuthorizationsOfAlertDefinition**](docs/AlertDefinitionApi.md#alertdefinitiongetauthorizationsofalertdefinition) | **Get** /AlertDefinition/{alertDefinitionGuid}/Authorizations | Get authorizations of alert definition *AlertDefinitionApi* | [**AlertDefinitionGetEscalationLevel**](docs/AlertDefinitionApi.md#alertdefinitiongetescalationlevel) | **Get** /AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId} | Gets the escalation level information of the specified alert definition. *AlertDefinitionApi* | [**AlertDefinitionGetEscalationLevelIntegration**](docs/AlertDefinitionApi.md#alertdefinitiongetescalationlevelintegration) | **Get** /AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}/Integration/{integrationGuid} | Gets a single integration for a specified escalation level. *AlertDefinitionApi* | [**AlertDefinitionGetEscalationLevelOperator**](docs/AlertDefinitionApi.md#alertdefinitiongetescalationleveloperator) | **Get** /AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}/Member | Gets the operator and operator group guids for the specified escalation level. @@ -121,32 +126,37 @@ Class | Method | HTTP request | Description *AlertDefinitionApi* | [**AlertDefinitionRemoveOperatorGroupFromEscalationLevel**](docs/AlertDefinitionApi.md#alertdefinitionremoveoperatorgroupfromescalationlevel) | **Delete** /AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}/Member/OperatorGroup/{operatorGroupGuid} | Removes an operator group for the specified escalation level. *AlertDefinitionApi* | [**AlertDefinitionUpdateIntegrationForEscalationWithPatch**](docs/AlertDefinitionApi.md#alertdefinitionupdateintegrationforescalationwithpatch) | **Patch** /AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}/Integration/{integrationGuid} | Partially updates an integration for a specified escalation level. *AlertDefinitionApi* | [**AlertDefinitionUpdateIntegrationForEscalationWithPut**](docs/AlertDefinitionApi.md#alertdefinitionupdateintegrationforescalationwithput) | **Put** /AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}/Integration/{integrationGuid} | Updates an integration for a specified escalation level. -*CheckpointApi* | [**CheckpointGetAllCheckpoints**](docs/CheckpointApi.md#checkpointgetallcheckpoints) | **Get** /Checkpoint | Returns all the checkpoints. -*CheckpointApi* | [**CheckpointGetCheckpoint**](docs/CheckpointApi.md#checkpointgetcheckpoint) | **Get** /Checkpoint/{checkpointId} | Returns the specified checkpoint. -*CheckpointApi* | [**CheckpointRegionGetAllCheckpointRegions**](docs/CheckpointApi.md#checkpointregiongetallcheckpointregions) | **Get** /CheckpointRegion | Returns all the checkpoint regions. -*CheckpointApi* | [**CheckpointRegionGetCheckpointRegionCheckpoints**](docs/CheckpointApi.md#checkpointregiongetcheckpointregioncheckpoints) | **Get** /CheckpointRegion/{checkpointRegionId}/Checkpoint | Returns the checkpoints for the specified checkpoint region. -*CheckpointApi* | [**CheckpointRegionGetSpecifiedCheckpointRegion**](docs/CheckpointApi.md#checkpointregiongetspecifiedcheckpointregion) | **Get** /CheckpointRegion/{checkpointRegionId} | Returns the specified checkpoint region. -*CheckpointApi* | [**CheckpointServerGetAllServerIpv4Addresses**](docs/CheckpointApi.md#checkpointservergetallserveripv4addresses) | **Get** /Checkpoint/Server/Ipv4 | Anonymous call that returns all the IPv4 addresses of all the checkpoint servers. -*CheckpointApi* | [**CheckpointServerGetAllServerIpv6Addresses**](docs/CheckpointApi.md#checkpointservergetallserveripv6addresses) | **Get** /Checkpoint/Server/Ipv6 | Anonymous call that returns all the IPv6 addresses of all the checkpoint servers. +*CheckpointApi* | [**CheckpointGetAllCheckpoints**](docs/CheckpointApi.md#checkpointgetallcheckpoints) | **Get** /Checkpoint | Returns all the checkpoints that are not deleted +*CheckpointApi* | [**CheckpointGetCheckpoint**](docs/CheckpointApi.md#checkpointgetcheckpoint) | **Get** /Checkpoint/{checkpointId} | Returns the specified checkpoint, deleted or not +*CheckpointApi* | [**CheckpointRegionGetAllCheckpointRegions**](docs/CheckpointApi.md#checkpointregiongetallcheckpointregions) | **Get** /CheckpointRegion | Returns all the checkpoint regions. +*CheckpointApi* | [**CheckpointRegionGetCheckpointRegionCheckpoints**](docs/CheckpointApi.md#checkpointregiongetcheckpointregioncheckpoints) | **Get** /CheckpointRegion/{checkpointRegionId}/Checkpoint | Returns the checkpoints for the specified checkpoint region. +*CheckpointApi* | [**CheckpointRegionGetSpecifiedCheckpointRegion**](docs/CheckpointApi.md#checkpointregiongetspecifiedcheckpointregion) | **Get** /CheckpointRegion/{checkpointRegionId} | Returns the specified checkpoint region. +*CheckpointApi* | [**CheckpointServerGetAllServerIpv4Addresses**](docs/CheckpointApi.md#checkpointservergetallserveripv4addresses) | **Get** /Checkpoint/Server/Ipv4 | Anonymous call that returns all the IPv4 addresses of all the checkpoint servers. +*CheckpointApi* | [**CheckpointServerGetAllServerIpv6Addresses**](docs/CheckpointApi.md#checkpointservergetallserveripv6addresses) | **Get** /Checkpoint/Server/Ipv6 | Anonymous call that returns all the IPv6 addresses of all the checkpoint servers. *CheckpointApi* | [**CheckpointServerGetServer**](docs/CheckpointApi.md#checkpointservergetserver) | **Get** /Checkpoint/Server/{serverId} | Returns the requested checkpoint server. +*CheckpointApi* | [**PrivateCheckpointHealthGetPrivateCheckpointHealthForRegion**](docs/CheckpointApi.md#privatecheckpointhealthgetprivatecheckpointhealthforregion) | **Get** /PrivateCheckpointHealthForRegion | Returns the status of the private checkpoints in the given region. +*CheckpointApi* | [**PrivateCheckpointHealthGetSpecifiedPrivateCheckpointHealth**](docs/CheckpointApi.md#privatecheckpointhealthgetspecifiedprivatecheckpointhealth) | **Get** /PrivateCheckpointHealth | Returns the status of the specified private checkpoints. *DashboardApi* | [**DashboardCloneDashboard**](docs/DashboardApi.md#dashboardclonedashboard) | **Post** /Dashboard/{dashboardGuid}/Clone | Clone the specified dashboard. *DashboardApi* | [**DashboardDeleteDashboard**](docs/DashboardApi.md#dashboarddeletedashboard) | **Delete** /Dashboard/{dashboardGuid} | Delete the specified dashboard. *DashboardApi* | [**DashboardGetAllDashboards**](docs/DashboardApi.md#dashboardgetalldashboards) | **Get** /Dashboard | Returns data for all dashboards. *DashboardApi* | [**DashboardGetOneDashboard**](docs/DashboardApi.md#dashboardgetonedashboard) | **Get** /Dashboard/{dashboardGuid} | Returns data for the specified dashboard. *DashboardApi* | [**DashboardPartiallyUpdateDashboard**](docs/DashboardApi.md#dashboardpartiallyupdatedashboard) | **Patch** /Dashboard/{dashboardGuid} | Partially update the specified dashboard. *DashboardApi* | [**DashboardUpdateDashboard**](docs/DashboardApi.md#dashboardupdatedashboard) | **Put** /Dashboard/{dashboardGuid} | Update the specified dashboard. +*IntegrationApi* | [**IntegrationCreateAuthorizationForIntegration**](docs/IntegrationApi.md#integrationcreateauthorizationforintegration) | **Post** /Integration/{integrationGuid}/Authorizations | Create authorizations for integration If the wanted authorizations requires other authorizations, these will be added as well +*IntegrationApi* | [**IntegrationDeleteAuthorizationForIntegration**](docs/IntegrationApi.md#integrationdeleteauthorizationforintegration) | **Delete** /Integration/{integrationGuid}/Authorizations/{authorizationGuid} | Delete integration authorization for integration *IntegrationApi* | [**IntegrationGetAllIntegrations**](docs/IntegrationApi.md#integrationgetallintegrations) | **Get** /Integration | Gets a list of all integrations. -*MiscellaneousApi* | [**MiscellaneousGetAllOutgoingPhoneNumbers**](docs/MiscellaneousApi.md#miscellaneousgetalloutgoingphonenumbers) | **Get** /OutgoingPhoneNumber | Gets a list of all outgoing phone numbers available. -*MiscellaneousApi* | [**MiscellaneousGetAllTimezones**](docs/MiscellaneousApi.md#miscellaneousgetalltimezones) | **Get** /Timezone | Gets all timezones available. -*MiscellaneousApi* | [**MiscellaneousGetTimezoneById**](docs/MiscellaneousApi.md#miscellaneousgettimezonebyid) | **Get** /Timezone/{timezoneId} | Gets the timezone with the specified Id. +*IntegrationApi* | [**IntegrationGetAuthorizationsOfIntegration**](docs/IntegrationApi.md#integrationgetauthorizationsofintegration) | **Get** /Integration/{integrationGuid}/Authorizations | Get authorizations of integration *MonitorApi* | [**MonitorCleanupMaintenancePeriods**](docs/MonitorApi.md#monitorcleanupmaintenanceperiods) | **Post** /Monitor/{monitorGuid}/MaintenancePeriod/Cleanup/{beforeDate} | Clears out all one-time maintenance periods for the specified monitor older than the specified date *MonitorApi* | [**MonitorCloneMonitor**](docs/MonitorApi.md#monitorclonemonitor) | **Post** /Monitor/{monitorGuid}/Clone | Creates a clone (duplicate) of the specified monitor. +*MonitorApi* | [**MonitorCreateAuthorizationForMonitor**](docs/MonitorApi.md#monitorcreateauthorizationformonitor) | **Post** /Monitor/{monitorGuid}/Authorizations | Create monitor authorizations for monitor If the wanted authorizations requires other authorizations, these will be added as well *MonitorApi* | [**MonitorCreateMaintenancePeriodForMonitor**](docs/MonitorApi.md#monitorcreatemaintenanceperiodformonitor) | **Post** /Monitor/{monitorGuid}/MaintenancePeriod | Saves the new maintenance period provided for the specified monitor +*MonitorApi* | [**MonitorDeleteAuthorizationForMonitorGroup**](docs/MonitorApi.md#monitordeleteauthorizationformonitorgroup) | **Delete** /Monitor/{monitorGuid}/Authorizations/{authorizationGuid} | Delete monitor authorization for monitor *MonitorApi* | [**MonitorDeleteMaintenancePeriodFromMonitor**](docs/MonitorApi.md#monitordeletemaintenanceperiodfrommonitor) | **Delete** /Monitor/{monitorGuid}/MaintenancePeriod/{maintenancePeriodId} | Deletes the specified maintenance period from the specified monitor *MonitorApi* | [**MonitorDeleteMonitor**](docs/MonitorApi.md#monitordeletemonitor) | **Delete** /Monitor/{monitorGuid} | Deletes the specified monitor. *MonitorApi* | [**MonitorGetAllMaintenancePeriodsForMonitor**](docs/MonitorApi.md#monitorgetallmaintenanceperiodsformonitor) | **Get** /Monitor/{monitorGuid}/MaintenancePeriod | Finds all maintenance periods for a monitor. -*MonitorApi* | [**MonitorGetMonitor**](docs/MonitorApi.md#monitorgetmonitor) | **Get** /Monitor/{monitorGuid} | Returns the definition of the specified monitor. -*MonitorApi* | [**MonitorGetMonitorGroups**](docs/MonitorApi.md#monitorgetmonitorgroups) | **Get** /Monitor/{monitorGuid}/MonitorGroup | Returns the Guid of each monitor group where the specified monitor is a member of. +*MonitorApi* | [**MonitorGetAuthorizationsOfMonitor**](docs/MonitorApi.md#monitorgetauthorizationsofmonitor) | **Get** /Monitor/{monitorGuid}/Authorizations | Get monitor authorizations of monitor +*MonitorApi* | [**MonitorGetMonitor**](docs/MonitorApi.md#monitorgetmonitor) | **Get** /Monitor/{monitorGuid} | Returns the definition of the specified monitor. +*MonitorApi* | [**MonitorGetMonitorGroups**](docs/MonitorApi.md#monitorgetmonitorgroups) | **Get** /Monitor/{monitorGuid}/MonitorGroup | Returns the Guid of each monitor group where the specified monitor is a member of. *MonitorApi* | [**MonitorGetMonitors**](docs/MonitorApi.md#monitorgetmonitors) | **Get** /Monitor | Returns the definition of all monitors available in the account. *MonitorApi* | [**MonitorGetMonitorsByMonitorGroup**](docs/MonitorApi.md#monitorgetmonitorsbymonitorgroup) | **Get** /Monitor/MonitorGroup/{monitorGroupGuid} | Returns the definition of all monitors available in the account that are a member of the specified monitor group. *MonitorApi* | [**MonitorPatchMonitor**](docs/MonitorApi.md#monitorpatchmonitor) | **Patch** /Monitor/{monitorGuid} | Partially updates the definition of the specified monitor. @@ -165,11 +175,14 @@ Class | Method | HTTP request | Description *MonitorCheckApi* | [**MonitorCheckGetSingleMonitorCheck**](docs/MonitorCheckApi.md#monitorcheckgetsinglemonitorcheck) | **Get** /MonitorCheck/{monitorCheckId} | Returns a single monitor check. *MonitorCheckApi* | [**MonitorCheckGetTransactionDetails**](docs/MonitorCheckApi.md#monitorcheckgettransactiondetails) | **Get** /MonitorCheck/{monitorCheckId}/Transaction | Returns transaction step details for a monitor check. *MonitorCheckApi* | [**MonitorCheckGetWaterfallInfo**](docs/MonitorCheckApi.md#monitorcheckgetwaterfallinfo) | **Get** /MonitorCheck/{monitorCheckId}/Waterfall | Returns waterfall information for a monitor check. -*MonitorGroupApi* | [**MonitorGroupAddMaintenancePeriodToAllMembers**](docs/MonitorGroupApi.md#monitorgroupaddmaintenanceperiodtoallmembers) | **Post** /MonitorGroup/{monitorGroupGuid}/AddMaintenancePeriodToAllMembers | Adds the provided maintenance period to all monitors in the group specified -*MonitorGroupApi* | [**MonitorGroupAddMonitorToMonitorGroup**](docs/MonitorGroupApi.md#monitorgroupaddmonitortomonitorgroup) | **Post** /MonitorGroup/{monitorGroupGuid}/Member/{monitorGuid} | Adds the specified monitor to the monitor group +*MonitorGroupApi* | [**MonitorGroupAddMaintenancePeriodToAllMembers**](docs/MonitorGroupApi.md#monitorgroupaddmaintenanceperiodtoallmembers) | **Post** /MonitorGroup/{monitorGroupGuid}/AddMaintenancePeriodToAllMembers | Adds the provided maintenance period to all monitors in the group specified +*MonitorGroupApi* | [**MonitorGroupAddMonitorToMonitorGroup**](docs/MonitorGroupApi.md#monitorgroupaddmonitortomonitorgroup) | **Post** /MonitorGroup/{monitorGroupGuid}/Member/{monitorGuid} | Adds the specified monitor to the monitor group +*MonitorGroupApi* | [**MonitorGroupCreateAuthorizationForMonitorGroup**](docs/MonitorGroupApi.md#monitorgroupcreateauthorizationformonitorgroup) | **Post** /MonitorGroup/{monitorGroupGuid}/Authorizations | Create monitor authorizations for monitor group If the wanted authorizations requires other authorizations, these will be added as well *MonitorGroupApi* | [**MonitorGroupCreateMonitorGroup**](docs/MonitorGroupApi.md#monitorgroupcreatemonitorgroup) | **Post** /MonitorGroup | Creates a new monitor group +*MonitorGroupApi* | [**MonitorGroupDeleteAuthorizationForMonitorGroup**](docs/MonitorGroupApi.md#monitorgroupdeleteauthorizationformonitorgroup) | **Delete** /MonitorGroup/{monitorGroupGuid}/Authorizations/{authorizationGuid} | Delete monitor authorization for monitor group *MonitorGroupApi* | [**MonitorGroupDeleteMonitorGroup**](docs/MonitorGroupApi.md#monitorgroupdeletemonitorgroup) | **Delete** /MonitorGroup/{monitorGroupGuid} | Deletes the specified monitor group *MonitorGroupApi* | [**MonitorGroupGetAllMonitorGroups**](docs/MonitorGroupApi.md#monitorgroupgetallmonitorgroups) | **Get** /MonitorGroup | Gets all monitor groups +*MonitorGroupApi* | [**MonitorGroupGetAuthorizationsOfMonitorGroup**](docs/MonitorGroupApi.md#monitorgroupgetauthorizationsofmonitorgroup) | **Get** /MonitorGroup/{monitorGroupGuid}/Authorizations | Get monitor authorizations of monitor group *MonitorGroupApi* | [**MonitorGroupGetMonitorGroup**](docs/MonitorGroupApi.md#monitorgroupgetmonitorgroup) | **Get** /MonitorGroup/{monitorGroupGuid} | Gets the details of a monitor group *MonitorGroupApi* | [**MonitorGroupGetMonitorGroupMembers**](docs/MonitorGroupApi.md#monitorgroupgetmonitorgroupmembers) | **Get** /MonitorGroup/{monitorGroupGuid}/Member | Gets a list of all members of a monitor group *MonitorGroupApi* | [**MonitorGroupRemoveMonitorFromMonitorGroup**](docs/MonitorGroupApi.md#monitorgroupremovemonitorfrommonitorgroup) | **Delete** /MonitorGroup/{monitorGroupGuid}/Member/{monitorGuid} | Removes the specified monitor from the monitor group @@ -192,20 +205,21 @@ Class | Method | HTTP request | Description *OperatorApi* | [**OperatorUpdateDutyPeriodForOperator**](docs/OperatorApi.md#operatorupdatedutyperiodforoperator) | **Put** /Operator/{operatorGuid}/DutySchedule/{dutyScheduleId} | Updates the specified duty schedule of the specified operator. *OperatorApi* | [**OperatorUpdateOperator**](docs/OperatorApi.md#operatorupdateoperator) | **Put** /Operator/{operatorGuid} | Updates an existing operator. *OperatorApi* | [**OperatorUpdateOperatorWithPatch**](docs/OperatorApi.md#operatorupdateoperatorwithpatch) | **Patch** /Operator/{operatorGuid} | Updates an existing operator. -*OperatorGroupApi* | [**OperatorGroupAddDutyScheduleToAllMembers**](docs/OperatorGroupApi.md#operatorgroupadddutyscheduletoallmembers) | **Post** /OperatorGroup/{operatorGroupGuid}/DutySchedule/AddDutyScheduleForAllMembers | Adds the provided duty schedule to all operators in the group specified -*OperatorGroupApi* | [**OperatorGroupAddOperatorToOperatorGroup**](docs/OperatorGroupApi.md#operatorgroupaddoperatortooperatorgroup) | **Post** /OperatorGroup/{operatorGroupGuid}/Member/{operatorGuid} | Adds the specified operator to the operator group +*OperatorGroupApi* | [**OperatorGroupAddDutyScheduleToAllMembers**](docs/OperatorGroupApi.md#operatorgroupadddutyscheduletoallmembers) | **Post** /OperatorGroup/{operatorGroupGuid}/DutySchedule/AddDutyScheduleForAllMembers | Adds the provided duty schedule to all operators in the group specified +*OperatorGroupApi* | [**OperatorGroupAddOperatorToOperatorGroup**](docs/OperatorGroupApi.md#operatorgroupaddoperatortooperatorgroup) | **Post** /OperatorGroup/{operatorGroupGuid}/Member/{operatorGuid} | Adds the specified operator to the operator group *OperatorGroupApi* | [**OperatorGroupAllOperatorsInGroupOffDuty**](docs/OperatorGroupApi.md#operatorgroupalloperatorsingroupoffduty) | **Post** /OperatorGroup/{operatorGroupGuid}/AllOperatorsOffDuty | Set the OnDuty flag to off for all operators that are a member of the operator group specified by the operator group GUID *OperatorGroupApi* | [**OperatorGroupAllOperatorsInGroupOnDuty**](docs/OperatorGroupApi.md#operatorgroupalloperatorsingrouponduty) | **Post** /OperatorGroup/{operatorGroupGuid}/AllOperatorsOnDuty | Set the OnDuty flag to on for all operators that are a member of the operator group specified by the operator group GUID -*OperatorGroupApi* | [**OperatorGroupCreateAuthorizationForOperatorGroup**](docs/OperatorGroupApi.md#operatorgroupcreateauthorizationforoperatorgroup) | **Post** /OperatorGroup/{operatorGroupGuid}/Authorization | Creates a new authorization for the specified operator group *OperatorGroupApi* | [**OperatorGroupCreateOperatorGroup**](docs/OperatorGroupApi.md#operatorgroupcreateoperatorgroup) | **Post** /OperatorGroup | Creates a new operator group -*OperatorGroupApi* | [**OperatorGroupDeleteAuthorizationForOperatorGroup**](docs/OperatorGroupApi.md#operatorgroupdeleteauthorizationforoperatorgroup) | **Delete** /OperatorGroup/{operatorGroupGuid}/Authorization/{authorizationGuid} | Deletes the specified authorization for the specified operator group +*OperatorGroupApi* | [**OperatorGroupDeleteAuthorizationForOperatorGroup**](docs/OperatorGroupApi.md#operatorgroupdeleteauthorizationforoperatorgroup) | **Delete** /OperatorGroup/{operatorGroupGuid}/Authorization/{authorizationType} | Removes the specified authorization of the operator group. *OperatorGroupApi* | [**OperatorGroupDeleteOperatorGroup**](docs/OperatorGroupApi.md#operatorgroupdeleteoperatorgroup) | **Delete** /OperatorGroup/{operatorGroupGuid} | Deletes the specified operator group *OperatorGroupApi* | [**OperatorGroupGetAllOperatorGroups**](docs/OperatorGroupApi.md#operatorgroupgetalloperatorgroups) | **Get** /OperatorGroup | Gets all operator groups -*OperatorGroupApi* | [**OperatorGroupGetAuthorizationsForOperatorGroup**](docs/OperatorGroupApi.md#operatorgroupgetauthorizationsforoperatorgroup) | **Get** /OperatorGroup/{operatorGroupGuid}/Authorization | Returns all authorizations for the specified operator group +*OperatorGroupApi* | [**OperatorGroupGetAuthorizationsForOperatorGroup**](docs/OperatorGroupApi.md#operatorgroupgetauthorizationsforoperatorgroup) | **Get** /OperatorGroup/{operatorGroupGuid}/Authorization | Gets all authorizations for the specified operator group. *OperatorGroupApi* | [**OperatorGroupGetOperatorGroup**](docs/OperatorGroupApi.md#operatorgroupgetoperatorgroup) | **Get** /OperatorGroup/{operatorGroupGuid} | Gets the details of a operator group *OperatorGroupApi* | [**OperatorGroupGetOperatorGroupMembers**](docs/OperatorGroupApi.md#operatorgroupgetoperatorgroupmembers) | **Get** /OperatorGroup/{operatorGroupGuid}/Member | Gets a list of all members of an operator group +*OperatorGroupApi* | [**OperatorGroupPostAuthorizationForOperatorGroup**](docs/OperatorGroupApi.md#operatorgrouppostauthorizationforoperatorgroup) | **Post** /OperatorGroup/{operatorGroupGuid}/Authorization/{authorizationType} | Assigns the specified authorization to the operator group. *OperatorGroupApi* | [**OperatorGroupRemoveOperatorFromOperatorGroup**](docs/OperatorGroupApi.md#operatorgroupremoveoperatorfromoperatorgroup) | **Delete** /OperatorGroup/{operatorGroupGuid}/Member/{operatorGuid} | Removes the specified operator from the operator group *OperatorGroupApi* | [**OperatorGroupUpdateOperatorGroup**](docs/OperatorGroupApi.md#operatorgroupupdateoperatorgroup) | **Put** /OperatorGroup/{operatorGroupGuid} | Updates the operator group with the Guid specified +*OutgoingPhoneNumberApi* | [**OutgoingPhoneNumberGetAllOutgoingPhoneNumbers**](docs/OutgoingPhoneNumberApi.md#outgoingphonenumbergetalloutgoingphonenumbers) | **Get** /OutgoingPhoneNumber | Gets a list of all outgoing phone numbers available. *PublicStatusPageApi* | [**PublicStatusPageAddAuthorizationToPublicStatusPage**](docs/PublicStatusPageApi.md#publicstatuspageaddauthorizationtopublicstatuspage) | **Post** /PublicStatusPage/{publicStatusPageGuid}/Authorization | Creates a new authorization for the specified public status page. *PublicStatusPageApi* | [**PublicStatusPageDeletePublicStatusPage**](docs/PublicStatusPageApi.md#publicstatuspagedeletepublicstatuspage) | **Delete** /PublicStatusPage/{publicStatusPageGuid} | Deletes the definition of the specified public status page. *PublicStatusPageApi* | [**PublicStatusPageGetAuthorizationsForPublicStatusPage**](docs/PublicStatusPageApi.md#publicstatuspagegetauthorizationsforpublicstatuspage) | **Get** /PublicStatusPage/{publicStatusPageGuid}/Authorization | Returns all authorizations for the specified public status page. @@ -215,6 +229,9 @@ Class | Method | HTTP request | Description *PublicStatusPageApi* | [**PublicStatusPagePostPublicStatusPage**](docs/PublicStatusPageApi.md#publicstatuspagepostpublicstatuspage) | **Post** /PublicStatusPage | Creates a new public status page. *PublicStatusPageApi* | [**PublicStatusPagePutPublicStatusPage**](docs/PublicStatusPageApi.md#publicstatuspageputpublicstatuspage) | **Put** /PublicStatusPage/{publicStatusPageGuid} | Updates the definition of the specified public status page. *PublicStatusPageApi* | [**PublicStatusPageRemoveAuthorizationFromPublicStatusPage**](docs/PublicStatusPageApi.md#publicstatuspageremoveauthorizationfrompublicstatuspage) | **Delete** /PublicStatusPage/{publicStatusPageGuid}/Authorization/{authorizationGuid} | Removes an authorization from a public status page. +*RUMApi* | [**RumGetRumMetricsForAllWebsites**](docs/RUMApi.md#rumgetrummetricsforallwebsites) | **Get** /Rum/Website/Metrics | Returns all metrics of all RUM websites. +*RUMApi* | [**RumGetRumWebsiteMetrics**](docs/RUMApi.md#rumgetrumwebsitemetrics) | **Get** /Rum/Website/{rumWebsiteGuid}/Metrics | Returns all metrics of the specified RUM website. +*RUMApi* | [**RumGetRumWebsites**](docs/RUMApi.md#rumgetrumwebsites) | **Get** /Rum/Website | Returns the definition of all RUM websites available in the account. *RegisterApi* | [**RegisterPost**](docs/RegisterApi.md#registerpost) | **Post** /Register | Creates a new API account. *SLAApi* | [**SlaCreateSla**](docs/SLAApi.md#slacreatesla) | **Post** /Sla | Creates a new SLA. *SLAApi* | [**SlaDeleteExclusionPeriod**](docs/SLAApi.md#sladeleteexclusionperiod) | **Delete** /Sla/{slaGuid}/ExclusionPeriod/{exclusionPeriodId} | Deletes the specified exclusion period for the specified SLA. @@ -238,10 +255,12 @@ Class | Method | HTTP request | Description *StatisticsApi* | [**StatisticsGetMonitorStatistics**](docs/StatisticsApi.md#statisticsgetmonitorstatistics) | **Get** /Statistics/Monitor/{monitorGuid} | Gets the monitor statistics. *StatusApi* | [**StatusGetMonitorGroupStatus**](docs/StatusApi.md#statusgetmonitorgroupstatus) | **Get** /Status/MonitorGroup/{monitorGroupGuid} | Gets a list of all monitor group status data. *StatusApi* | [**StatusGetMonitorStatus**](docs/StatusApi.md#statusgetmonitorstatus) | **Get** /Status/Monitor/{monitorGuid} | Gets all monitor status data. -*VaultApi* | [**VaultCreateAuthorizationForVaultSection**](docs/VaultApi.md#vaultcreateauthorizationforvaultsection) | **Post** /VaultSection/{vaultSectionGuid}/Authorization | Creates a new authorization for the specified vault section. +*TimezoneApi* | [**TimezoneGetAllTimezones**](docs/TimezoneApi.md#timezonegetalltimezones) | **Get** /Timezone | Gets all timezones available. +*TimezoneApi* | [**TimezoneGetTimezoneById**](docs/TimezoneApi.md#timezonegettimezonebyid) | **Get** /Timezone/{timezoneId} | Gets the timezone with the specified Id. +*VaultApi* | [**VaultCreateAuthorizationForVaultSection**](docs/VaultApi.md#vaultcreateauthorizationforvaultsection) | **Post** /VaultSection/{vaultSectionGuid}/Authorization | Creates a new authorization for the specified vault section. *VaultApi* | [**VaultCreateNewVaultItem**](docs/VaultApi.md#vaultcreatenewvaultitem) | **Post** /VaultItem | Creates a new vault item. *VaultApi* | [**VaultCreateNewVaultSection**](docs/VaultApi.md#vaultcreatenewvaultsection) | **Post** /VaultSection | Creates a new vault section. -*VaultApi* | [**VaultDeleteAuthorizationForVaultSection**](docs/VaultApi.md#vaultdeleteauthorizationforvaultsection) | **Delete** /VaultSection/{vaultSectionGuid}/Authorization/{authorizationGuid} | Deletes the specified authorization for the specified vault section. +*VaultApi* | [**VaultDeleteAuthorizationForVaultSection**](docs/VaultApi.md#vaultdeleteauthorizationforvaultsection) | **Delete** /VaultSection/{vaultSectionGuid}/Authorization/{authorizationGuid} | Deletes the specified authorization for the specified vault section. *VaultApi* | [**VaultDeleteVaultItem**](docs/VaultApi.md#vaultdeletevaultitem) | **Delete** /VaultItem/{vaultItemGuid} | Deletes the specified vault item. *VaultApi* | [**VaultDeleteVaultSection**](docs/VaultApi.md#vaultdeletevaultsection) | **Delete** /VaultSection/{vaultSectionGuid} | Deletes the specified vault section. *VaultApi* | [**VaultGetAllVaultItems**](docs/VaultApi.md#vaultgetallvaultitems) | **Get** /VaultItem | Returns all vault items. @@ -256,10 +275,13 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [AccountSettings](docs/AccountSettings.md) - [AccountStatistics](docs/AccountStatistics.md) - [Alert](docs/Alert.md) - [AlertAttributes](docs/AlertAttributes.md) - [AlertDefinition](docs/AlertDefinition.md) + - [AlertDefinitionAuthorization](docs/AlertDefinitionAuthorization.md) + - [AlertDefinitionAuthorizationType](docs/AlertDefinitionAuthorizationType.md) - [AlertDefinitionMember](docs/AlertDefinitionMember.md) - [AlertDefinitionMonitor](docs/AlertDefinitionMonitor.md) - [AlertDefinitionMonitorGroup](docs/AlertDefinitionMonitorGroup.md) @@ -267,6 +289,7 @@ Class | Method | HTTP request | Description - [AlertDefinitionOperatorGroup](docs/AlertDefinitionOperatorGroup.md) - [AlertEscalationLevelMember](docs/AlertEscalationLevelMember.md) - [AlertResponse](docs/AlertResponse.md) + - [AlertResponseCursors](docs/AlertResponseCursors.md) - [AlertType](docs/AlertType.md) - [ApiAssertion](docs/ApiAssertion.md) - [ApiAssertionSourceType](docs/ApiAssertionSourceType.md) @@ -283,14 +306,18 @@ Class | Method | HTTP request | Description - [CapabilityFilterEnum](docs/CapabilityFilterEnum.md) - [CertificateArchive](docs/CertificateArchive.md) - [CheckpoinServerResponse](docs/CheckpoinServerResponse.md) + - [CheckpoinServerResponseData](docs/CheckpoinServerResponseData.md) - [Checkpoint](docs/Checkpoint.md) - [Checkpoint2](docs/Checkpoint2.md) + - [Checkpoint2Attributes](docs/Checkpoint2Attributes.md) - [CheckpointAttributes](docs/CheckpointAttributes.md) - [CheckpointListResponse](docs/CheckpointListResponse.md) - [CheckpointRegion](docs/CheckpointRegion.md) - [CheckpointResponse](docs/CheckpointResponse.md) + - [CheckpointResponseData](docs/CheckpointResponseData.md) - [CheckpointServer](docs/CheckpointServer.md) - [CheckpointServerAttributes](docs/CheckpointServerAttributes.md) + - [CheckpointsHealth](docs/CheckpointsHealth.md) - [CursorsData](docs/CursorsData.md) - [CustomField](docs/CustomField.md) - [CustomMetric](docs/CustomMetric.md) @@ -299,7 +326,14 @@ Class | Method | HTTP request | Description - [DashboardFilter](docs/DashboardFilter.md) - [DateTimePatternMatch](docs/DateTimePatternMatch.md) - [DayOfWeek](docs/DayOfWeek.md) + - [DnsBypass](docs/DnsBypass.md) - [DnsQuery](docs/DnsQuery.md) + - [EngineHashAlgorithm](docs/EngineHashAlgorithm.md) + - [ErrorCondition](docs/ErrorCondition.md) + - [ErrorConditionConsoleLevel](docs/ErrorConditionConsoleLevel.md) + - [ErrorConditionEffect](docs/ErrorConditionEffect.md) + - [ErrorConditionMatchType](docs/ErrorConditionMatchType.md) + - [ErrorConditionType](docs/ErrorConditionType.md) - [ErrorLevel](docs/ErrorLevel.md) - [ErrorLevelFilter](docs/ErrorLevelFilter.md) - [EscalationLevel](docs/EscalationLevel.md) @@ -307,15 +341,23 @@ Class | Method | HTTP request | Description - [EscalationMode](docs/EscalationMode.md) - [ExclusionPeriod](docs/ExclusionPeriod.md) - [FileInfo](docs/FileInfo.md) + - [HashAlgorithm](docs/HashAlgorithm.md) - [HttpAttributes](docs/HttpAttributes.md) - [HttpCheckDetails](docs/HttpCheckDetails.md) + - [HttpCheckDetailsAttributes](docs/HttpCheckDetailsAttributes.md) - [HttpDetailsResponse](docs/HttpDetailsResponse.md) + - [HttpDetailsResponseData](docs/HttpDetailsResponseData.md) - [HttpEngineAttributes](docs/HttpEngineAttributes.md) + - [HttpEngineAttributesTimingInfo](docs/HttpEngineAttributesTimingInfo.md) - [HttpEngineCheckDetails](docs/HttpEngineCheckDetails.md) + - [HttpEngineCheckDetailsAttributes](docs/HttpEngineCheckDetailsAttributes.md) - [HttpEngineStep](docs/HttpEngineStep.md) + - [HttpEngineStepAssertionResultsInfo](docs/HttpEngineStepAssertionResultsInfo.md) - [HttpMethod](docs/HttpMethod.md) - - [IPv6Address](docs/IPv6Address.md) + - [HttpMethods](docs/HttpMethods.md) - [Integration](docs/Integration.md) + - [IntegrationAuthorization](docs/IntegrationAuthorization.md) + - [IntegrationAuthorizationType](docs/IntegrationAuthorizationType.md) - [IntegrationServiceMap](docs/IntegrationServiceMap.md) - [IntegrationTypeEnum](docs/IntegrationTypeEnum.md) - [IpVersion](docs/IpVersion.md) @@ -330,10 +372,14 @@ Class | Method | HTTP request | Description - [MessageList](docs/MessageList.md) - [MetaData](docs/MetaData.md) - [Monitor](docs/Monitor.md) + - [MonitorAuthorization](docs/MonitorAuthorization.md) + - [MonitorAuthorizationType](docs/MonitorAuthorizationType.md) - [MonitorCheck](docs/MonitorCheck.md) - [MonitorCheckAttributes](docs/MonitorCheckAttributes.md) - [MonitorCheckResponse](docs/MonitorCheckResponse.md) - [MonitorGroup](docs/MonitorGroup.md) + - [MonitorGroupAuthorization](docs/MonitorGroupAuthorization.md) + - [MonitorGroupAuthorizationType](docs/MonitorGroupAuthorizationType.md) - [MonitorGroupMember](docs/MonitorGroupMember.md) - [MonitorMode](docs/MonitorMode.md) - [MonitorQuota](docs/MonitorQuota.md) @@ -341,25 +387,30 @@ Class | Method | HTTP request | Description - [MonitorStatusAttributes](docs/MonitorStatusAttributes.md) - [MonitorStatusListResponse](docs/MonitorStatusListResponse.md) - [MonitorStatusResponse](docs/MonitorStatusResponse.md) + - [MonitorStatusResponseData](docs/MonitorStatusResponseData.md) + - [MonitorTransactionStepDefinition](docs/MonitorTransactionStepDefinition.md) - [MonitorType](docs/MonitorType.md) - [MsaBodyType](docs/MsaBodyType.md) - [MsaDetailsResponse](docs/MsaDetailsResponse.md) + - [MsaDetailsResponseData](docs/MsaDetailsResponseData.md) - [MsaStep](docs/MsaStep.md) - [MsaStepType](docs/MsaStepType.md) + - [OneTimePasswordInfo](docs/OneTimePasswordInfo.md) - [Operator](docs/Operator.md) - [OperatorAuthorizationType](docs/OperatorAuthorizationType.md) - [OperatorDutySchedule](docs/OperatorDutySchedule.md) - [OperatorGroup](docs/OperatorGroup.md) - - [OperatorGroupAuthorization](docs/OperatorGroupAuthorization.md) - [OperatorGroupAuthorizationType](docs/OperatorGroupAuthorizationType.md) - [OperatorGroupMember](docs/OperatorGroupMember.md) - [OperatorMember](docs/OperatorMember.md) - [OperatorQuota](docs/OperatorQuota.md) - [OperatorScheduleMode](docs/OperatorScheduleMode.md) + - [OperatorSetupMode](docs/OperatorSetupMode.md) - [OutgoingPhoneNumberDetails](docs/OutgoingPhoneNumberDetails.md) - [PSPAuthorization](docs/PSPAuthorization.md) - [PSPAuthorizationType](docs/PSPAuthorizationType.md) - [PageElement](docs/PageElement.md) + - [PageLoadMetrics](docs/PageLoadMetrics.md) - [PatternMatch](docs/PatternMatch.md) - [PeriodMetaData](docs/PeriodMetaData.md) - [PredefinedVariable](docs/PredefinedVariable.md) @@ -371,6 +422,10 @@ Class | Method | HTTP request | Description - [RegistrationResponse](docs/RegistrationResponse.md) - [RelationObject](docs/RelationObject.md) - [RequestHeader](docs/RequestHeader.md) + - [RumMetric](docs/RumMetric.md) + - [RumMetricValues](docs/RumMetricValues.md) + - [RumWebsite](docs/RumWebsite.md) + - [RumWebsiteWithMetricValues](docs/RumWebsiteWithMetricValues.md) - [Schedule](docs/Schedule.md) - [ScheduleMode](docs/ScheduleMode.md) - [ScheduleType](docs/ScheduleType.md) @@ -380,8 +435,12 @@ Class | Method | HTTP request | Description - [SelectedCheckpoints](docs/SelectedCheckpoints.md) - [SelectedPeriod](docs/SelectedPeriod.md) - [SelectedPeriodType](docs/SelectedPeriodType.md) + - [ServerHealth](docs/ServerHealth.md) + - [ServerHealthStatusDetails](docs/ServerHealthStatusDetails.md) + - [ServerStatusDetails](docs/ServerStatusDetails.md) - [SftpAction](docs/SftpAction.md) - [SingleMonitorCheckResponse](docs/SingleMonitorCheckResponse.md) + - [SingleMonitorCheckResponseData](docs/SingleMonitorCheckResponseData.md) - [Sla](docs/Sla.md) - [SmsProvider](docs/SmsProvider.md) - [SortDirection](docs/SortDirection.md) @@ -389,6 +448,8 @@ Class | Method | HTTP request | Description - [Statistics](docs/Statistics.md) - [StatisticsAttributes](docs/StatisticsAttributes.md) - [StatisticsResponse](docs/StatisticsResponse.md) + - [StatisticsResponseLinks](docs/StatisticsResponseLinks.md) + - [StatisticsResponseMeta](docs/StatisticsResponseMeta.md) - [StepTimingInfo](docs/StepTimingInfo.md) - [SubStepType](docs/SubStepType.md) - [ThrottlingOptions](docs/ThrottlingOptions.md) @@ -398,22 +459,32 @@ Class | Method | HTTP request | Description - [TlsVersion](docs/TlsVersion.md) - [TransactionAttributes](docs/TransactionAttributes.md) - [TransactionCheckDetails](docs/TransactionCheckDetails.md) + - [TransactionCheckDetailsAttributes](docs/TransactionCheckDetailsAttributes.md) - [TransactionDetailsResponse](docs/TransactionDetailsResponse.md) + - [TransactionDetailsResponseData](docs/TransactionDetailsResponseData.md) - [TransactionStep](docs/TransactionStep.md) - [TransactionStep2](docs/TransactionStep2.md) - [TransactionStepDefinition](docs/TransactionStepDefinition.md) - [TransactionStepOResourceObject](docs/TransactionStepOResourceObject.md) + - [TransactionStepOResourceObjectAttributes](docs/TransactionStepOResourceObjectAttributes.md) - [TransactionSubStep](docs/TransactionSubStep.md) - [UserDefinedFunction](docs/UserDefinedFunction.md) - [UserDefinedFunctionMapping](docs/UserDefinedFunctionMapping.md) - [UserDefinedFunctionType](docs/UserDefinedFunctionType.md) - [VaultItem](docs/VaultItem.md) + - [VaultItemCertificateArchive](docs/VaultItemCertificateArchive.md) + - [VaultItemFileInfo](docs/VaultItemFileInfo.md) + - [VaultItemOneTimePasswordInfo](docs/VaultItemOneTimePasswordInfo.md) - [VaultItemTypes](docs/VaultItemTypes.md) - [VaultSection](docs/VaultSection.md) - [VaultSectionAuthorization](docs/VaultSectionAuthorization.md) - [VaultSectionAuthorizationType](docs/VaultSectionAuthorizationType.md) + - [W3CNavigationTiming](docs/W3CNavigationTiming.md) - [WaterfallInfo](docs/WaterfallInfo.md) + - [WaterfallInfoPageLoadMetrics](docs/WaterfallInfoPageLoadMetrics.md) + - [WaterfallInfoW3CNavigationTiming](docs/WaterfallInfoW3CNavigationTiming.md) - [WaterfallResponse](docs/WaterfallResponse.md) + - [WaterfallResponseAttributes](docs/WaterfallResponseAttributes.md) ## Documentation For Authorization diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_account.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_account.go index b9c5195a..c1e77ea3 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/api_account.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_account.go @@ -12,37 +12,32 @@ package uptrends import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) // AccountApiService AccountApi service type AccountApiService service type ApiAccountGetAccountStatisticsRequest struct { - ctx _context.Context + ctx context.Context ApiService *AccountApiService } - -func (r ApiAccountGetAccountStatisticsRequest) Execute() (AccountStatistics, *_nethttp.Response, error) { +func (r ApiAccountGetAccountStatisticsRequest) Execute() (*AccountStatistics, *http.Response, error) { return r.ApiService.AccountGetAccountStatisticsExecute(r) } /* AccountGetAccountStatistics Returns the account statistics. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiAccountGetAccountStatisticsRequest */ -func (a *AccountApiService) AccountGetAccountStatistics(ctx _context.Context) ApiAccountGetAccountStatisticsRequest { +func (a *AccountApiService) AccountGetAccountStatistics(ctx context.Context) ApiAccountGetAccountStatisticsRequest { return ApiAccountGetAccountStatisticsRequest{ ApiService: a, ctx: ctx, @@ -51,26 +46,131 @@ func (a *AccountApiService) AccountGetAccountStatistics(ctx _context.Context) Ap // Execute executes the request // @return AccountStatistics -func (a *AccountApiService) AccountGetAccountStatisticsExecute(r ApiAccountGetAccountStatisticsRequest) (AccountStatistics, *_nethttp.Response, error) { +func (a *AccountApiService) AccountGetAccountStatisticsExecute(r ApiAccountGetAccountStatisticsRequest) (*AccountStatistics, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AccountStatistics + formFiles []formFile + localVarReturnValue *AccountStatistics ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccountApiService.AccountGetAccountStatistics") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Account" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAccountGetSettingsRequest struct { + ctx context.Context + ApiService *AccountApiService +} + +func (r ApiAccountGetSettingsRequest) Execute() (*AccountSettings, *http.Response, error) { + return r.ApiService.AccountGetSettingsExecute(r) +} + +/* +AccountGetSettings Returns account general settings. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAccountGetSettingsRequest +*/ +func (a *AccountApiService) AccountGetSettings(ctx context.Context) ApiAccountGetSettingsRequest { + return ApiAccountGetSettingsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return AccountSettings +func (a *AccountApiService) AccountGetSettingsExecute(r ApiAccountGetSettingsRequest) (*AccountSettings, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AccountSettings + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccountApiService.AccountGetSettings") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/Account/Settings" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -89,7 +189,7 @@ func (a *AccountApiService) AccountGetAccountStatisticsExecute(r ApiAccountGetAc if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -99,15 +199,15 @@ func (a *AccountApiService) AccountGetAccountStatisticsExecute(r ApiAccountGetAc return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -118,14 +218,15 @@ func (a *AccountApiService) AccountGetAccountStatisticsExecute(r ApiAccountGetAc newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_alert.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_alert.go index 59363aec..10822151 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/api_alert.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_alert.go @@ -12,32 +12,27 @@ package uptrends import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" - "time" ) -// Linger please -var ( - _ _context.Context -) // AlertApiService AlertApi service type AlertApiService service type ApiAlertGetMonitorAlertsRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertApiService monitorGuid string includeReminders *bool cursor *string sorting *string take *int32 - start *time.Time - end *time.Time + start *interface{} + end *interface{} presetPeriod *string } @@ -46,49 +41,55 @@ func (r ApiAlertGetMonitorAlertsRequest) IncludeReminders(includeReminders bool) r.includeReminders = &includeReminders return r } + // A cursor value that should be used for traversing the dataset. func (r ApiAlertGetMonitorAlertsRequest) Cursor(cursor string) ApiAlertGetMonitorAlertsRequest { r.cursor = &cursor return r } + // Sorting direction based on timestamp. func (r ApiAlertGetMonitorAlertsRequest) Sorting(sorting string) ApiAlertGetMonitorAlertsRequest { r.sorting = &sorting return r } + // The number of records to return (Max value = 100) func (r ApiAlertGetMonitorAlertsRequest) Take(take int32) ApiAlertGetMonitorAlertsRequest { r.take = &take return r } + // The start of a custom period (can't be used together with the PresetPeriod parameter) -func (r ApiAlertGetMonitorAlertsRequest) Start(start time.Time) ApiAlertGetMonitorAlertsRequest { +func (r ApiAlertGetMonitorAlertsRequest) Start(start interface{}) ApiAlertGetMonitorAlertsRequest { r.start = &start return r } + // The end of a custom period -func (r ApiAlertGetMonitorAlertsRequest) End(end time.Time) ApiAlertGetMonitorAlertsRequest { +func (r ApiAlertGetMonitorAlertsRequest) End(end interface{}) ApiAlertGetMonitorAlertsRequest { r.end = &end return r } + // The requested time period. func (r ApiAlertGetMonitorAlertsRequest) PresetPeriod(presetPeriod string) ApiAlertGetMonitorAlertsRequest { r.presetPeriod = &presetPeriod return r } -func (r ApiAlertGetMonitorAlertsRequest) Execute() (AlertResponse, *_nethttp.Response, error) { +func (r ApiAlertGetMonitorAlertsRequest) Execute() (*AlertResponse, *http.Response, error) { return r.ApiService.AlertGetMonitorAlertsExecute(r) } /* AlertGetMonitorAlerts Returns alerts for a specific monitor. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGuid The Guid of the monitor to get alerts for. @return ApiAlertGetMonitorAlertsRequest */ -func (a *AlertApiService) AlertGetMonitorAlerts(ctx _context.Context, monitorGuid string) ApiAlertGetMonitorAlertsRequest { +func (a *AlertApiService) AlertGetMonitorAlerts(ctx context.Context, monitorGuid string) ApiAlertGetMonitorAlertsRequest { return ApiAlertGetMonitorAlertsRequest{ ApiService: a, ctx: ctx, @@ -98,27 +99,25 @@ func (a *AlertApiService) AlertGetMonitorAlerts(ctx _context.Context, monitorGui // Execute executes the request // @return AlertResponse -func (a *AlertApiService) AlertGetMonitorAlertsExecute(r ApiAlertGetMonitorAlertsRequest) (AlertResponse, *_nethttp.Response, error) { +func (a *AlertApiService) AlertGetMonitorAlertsExecute(r ApiAlertGetMonitorAlertsRequest) (*AlertResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AlertResponse + formFiles []formFile + localVarReturnValue *AlertResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertApiService.AlertGetMonitorAlerts") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Alert/Monitor/{monitorGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.includeReminders != nil { localVarQueryParams.Add("IncludeReminders", parameterToString(*r.includeReminders, "")) @@ -158,7 +157,7 @@ func (a *AlertApiService) AlertGetMonitorAlertsExecute(r ApiAlertGetMonitorAlert if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -168,15 +167,15 @@ func (a *AlertApiService) AlertGetMonitorAlertsExecute(r ApiAlertGetMonitorAlert return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -187,7 +186,8 @@ func (a *AlertApiService) AlertGetMonitorAlertsExecute(r ApiAlertGetMonitorAlert newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -197,14 +197,15 @@ func (a *AlertApiService) AlertGetMonitorAlertsExecute(r ApiAlertGetMonitorAlert newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -215,15 +216,15 @@ func (a *AlertApiService) AlertGetMonitorAlertsExecute(r ApiAlertGetMonitorAlert } type ApiAlertGetMonitorGroupAlertsRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertApiService monitorGroupGuid string includeReminders *bool cursor *string sorting *string take *int32 - start *time.Time - end *time.Time + start *interface{} + end *interface{} presetPeriod *string } @@ -232,49 +233,55 @@ func (r ApiAlertGetMonitorGroupAlertsRequest) IncludeReminders(includeReminders r.includeReminders = &includeReminders return r } + // A cursor value that should be used for traversing the dataset. func (r ApiAlertGetMonitorGroupAlertsRequest) Cursor(cursor string) ApiAlertGetMonitorGroupAlertsRequest { r.cursor = &cursor return r } + // Sorting direction based on timestamp. func (r ApiAlertGetMonitorGroupAlertsRequest) Sorting(sorting string) ApiAlertGetMonitorGroupAlertsRequest { r.sorting = &sorting return r } + // The number of records to return (Max value = 100) func (r ApiAlertGetMonitorGroupAlertsRequest) Take(take int32) ApiAlertGetMonitorGroupAlertsRequest { r.take = &take return r } + // The start of a custom period (can't be used together with the PresetPeriod parameter) -func (r ApiAlertGetMonitorGroupAlertsRequest) Start(start time.Time) ApiAlertGetMonitorGroupAlertsRequest { +func (r ApiAlertGetMonitorGroupAlertsRequest) Start(start interface{}) ApiAlertGetMonitorGroupAlertsRequest { r.start = &start return r } + // The end of a custom period -func (r ApiAlertGetMonitorGroupAlertsRequest) End(end time.Time) ApiAlertGetMonitorGroupAlertsRequest { +func (r ApiAlertGetMonitorGroupAlertsRequest) End(end interface{}) ApiAlertGetMonitorGroupAlertsRequest { r.end = &end return r } + // The requested time period. func (r ApiAlertGetMonitorGroupAlertsRequest) PresetPeriod(presetPeriod string) ApiAlertGetMonitorGroupAlertsRequest { r.presetPeriod = &presetPeriod return r } -func (r ApiAlertGetMonitorGroupAlertsRequest) Execute() (AlertResponse, *_nethttp.Response, error) { +func (r ApiAlertGetMonitorGroupAlertsRequest) Execute() (*AlertResponse, *http.Response, error) { return r.ApiService.AlertGetMonitorGroupAlertsExecute(r) } /* AlertGetMonitorGroupAlerts Returns alerts for a specific monitor group. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGroupGuid The Guid of the monitor group to get alerts for. @return ApiAlertGetMonitorGroupAlertsRequest */ -func (a *AlertApiService) AlertGetMonitorGroupAlerts(ctx _context.Context, monitorGroupGuid string) ApiAlertGetMonitorGroupAlertsRequest { +func (a *AlertApiService) AlertGetMonitorGroupAlerts(ctx context.Context, monitorGroupGuid string) ApiAlertGetMonitorGroupAlertsRequest { return ApiAlertGetMonitorGroupAlertsRequest{ ApiService: a, ctx: ctx, @@ -284,27 +291,25 @@ func (a *AlertApiService) AlertGetMonitorGroupAlerts(ctx _context.Context, monit // Execute executes the request // @return AlertResponse -func (a *AlertApiService) AlertGetMonitorGroupAlertsExecute(r ApiAlertGetMonitorGroupAlertsRequest) (AlertResponse, *_nethttp.Response, error) { +func (a *AlertApiService) AlertGetMonitorGroupAlertsExecute(r ApiAlertGetMonitorGroupAlertsRequest) (*AlertResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AlertResponse + formFiles []formFile + localVarReturnValue *AlertResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertApiService.AlertGetMonitorGroupAlerts") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Alert/MonitorGroup/{monitorGroupGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.includeReminders != nil { localVarQueryParams.Add("IncludeReminders", parameterToString(*r.includeReminders, "")) @@ -344,7 +349,7 @@ func (a *AlertApiService) AlertGetMonitorGroupAlertsExecute(r ApiAlertGetMonitor if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -354,15 +359,15 @@ func (a *AlertApiService) AlertGetMonitorGroupAlertsExecute(r ApiAlertGetMonitor return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -373,7 +378,8 @@ func (a *AlertApiService) AlertGetMonitorGroupAlertsExecute(r ApiAlertGetMonitor newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -383,14 +389,15 @@ func (a *AlertApiService) AlertGetMonitorGroupAlertsExecute(r ApiAlertGetMonitor newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_alert_definition.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_alert_definition.go index b15a78ad..f2cedc0b 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/api_alert_definition.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_alert_definition.go @@ -12,23 +12,19 @@ package uptrends import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // AlertDefinitionApiService AlertDefinitionApi service type AlertDefinitionApiService service type ApiAlertDefinitionAddIntegrationToEscalationLevelRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string escalationLevelId int32 @@ -41,19 +37,19 @@ func (r ApiAlertDefinitionAddIntegrationToEscalationLevelRequest) EscalationLeve return r } -func (r ApiAlertDefinitionAddIntegrationToEscalationLevelRequest) Execute() (AlertDefinitionMonitorGroup, *_nethttp.Response, error) { +func (r ApiAlertDefinitionAddIntegrationToEscalationLevelRequest) Execute() (*Integration, *http.Response, error) { return r.ApiService.AlertDefinitionAddIntegrationToEscalationLevelExecute(r) } /* AlertDefinitionAddIntegrationToEscalationLevel Adds an integration to a specified escalation level. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition. @param escalationLevelId The escalation level id. @return ApiAlertDefinitionAddIntegrationToEscalationLevelRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionAddIntegrationToEscalationLevel(ctx _context.Context, alertDefinitionGuid string, escalationLevelId int32) ApiAlertDefinitionAddIntegrationToEscalationLevelRequest { +func (a *AlertDefinitionApiService) AlertDefinitionAddIntegrationToEscalationLevel(ctx context.Context, alertDefinitionGuid string, escalationLevelId int32) ApiAlertDefinitionAddIntegrationToEscalationLevelRequest { return ApiAlertDefinitionAddIntegrationToEscalationLevelRequest{ ApiService: a, ctx: ctx, @@ -63,32 +59,27 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddIntegrationToEscalationLev } // Execute executes the request -// @return AlertDefinitionMonitorGroup -func (a *AlertDefinitionApiService) AlertDefinitionAddIntegrationToEscalationLevelExecute(r ApiAlertDefinitionAddIntegrationToEscalationLevelRequest) (AlertDefinitionMonitorGroup, *_nethttp.Response, error) { +// @return Integration +func (a *AlertDefinitionApiService) AlertDefinitionAddIntegrationToEscalationLevelExecute(r ApiAlertDefinitionAddIntegrationToEscalationLevelRequest) (*Integration, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AlertDefinitionMonitorGroup + formFiles []formFile + localVarReturnValue *Integration ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionAddIntegrationToEscalationLevel") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}/Integration" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", _neturl.PathEscape(parameterToString(r.escalationLevelId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", url.PathEscape(parameterToString(r.escalationLevelId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.escalationLevelIntegration == nil { - return localVarReturnValue, nil, reportError("escalationLevelIntegration is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -109,7 +100,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddIntegrationToEscalationLev } // body params localVarPostBody = r.escalationLevelIntegration - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -119,15 +110,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddIntegrationToEscalationLev return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -138,7 +129,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddIntegrationToEscalationLev newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -148,7 +140,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddIntegrationToEscalationLev newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -158,14 +151,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddIntegrationToEscalationLev newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -176,26 +170,25 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddIntegrationToEscalationLev } type ApiAlertDefinitionAddMonitorGroupToAlertDefinitionRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string monitorGroupGuid string } - -func (r ApiAlertDefinitionAddMonitorGroupToAlertDefinitionRequest) Execute() (AlertDefinitionMonitorGroup, *_nethttp.Response, error) { +func (r ApiAlertDefinitionAddMonitorGroupToAlertDefinitionRequest) Execute() (*AlertDefinitionMonitorGroup, *http.Response, error) { return r.ApiService.AlertDefinitionAddMonitorGroupToAlertDefinitionExecute(r) } /* AlertDefinitionAddMonitorGroupToAlertDefinition Adds a monitor group to the specified alert definition. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition to modify. @param monitorGroupGuid The Guid of the monitor group to add. @return ApiAlertDefinitionAddMonitorGroupToAlertDefinitionRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorGroupToAlertDefinition(ctx _context.Context, alertDefinitionGuid string, monitorGroupGuid string) ApiAlertDefinitionAddMonitorGroupToAlertDefinitionRequest { +func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorGroupToAlertDefinition(ctx context.Context, alertDefinitionGuid string, monitorGroupGuid string) ApiAlertDefinitionAddMonitorGroupToAlertDefinitionRequest { return ApiAlertDefinitionAddMonitorGroupToAlertDefinitionRequest{ ApiService: a, ctx: ctx, @@ -206,28 +199,26 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorGroupToAlertDefinit // Execute executes the request // @return AlertDefinitionMonitorGroup -func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorGroupToAlertDefinitionExecute(r ApiAlertDefinitionAddMonitorGroupToAlertDefinitionRequest) (AlertDefinitionMonitorGroup, *_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorGroupToAlertDefinitionExecute(r ApiAlertDefinitionAddMonitorGroupToAlertDefinitionRequest) (*AlertDefinitionMonitorGroup, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AlertDefinitionMonitorGroup + formFiles []formFile + localVarReturnValue *AlertDefinitionMonitorGroup ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionAddMonitorGroupToAlertDefinition") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/Member/MonitorGroup/{monitorGroupGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -246,7 +237,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorGroupToAlertDefinit if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -256,15 +247,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorGroupToAlertDefinit return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -275,7 +266,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorGroupToAlertDefinit newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -285,7 +277,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorGroupToAlertDefinit newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -295,14 +288,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorGroupToAlertDefinit newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -313,26 +307,25 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorGroupToAlertDefinit } type ApiAlertDefinitionAddMonitorToAlertDefinitionRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string monitorGuid string } - -func (r ApiAlertDefinitionAddMonitorToAlertDefinitionRequest) Execute() (AlertDefinitionMonitor, *_nethttp.Response, error) { +func (r ApiAlertDefinitionAddMonitorToAlertDefinitionRequest) Execute() (*AlertDefinitionMonitor, *http.Response, error) { return r.ApiService.AlertDefinitionAddMonitorToAlertDefinitionExecute(r) } /* AlertDefinitionAddMonitorToAlertDefinition Adds a monitor to the specified alert definition. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition to modify. @param monitorGuid The Guid of the monitor to add. @return ApiAlertDefinitionAddMonitorToAlertDefinitionRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorToAlertDefinition(ctx _context.Context, alertDefinitionGuid string, monitorGuid string) ApiAlertDefinitionAddMonitorToAlertDefinitionRequest { +func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorToAlertDefinition(ctx context.Context, alertDefinitionGuid string, monitorGuid string) ApiAlertDefinitionAddMonitorToAlertDefinitionRequest { return ApiAlertDefinitionAddMonitorToAlertDefinitionRequest{ ApiService: a, ctx: ctx, @@ -343,28 +336,26 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorToAlertDefinition(c // Execute executes the request // @return AlertDefinitionMonitor -func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorToAlertDefinitionExecute(r ApiAlertDefinitionAddMonitorToAlertDefinitionRequest) (AlertDefinitionMonitor, *_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorToAlertDefinitionExecute(r ApiAlertDefinitionAddMonitorToAlertDefinitionRequest) (*AlertDefinitionMonitor, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AlertDefinitionMonitor + formFiles []formFile + localVarReturnValue *AlertDefinitionMonitor ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionAddMonitorToAlertDefinition") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/Member/Monitor/{monitorGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -383,7 +374,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorToAlertDefinitionEx if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -393,15 +384,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorToAlertDefinitionEx return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -412,7 +403,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorToAlertDefinitionEx newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -422,7 +414,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorToAlertDefinitionEx newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -432,14 +425,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorToAlertDefinitionEx newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -450,28 +444,27 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddMonitorToAlertDefinitionEx } type ApiAlertDefinitionAddOperatorGroupToEscalationLevelRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string escalationLevelId int32 operatorGroupGuid string } - -func (r ApiAlertDefinitionAddOperatorGroupToEscalationLevelRequest) Execute() (AlertDefinitionOperatorGroup, *_nethttp.Response, error) { +func (r ApiAlertDefinitionAddOperatorGroupToEscalationLevelRequest) Execute() (*AlertDefinitionOperatorGroup, *http.Response, error) { return r.ApiService.AlertDefinitionAddOperatorGroupToEscalationLevelExecute(r) } /* AlertDefinitionAddOperatorGroupToEscalationLevel Adds an operator group to the specified escalation level. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition. @param escalationLevelId The escalation level id. @param operatorGroupGuid The Guid of the operator group to add. @return ApiAlertDefinitionAddOperatorGroupToEscalationLevelRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorGroupToEscalationLevel(ctx _context.Context, alertDefinitionGuid string, escalationLevelId int32, operatorGroupGuid string) ApiAlertDefinitionAddOperatorGroupToEscalationLevelRequest { +func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorGroupToEscalationLevel(ctx context.Context, alertDefinitionGuid string, escalationLevelId int32, operatorGroupGuid string) ApiAlertDefinitionAddOperatorGroupToEscalationLevelRequest { return ApiAlertDefinitionAddOperatorGroupToEscalationLevelRequest{ ApiService: a, ctx: ctx, @@ -483,29 +476,27 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorGroupToEscalationL // Execute executes the request // @return AlertDefinitionOperatorGroup -func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorGroupToEscalationLevelExecute(r ApiAlertDefinitionAddOperatorGroupToEscalationLevelRequest) (AlertDefinitionOperatorGroup, *_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorGroupToEscalationLevelExecute(r ApiAlertDefinitionAddOperatorGroupToEscalationLevelRequest) (*AlertDefinitionOperatorGroup, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AlertDefinitionOperatorGroup + formFiles []formFile + localVarReturnValue *AlertDefinitionOperatorGroup ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionAddOperatorGroupToEscalationLevel") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}/Member/OperatorGroup/{operatorGroupGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", _neturl.PathEscape(parameterToString(r.escalationLevelId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", url.PathEscape(parameterToString(r.escalationLevelId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", url.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -524,7 +515,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorGroupToEscalationL if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -534,15 +525,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorGroupToEscalationL return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -553,7 +544,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorGroupToEscalationL newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -563,7 +555,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorGroupToEscalationL newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -573,14 +566,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorGroupToEscalationL newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -591,28 +585,27 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorGroupToEscalationL } type ApiAlertDefinitionAddOperatorToEscalationLevelRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string escalationLevelId int32 operatorGuid string } - -func (r ApiAlertDefinitionAddOperatorToEscalationLevelRequest) Execute() (AlertDefinitionOperator, *_nethttp.Response, error) { +func (r ApiAlertDefinitionAddOperatorToEscalationLevelRequest) Execute() (*AlertDefinitionOperator, *http.Response, error) { return r.ApiService.AlertDefinitionAddOperatorToEscalationLevelExecute(r) } /* AlertDefinitionAddOperatorToEscalationLevel Adds an operator to the specified escalation level. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition. @param escalationLevelId The escalation level id. @param operatorGuid The Guid of the operator to add. @return ApiAlertDefinitionAddOperatorToEscalationLevelRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorToEscalationLevel(ctx _context.Context, alertDefinitionGuid string, escalationLevelId int32, operatorGuid string) ApiAlertDefinitionAddOperatorToEscalationLevelRequest { +func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorToEscalationLevel(ctx context.Context, alertDefinitionGuid string, escalationLevelId int32, operatorGuid string) ApiAlertDefinitionAddOperatorToEscalationLevelRequest { return ApiAlertDefinitionAddOperatorToEscalationLevelRequest{ ApiService: a, ctx: ctx, @@ -624,29 +617,27 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorToEscalationLevel( // Execute executes the request // @return AlertDefinitionOperator -func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorToEscalationLevelExecute(r ApiAlertDefinitionAddOperatorToEscalationLevelRequest) (AlertDefinitionOperator, *_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorToEscalationLevelExecute(r ApiAlertDefinitionAddOperatorToEscalationLevelRequest) (*AlertDefinitionOperator, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AlertDefinitionOperator + formFiles []formFile + localVarReturnValue *AlertDefinitionOperator ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionAddOperatorToEscalationLevel") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}/Member/Operator/{operatorGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", _neturl.PathEscape(parameterToString(r.escalationLevelId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", url.PathEscape(parameterToString(r.escalationLevelId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", url.PathEscape(parameterToString(r.operatorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -665,7 +656,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorToEscalationLevelE if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -675,15 +666,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorToEscalationLevelE return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -694,7 +685,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorToEscalationLevelE newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -704,7 +696,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorToEscalationLevelE newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -714,14 +707,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorToEscalationLevelE newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -732,7 +726,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionAddOperatorToEscalationLevelE } type ApiAlertDefinitionCreateAlertDefinitionRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinition *AlertDefinition } @@ -743,17 +737,17 @@ func (r ApiAlertDefinitionCreateAlertDefinitionRequest) AlertDefinition(alertDef return r } -func (r ApiAlertDefinitionCreateAlertDefinitionRequest) Execute() (AlertDefinition, *_nethttp.Response, error) { +func (r ApiAlertDefinitionCreateAlertDefinitionRequest) Execute() (*AlertDefinition, *http.Response, error) { return r.ApiService.AlertDefinitionCreateAlertDefinitionExecute(r) } /* AlertDefinitionCreateAlertDefinition Creates a new alert definition. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiAlertDefinitionCreateAlertDefinitionRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionCreateAlertDefinition(ctx _context.Context) ApiAlertDefinitionCreateAlertDefinitionRequest { +func (a *AlertDefinitionApiService) AlertDefinitionCreateAlertDefinition(ctx context.Context) ApiAlertDefinitionCreateAlertDefinitionRequest { return ApiAlertDefinitionCreateAlertDefinitionRequest{ ApiService: a, ctx: ctx, @@ -762,29 +756,24 @@ func (a *AlertDefinitionApiService) AlertDefinitionCreateAlertDefinition(ctx _co // Execute executes the request // @return AlertDefinition -func (a *AlertDefinitionApiService) AlertDefinitionCreateAlertDefinitionExecute(r ApiAlertDefinitionCreateAlertDefinitionRequest) (AlertDefinition, *_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionCreateAlertDefinitionExecute(r ApiAlertDefinitionCreateAlertDefinitionRequest) (*AlertDefinition, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AlertDefinition + formFiles []formFile + localVarReturnValue *AlertDefinition ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionCreateAlertDefinition") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.alertDefinition == nil { - return localVarReturnValue, nil, reportError("alertDefinition is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -805,7 +794,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionCreateAlertDefinitionExecute( } // body params localVarPostBody = r.alertDefinition - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -815,15 +804,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionCreateAlertDefinitionExecute( return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -834,7 +823,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionCreateAlertDefinitionExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -844,14 +834,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionCreateAlertDefinitionExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -861,25 +852,155 @@ func (a *AlertDefinitionApiService) AlertDefinitionCreateAlertDefinitionExecute( return localVarReturnValue, localVarHTTPResponse, nil } -type ApiAlertDefinitionDeleteAlertDefinitionRequest struct { - ctx _context.Context +type ApiAlertDefinitionCreateAuthorizationForAlertDefinitionRequest struct { + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string + alertDefinitionAuthorization *AlertDefinitionAuthorization +} + +// Authorization to add +func (r ApiAlertDefinitionCreateAuthorizationForAlertDefinitionRequest) AlertDefinitionAuthorization(alertDefinitionAuthorization AlertDefinitionAuthorization) ApiAlertDefinitionCreateAuthorizationForAlertDefinitionRequest { + r.alertDefinitionAuthorization = &alertDefinitionAuthorization + return r +} + +func (r ApiAlertDefinitionCreateAuthorizationForAlertDefinitionRequest) Execute() ([]AlertDefinitionAuthorization, *http.Response, error) { + return r.ApiService.AlertDefinitionCreateAuthorizationForAlertDefinitionExecute(r) +} + +/* +AlertDefinitionCreateAuthorizationForAlertDefinition Create authorizations for alert definition If the wanted authorizations requires other authorizations, these will be added as well + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertDefinitionGuid The alert definition GUID + @return ApiAlertDefinitionCreateAuthorizationForAlertDefinitionRequest +*/ +func (a *AlertDefinitionApiService) AlertDefinitionCreateAuthorizationForAlertDefinition(ctx context.Context, alertDefinitionGuid string) ApiAlertDefinitionCreateAuthorizationForAlertDefinitionRequest { + return ApiAlertDefinitionCreateAuthorizationForAlertDefinitionRequest{ + ApiService: a, + ctx: ctx, + alertDefinitionGuid: alertDefinitionGuid, + } } +// Execute executes the request +// @return []AlertDefinitionAuthorization +func (a *AlertDefinitionApiService) AlertDefinitionCreateAuthorizationForAlertDefinitionExecute(r ApiAlertDefinitionCreateAuthorizationForAlertDefinitionRequest) ([]AlertDefinitionAuthorization, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []AlertDefinitionAuthorization + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionCreateAuthorizationForAlertDefinition") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/Authorizations" + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "application/xml"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.alertDefinitionAuthorization + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } -func (r ApiAlertDefinitionDeleteAlertDefinitionRequest) Execute() (*_nethttp.Response, error) { + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAlertDefinitionDeleteAlertDefinitionRequest struct { + ctx context.Context + ApiService *AlertDefinitionApiService + alertDefinitionGuid string +} + +func (r ApiAlertDefinitionDeleteAlertDefinitionRequest) Execute() (*http.Response, error) { return r.ApiService.AlertDefinitionDeleteAlertDefinitionExecute(r) } /* AlertDefinitionDeleteAlertDefinition Deletes an existing alert definition. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition to remove. @return ApiAlertDefinitionDeleteAlertDefinitionRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionDeleteAlertDefinition(ctx _context.Context, alertDefinitionGuid string) ApiAlertDefinitionDeleteAlertDefinitionRequest { +func (a *AlertDefinitionApiService) AlertDefinitionDeleteAlertDefinition(ctx context.Context, alertDefinitionGuid string) ApiAlertDefinitionDeleteAlertDefinitionRequest { return ApiAlertDefinitionDeleteAlertDefinitionRequest{ ApiService: a, ctx: ctx, @@ -888,26 +1009,24 @@ func (a *AlertDefinitionApiService) AlertDefinitionDeleteAlertDefinition(ctx _co } // Execute executes the request -func (a *AlertDefinitionApiService) AlertDefinitionDeleteAlertDefinitionExecute(r ApiAlertDefinitionDeleteAlertDefinitionRequest) (*_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionDeleteAlertDefinitionExecute(r ApiAlertDefinitionDeleteAlertDefinitionRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionDeleteAlertDefinition") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -926,7 +1045,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionDeleteAlertDefinitionExecute( if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -936,15 +1055,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionDeleteAlertDefinitionExecute( return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -955,7 +1074,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionDeleteAlertDefinitionExecute( newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -965,7 +1085,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionDeleteAlertDefinitionExecute( newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -975,7 +1096,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionDeleteAlertDefinitionExecute( newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -983,23 +1105,137 @@ func (a *AlertDefinitionApiService) AlertDefinitionDeleteAlertDefinitionExecute( return localVarHTTPResponse, nil } -type ApiAlertDefinitionGetAllAlertDefinitionsRequest struct { - ctx _context.Context +type ApiAlertDefinitionDeleteAuthorizationForAlertDefinitionRequest struct { + ctx context.Context ApiService *AlertDefinitionApiService + alertDefinitionGuid string + authorizationGuid string } +func (r ApiAlertDefinitionDeleteAuthorizationForAlertDefinitionRequest) Execute() (*http.Response, error) { + return r.ApiService.AlertDefinitionDeleteAuthorizationForAlertDefinitionExecute(r) +} -func (r ApiAlertDefinitionGetAllAlertDefinitionsRequest) Execute() ([]AlertDefinition, *_nethttp.Response, error) { +/* +AlertDefinitionDeleteAuthorizationForAlertDefinition Delete alert definition authorization for alert definition + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertDefinitionGuid The alert definition GUID + @param authorizationGuid The authorization GUID that needs to be deleted + @return ApiAlertDefinitionDeleteAuthorizationForAlertDefinitionRequest +*/ +func (a *AlertDefinitionApiService) AlertDefinitionDeleteAuthorizationForAlertDefinition(ctx context.Context, alertDefinitionGuid string, authorizationGuid string) ApiAlertDefinitionDeleteAuthorizationForAlertDefinitionRequest { + return ApiAlertDefinitionDeleteAuthorizationForAlertDefinitionRequest{ + ApiService: a, + ctx: ctx, + alertDefinitionGuid: alertDefinitionGuid, + authorizationGuid: authorizationGuid, + } +} + +// Execute executes the request +func (a *AlertDefinitionApiService) AlertDefinitionDeleteAuthorizationForAlertDefinitionExecute(r ApiAlertDefinitionDeleteAuthorizationForAlertDefinitionRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionDeleteAuthorizationForAlertDefinition") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/Authorizations/{authorizationGuid}" + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"authorizationGuid"+"}", url.PathEscape(parameterToString(r.authorizationGuid, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAlertDefinitionGetAllAlertDefinitionsRequest struct { + ctx context.Context + ApiService *AlertDefinitionApiService +} + +func (r ApiAlertDefinitionGetAllAlertDefinitionsRequest) Execute() ([]AlertDefinition, *http.Response, error) { return r.ApiService.AlertDefinitionGetAllAlertDefinitionsExecute(r) } /* AlertDefinitionGetAllAlertDefinitions Gets a list of all alert definitions. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiAlertDefinitionGetAllAlertDefinitionsRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionGetAllAlertDefinitions(ctx _context.Context) ApiAlertDefinitionGetAllAlertDefinitionsRequest { +func (a *AlertDefinitionApiService) AlertDefinitionGetAllAlertDefinitions(ctx context.Context) ApiAlertDefinitionGetAllAlertDefinitionsRequest { return ApiAlertDefinitionGetAllAlertDefinitionsRequest{ ApiService: a, ctx: ctx, @@ -1008,26 +1244,24 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllAlertDefinitions(ctx _c // Execute executes the request // @return []AlertDefinition -func (a *AlertDefinitionApiService) AlertDefinitionGetAllAlertDefinitionsExecute(r ApiAlertDefinitionGetAllAlertDefinitionsRequest) ([]AlertDefinition, *_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionGetAllAlertDefinitionsExecute(r ApiAlertDefinitionGetAllAlertDefinitionsRequest) ([]AlertDefinition, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []AlertDefinition ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionGetAllAlertDefinitions") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1046,7 +1280,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllAlertDefinitionsExecute if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1056,15 +1290,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllAlertDefinitionsExecute return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1075,7 +1309,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllAlertDefinitionsExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1085,14 +1320,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllAlertDefinitionsExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1103,26 +1339,25 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllAlertDefinitionsExecute } type ApiAlertDefinitionGetAllEscalationLevelIntegrationsRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string escalationLevelId int32 } - -func (r ApiAlertDefinitionGetAllEscalationLevelIntegrationsRequest) Execute() ([]Integration, *_nethttp.Response, error) { +func (r ApiAlertDefinitionGetAllEscalationLevelIntegrationsRequest) Execute() ([]Integration, *http.Response, error) { return r.ApiService.AlertDefinitionGetAllEscalationLevelIntegrationsExecute(r) } /* AlertDefinitionGetAllEscalationLevelIntegrations Gets all integrations for a specified escalation level. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition. @param escalationLevelId The escalation level id. @return ApiAlertDefinitionGetAllEscalationLevelIntegrationsRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevelIntegrations(ctx _context.Context, alertDefinitionGuid string, escalationLevelId int32) ApiAlertDefinitionGetAllEscalationLevelIntegrationsRequest { +func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevelIntegrations(ctx context.Context, alertDefinitionGuid string, escalationLevelId int32) ApiAlertDefinitionGetAllEscalationLevelIntegrationsRequest { return ApiAlertDefinitionGetAllEscalationLevelIntegrationsRequest{ ApiService: a, ctx: ctx, @@ -1133,28 +1368,26 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevelIntegrat // Execute executes the request // @return []Integration -func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevelIntegrationsExecute(r ApiAlertDefinitionGetAllEscalationLevelIntegrationsRequest) ([]Integration, *_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevelIntegrationsExecute(r ApiAlertDefinitionGetAllEscalationLevelIntegrationsRequest) ([]Integration, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Integration ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionGetAllEscalationLevelIntegrations") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}/Integration" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", _neturl.PathEscape(parameterToString(r.escalationLevelId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", url.PathEscape(parameterToString(r.escalationLevelId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1173,7 +1406,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevelIntegrat if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1183,15 +1416,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevelIntegrat return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1202,7 +1435,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevelIntegrat newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1212,7 +1446,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevelIntegrat newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1222,14 +1457,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevelIntegrat newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1240,24 +1476,23 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevelIntegrat } type ApiAlertDefinitionGetAllEscalationLevelsRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string } - -func (r ApiAlertDefinitionGetAllEscalationLevelsRequest) Execute() ([]EscalationLevel, *_nethttp.Response, error) { +func (r ApiAlertDefinitionGetAllEscalationLevelsRequest) Execute() ([]EscalationLevel, *http.Response, error) { return r.ApiService.AlertDefinitionGetAllEscalationLevelsExecute(r) } /* AlertDefinitionGetAllEscalationLevels Gets all escalation level information for the specified alert definition. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition for which to return all escalation levels. @return ApiAlertDefinitionGetAllEscalationLevelsRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevels(ctx _context.Context, alertDefinitionGuid string) ApiAlertDefinitionGetAllEscalationLevelsRequest { +func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevels(ctx context.Context, alertDefinitionGuid string) ApiAlertDefinitionGetAllEscalationLevelsRequest { return ApiAlertDefinitionGetAllEscalationLevelsRequest{ ApiService: a, ctx: ctx, @@ -1267,27 +1502,25 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevels(ctx _c // Execute executes the request // @return []EscalationLevel -func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevelsExecute(r ApiAlertDefinitionGetAllEscalationLevelsRequest) ([]EscalationLevel, *_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevelsExecute(r ApiAlertDefinitionGetAllEscalationLevelsRequest) ([]EscalationLevel, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []EscalationLevel ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionGetAllEscalationLevels") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/EscalationLevel" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1306,7 +1539,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevelsExecute if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1316,15 +1549,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevelsExecute return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1335,7 +1568,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevelsExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1345,7 +1579,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevelsExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1355,14 +1590,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevelsExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1373,24 +1609,23 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllEscalationLevelsExecute } type ApiAlertDefinitionGetAllMembersRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string } - -func (r ApiAlertDefinitionGetAllMembersRequest) Execute() ([]AlertDefinitionMember, *_nethttp.Response, error) { +func (r ApiAlertDefinitionGetAllMembersRequest) Execute() ([]AlertDefinitionMember, *http.Response, error) { return r.ApiService.AlertDefinitionGetAllMembersExecute(r) } /* AlertDefinitionGetAllMembers Gets a list of all monitor and monitor group guids for the specified alert definition. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition for which to return the members. @return ApiAlertDefinitionGetAllMembersRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionGetAllMembers(ctx _context.Context, alertDefinitionGuid string) ApiAlertDefinitionGetAllMembersRequest { +func (a *AlertDefinitionApiService) AlertDefinitionGetAllMembers(ctx context.Context, alertDefinitionGuid string) ApiAlertDefinitionGetAllMembersRequest { return ApiAlertDefinitionGetAllMembersRequest{ ApiService: a, ctx: ctx, @@ -1400,27 +1635,25 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllMembers(ctx _context.Co // Execute executes the request // @return []AlertDefinitionMember -func (a *AlertDefinitionApiService) AlertDefinitionGetAllMembersExecute(r ApiAlertDefinitionGetAllMembersRequest) ([]AlertDefinitionMember, *_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionGetAllMembersExecute(r ApiAlertDefinitionGetAllMembersRequest) ([]AlertDefinitionMember, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []AlertDefinitionMember ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionGetAllMembers") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/Member" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1439,7 +1672,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllMembersExecute(r ApiAle if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1449,15 +1682,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllMembersExecute(r ApiAle return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1468,7 +1701,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllMembersExecute(r ApiAle newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1478,7 +1712,130 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllMembersExecute(r ApiAle newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAlertDefinitionGetAuthorizationsOfAlertDefinitionRequest struct { + ctx context.Context + ApiService *AlertDefinitionApiService + alertDefinitionGuid string +} + +func (r ApiAlertDefinitionGetAuthorizationsOfAlertDefinitionRequest) Execute() ([]AlertDefinitionAuthorization, *http.Response, error) { + return r.ApiService.AlertDefinitionGetAuthorizationsOfAlertDefinitionExecute(r) +} + +/* +AlertDefinitionGetAuthorizationsOfAlertDefinition Get authorizations of alert definition + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertDefinitionGuid The alert definition GUID + @return ApiAlertDefinitionGetAuthorizationsOfAlertDefinitionRequest +*/ +func (a *AlertDefinitionApiService) AlertDefinitionGetAuthorizationsOfAlertDefinition(ctx context.Context, alertDefinitionGuid string) ApiAlertDefinitionGetAuthorizationsOfAlertDefinitionRequest { + return ApiAlertDefinitionGetAuthorizationsOfAlertDefinitionRequest{ + ApiService: a, + ctx: ctx, + alertDefinitionGuid: alertDefinitionGuid, + } +} + +// Execute executes the request +// @return []AlertDefinitionAuthorization +func (a *AlertDefinitionApiService) AlertDefinitionGetAuthorizationsOfAlertDefinitionExecute(r ApiAlertDefinitionGetAuthorizationsOfAlertDefinitionRequest) ([]AlertDefinitionAuthorization, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []AlertDefinitionAuthorization + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionGetAuthorizationsOfAlertDefinition") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/Authorizations" + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1488,14 +1845,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllMembersExecute(r ApiAle newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1506,26 +1864,25 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetAllMembersExecute(r ApiAle } type ApiAlertDefinitionGetEscalationLevelRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string escalationLevelId int32 } - -func (r ApiAlertDefinitionGetEscalationLevelRequest) Execute() (EscalationLevel, *_nethttp.Response, error) { +func (r ApiAlertDefinitionGetEscalationLevelRequest) Execute() (*EscalationLevel, *http.Response, error) { return r.ApiService.AlertDefinitionGetEscalationLevelExecute(r) } /* AlertDefinitionGetEscalationLevel Gets the escalation level information of the specified alert definition. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition. @param escalationLevelId The escalation level id. @return ApiAlertDefinitionGetEscalationLevelRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevel(ctx _context.Context, alertDefinitionGuid string, escalationLevelId int32) ApiAlertDefinitionGetEscalationLevelRequest { +func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevel(ctx context.Context, alertDefinitionGuid string, escalationLevelId int32) ApiAlertDefinitionGetEscalationLevelRequest { return ApiAlertDefinitionGetEscalationLevelRequest{ ApiService: a, ctx: ctx, @@ -1536,28 +1893,26 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevel(ctx _conte // Execute executes the request // @return EscalationLevel -func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelExecute(r ApiAlertDefinitionGetEscalationLevelRequest) (EscalationLevel, *_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelExecute(r ApiAlertDefinitionGetEscalationLevelRequest) (*EscalationLevel, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EscalationLevel + formFiles []formFile + localVarReturnValue *EscalationLevel ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionGetEscalationLevel") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", _neturl.PathEscape(parameterToString(r.escalationLevelId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", url.PathEscape(parameterToString(r.escalationLevelId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1576,7 +1931,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelExecute(r A if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1586,15 +1941,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelExecute(r A return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1605,7 +1960,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelExecute(r A newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1615,7 +1971,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelExecute(r A newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1625,14 +1982,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelExecute(r A newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1643,28 +2001,27 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelExecute(r A } type ApiAlertDefinitionGetEscalationLevelIntegrationRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string escalationLevelId int32 integrationGuid string } - -func (r ApiAlertDefinitionGetEscalationLevelIntegrationRequest) Execute() (Integration, *_nethttp.Response, error) { +func (r ApiAlertDefinitionGetEscalationLevelIntegrationRequest) Execute() (*Integration, *http.Response, error) { return r.ApiService.AlertDefinitionGetEscalationLevelIntegrationExecute(r) } /* AlertDefinitionGetEscalationLevelIntegration Gets a single integration for a specified escalation level. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition. @param escalationLevelId The escalation level id. @param integrationGuid The Guid of the integration. @return ApiAlertDefinitionGetEscalationLevelIntegrationRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelIntegration(ctx _context.Context, alertDefinitionGuid string, escalationLevelId int32, integrationGuid string) ApiAlertDefinitionGetEscalationLevelIntegrationRequest { +func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelIntegration(ctx context.Context, alertDefinitionGuid string, escalationLevelId int32, integrationGuid string) ApiAlertDefinitionGetEscalationLevelIntegrationRequest { return ApiAlertDefinitionGetEscalationLevelIntegrationRequest{ ApiService: a, ctx: ctx, @@ -1676,29 +2033,27 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelIntegration // Execute executes the request // @return Integration -func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelIntegrationExecute(r ApiAlertDefinitionGetEscalationLevelIntegrationRequest) (Integration, *_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelIntegrationExecute(r ApiAlertDefinitionGetEscalationLevelIntegrationRequest) (*Integration, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Integration + formFiles []formFile + localVarReturnValue *Integration ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionGetEscalationLevelIntegration") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}/Integration/{integrationGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", _neturl.PathEscape(parameterToString(r.escalationLevelId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"integrationGuid"+"}", _neturl.PathEscape(parameterToString(r.integrationGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", url.PathEscape(parameterToString(r.escalationLevelId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"integrationGuid"+"}", url.PathEscape(parameterToString(r.integrationGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1717,7 +2072,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelIntegration if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1727,15 +2082,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelIntegration return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1746,7 +2101,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelIntegration newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1756,7 +2112,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelIntegration newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1766,14 +2123,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelIntegration newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1784,26 +2142,25 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelIntegration } type ApiAlertDefinitionGetEscalationLevelOperatorRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string escalationLevelId int32 } - -func (r ApiAlertDefinitionGetEscalationLevelOperatorRequest) Execute() ([]AlertEscalationLevelMember, *_nethttp.Response, error) { +func (r ApiAlertDefinitionGetEscalationLevelOperatorRequest) Execute() ([]AlertEscalationLevelMember, *http.Response, error) { return r.ApiService.AlertDefinitionGetEscalationLevelOperatorExecute(r) } /* AlertDefinitionGetEscalationLevelOperator Gets the operator and operator group guids for the specified escalation level. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition. @param escalationLevelId The escalation level id. @return ApiAlertDefinitionGetEscalationLevelOperatorRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelOperator(ctx _context.Context, alertDefinitionGuid string, escalationLevelId int32) ApiAlertDefinitionGetEscalationLevelOperatorRequest { +func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelOperator(ctx context.Context, alertDefinitionGuid string, escalationLevelId int32) ApiAlertDefinitionGetEscalationLevelOperatorRequest { return ApiAlertDefinitionGetEscalationLevelOperatorRequest{ ApiService: a, ctx: ctx, @@ -1814,28 +2171,26 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelOperator(ct // Execute executes the request // @return []AlertEscalationLevelMember -func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelOperatorExecute(r ApiAlertDefinitionGetEscalationLevelOperatorRequest) ([]AlertEscalationLevelMember, *_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelOperatorExecute(r ApiAlertDefinitionGetEscalationLevelOperatorRequest) ([]AlertEscalationLevelMember, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []AlertEscalationLevelMember ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionGetEscalationLevelOperator") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}/Member" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", _neturl.PathEscape(parameterToString(r.escalationLevelId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", url.PathEscape(parameterToString(r.escalationLevelId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1854,7 +2209,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelOperatorExe if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1864,15 +2219,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelOperatorExe return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1883,7 +2238,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelOperatorExe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1893,7 +2249,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelOperatorExe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1903,14 +2260,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelOperatorExe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1921,24 +2279,23 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetEscalationLevelOperatorExe } type ApiAlertDefinitionGetSpecifiedAlertDefinitionsRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string } - -func (r ApiAlertDefinitionGetSpecifiedAlertDefinitionsRequest) Execute() (AlertDefinition, *_nethttp.Response, error) { +func (r ApiAlertDefinitionGetSpecifiedAlertDefinitionsRequest) Execute() (*AlertDefinition, *http.Response, error) { return r.ApiService.AlertDefinitionGetSpecifiedAlertDefinitionsExecute(r) } /* AlertDefinitionGetSpecifiedAlertDefinitions Gets the specified alert definition. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition. @return ApiAlertDefinitionGetSpecifiedAlertDefinitionsRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionGetSpecifiedAlertDefinitions(ctx _context.Context, alertDefinitionGuid string) ApiAlertDefinitionGetSpecifiedAlertDefinitionsRequest { +func (a *AlertDefinitionApiService) AlertDefinitionGetSpecifiedAlertDefinitions(ctx context.Context, alertDefinitionGuid string) ApiAlertDefinitionGetSpecifiedAlertDefinitionsRequest { return ApiAlertDefinitionGetSpecifiedAlertDefinitionsRequest{ ApiService: a, ctx: ctx, @@ -1948,27 +2305,25 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetSpecifiedAlertDefinitions( // Execute executes the request // @return AlertDefinition -func (a *AlertDefinitionApiService) AlertDefinitionGetSpecifiedAlertDefinitionsExecute(r ApiAlertDefinitionGetSpecifiedAlertDefinitionsRequest) (AlertDefinition, *_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionGetSpecifiedAlertDefinitionsExecute(r ApiAlertDefinitionGetSpecifiedAlertDefinitionsRequest) (*AlertDefinition, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AlertDefinition + formFiles []formFile + localVarReturnValue *AlertDefinition ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionGetSpecifiedAlertDefinitions") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1987,7 +2342,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetSpecifiedAlertDefinitionsE if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1997,15 +2352,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetSpecifiedAlertDefinitionsE return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2016,7 +2371,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetSpecifiedAlertDefinitionsE newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -2026,14 +2382,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetSpecifiedAlertDefinitionsE newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -2044,7 +2401,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionGetSpecifiedAlertDefinitionsE } type ApiAlertDefinitionPatchAlertDefinitionRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string alertDefinition *AlertDefinition @@ -2056,7 +2413,7 @@ func (r ApiAlertDefinitionPatchAlertDefinitionRequest) AlertDefinition(alertDefi return r } -func (r ApiAlertDefinitionPatchAlertDefinitionRequest) Execute() (*_nethttp.Response, error) { +func (r ApiAlertDefinitionPatchAlertDefinitionRequest) Execute() (*http.Response, error) { return r.ApiService.AlertDefinitionPatchAlertDefinitionExecute(r) } @@ -2065,11 +2422,11 @@ AlertDefinitionPatchAlertDefinition Partially updates the definition for the spe This methods accepts parts of an alert definition. Fields that do not require changes can be omitted. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition that should be updated. @return ApiAlertDefinitionPatchAlertDefinitionRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinition(ctx _context.Context, alertDefinitionGuid string) ApiAlertDefinitionPatchAlertDefinitionRequest { +func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinition(ctx context.Context, alertDefinitionGuid string) ApiAlertDefinitionPatchAlertDefinitionRequest { return ApiAlertDefinitionPatchAlertDefinitionRequest{ ApiService: a, ctx: ctx, @@ -2078,29 +2435,24 @@ func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinition(ctx _con } // Execute executes the request -func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinitionExecute(r ApiAlertDefinitionPatchAlertDefinitionRequest) (*_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinitionExecute(r ApiAlertDefinitionPatchAlertDefinitionRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionPatchAlertDefinition") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.alertDefinition == nil { - return nil, reportError("alertDefinition is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -2121,7 +2473,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinitionExecute(r } // body params localVarPostBody = r.alertDefinition - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -2131,15 +2483,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinitionExecute(r return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2150,7 +2502,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinitionExecute(r newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -2160,7 +2513,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinitionExecute(r newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -2170,7 +2524,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinitionExecute(r newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -2179,7 +2534,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinitionExecute(r } type ApiAlertDefinitionPatchAlertDefinitionEscalationRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string escalationLevelId int32 @@ -2192,7 +2547,7 @@ func (r ApiAlertDefinitionPatchAlertDefinitionEscalationRequest) EscalationLevel return r } -func (r ApiAlertDefinitionPatchAlertDefinitionEscalationRequest) Execute() (*_nethttp.Response, error) { +func (r ApiAlertDefinitionPatchAlertDefinitionEscalationRequest) Execute() (*http.Response, error) { return r.ApiService.AlertDefinitionPatchAlertDefinitionEscalationExecute(r) } @@ -2201,12 +2556,12 @@ AlertDefinitionPatchAlertDefinitionEscalation Partially updates the escalation l This methods only accepts a complete alert definition where all fields are specified. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition that should be updated. @param escalationLevelId The level number of the escalation that should be updated. @return ApiAlertDefinitionPatchAlertDefinitionEscalationRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinitionEscalation(ctx _context.Context, alertDefinitionGuid string, escalationLevelId int32) ApiAlertDefinitionPatchAlertDefinitionEscalationRequest { +func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinitionEscalation(ctx context.Context, alertDefinitionGuid string, escalationLevelId int32) ApiAlertDefinitionPatchAlertDefinitionEscalationRequest { return ApiAlertDefinitionPatchAlertDefinitionEscalationRequest{ ApiService: a, ctx: ctx, @@ -2216,30 +2571,25 @@ func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinitionEscalatio } // Execute executes the request -func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinitionEscalationExecute(r ApiAlertDefinitionPatchAlertDefinitionEscalationRequest) (*_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinitionEscalationExecute(r ApiAlertDefinitionPatchAlertDefinitionEscalationRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionPatchAlertDefinitionEscalation") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", _neturl.PathEscape(parameterToString(r.escalationLevelId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", url.PathEscape(parameterToString(r.escalationLevelId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.escalationLevel == nil { - return nil, reportError("escalationLevel is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -2260,7 +2610,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinitionEscalatio } // body params localVarPostBody = r.escalationLevel - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -2270,15 +2620,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinitionEscalatio return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2289,7 +2639,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinitionEscalatio newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -2299,7 +2650,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinitionEscalatio newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -2309,7 +2661,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinitionEscalatio newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -2318,7 +2671,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionPatchAlertDefinitionEscalatio } type ApiAlertDefinitionPutAlertDefinitionRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string alertDefinition *AlertDefinition @@ -2330,7 +2683,7 @@ func (r ApiAlertDefinitionPutAlertDefinitionRequest) AlertDefinition(alertDefini return r } -func (r ApiAlertDefinitionPutAlertDefinitionRequest) Execute() (*_nethttp.Response, error) { +func (r ApiAlertDefinitionPutAlertDefinitionRequest) Execute() (*http.Response, error) { return r.ApiService.AlertDefinitionPutAlertDefinitionExecute(r) } @@ -2339,11 +2692,11 @@ AlertDefinitionPutAlertDefinition Updates the definition for the specified alert This methods only accepts a complete alert definition where all fields are specified. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition that should be updated. @return ApiAlertDefinitionPutAlertDefinitionRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinition(ctx _context.Context, alertDefinitionGuid string) ApiAlertDefinitionPutAlertDefinitionRequest { +func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinition(ctx context.Context, alertDefinitionGuid string) ApiAlertDefinitionPutAlertDefinitionRequest { return ApiAlertDefinitionPutAlertDefinitionRequest{ ApiService: a, ctx: ctx, @@ -2352,29 +2705,24 @@ func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinition(ctx _conte } // Execute executes the request -func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinitionExecute(r ApiAlertDefinitionPutAlertDefinitionRequest) (*_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinitionExecute(r ApiAlertDefinitionPutAlertDefinitionRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionPutAlertDefinition") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.alertDefinition == nil { - return nil, reportError("alertDefinition is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -2395,7 +2743,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinitionExecute(r A } // body params localVarPostBody = r.alertDefinition - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -2405,15 +2753,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinitionExecute(r A return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2424,7 +2772,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinitionExecute(r A newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -2434,7 +2783,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinitionExecute(r A newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -2444,7 +2794,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinitionExecute(r A newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -2453,7 +2804,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinitionExecute(r A } type ApiAlertDefinitionPutAlertDefinitionEscalationRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string escalationLevelId int32 @@ -2466,7 +2817,7 @@ func (r ApiAlertDefinitionPutAlertDefinitionEscalationRequest) EscalationLevel(e return r } -func (r ApiAlertDefinitionPutAlertDefinitionEscalationRequest) Execute() (*_nethttp.Response, error) { +func (r ApiAlertDefinitionPutAlertDefinitionEscalationRequest) Execute() (*http.Response, error) { return r.ApiService.AlertDefinitionPutAlertDefinitionEscalationExecute(r) } @@ -2475,12 +2826,12 @@ AlertDefinitionPutAlertDefinitionEscalation Updates the escalation level for the This methods only accepts a complete alert definition where all fields are specified. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition that should be updated. @param escalationLevelId The level number of the escalation that should be updated. @return ApiAlertDefinitionPutAlertDefinitionEscalationRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinitionEscalation(ctx _context.Context, alertDefinitionGuid string, escalationLevelId int32) ApiAlertDefinitionPutAlertDefinitionEscalationRequest { +func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinitionEscalation(ctx context.Context, alertDefinitionGuid string, escalationLevelId int32) ApiAlertDefinitionPutAlertDefinitionEscalationRequest { return ApiAlertDefinitionPutAlertDefinitionEscalationRequest{ ApiService: a, ctx: ctx, @@ -2490,30 +2841,25 @@ func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinitionEscalation( } // Execute executes the request -func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinitionEscalationExecute(r ApiAlertDefinitionPutAlertDefinitionEscalationRequest) (*_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinitionEscalationExecute(r ApiAlertDefinitionPutAlertDefinitionEscalationRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionPutAlertDefinitionEscalation") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", _neturl.PathEscape(parameterToString(r.escalationLevelId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", url.PathEscape(parameterToString(r.escalationLevelId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.escalationLevel == nil { - return nil, reportError("escalationLevel is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -2534,7 +2880,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinitionEscalationE } // body params localVarPostBody = r.escalationLevel - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -2544,15 +2890,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinitionEscalationE return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2563,7 +2909,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinitionEscalationE newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -2573,7 +2920,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinitionEscalationE newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -2583,7 +2931,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinitionEscalationE newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -2592,28 +2941,27 @@ func (a *AlertDefinitionApiService) AlertDefinitionPutAlertDefinitionEscalationE } type ApiAlertDefinitionRemoveIntegrationFromEscalationLevelRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string escalationLevelId int32 integrationGuid string } - -func (r ApiAlertDefinitionRemoveIntegrationFromEscalationLevelRequest) Execute() (*_nethttp.Response, error) { +func (r ApiAlertDefinitionRemoveIntegrationFromEscalationLevelRequest) Execute() (*http.Response, error) { return r.ApiService.AlertDefinitionRemoveIntegrationFromEscalationLevelExecute(r) } /* AlertDefinitionRemoveIntegrationFromEscalationLevel Removes an integration from a specified escalation level. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition. @param escalationLevelId The escalation level id. @param integrationGuid The Guid of the integration to remove. @return ApiAlertDefinitionRemoveIntegrationFromEscalationLevelRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionRemoveIntegrationFromEscalationLevel(ctx _context.Context, alertDefinitionGuid string, escalationLevelId int32, integrationGuid string) ApiAlertDefinitionRemoveIntegrationFromEscalationLevelRequest { +func (a *AlertDefinitionApiService) AlertDefinitionRemoveIntegrationFromEscalationLevel(ctx context.Context, alertDefinitionGuid string, escalationLevelId int32, integrationGuid string) ApiAlertDefinitionRemoveIntegrationFromEscalationLevelRequest { return ApiAlertDefinitionRemoveIntegrationFromEscalationLevelRequest{ ApiService: a, ctx: ctx, @@ -2624,28 +2972,26 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveIntegrationFromEscalati } // Execute executes the request -func (a *AlertDefinitionApiService) AlertDefinitionRemoveIntegrationFromEscalationLevelExecute(r ApiAlertDefinitionRemoveIntegrationFromEscalationLevelRequest) (*_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionRemoveIntegrationFromEscalationLevelExecute(r ApiAlertDefinitionRemoveIntegrationFromEscalationLevelRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionRemoveIntegrationFromEscalationLevel") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}/Integration/{integrationGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", _neturl.PathEscape(parameterToString(r.escalationLevelId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"integrationGuid"+"}", _neturl.PathEscape(parameterToString(r.integrationGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", url.PathEscape(parameterToString(r.escalationLevelId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"integrationGuid"+"}", url.PathEscape(parameterToString(r.integrationGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2664,7 +3010,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveIntegrationFromEscalati if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -2674,15 +3020,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveIntegrationFromEscalati return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2693,7 +3039,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveIntegrationFromEscalati newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -2703,7 +3050,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveIntegrationFromEscalati newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -2713,7 +3061,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveIntegrationFromEscalati newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -2722,26 +3071,25 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveIntegrationFromEscalati } type ApiAlertDefinitionRemoveMonitorFromAlertDefinitionRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string monitorGuid string } - -func (r ApiAlertDefinitionRemoveMonitorFromAlertDefinitionRequest) Execute() (*_nethttp.Response, error) { +func (r ApiAlertDefinitionRemoveMonitorFromAlertDefinitionRequest) Execute() (*http.Response, error) { return r.ApiService.AlertDefinitionRemoveMonitorFromAlertDefinitionExecute(r) } /* AlertDefinitionRemoveMonitorFromAlertDefinition Removes a monitor for the specified alert definition. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition to modify. @param monitorGuid The Guid of the monitor to remove. @return ApiAlertDefinitionRemoveMonitorFromAlertDefinitionRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorFromAlertDefinition(ctx _context.Context, alertDefinitionGuid string, monitorGuid string) ApiAlertDefinitionRemoveMonitorFromAlertDefinitionRequest { +func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorFromAlertDefinition(ctx context.Context, alertDefinitionGuid string, monitorGuid string) ApiAlertDefinitionRemoveMonitorFromAlertDefinitionRequest { return ApiAlertDefinitionRemoveMonitorFromAlertDefinitionRequest{ ApiService: a, ctx: ctx, @@ -2751,27 +3099,25 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorFromAlertDefinit } // Execute executes the request -func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorFromAlertDefinitionExecute(r ApiAlertDefinitionRemoveMonitorFromAlertDefinitionRequest) (*_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorFromAlertDefinitionExecute(r ApiAlertDefinitionRemoveMonitorFromAlertDefinitionRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionRemoveMonitorFromAlertDefinition") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/Member/Monitor/{monitorGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2790,7 +3136,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorFromAlertDefinit if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -2800,15 +3146,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorFromAlertDefinit return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2819,7 +3165,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorFromAlertDefinit newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -2829,7 +3176,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorFromAlertDefinit newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -2839,7 +3187,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorFromAlertDefinit newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -2848,26 +3197,25 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorFromAlertDefinit } type ApiAlertDefinitionRemoveMonitorGroupFromAlertDefinitionRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string monitorGroupGuid string } - -func (r ApiAlertDefinitionRemoveMonitorGroupFromAlertDefinitionRequest) Execute() (*_nethttp.Response, error) { +func (r ApiAlertDefinitionRemoveMonitorGroupFromAlertDefinitionRequest) Execute() (*http.Response, error) { return r.ApiService.AlertDefinitionRemoveMonitorGroupFromAlertDefinitionExecute(r) } /* AlertDefinitionRemoveMonitorGroupFromAlertDefinition Removes a monitor group for the specified alert definition. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition to modify. @param monitorGroupGuid The Guid of the monitor group to remove. @return ApiAlertDefinitionRemoveMonitorGroupFromAlertDefinitionRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorGroupFromAlertDefinition(ctx _context.Context, alertDefinitionGuid string, monitorGroupGuid string) ApiAlertDefinitionRemoveMonitorGroupFromAlertDefinitionRequest { +func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorGroupFromAlertDefinition(ctx context.Context, alertDefinitionGuid string, monitorGroupGuid string) ApiAlertDefinitionRemoveMonitorGroupFromAlertDefinitionRequest { return ApiAlertDefinitionRemoveMonitorGroupFromAlertDefinitionRequest{ ApiService: a, ctx: ctx, @@ -2877,27 +3225,25 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorGroupFromAlertDe } // Execute executes the request -func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorGroupFromAlertDefinitionExecute(r ApiAlertDefinitionRemoveMonitorGroupFromAlertDefinitionRequest) (*_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorGroupFromAlertDefinitionExecute(r ApiAlertDefinitionRemoveMonitorGroupFromAlertDefinitionRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionRemoveMonitorGroupFromAlertDefinition") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/Member/MonitorGroup/{monitorGroupGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2916,7 +3262,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorGroupFromAlertDe if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -2926,15 +3272,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorGroupFromAlertDe return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2945,7 +3291,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorGroupFromAlertDe newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -2955,7 +3302,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorGroupFromAlertDe newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -2965,7 +3313,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorGroupFromAlertDe newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -2974,28 +3323,27 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveMonitorGroupFromAlertDe } type ApiAlertDefinitionRemoveOperatorFromEscalationLevelRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string escalationLevelId int32 operatorGuid string } - -func (r ApiAlertDefinitionRemoveOperatorFromEscalationLevelRequest) Execute() (*_nethttp.Response, error) { +func (r ApiAlertDefinitionRemoveOperatorFromEscalationLevelRequest) Execute() (*http.Response, error) { return r.ApiService.AlertDefinitionRemoveOperatorFromEscalationLevelExecute(r) } /* AlertDefinitionRemoveOperatorFromEscalationLevel Removes an operator for the specified escalation level. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition. @param escalationLevelId The escalation level id. @param operatorGuid The Guid of the operator to remove. @return ApiAlertDefinitionRemoveOperatorFromEscalationLevelRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorFromEscalationLevel(ctx _context.Context, alertDefinitionGuid string, escalationLevelId int32, operatorGuid string) ApiAlertDefinitionRemoveOperatorFromEscalationLevelRequest { +func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorFromEscalationLevel(ctx context.Context, alertDefinitionGuid string, escalationLevelId int32, operatorGuid string) ApiAlertDefinitionRemoveOperatorFromEscalationLevelRequest { return ApiAlertDefinitionRemoveOperatorFromEscalationLevelRequest{ ApiService: a, ctx: ctx, @@ -3006,28 +3354,26 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorFromEscalationL } // Execute executes the request -func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorFromEscalationLevelExecute(r ApiAlertDefinitionRemoveOperatorFromEscalationLevelRequest) (*_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorFromEscalationLevelExecute(r ApiAlertDefinitionRemoveOperatorFromEscalationLevelRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionRemoveOperatorFromEscalationLevel") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}/Member/Operator/{operatorGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", _neturl.PathEscape(parameterToString(r.escalationLevelId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", url.PathEscape(parameterToString(r.escalationLevelId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", url.PathEscape(parameterToString(r.operatorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3046,7 +3392,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorFromEscalationL if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -3056,15 +3402,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorFromEscalationL return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -3075,7 +3421,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorFromEscalationL newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -3085,7 +3432,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorFromEscalationL newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -3095,7 +3443,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorFromEscalationL newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -3104,28 +3453,27 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorFromEscalationL } type ApiAlertDefinitionRemoveOperatorGroupFromEscalationLevelRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string escalationLevelId int32 operatorGroupGuid string } - -func (r ApiAlertDefinitionRemoveOperatorGroupFromEscalationLevelRequest) Execute() (*_nethttp.Response, error) { +func (r ApiAlertDefinitionRemoveOperatorGroupFromEscalationLevelRequest) Execute() (*http.Response, error) { return r.ApiService.AlertDefinitionRemoveOperatorGroupFromEscalationLevelExecute(r) } /* AlertDefinitionRemoveOperatorGroupFromEscalationLevel Removes an operator group for the specified escalation level. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition. @param escalationLevelId The escalation level id. @param operatorGroupGuid The Guid of the operator group to remove. @return ApiAlertDefinitionRemoveOperatorGroupFromEscalationLevelRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorGroupFromEscalationLevel(ctx _context.Context, alertDefinitionGuid string, escalationLevelId int32, operatorGroupGuid string) ApiAlertDefinitionRemoveOperatorGroupFromEscalationLevelRequest { +func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorGroupFromEscalationLevel(ctx context.Context, alertDefinitionGuid string, escalationLevelId int32, operatorGroupGuid string) ApiAlertDefinitionRemoveOperatorGroupFromEscalationLevelRequest { return ApiAlertDefinitionRemoveOperatorGroupFromEscalationLevelRequest{ ApiService: a, ctx: ctx, @@ -3136,28 +3484,26 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorGroupFromEscala } // Execute executes the request -func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorGroupFromEscalationLevelExecute(r ApiAlertDefinitionRemoveOperatorGroupFromEscalationLevelRequest) (*_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorGroupFromEscalationLevelExecute(r ApiAlertDefinitionRemoveOperatorGroupFromEscalationLevelRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionRemoveOperatorGroupFromEscalationLevel") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}/Member/OperatorGroup/{operatorGroupGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", _neturl.PathEscape(parameterToString(r.escalationLevelId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", url.PathEscape(parameterToString(r.escalationLevelId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", url.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3176,7 +3522,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorGroupFromEscala if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -3186,15 +3532,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorGroupFromEscala return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -3205,7 +3551,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorGroupFromEscala newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -3215,7 +3562,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorGroupFromEscala newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -3225,7 +3573,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorGroupFromEscala newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -3234,7 +3583,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionRemoveOperatorGroupFromEscala } type ApiAlertDefinitionUpdateIntegrationForEscalationWithPatchRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string escalationLevelId int32 @@ -3248,20 +3597,20 @@ func (r ApiAlertDefinitionUpdateIntegrationForEscalationWithPatchRequest) Escala return r } -func (r ApiAlertDefinitionUpdateIntegrationForEscalationWithPatchRequest) Execute() (*_nethttp.Response, error) { +func (r ApiAlertDefinitionUpdateIntegrationForEscalationWithPatchRequest) Execute() (*http.Response, error) { return r.ApiService.AlertDefinitionUpdateIntegrationForEscalationWithPatchExecute(r) } /* AlertDefinitionUpdateIntegrationForEscalationWithPatch Partially updates an integration for a specified escalation level. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition. @param escalationLevelId The escalation level id. @param integrationGuid The Guid of the integration to update. @return ApiAlertDefinitionUpdateIntegrationForEscalationWithPatchRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalationWithPatch(ctx _context.Context, alertDefinitionGuid string, escalationLevelId int32, integrationGuid string) ApiAlertDefinitionUpdateIntegrationForEscalationWithPatchRequest { +func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalationWithPatch(ctx context.Context, alertDefinitionGuid string, escalationLevelId int32, integrationGuid string) ApiAlertDefinitionUpdateIntegrationForEscalationWithPatchRequest { return ApiAlertDefinitionUpdateIntegrationForEscalationWithPatchRequest{ ApiService: a, ctx: ctx, @@ -3272,31 +3621,26 @@ func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalatio } // Execute executes the request -func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalationWithPatchExecute(r ApiAlertDefinitionUpdateIntegrationForEscalationWithPatchRequest) (*_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalationWithPatchExecute(r ApiAlertDefinitionUpdateIntegrationForEscalationWithPatchRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionUpdateIntegrationForEscalationWithPatch") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}/Integration/{integrationGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", _neturl.PathEscape(parameterToString(r.escalationLevelId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"integrationGuid"+"}", _neturl.PathEscape(parameterToString(r.integrationGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", url.PathEscape(parameterToString(r.escalationLevelId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"integrationGuid"+"}", url.PathEscape(parameterToString(r.integrationGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.escalationLevelIntegration == nil { - return nil, reportError("escalationLevelIntegration is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -3317,7 +3661,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalatio } // body params localVarPostBody = r.escalationLevelIntegration - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -3327,15 +3671,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalatio return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -3346,7 +3690,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalatio newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -3356,7 +3701,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalatio newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -3366,7 +3712,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalatio newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -3375,7 +3722,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalatio } type ApiAlertDefinitionUpdateIntegrationForEscalationWithPutRequest struct { - ctx _context.Context + ctx context.Context ApiService *AlertDefinitionApiService alertDefinitionGuid string escalationLevelId int32 @@ -3389,20 +3736,20 @@ func (r ApiAlertDefinitionUpdateIntegrationForEscalationWithPutRequest) Escalati return r } -func (r ApiAlertDefinitionUpdateIntegrationForEscalationWithPutRequest) Execute() (*_nethttp.Response, error) { +func (r ApiAlertDefinitionUpdateIntegrationForEscalationWithPutRequest) Execute() (*http.Response, error) { return r.ApiService.AlertDefinitionUpdateIntegrationForEscalationWithPutExecute(r) } /* AlertDefinitionUpdateIntegrationForEscalationWithPut Updates an integration for a specified escalation level. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param alertDefinitionGuid The Guid of the alert definition. @param escalationLevelId The escalation level id. @param integrationGuid The Guid of the integration to update. @return ApiAlertDefinitionUpdateIntegrationForEscalationWithPutRequest */ -func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalationWithPut(ctx _context.Context, alertDefinitionGuid string, escalationLevelId int32, integrationGuid string) ApiAlertDefinitionUpdateIntegrationForEscalationWithPutRequest { +func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalationWithPut(ctx context.Context, alertDefinitionGuid string, escalationLevelId int32, integrationGuid string) ApiAlertDefinitionUpdateIntegrationForEscalationWithPutRequest { return ApiAlertDefinitionUpdateIntegrationForEscalationWithPutRequest{ ApiService: a, ctx: ctx, @@ -3413,31 +3760,26 @@ func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalatio } // Execute executes the request -func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalationWithPutExecute(r ApiAlertDefinitionUpdateIntegrationForEscalationWithPutRequest) (*_nethttp.Response, error) { +func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalationWithPutExecute(r ApiAlertDefinitionUpdateIntegrationForEscalationWithPutRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AlertDefinitionApiService.AlertDefinitionUpdateIntegrationForEscalationWithPut") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/AlertDefinition/{alertDefinitionGuid}/EscalationLevel/{escalationLevelId}/Integration/{integrationGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", _neturl.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", _neturl.PathEscape(parameterToString(r.escalationLevelId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"integrationGuid"+"}", _neturl.PathEscape(parameterToString(r.integrationGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alertDefinitionGuid"+"}", url.PathEscape(parameterToString(r.alertDefinitionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"escalationLevelId"+"}", url.PathEscape(parameterToString(r.escalationLevelId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"integrationGuid"+"}", url.PathEscape(parameterToString(r.integrationGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.escalationLevelIntegration == nil { - return nil, reportError("escalationLevelIntegration is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -3458,7 +3800,7 @@ func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalatio } // body params localVarPostBody = r.escalationLevelIntegration - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -3468,15 +3810,15 @@ func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalatio return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -3487,7 +3829,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalatio newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -3497,7 +3840,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalatio newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -3507,7 +3851,8 @@ func (a *AlertDefinitionApiService) AlertDefinitionUpdateIntegrationForEscalatio newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_checkpoint.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_checkpoint.go index f20d2904..c33c89b8 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/api_checkpoint.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_checkpoint.go @@ -12,38 +12,33 @@ package uptrends import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // CheckpointApiService CheckpointApi service type CheckpointApiService service type ApiCheckpointGetAllCheckpointsRequest struct { - ctx _context.Context + ctx context.Context ApiService *CheckpointApiService } - -func (r ApiCheckpointGetAllCheckpointsRequest) Execute() (CheckpointListResponse, *_nethttp.Response, error) { +func (r ApiCheckpointGetAllCheckpointsRequest) Execute() (*CheckpointListResponse, *http.Response, error) { return r.ApiService.CheckpointGetAllCheckpointsExecute(r) } /* -CheckpointGetAllCheckpoints Returns all the checkpoints. +CheckpointGetAllCheckpoints Returns all the checkpoints that are not deleted - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCheckpointGetAllCheckpointsRequest */ -func (a *CheckpointApiService) CheckpointGetAllCheckpoints(ctx _context.Context) ApiCheckpointGetAllCheckpointsRequest { +func (a *CheckpointApiService) CheckpointGetAllCheckpoints(ctx context.Context) ApiCheckpointGetAllCheckpointsRequest { return ApiCheckpointGetAllCheckpointsRequest{ ApiService: a, ctx: ctx, @@ -52,26 +47,24 @@ func (a *CheckpointApiService) CheckpointGetAllCheckpoints(ctx _context.Context) // Execute executes the request // @return CheckpointListResponse -func (a *CheckpointApiService) CheckpointGetAllCheckpointsExecute(r ApiCheckpointGetAllCheckpointsRequest) (CheckpointListResponse, *_nethttp.Response, error) { +func (a *CheckpointApiService) CheckpointGetAllCheckpointsExecute(r ApiCheckpointGetAllCheckpointsRequest) (*CheckpointListResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue CheckpointListResponse + formFiles []formFile + localVarReturnValue *CheckpointListResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CheckpointApiService.CheckpointGetAllCheckpoints") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Checkpoint" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -90,7 +83,7 @@ func (a *CheckpointApiService) CheckpointGetAllCheckpointsExecute(r ApiCheckpoin if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -100,15 +93,15 @@ func (a *CheckpointApiService) CheckpointGetAllCheckpointsExecute(r ApiCheckpoin return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -119,14 +112,15 @@ func (a *CheckpointApiService) CheckpointGetAllCheckpointsExecute(r ApiCheckpoin newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -137,24 +131,23 @@ func (a *CheckpointApiService) CheckpointGetAllCheckpointsExecute(r ApiCheckpoin } type ApiCheckpointGetCheckpointRequest struct { - ctx _context.Context + ctx context.Context ApiService *CheckpointApiService checkpointId int32 } - -func (r ApiCheckpointGetCheckpointRequest) Execute() (CheckpointResponse, *_nethttp.Response, error) { +func (r ApiCheckpointGetCheckpointRequest) Execute() (*CheckpointResponse, *http.Response, error) { return r.ApiService.CheckpointGetCheckpointExecute(r) } /* -CheckpointGetCheckpoint Returns the specified checkpoint. +CheckpointGetCheckpoint Returns the specified checkpoint, deleted or not - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param checkpointId The Id of the requested checkpoint. @return ApiCheckpointGetCheckpointRequest */ -func (a *CheckpointApiService) CheckpointGetCheckpoint(ctx _context.Context, checkpointId int32) ApiCheckpointGetCheckpointRequest { +func (a *CheckpointApiService) CheckpointGetCheckpoint(ctx context.Context, checkpointId int32) ApiCheckpointGetCheckpointRequest { return ApiCheckpointGetCheckpointRequest{ ApiService: a, ctx: ctx, @@ -164,27 +157,25 @@ func (a *CheckpointApiService) CheckpointGetCheckpoint(ctx _context.Context, che // Execute executes the request // @return CheckpointResponse -func (a *CheckpointApiService) CheckpointGetCheckpointExecute(r ApiCheckpointGetCheckpointRequest) (CheckpointResponse, *_nethttp.Response, error) { +func (a *CheckpointApiService) CheckpointGetCheckpointExecute(r ApiCheckpointGetCheckpointRequest) (*CheckpointResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue CheckpointResponse + formFiles []formFile + localVarReturnValue *CheckpointResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CheckpointApiService.CheckpointGetCheckpoint") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Checkpoint/{checkpointId}" - localVarPath = strings.Replace(localVarPath, "{"+"checkpointId"+"}", _neturl.PathEscape(parameterToString(r.checkpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"checkpointId"+"}", url.PathEscape(parameterToString(r.checkpointId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -203,7 +194,7 @@ func (a *CheckpointApiService) CheckpointGetCheckpointExecute(r ApiCheckpointGet if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -213,15 +204,15 @@ func (a *CheckpointApiService) CheckpointGetCheckpointExecute(r ApiCheckpointGet return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -232,7 +223,8 @@ func (a *CheckpointApiService) CheckpointGetCheckpointExecute(r ApiCheckpointGet newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -242,14 +234,15 @@ func (a *CheckpointApiService) CheckpointGetCheckpointExecute(r ApiCheckpointGet newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -260,22 +253,21 @@ func (a *CheckpointApiService) CheckpointGetCheckpointExecute(r ApiCheckpointGet } type ApiCheckpointRegionGetAllCheckpointRegionsRequest struct { - ctx _context.Context + ctx context.Context ApiService *CheckpointApiService } - -func (r ApiCheckpointRegionGetAllCheckpointRegionsRequest) Execute() ([]CheckpointRegion, *_nethttp.Response, error) { +func (r ApiCheckpointRegionGetAllCheckpointRegionsRequest) Execute() ([]CheckpointRegion, *http.Response, error) { return r.ApiService.CheckpointRegionGetAllCheckpointRegionsExecute(r) } /* -CheckpointRegionGetAllCheckpointRegions Returns all the checkpoint regions. +CheckpointRegionGetAllCheckpointRegions Returns all the checkpoint regions. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCheckpointRegionGetAllCheckpointRegionsRequest */ -func (a *CheckpointApiService) CheckpointRegionGetAllCheckpointRegions(ctx _context.Context) ApiCheckpointRegionGetAllCheckpointRegionsRequest { +func (a *CheckpointApiService) CheckpointRegionGetAllCheckpointRegions(ctx context.Context) ApiCheckpointRegionGetAllCheckpointRegionsRequest { return ApiCheckpointRegionGetAllCheckpointRegionsRequest{ ApiService: a, ctx: ctx, @@ -284,26 +276,24 @@ func (a *CheckpointApiService) CheckpointRegionGetAllCheckpointRegions(ctx _cont // Execute executes the request // @return []CheckpointRegion -func (a *CheckpointApiService) CheckpointRegionGetAllCheckpointRegionsExecute(r ApiCheckpointRegionGetAllCheckpointRegionsRequest) ([]CheckpointRegion, *_nethttp.Response, error) { +func (a *CheckpointApiService) CheckpointRegionGetAllCheckpointRegionsExecute(r ApiCheckpointRegionGetAllCheckpointRegionsRequest) ([]CheckpointRegion, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []CheckpointRegion ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CheckpointApiService.CheckpointRegionGetAllCheckpointRegions") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/CheckpointRegion" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -322,7 +312,7 @@ func (a *CheckpointApiService) CheckpointRegionGetAllCheckpointRegionsExecute(r if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -332,15 +322,15 @@ func (a *CheckpointApiService) CheckpointRegionGetAllCheckpointRegionsExecute(r return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -351,14 +341,15 @@ func (a *CheckpointApiService) CheckpointRegionGetAllCheckpointRegionsExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -369,24 +360,23 @@ func (a *CheckpointApiService) CheckpointRegionGetAllCheckpointRegionsExecute(r } type ApiCheckpointRegionGetCheckpointRegionCheckpointsRequest struct { - ctx _context.Context + ctx context.Context ApiService *CheckpointApiService checkpointRegionId int32 } - -func (r ApiCheckpointRegionGetCheckpointRegionCheckpointsRequest) Execute() ([]Checkpoint, *_nethttp.Response, error) { +func (r ApiCheckpointRegionGetCheckpointRegionCheckpointsRequest) Execute() ([]Checkpoint, *http.Response, error) { return r.ApiService.CheckpointRegionGetCheckpointRegionCheckpointsExecute(r) } /* -CheckpointRegionGetCheckpointRegionCheckpoints Returns the checkpoints for the specified checkpoint region. +CheckpointRegionGetCheckpointRegionCheckpoints Returns the checkpoints for the specified checkpoint region. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param checkpointRegionId The id for the specified checkpoint region. @return ApiCheckpointRegionGetCheckpointRegionCheckpointsRequest */ -func (a *CheckpointApiService) CheckpointRegionGetCheckpointRegionCheckpoints(ctx _context.Context, checkpointRegionId int32) ApiCheckpointRegionGetCheckpointRegionCheckpointsRequest { +func (a *CheckpointApiService) CheckpointRegionGetCheckpointRegionCheckpoints(ctx context.Context, checkpointRegionId int32) ApiCheckpointRegionGetCheckpointRegionCheckpointsRequest { return ApiCheckpointRegionGetCheckpointRegionCheckpointsRequest{ ApiService: a, ctx: ctx, @@ -396,27 +386,25 @@ func (a *CheckpointApiService) CheckpointRegionGetCheckpointRegionCheckpoints(ct // Execute executes the request // @return []Checkpoint -func (a *CheckpointApiService) CheckpointRegionGetCheckpointRegionCheckpointsExecute(r ApiCheckpointRegionGetCheckpointRegionCheckpointsRequest) ([]Checkpoint, *_nethttp.Response, error) { +func (a *CheckpointApiService) CheckpointRegionGetCheckpointRegionCheckpointsExecute(r ApiCheckpointRegionGetCheckpointRegionCheckpointsRequest) ([]Checkpoint, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Checkpoint ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CheckpointApiService.CheckpointRegionGetCheckpointRegionCheckpoints") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/CheckpointRegion/{checkpointRegionId}/Checkpoint" - localVarPath = strings.Replace(localVarPath, "{"+"checkpointRegionId"+"}", _neturl.PathEscape(parameterToString(r.checkpointRegionId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"checkpointRegionId"+"}", url.PathEscape(parameterToString(r.checkpointRegionId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -435,7 +423,7 @@ func (a *CheckpointApiService) CheckpointRegionGetCheckpointRegionCheckpointsExe if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -445,15 +433,15 @@ func (a *CheckpointApiService) CheckpointRegionGetCheckpointRegionCheckpointsExe return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -464,7 +452,8 @@ func (a *CheckpointApiService) CheckpointRegionGetCheckpointRegionCheckpointsExe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -474,14 +463,15 @@ func (a *CheckpointApiService) CheckpointRegionGetCheckpointRegionCheckpointsExe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -492,24 +482,23 @@ func (a *CheckpointApiService) CheckpointRegionGetCheckpointRegionCheckpointsExe } type ApiCheckpointRegionGetSpecifiedCheckpointRegionRequest struct { - ctx _context.Context + ctx context.Context ApiService *CheckpointApiService checkpointRegionId int32 } - -func (r ApiCheckpointRegionGetSpecifiedCheckpointRegionRequest) Execute() (CheckpointRegion, *_nethttp.Response, error) { +func (r ApiCheckpointRegionGetSpecifiedCheckpointRegionRequest) Execute() (*CheckpointRegion, *http.Response, error) { return r.ApiService.CheckpointRegionGetSpecifiedCheckpointRegionExecute(r) } /* -CheckpointRegionGetSpecifiedCheckpointRegion Returns the specified checkpoint region. +CheckpointRegionGetSpecifiedCheckpointRegion Returns the specified checkpoint region. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param checkpointRegionId The id for the specified checkpoint region. @return ApiCheckpointRegionGetSpecifiedCheckpointRegionRequest */ -func (a *CheckpointApiService) CheckpointRegionGetSpecifiedCheckpointRegion(ctx _context.Context, checkpointRegionId int32) ApiCheckpointRegionGetSpecifiedCheckpointRegionRequest { +func (a *CheckpointApiService) CheckpointRegionGetSpecifiedCheckpointRegion(ctx context.Context, checkpointRegionId int32) ApiCheckpointRegionGetSpecifiedCheckpointRegionRequest { return ApiCheckpointRegionGetSpecifiedCheckpointRegionRequest{ ApiService: a, ctx: ctx, @@ -519,27 +508,25 @@ func (a *CheckpointApiService) CheckpointRegionGetSpecifiedCheckpointRegion(ctx // Execute executes the request // @return CheckpointRegion -func (a *CheckpointApiService) CheckpointRegionGetSpecifiedCheckpointRegionExecute(r ApiCheckpointRegionGetSpecifiedCheckpointRegionRequest) (CheckpointRegion, *_nethttp.Response, error) { +func (a *CheckpointApiService) CheckpointRegionGetSpecifiedCheckpointRegionExecute(r ApiCheckpointRegionGetSpecifiedCheckpointRegionRequest) (*CheckpointRegion, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue CheckpointRegion + formFiles []formFile + localVarReturnValue *CheckpointRegion ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CheckpointApiService.CheckpointRegionGetSpecifiedCheckpointRegion") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/CheckpointRegion/{checkpointRegionId}" - localVarPath = strings.Replace(localVarPath, "{"+"checkpointRegionId"+"}", _neturl.PathEscape(parameterToString(r.checkpointRegionId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"checkpointRegionId"+"}", url.PathEscape(parameterToString(r.checkpointRegionId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -558,7 +545,7 @@ func (a *CheckpointApiService) CheckpointRegionGetSpecifiedCheckpointRegionExecu if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -568,15 +555,15 @@ func (a *CheckpointApiService) CheckpointRegionGetSpecifiedCheckpointRegionExecu return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -587,7 +574,8 @@ func (a *CheckpointApiService) CheckpointRegionGetSpecifiedCheckpointRegionExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -597,14 +585,15 @@ func (a *CheckpointApiService) CheckpointRegionGetSpecifiedCheckpointRegionExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -615,22 +604,21 @@ func (a *CheckpointApiService) CheckpointRegionGetSpecifiedCheckpointRegionExecu } type ApiCheckpointServerGetAllServerIpv4AddressesRequest struct { - ctx _context.Context + ctx context.Context ApiService *CheckpointApiService } - -func (r ApiCheckpointServerGetAllServerIpv4AddressesRequest) Execute() (ListStringResponse, *_nethttp.Response, error) { +func (r ApiCheckpointServerGetAllServerIpv4AddressesRequest) Execute() (*ListStringResponse, *http.Response, error) { return r.ApiService.CheckpointServerGetAllServerIpv4AddressesExecute(r) } /* -CheckpointServerGetAllServerIpv4Addresses Anonymous call that returns all the IPv4 addresses of all the checkpoint servers. +CheckpointServerGetAllServerIpv4Addresses Anonymous call that returns all the IPv4 addresses of all the checkpoint servers. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCheckpointServerGetAllServerIpv4AddressesRequest */ -func (a *CheckpointApiService) CheckpointServerGetAllServerIpv4Addresses(ctx _context.Context) ApiCheckpointServerGetAllServerIpv4AddressesRequest { +func (a *CheckpointApiService) CheckpointServerGetAllServerIpv4Addresses(ctx context.Context) ApiCheckpointServerGetAllServerIpv4AddressesRequest { return ApiCheckpointServerGetAllServerIpv4AddressesRequest{ ApiService: a, ctx: ctx, @@ -639,26 +627,24 @@ func (a *CheckpointApiService) CheckpointServerGetAllServerIpv4Addresses(ctx _co // Execute executes the request // @return ListStringResponse -func (a *CheckpointApiService) CheckpointServerGetAllServerIpv4AddressesExecute(r ApiCheckpointServerGetAllServerIpv4AddressesRequest) (ListStringResponse, *_nethttp.Response, error) { +func (a *CheckpointApiService) CheckpointServerGetAllServerIpv4AddressesExecute(r ApiCheckpointServerGetAllServerIpv4AddressesRequest) (*ListStringResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ListStringResponse + formFiles []formFile + localVarReturnValue *ListStringResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CheckpointApiService.CheckpointServerGetAllServerIpv4Addresses") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Checkpoint/Server/Ipv4" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -677,7 +663,7 @@ func (a *CheckpointApiService) CheckpointServerGetAllServerIpv4AddressesExecute( if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -687,15 +673,15 @@ func (a *CheckpointApiService) CheckpointServerGetAllServerIpv4AddressesExecute( return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -706,14 +692,15 @@ func (a *CheckpointApiService) CheckpointServerGetAllServerIpv4AddressesExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -724,22 +711,21 @@ func (a *CheckpointApiService) CheckpointServerGetAllServerIpv4AddressesExecute( } type ApiCheckpointServerGetAllServerIpv6AddressesRequest struct { - ctx _context.Context + ctx context.Context ApiService *CheckpointApiService } - -func (r ApiCheckpointServerGetAllServerIpv6AddressesRequest) Execute() (ListStringResponse, *_nethttp.Response, error) { +func (r ApiCheckpointServerGetAllServerIpv6AddressesRequest) Execute() (*ListStringResponse, *http.Response, error) { return r.ApiService.CheckpointServerGetAllServerIpv6AddressesExecute(r) } /* -CheckpointServerGetAllServerIpv6Addresses Anonymous call that returns all the IPv6 addresses of all the checkpoint servers. +CheckpointServerGetAllServerIpv6Addresses Anonymous call that returns all the IPv6 addresses of all the checkpoint servers. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCheckpointServerGetAllServerIpv6AddressesRequest */ -func (a *CheckpointApiService) CheckpointServerGetAllServerIpv6Addresses(ctx _context.Context) ApiCheckpointServerGetAllServerIpv6AddressesRequest { +func (a *CheckpointApiService) CheckpointServerGetAllServerIpv6Addresses(ctx context.Context) ApiCheckpointServerGetAllServerIpv6AddressesRequest { return ApiCheckpointServerGetAllServerIpv6AddressesRequest{ ApiService: a, ctx: ctx, @@ -748,26 +734,24 @@ func (a *CheckpointApiService) CheckpointServerGetAllServerIpv6Addresses(ctx _co // Execute executes the request // @return ListStringResponse -func (a *CheckpointApiService) CheckpointServerGetAllServerIpv6AddressesExecute(r ApiCheckpointServerGetAllServerIpv6AddressesRequest) (ListStringResponse, *_nethttp.Response, error) { +func (a *CheckpointApiService) CheckpointServerGetAllServerIpv6AddressesExecute(r ApiCheckpointServerGetAllServerIpv6AddressesRequest) (*ListStringResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ListStringResponse + formFiles []formFile + localVarReturnValue *ListStringResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CheckpointApiService.CheckpointServerGetAllServerIpv6Addresses") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Checkpoint/Server/Ipv6" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -786,7 +770,7 @@ func (a *CheckpointApiService) CheckpointServerGetAllServerIpv6AddressesExecute( if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -796,15 +780,15 @@ func (a *CheckpointApiService) CheckpointServerGetAllServerIpv6AddressesExecute( return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -815,14 +799,15 @@ func (a *CheckpointApiService) CheckpointServerGetAllServerIpv6AddressesExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -833,24 +818,23 @@ func (a *CheckpointApiService) CheckpointServerGetAllServerIpv6AddressesExecute( } type ApiCheckpointServerGetServerRequest struct { - ctx _context.Context + ctx context.Context ApiService *CheckpointApiService serverId int32 } - -func (r ApiCheckpointServerGetServerRequest) Execute() (CheckpoinServerResponse, *_nethttp.Response, error) { +func (r ApiCheckpointServerGetServerRequest) Execute() (*CheckpoinServerResponse, *http.Response, error) { return r.ApiService.CheckpointServerGetServerExecute(r) } /* CheckpointServerGetServer Returns the requested checkpoint server. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param serverId The Id of the requested server. @return ApiCheckpointServerGetServerRequest */ -func (a *CheckpointApiService) CheckpointServerGetServer(ctx _context.Context, serverId int32) ApiCheckpointServerGetServerRequest { +func (a *CheckpointApiService) CheckpointServerGetServer(ctx context.Context, serverId int32) ApiCheckpointServerGetServerRequest { return ApiCheckpointServerGetServerRequest{ ApiService: a, ctx: ctx, @@ -860,28 +844,144 @@ func (a *CheckpointApiService) CheckpointServerGetServer(ctx _context.Context, s // Execute executes the request // @return CheckpoinServerResponse -func (a *CheckpointApiService) CheckpointServerGetServerExecute(r ApiCheckpointServerGetServerRequest) (CheckpoinServerResponse, *_nethttp.Response, error) { +func (a *CheckpointApiService) CheckpointServerGetServerExecute(r ApiCheckpointServerGetServerRequest) (*CheckpoinServerResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue CheckpoinServerResponse + formFiles []formFile + localVarReturnValue *CheckpoinServerResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CheckpointApiService.CheckpointServerGetServer") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Checkpoint/Server/{serverId}" - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterToString(r.serverId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPrivateCheckpointHealthGetPrivateCheckpointHealthForRegionRequest struct { + ctx context.Context + ApiService *CheckpointApiService + regionId *int32 +} + +// The id of the region. +func (r ApiPrivateCheckpointHealthGetPrivateCheckpointHealthForRegionRequest) RegionId(regionId int32) ApiPrivateCheckpointHealthGetPrivateCheckpointHealthForRegionRequest { + r.regionId = ®ionId + return r +} + +func (r ApiPrivateCheckpointHealthGetPrivateCheckpointHealthForRegionRequest) Execute() (*CheckpointsHealth, *http.Response, error) { + return r.ApiService.PrivateCheckpointHealthGetPrivateCheckpointHealthForRegionExecute(r) +} + +/* +PrivateCheckpointHealthGetPrivateCheckpointHealthForRegion Returns the status of the private checkpoints in the given region. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPrivateCheckpointHealthGetPrivateCheckpointHealthForRegionRequest +*/ +func (a *CheckpointApiService) PrivateCheckpointHealthGetPrivateCheckpointHealthForRegion(ctx context.Context) ApiPrivateCheckpointHealthGetPrivateCheckpointHealthForRegionRequest { + return ApiPrivateCheckpointHealthGetPrivateCheckpointHealthForRegionRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return CheckpointsHealth +func (a *CheckpointApiService) PrivateCheckpointHealthGetPrivateCheckpointHealthForRegionExecute(r ApiPrivateCheckpointHealthGetPrivateCheckpointHealthForRegionRequest) (*CheckpointsHealth, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CheckpointsHealth + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CheckpointApiService.PrivateCheckpointHealthGetPrivateCheckpointHealthForRegion") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/PrivateCheckpointHealthForRegion" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.regionId == nil { + return localVarReturnValue, nil, reportError("regionId is required and must be specified") + } + localVarQueryParams.Add("regionId", parameterToString(*r.regionId, "")) // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -899,7 +999,7 @@ func (a *CheckpointApiService) CheckpointServerGetServerExecute(r ApiCheckpointS if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -909,15 +1009,15 @@ func (a *CheckpointApiService) CheckpointServerGetServerExecute(r ApiCheckpointS return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -928,14 +1028,153 @@ func (a *CheckpointApiService) CheckpointServerGetServerExecute(r ApiCheckpointS newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPrivateCheckpointHealthGetSpecifiedPrivateCheckpointHealthRequest struct { + ctx context.Context + ApiService *CheckpointApiService + filter *string +} + +func (r ApiPrivateCheckpointHealthGetSpecifiedPrivateCheckpointHealthRequest) Filter(filter string) ApiPrivateCheckpointHealthGetSpecifiedPrivateCheckpointHealthRequest { + r.filter = &filter + return r +} + +func (r ApiPrivateCheckpointHealthGetSpecifiedPrivateCheckpointHealthRequest) Execute() (*CheckpointsHealth, *http.Response, error) { + return r.ApiService.PrivateCheckpointHealthGetSpecifiedPrivateCheckpointHealthExecute(r) +} + +/* +PrivateCheckpointHealthGetSpecifiedPrivateCheckpointHealth Returns the status of the specified private checkpoints. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPrivateCheckpointHealthGetSpecifiedPrivateCheckpointHealthRequest +*/ +func (a *CheckpointApiService) PrivateCheckpointHealthGetSpecifiedPrivateCheckpointHealth(ctx context.Context) ApiPrivateCheckpointHealthGetSpecifiedPrivateCheckpointHealthRequest { + return ApiPrivateCheckpointHealthGetSpecifiedPrivateCheckpointHealthRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return CheckpointsHealth +func (a *CheckpointApiService) PrivateCheckpointHealthGetSpecifiedPrivateCheckpointHealthExecute(r ApiPrivateCheckpointHealthGetSpecifiedPrivateCheckpointHealthRequest) (*CheckpointsHealth, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CheckpointsHealth + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CheckpointApiService.PrivateCheckpointHealthGetSpecifiedPrivateCheckpointHealth") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/PrivateCheckpointHealth" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.filter != nil { + localVarQueryParams.Add("filter", parameterToString(*r.filter, "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_dashboard.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_dashboard.go index f940d734..ec3d2f08 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/api_dashboard.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_dashboard.go @@ -12,40 +12,35 @@ package uptrends import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // DashboardApiService DashboardApi service type DashboardApiService service type ApiDashboardCloneDashboardRequest struct { - ctx _context.Context + ctx context.Context ApiService *DashboardApiService dashboardGuid string } - -func (r ApiDashboardCloneDashboardRequest) Execute() (Dashboard, *_nethttp.Response, error) { +func (r ApiDashboardCloneDashboardRequest) Execute() (*Dashboard, *http.Response, error) { return r.ApiService.DashboardCloneDashboardExecute(r) } /* DashboardCloneDashboard Clone the specified dashboard. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dashboardGuid The guid of the specified dashboard. @return ApiDashboardCloneDashboardRequest */ -func (a *DashboardApiService) DashboardCloneDashboard(ctx _context.Context, dashboardGuid string) ApiDashboardCloneDashboardRequest { +func (a *DashboardApiService) DashboardCloneDashboard(ctx context.Context, dashboardGuid string) ApiDashboardCloneDashboardRequest { return ApiDashboardCloneDashboardRequest{ ApiService: a, ctx: ctx, @@ -55,27 +50,25 @@ func (a *DashboardApiService) DashboardCloneDashboard(ctx _context.Context, dash // Execute executes the request // @return Dashboard -func (a *DashboardApiService) DashboardCloneDashboardExecute(r ApiDashboardCloneDashboardRequest) (Dashboard, *_nethttp.Response, error) { +func (a *DashboardApiService) DashboardCloneDashboardExecute(r ApiDashboardCloneDashboardRequest) (*Dashboard, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Dashboard + formFiles []formFile + localVarReturnValue *Dashboard ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DashboardApiService.DashboardCloneDashboard") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Dashboard/{dashboardGuid}/Clone" - localVarPath = strings.Replace(localVarPath, "{"+"dashboardGuid"+"}", _neturl.PathEscape(parameterToString(r.dashboardGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dashboardGuid"+"}", url.PathEscape(parameterToString(r.dashboardGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -94,7 +87,7 @@ func (a *DashboardApiService) DashboardCloneDashboardExecute(r ApiDashboardClone if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -104,15 +97,15 @@ func (a *DashboardApiService) DashboardCloneDashboardExecute(r ApiDashboardClone return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -123,7 +116,8 @@ func (a *DashboardApiService) DashboardCloneDashboardExecute(r ApiDashboardClone newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -133,14 +127,15 @@ func (a *DashboardApiService) DashboardCloneDashboardExecute(r ApiDashboardClone newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -151,24 +146,23 @@ func (a *DashboardApiService) DashboardCloneDashboardExecute(r ApiDashboardClone } type ApiDashboardDeleteDashboardRequest struct { - ctx _context.Context + ctx context.Context ApiService *DashboardApiService dashboardGuid string } - -func (r ApiDashboardDeleteDashboardRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDashboardDeleteDashboardRequest) Execute() (*http.Response, error) { return r.ApiService.DashboardDeleteDashboardExecute(r) } /* DashboardDeleteDashboard Delete the specified dashboard. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dashboardGuid The guid of the specified dashboard. @return ApiDashboardDeleteDashboardRequest */ -func (a *DashboardApiService) DashboardDeleteDashboard(ctx _context.Context, dashboardGuid string) ApiDashboardDeleteDashboardRequest { +func (a *DashboardApiService) DashboardDeleteDashboard(ctx context.Context, dashboardGuid string) ApiDashboardDeleteDashboardRequest { return ApiDashboardDeleteDashboardRequest{ ApiService: a, ctx: ctx, @@ -177,26 +171,24 @@ func (a *DashboardApiService) DashboardDeleteDashboard(ctx _context.Context, das } // Execute executes the request -func (a *DashboardApiService) DashboardDeleteDashboardExecute(r ApiDashboardDeleteDashboardRequest) (*_nethttp.Response, error) { +func (a *DashboardApiService) DashboardDeleteDashboardExecute(r ApiDashboardDeleteDashboardRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DashboardApiService.DashboardDeleteDashboard") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Dashboard/{dashboardGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"dashboardGuid"+"}", _neturl.PathEscape(parameterToString(r.dashboardGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dashboardGuid"+"}", url.PathEscape(parameterToString(r.dashboardGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -215,7 +207,7 @@ func (a *DashboardApiService) DashboardDeleteDashboardExecute(r ApiDashboardDele if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -225,15 +217,15 @@ func (a *DashboardApiService) DashboardDeleteDashboardExecute(r ApiDashboardDele return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -244,7 +236,8 @@ func (a *DashboardApiService) DashboardDeleteDashboardExecute(r ApiDashboardDele newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -254,7 +247,8 @@ func (a *DashboardApiService) DashboardDeleteDashboardExecute(r ApiDashboardDele newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -263,22 +257,21 @@ func (a *DashboardApiService) DashboardDeleteDashboardExecute(r ApiDashboardDele } type ApiDashboardGetAllDashboardsRequest struct { - ctx _context.Context + ctx context.Context ApiService *DashboardApiService } - -func (r ApiDashboardGetAllDashboardsRequest) Execute() ([]Dashboard, *_nethttp.Response, error) { +func (r ApiDashboardGetAllDashboardsRequest) Execute() ([]Dashboard, *http.Response, error) { return r.ApiService.DashboardGetAllDashboardsExecute(r) } /* DashboardGetAllDashboards Returns data for all dashboards. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiDashboardGetAllDashboardsRequest */ -func (a *DashboardApiService) DashboardGetAllDashboards(ctx _context.Context) ApiDashboardGetAllDashboardsRequest { +func (a *DashboardApiService) DashboardGetAllDashboards(ctx context.Context) ApiDashboardGetAllDashboardsRequest { return ApiDashboardGetAllDashboardsRequest{ ApiService: a, ctx: ctx, @@ -287,26 +280,24 @@ func (a *DashboardApiService) DashboardGetAllDashboards(ctx _context.Context) Ap // Execute executes the request // @return []Dashboard -func (a *DashboardApiService) DashboardGetAllDashboardsExecute(r ApiDashboardGetAllDashboardsRequest) ([]Dashboard, *_nethttp.Response, error) { +func (a *DashboardApiService) DashboardGetAllDashboardsExecute(r ApiDashboardGetAllDashboardsRequest) ([]Dashboard, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Dashboard ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DashboardApiService.DashboardGetAllDashboards") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Dashboard" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -325,7 +316,7 @@ func (a *DashboardApiService) DashboardGetAllDashboardsExecute(r ApiDashboardGet if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -335,15 +326,15 @@ func (a *DashboardApiService) DashboardGetAllDashboardsExecute(r ApiDashboardGet return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -354,14 +345,15 @@ func (a *DashboardApiService) DashboardGetAllDashboardsExecute(r ApiDashboardGet newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -372,24 +364,23 @@ func (a *DashboardApiService) DashboardGetAllDashboardsExecute(r ApiDashboardGet } type ApiDashboardGetOneDashboardRequest struct { - ctx _context.Context + ctx context.Context ApiService *DashboardApiService dashboardGuid string } - -func (r ApiDashboardGetOneDashboardRequest) Execute() (Dashboard, *_nethttp.Response, error) { +func (r ApiDashboardGetOneDashboardRequest) Execute() (*Dashboard, *http.Response, error) { return r.ApiService.DashboardGetOneDashboardExecute(r) } /* DashboardGetOneDashboard Returns data for the specified dashboard. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dashboardGuid The guid of the specified dashboard. @return ApiDashboardGetOneDashboardRequest */ -func (a *DashboardApiService) DashboardGetOneDashboard(ctx _context.Context, dashboardGuid string) ApiDashboardGetOneDashboardRequest { +func (a *DashboardApiService) DashboardGetOneDashboard(ctx context.Context, dashboardGuid string) ApiDashboardGetOneDashboardRequest { return ApiDashboardGetOneDashboardRequest{ ApiService: a, ctx: ctx, @@ -399,27 +390,25 @@ func (a *DashboardApiService) DashboardGetOneDashboard(ctx _context.Context, das // Execute executes the request // @return Dashboard -func (a *DashboardApiService) DashboardGetOneDashboardExecute(r ApiDashboardGetOneDashboardRequest) (Dashboard, *_nethttp.Response, error) { +func (a *DashboardApiService) DashboardGetOneDashboardExecute(r ApiDashboardGetOneDashboardRequest) (*Dashboard, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Dashboard + formFiles []formFile + localVarReturnValue *Dashboard ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DashboardApiService.DashboardGetOneDashboard") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Dashboard/{dashboardGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"dashboardGuid"+"}", _neturl.PathEscape(parameterToString(r.dashboardGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dashboardGuid"+"}", url.PathEscape(parameterToString(r.dashboardGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -438,7 +427,7 @@ func (a *DashboardApiService) DashboardGetOneDashboardExecute(r ApiDashboardGetO if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -448,15 +437,15 @@ func (a *DashboardApiService) DashboardGetOneDashboardExecute(r ApiDashboardGetO return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -467,7 +456,8 @@ func (a *DashboardApiService) DashboardGetOneDashboardExecute(r ApiDashboardGetO newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -477,14 +467,15 @@ func (a *DashboardApiService) DashboardGetOneDashboardExecute(r ApiDashboardGetO newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -495,7 +486,7 @@ func (a *DashboardApiService) DashboardGetOneDashboardExecute(r ApiDashboardGetO } type ApiDashboardPartiallyUpdateDashboardRequest struct { - ctx _context.Context + ctx context.Context ApiService *DashboardApiService dashboardGuid string dashboard *Dashboard @@ -507,18 +498,18 @@ func (r ApiDashboardPartiallyUpdateDashboardRequest) Dashboard(dashboard Dashboa return r } -func (r ApiDashboardPartiallyUpdateDashboardRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDashboardPartiallyUpdateDashboardRequest) Execute() (*http.Response, error) { return r.ApiService.DashboardPartiallyUpdateDashboardExecute(r) } /* DashboardPartiallyUpdateDashboard Partially update the specified dashboard. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dashboardGuid The guid of the specified dashboard. @return ApiDashboardPartiallyUpdateDashboardRequest */ -func (a *DashboardApiService) DashboardPartiallyUpdateDashboard(ctx _context.Context, dashboardGuid string) ApiDashboardPartiallyUpdateDashboardRequest { +func (a *DashboardApiService) DashboardPartiallyUpdateDashboard(ctx context.Context, dashboardGuid string) ApiDashboardPartiallyUpdateDashboardRequest { return ApiDashboardPartiallyUpdateDashboardRequest{ ApiService: a, ctx: ctx, @@ -527,29 +518,24 @@ func (a *DashboardApiService) DashboardPartiallyUpdateDashboard(ctx _context.Con } // Execute executes the request -func (a *DashboardApiService) DashboardPartiallyUpdateDashboardExecute(r ApiDashboardPartiallyUpdateDashboardRequest) (*_nethttp.Response, error) { +func (a *DashboardApiService) DashboardPartiallyUpdateDashboardExecute(r ApiDashboardPartiallyUpdateDashboardRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DashboardApiService.DashboardPartiallyUpdateDashboard") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Dashboard/{dashboardGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"dashboardGuid"+"}", _neturl.PathEscape(parameterToString(r.dashboardGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dashboardGuid"+"}", url.PathEscape(parameterToString(r.dashboardGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.dashboard == nil { - return nil, reportError("dashboard is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -570,7 +556,7 @@ func (a *DashboardApiService) DashboardPartiallyUpdateDashboardExecute(r ApiDash } // body params localVarPostBody = r.dashboard - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -580,15 +566,15 @@ func (a *DashboardApiService) DashboardPartiallyUpdateDashboardExecute(r ApiDash return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -599,7 +585,8 @@ func (a *DashboardApiService) DashboardPartiallyUpdateDashboardExecute(r ApiDash newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -609,7 +596,8 @@ func (a *DashboardApiService) DashboardPartiallyUpdateDashboardExecute(r ApiDash newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -618,7 +606,7 @@ func (a *DashboardApiService) DashboardPartiallyUpdateDashboardExecute(r ApiDash } type ApiDashboardUpdateDashboardRequest struct { - ctx _context.Context + ctx context.Context ApiService *DashboardApiService dashboardGuid string dashboard *Dashboard @@ -630,18 +618,18 @@ func (r ApiDashboardUpdateDashboardRequest) Dashboard(dashboard Dashboard) ApiDa return r } -func (r ApiDashboardUpdateDashboardRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDashboardUpdateDashboardRequest) Execute() (*http.Response, error) { return r.ApiService.DashboardUpdateDashboardExecute(r) } /* DashboardUpdateDashboard Update the specified dashboard. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dashboardGuid The guid of the specified dashboard. @return ApiDashboardUpdateDashboardRequest */ -func (a *DashboardApiService) DashboardUpdateDashboard(ctx _context.Context, dashboardGuid string) ApiDashboardUpdateDashboardRequest { +func (a *DashboardApiService) DashboardUpdateDashboard(ctx context.Context, dashboardGuid string) ApiDashboardUpdateDashboardRequest { return ApiDashboardUpdateDashboardRequest{ ApiService: a, ctx: ctx, @@ -650,29 +638,24 @@ func (a *DashboardApiService) DashboardUpdateDashboard(ctx _context.Context, das } // Execute executes the request -func (a *DashboardApiService) DashboardUpdateDashboardExecute(r ApiDashboardUpdateDashboardRequest) (*_nethttp.Response, error) { +func (a *DashboardApiService) DashboardUpdateDashboardExecute(r ApiDashboardUpdateDashboardRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DashboardApiService.DashboardUpdateDashboard") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Dashboard/{dashboardGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"dashboardGuid"+"}", _neturl.PathEscape(parameterToString(r.dashboardGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dashboardGuid"+"}", url.PathEscape(parameterToString(r.dashboardGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.dashboard == nil { - return nil, reportError("dashboard is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -693,7 +676,7 @@ func (a *DashboardApiService) DashboardUpdateDashboardExecute(r ApiDashboardUpda } // body params localVarPostBody = r.dashboard - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -703,15 +686,15 @@ func (a *DashboardApiService) DashboardUpdateDashboardExecute(r ApiDashboardUpda return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -722,7 +705,8 @@ func (a *DashboardApiService) DashboardUpdateDashboardExecute(r ApiDashboardUpda newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -732,7 +716,8 @@ func (a *DashboardApiService) DashboardUpdateDashboardExecute(r ApiDashboardUpda newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_integration.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_integration.go index e6dce9ba..87a6c32a 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/api_integration.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_integration.go @@ -12,37 +12,279 @@ package uptrends import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" ) -// Linger please -var ( - _ _context.Context -) // IntegrationApiService IntegrationApi service type IntegrationApiService service -type ApiIntegrationGetAllIntegrationsRequest struct { - ctx _context.Context +type ApiIntegrationCreateAuthorizationForIntegrationRequest struct { + ctx context.Context + ApiService *IntegrationApiService + integrationGuid string + integrationAuthorization *IntegrationAuthorization +} + +// Authorization to add +func (r ApiIntegrationCreateAuthorizationForIntegrationRequest) IntegrationAuthorization(integrationAuthorization IntegrationAuthorization) ApiIntegrationCreateAuthorizationForIntegrationRequest { + r.integrationAuthorization = &integrationAuthorization + return r +} + +func (r ApiIntegrationCreateAuthorizationForIntegrationRequest) Execute() ([]IntegrationAuthorization, *http.Response, error) { + return r.ApiService.IntegrationCreateAuthorizationForIntegrationExecute(r) +} + +/* +IntegrationCreateAuthorizationForIntegration Create authorizations for integration If the wanted authorizations requires other authorizations, these will be added as well + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param integrationGuid The integration GUID + @return ApiIntegrationCreateAuthorizationForIntegrationRequest +*/ +func (a *IntegrationApiService) IntegrationCreateAuthorizationForIntegration(ctx context.Context, integrationGuid string) ApiIntegrationCreateAuthorizationForIntegrationRequest { + return ApiIntegrationCreateAuthorizationForIntegrationRequest{ + ApiService: a, + ctx: ctx, + integrationGuid: integrationGuid, + } +} + +// Execute executes the request +// @return []IntegrationAuthorization +func (a *IntegrationApiService) IntegrationCreateAuthorizationForIntegrationExecute(r ApiIntegrationCreateAuthorizationForIntegrationRequest) ([]IntegrationAuthorization, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []IntegrationAuthorization + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IntegrationApiService.IntegrationCreateAuthorizationForIntegration") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/Integration/{integrationGuid}/Authorizations" + localVarPath = strings.Replace(localVarPath, "{"+"integrationGuid"+"}", url.PathEscape(parameterToString(r.integrationGuid, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "application/xml"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.integrationAuthorization + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIntegrationDeleteAuthorizationForIntegrationRequest struct { + ctx context.Context ApiService *IntegrationApiService + integrationGuid string + authorizationGuid string +} + +func (r ApiIntegrationDeleteAuthorizationForIntegrationRequest) Execute() (*http.Response, error) { + return r.ApiService.IntegrationDeleteAuthorizationForIntegrationExecute(r) +} + +/* +IntegrationDeleteAuthorizationForIntegration Delete integration authorization for integration + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param integrationGuid The integration GUID + @param authorizationGuid The authorization GUID that needs to be deleted + @return ApiIntegrationDeleteAuthorizationForIntegrationRequest +*/ +func (a *IntegrationApiService) IntegrationDeleteAuthorizationForIntegration(ctx context.Context, integrationGuid string, authorizationGuid string) ApiIntegrationDeleteAuthorizationForIntegrationRequest { + return ApiIntegrationDeleteAuthorizationForIntegrationRequest{ + ApiService: a, + ctx: ctx, + integrationGuid: integrationGuid, + authorizationGuid: authorizationGuid, + } +} + +// Execute executes the request +func (a *IntegrationApiService) IntegrationDeleteAuthorizationForIntegrationExecute(r ApiIntegrationDeleteAuthorizationForIntegrationRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IntegrationApiService.IntegrationDeleteAuthorizationForIntegration") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/Integration/{integrationGuid}/Authorizations/{authorizationGuid}" + localVarPath = strings.Replace(localVarPath, "{"+"integrationGuid"+"}", url.PathEscape(parameterToString(r.integrationGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"authorizationGuid"+"}", url.PathEscape(parameterToString(r.authorizationGuid, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil } +type ApiIntegrationGetAllIntegrationsRequest struct { + ctx context.Context + ApiService *IntegrationApiService +} -func (r ApiIntegrationGetAllIntegrationsRequest) Execute() ([]Integration, *_nethttp.Response, error) { +func (r ApiIntegrationGetAllIntegrationsRequest) Execute() ([]Integration, *http.Response, error) { return r.ApiService.IntegrationGetAllIntegrationsExecute(r) } /* IntegrationGetAllIntegrations Gets a list of all integrations. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiIntegrationGetAllIntegrationsRequest */ -func (a *IntegrationApiService) IntegrationGetAllIntegrations(ctx _context.Context) ApiIntegrationGetAllIntegrationsRequest { +func (a *IntegrationApiService) IntegrationGetAllIntegrations(ctx context.Context) ApiIntegrationGetAllIntegrationsRequest { return ApiIntegrationGetAllIntegrationsRequest{ ApiService: a, ctx: ctx, @@ -51,26 +293,135 @@ func (a *IntegrationApiService) IntegrationGetAllIntegrations(ctx _context.Conte // Execute executes the request // @return []Integration -func (a *IntegrationApiService) IntegrationGetAllIntegrationsExecute(r ApiIntegrationGetAllIntegrationsRequest) ([]Integration, *_nethttp.Response, error) { +func (a *IntegrationApiService) IntegrationGetAllIntegrationsExecute(r ApiIntegrationGetAllIntegrationsRequest) ([]Integration, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Integration ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IntegrationApiService.IntegrationGetAllIntegrations") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Integration" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIntegrationGetAuthorizationsOfIntegrationRequest struct { + ctx context.Context + ApiService *IntegrationApiService + integrationGuid string +} + +func (r ApiIntegrationGetAuthorizationsOfIntegrationRequest) Execute() ([]IntegrationAuthorization, *http.Response, error) { + return r.ApiService.IntegrationGetAuthorizationsOfIntegrationExecute(r) +} + +/* +IntegrationGetAuthorizationsOfIntegration Get authorizations of integration + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param integrationGuid The intregration GUID + @return ApiIntegrationGetAuthorizationsOfIntegrationRequest +*/ +func (a *IntegrationApiService) IntegrationGetAuthorizationsOfIntegration(ctx context.Context, integrationGuid string) ApiIntegrationGetAuthorizationsOfIntegrationRequest { + return ApiIntegrationGetAuthorizationsOfIntegrationRequest{ + ApiService: a, + ctx: ctx, + integrationGuid: integrationGuid, + } +} + +// Execute executes the request +// @return []IntegrationAuthorization +func (a *IntegrationApiService) IntegrationGetAuthorizationsOfIntegrationExecute(r ApiIntegrationGetAuthorizationsOfIntegrationRequest) ([]IntegrationAuthorization, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []IntegrationAuthorization + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IntegrationApiService.IntegrationGetAuthorizationsOfIntegration") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/Integration/{integrationGuid}/Authorizations" + localVarPath = strings.Replace(localVarPath, "{"+"integrationGuid"+"}", url.PathEscape(parameterToString(r.integrationGuid, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -89,7 +440,7 @@ func (a *IntegrationApiService) IntegrationGetAllIntegrationsExecute(r ApiIntegr if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -99,15 +450,15 @@ func (a *IntegrationApiService) IntegrationGetAllIntegrationsExecute(r ApiIntegr return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -118,14 +469,26 @@ func (a *IntegrationApiService) IntegrationGetAllIntegrationsExecute(r ApiIntegr newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_miscellaneous.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_miscellaneous.go index 32f1df5c..169fe0f7 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/api_miscellaneous.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_miscellaneous.go @@ -56,9 +56,7 @@ func (a *MiscellaneousApiService) MiscellaneousGetAllOutgoingPhoneNumbersExecute var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []OutgoingPhoneNumberDetails ) @@ -90,7 +88,7 @@ func (a *MiscellaneousApiService) MiscellaneousGetAllOutgoingPhoneNumbersExecute if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -165,9 +163,7 @@ func (a *MiscellaneousApiService) MiscellaneousGetAllTimezonesExecute(r ApiMisce var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Timezone ) @@ -199,7 +195,7 @@ func (a *MiscellaneousApiService) MiscellaneousGetAllTimezonesExecute(r ApiMisce if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -277,9 +273,7 @@ func (a *MiscellaneousApiService) MiscellaneousGetTimezoneByIdExecute(r ApiMisce var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue Timezone ) @@ -312,7 +306,7 @@ func (a *MiscellaneousApiService) MiscellaneousGetTimezoneByIdExecute(r ApiMisce if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_monitor.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_monitor.go index 3a69f056..d44338de 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/api_monitor.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_monitor.go @@ -12,43 +12,37 @@ package uptrends import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" - "time" ) -// Linger please -var ( - _ _context.Context -) // MonitorApiService MonitorApi service type MonitorApiService service type ApiMonitorCleanupMaintenancePeriodsRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorApiService monitorGuid string - beforeDate time.Time + beforeDate interface{} } - -func (r ApiMonitorCleanupMaintenancePeriodsRequest) Execute() (*_nethttp.Response, error) { +func (r ApiMonitorCleanupMaintenancePeriodsRequest) Execute() (*http.Response, error) { return r.ApiService.MonitorCleanupMaintenancePeriodsExecute(r) } /* MonitorCleanupMaintenancePeriods Clears out all one-time maintenance periods for the specified monitor older than the specified date - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGuid @param beforeDate A string representing the date, formatted as \"yyyy-MM-dd\" @return ApiMonitorCleanupMaintenancePeriodsRequest */ -func (a *MonitorApiService) MonitorCleanupMaintenancePeriods(ctx _context.Context, monitorGuid string, beforeDate time.Time) ApiMonitorCleanupMaintenancePeriodsRequest { +func (a *MonitorApiService) MonitorCleanupMaintenancePeriods(ctx context.Context, monitorGuid string, beforeDate interface{}) ApiMonitorCleanupMaintenancePeriodsRequest { return ApiMonitorCleanupMaintenancePeriodsRequest{ ApiService: a, ctx: ctx, @@ -58,27 +52,25 @@ func (a *MonitorApiService) MonitorCleanupMaintenancePeriods(ctx _context.Contex } // Execute executes the request -func (a *MonitorApiService) MonitorCleanupMaintenancePeriodsExecute(r ApiMonitorCleanupMaintenancePeriodsRequest) (*_nethttp.Response, error) { +func (a *MonitorApiService) MonitorCleanupMaintenancePeriodsExecute(r ApiMonitorCleanupMaintenancePeriodsRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorApiService.MonitorCleanupMaintenancePeriods") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Monitor/{monitorGuid}/MaintenancePeriod/Cleanup/{beforeDate}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"beforeDate"+"}", _neturl.PathEscape(parameterToString(r.beforeDate, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"beforeDate"+"}", url.PathEscape(parameterToString(r.beforeDate, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -97,7 +89,7 @@ func (a *MonitorApiService) MonitorCleanupMaintenancePeriodsExecute(r ApiMonitor if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -107,15 +99,15 @@ func (a *MonitorApiService) MonitorCleanupMaintenancePeriodsExecute(r ApiMonitor return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -126,7 +118,8 @@ func (a *MonitorApiService) MonitorCleanupMaintenancePeriodsExecute(r ApiMonitor newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -136,7 +129,8 @@ func (a *MonitorApiService) MonitorCleanupMaintenancePeriodsExecute(r ApiMonitor newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -145,7 +139,7 @@ func (a *MonitorApiService) MonitorCleanupMaintenancePeriodsExecute(r ApiMonitor } type ApiMonitorCloneMonitorRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorApiService monitorGuid string includeMaintenancePeriods *bool @@ -157,13 +151,14 @@ func (r ApiMonitorCloneMonitorRequest) IncludeMaintenancePeriods(includeMaintena r.includeMaintenancePeriods = &includeMaintenancePeriods return r } + // Whether or not to also copy the monitor group memberships into the clone. func (r ApiMonitorCloneMonitorRequest) IncludeMonitorGroups(includeMonitorGroups bool) ApiMonitorCloneMonitorRequest { r.includeMonitorGroups = &includeMonitorGroups return r } -func (r ApiMonitorCloneMonitorRequest) Execute() (Monitor, *_nethttp.Response, error) { +func (r ApiMonitorCloneMonitorRequest) Execute() (*Monitor, *http.Response, error) { return r.ApiService.MonitorCloneMonitorExecute(r) } @@ -172,11 +167,11 @@ MonitorCloneMonitor Creates a clone (duplicate) of the specified monitor. Upon creation, the new monitor will be inactive. This allows you to make the necessary changes before you activate it. All other settings will be transferred to the new monitor as-is. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGuid The guid of the monitor you want to clone. @return ApiMonitorCloneMonitorRequest */ -func (a *MonitorApiService) MonitorCloneMonitor(ctx _context.Context, monitorGuid string) ApiMonitorCloneMonitorRequest { +func (a *MonitorApiService) MonitorCloneMonitor(ctx context.Context, monitorGuid string) ApiMonitorCloneMonitorRequest { return ApiMonitorCloneMonitorRequest{ ApiService: a, ctx: ctx, @@ -186,27 +181,25 @@ func (a *MonitorApiService) MonitorCloneMonitor(ctx _context.Context, monitorGui // Execute executes the request // @return Monitor -func (a *MonitorApiService) MonitorCloneMonitorExecute(r ApiMonitorCloneMonitorRequest) (Monitor, *_nethttp.Response, error) { +func (a *MonitorApiService) MonitorCloneMonitorExecute(r ApiMonitorCloneMonitorRequest) (*Monitor, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Monitor + formFiles []formFile + localVarReturnValue *Monitor ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorApiService.MonitorCloneMonitor") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Monitor/{monitorGuid}/Clone" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.includeMaintenancePeriods != nil { localVarQueryParams.Add("includeMaintenancePeriods", parameterToString(*r.includeMaintenancePeriods, "")) @@ -231,7 +224,7 @@ func (a *MonitorApiService) MonitorCloneMonitorExecute(r ApiMonitorCloneMonitorR if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -241,15 +234,15 @@ func (a *MonitorApiService) MonitorCloneMonitorExecute(r ApiMonitorCloneMonitorR return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -260,7 +253,8 @@ func (a *MonitorApiService) MonitorCloneMonitorExecute(r ApiMonitorCloneMonitorR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -270,14 +264,15 @@ func (a *MonitorApiService) MonitorCloneMonitorExecute(r ApiMonitorCloneMonitorR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -288,7 +283,7 @@ func (a *MonitorApiService) MonitorCloneMonitorExecute(r ApiMonitorCloneMonitorR } type ApiMonitorCreateAuthorizationForMonitorRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorApiService monitorGuid string monitorAuthorization *MonitorAuthorization @@ -300,18 +295,18 @@ func (r ApiMonitorCreateAuthorizationForMonitorRequest) MonitorAuthorization(mon return r } -func (r ApiMonitorCreateAuthorizationForMonitorRequest) Execute() ([]MonitorAuthorization, *_nethttp.Response, error) { +func (r ApiMonitorCreateAuthorizationForMonitorRequest) Execute() ([]MonitorAuthorization, *http.Response, error) { return r.ApiService.MonitorCreateAuthorizationForMonitorExecute(r) } /* MonitorCreateAuthorizationForMonitor Create monitor authorizations for monitor If the wanted authorizations requires other authorizations, these will be added as well - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGuid The monitor GUID @return ApiMonitorCreateAuthorizationForMonitorRequest */ -func (a *MonitorApiService) MonitorCreateAuthorizationForMonitor(ctx _context.Context, monitorGuid string) ApiMonitorCreateAuthorizationForMonitorRequest { +func (a *MonitorApiService) MonitorCreateAuthorizationForMonitor(ctx context.Context, monitorGuid string) ApiMonitorCreateAuthorizationForMonitorRequest { return ApiMonitorCreateAuthorizationForMonitorRequest{ ApiService: a, ctx: ctx, @@ -321,30 +316,25 @@ func (a *MonitorApiService) MonitorCreateAuthorizationForMonitor(ctx _context.Co // Execute executes the request // @return []MonitorAuthorization -func (a *MonitorApiService) MonitorCreateAuthorizationForMonitorExecute(r ApiMonitorCreateAuthorizationForMonitorRequest) ([]MonitorAuthorization, *_nethttp.Response, error) { +func (a *MonitorApiService) MonitorCreateAuthorizationForMonitorExecute(r ApiMonitorCreateAuthorizationForMonitorRequest) ([]MonitorAuthorization, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []MonitorAuthorization ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorApiService.MonitorCreateAuthorizationForMonitor") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Monitor/{monitorGuid}/Authorizations" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.monitorAuthorization == nil { - return localVarReturnValue, nil, reportError("monitorAuthorization is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -365,7 +355,7 @@ func (a *MonitorApiService) MonitorCreateAuthorizationForMonitorExecute(r ApiMon } // body params localVarPostBody = r.monitorAuthorization - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -375,15 +365,15 @@ func (a *MonitorApiService) MonitorCreateAuthorizationForMonitorExecute(r ApiMon return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -394,7 +384,8 @@ func (a *MonitorApiService) MonitorCreateAuthorizationForMonitorExecute(r ApiMon newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -404,14 +395,15 @@ func (a *MonitorApiService) MonitorCreateAuthorizationForMonitorExecute(r ApiMon newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -422,7 +414,7 @@ func (a *MonitorApiService) MonitorCreateAuthorizationForMonitorExecute(r ApiMon } type ApiMonitorCreateMaintenancePeriodForMonitorRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorApiService monitorGuid string maintenancePeriod *MaintenancePeriod @@ -433,18 +425,18 @@ func (r ApiMonitorCreateMaintenancePeriodForMonitorRequest) MaintenancePeriod(ma return r } -func (r ApiMonitorCreateMaintenancePeriodForMonitorRequest) Execute() (MaintenancePeriod, *_nethttp.Response, error) { +func (r ApiMonitorCreateMaintenancePeriodForMonitorRequest) Execute() (*MaintenancePeriod, *http.Response, error) { return r.ApiService.MonitorCreateMaintenancePeriodForMonitorExecute(r) } /* MonitorCreateMaintenancePeriodForMonitor Saves the new maintenance period provided for the specified monitor - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGuid @return ApiMonitorCreateMaintenancePeriodForMonitorRequest */ -func (a *MonitorApiService) MonitorCreateMaintenancePeriodForMonitor(ctx _context.Context, monitorGuid string) ApiMonitorCreateMaintenancePeriodForMonitorRequest { +func (a *MonitorApiService) MonitorCreateMaintenancePeriodForMonitor(ctx context.Context, monitorGuid string) ApiMonitorCreateMaintenancePeriodForMonitorRequest { return ApiMonitorCreateMaintenancePeriodForMonitorRequest{ ApiService: a, ctx: ctx, @@ -454,30 +446,25 @@ func (a *MonitorApiService) MonitorCreateMaintenancePeriodForMonitor(ctx _contex // Execute executes the request // @return MaintenancePeriod -func (a *MonitorApiService) MonitorCreateMaintenancePeriodForMonitorExecute(r ApiMonitorCreateMaintenancePeriodForMonitorRequest) (MaintenancePeriod, *_nethttp.Response, error) { +func (a *MonitorApiService) MonitorCreateMaintenancePeriodForMonitorExecute(r ApiMonitorCreateMaintenancePeriodForMonitorRequest) (*MaintenancePeriod, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MaintenancePeriod + formFiles []formFile + localVarReturnValue *MaintenancePeriod ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorApiService.MonitorCreateMaintenancePeriodForMonitor") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Monitor/{monitorGuid}/MaintenancePeriod" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.maintenancePeriod == nil { - return localVarReturnValue, nil, reportError("maintenancePeriod is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -498,7 +485,7 @@ func (a *MonitorApiService) MonitorCreateMaintenancePeriodForMonitorExecute(r Ap } // body params localVarPostBody = r.maintenancePeriod - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -508,15 +495,15 @@ func (a *MonitorApiService) MonitorCreateMaintenancePeriodForMonitorExecute(r Ap return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -527,7 +514,8 @@ func (a *MonitorApiService) MonitorCreateMaintenancePeriodForMonitorExecute(r Ap newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -537,14 +525,15 @@ func (a *MonitorApiService) MonitorCreateMaintenancePeriodForMonitorExecute(r Ap newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -555,26 +544,25 @@ func (a *MonitorApiService) MonitorCreateMaintenancePeriodForMonitorExecute(r Ap } type ApiMonitorDeleteAuthorizationForMonitorGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorApiService monitorGuid string authorizationGuid string } - -func (r ApiMonitorDeleteAuthorizationForMonitorGroupRequest) Execute() (*_nethttp.Response, error) { +func (r ApiMonitorDeleteAuthorizationForMonitorGroupRequest) Execute() (*http.Response, error) { return r.ApiService.MonitorDeleteAuthorizationForMonitorGroupExecute(r) } /* MonitorDeleteAuthorizationForMonitorGroup Delete monitor authorization for monitor - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGuid The monitor GUID @param authorizationGuid The authorization GUID that needs to be deleted @return ApiMonitorDeleteAuthorizationForMonitorGroupRequest */ -func (a *MonitorApiService) MonitorDeleteAuthorizationForMonitorGroup(ctx _context.Context, monitorGuid string, authorizationGuid string) ApiMonitorDeleteAuthorizationForMonitorGroupRequest { +func (a *MonitorApiService) MonitorDeleteAuthorizationForMonitorGroup(ctx context.Context, monitorGuid string, authorizationGuid string) ApiMonitorDeleteAuthorizationForMonitorGroupRequest { return ApiMonitorDeleteAuthorizationForMonitorGroupRequest{ ApiService: a, ctx: ctx, @@ -584,27 +572,25 @@ func (a *MonitorApiService) MonitorDeleteAuthorizationForMonitorGroup(ctx _conte } // Execute executes the request -func (a *MonitorApiService) MonitorDeleteAuthorizationForMonitorGroupExecute(r ApiMonitorDeleteAuthorizationForMonitorGroupRequest) (*_nethttp.Response, error) { +func (a *MonitorApiService) MonitorDeleteAuthorizationForMonitorGroupExecute(r ApiMonitorDeleteAuthorizationForMonitorGroupRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorApiService.MonitorDeleteAuthorizationForMonitorGroup") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Monitor/{monitorGuid}/Authorizations/{authorizationGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"authorizationGuid"+"}", _neturl.PathEscape(parameterToString(r.authorizationGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"authorizationGuid"+"}", url.PathEscape(parameterToString(r.authorizationGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -623,7 +609,7 @@ func (a *MonitorApiService) MonitorDeleteAuthorizationForMonitorGroupExecute(r A if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -633,15 +619,15 @@ func (a *MonitorApiService) MonitorDeleteAuthorizationForMonitorGroupExecute(r A return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -652,7 +638,8 @@ func (a *MonitorApiService) MonitorDeleteAuthorizationForMonitorGroupExecute(r A newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -662,7 +649,8 @@ func (a *MonitorApiService) MonitorDeleteAuthorizationForMonitorGroupExecute(r A newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -671,26 +659,25 @@ func (a *MonitorApiService) MonitorDeleteAuthorizationForMonitorGroupExecute(r A } type ApiMonitorDeleteMaintenancePeriodFromMonitorRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorApiService monitorGuid string maintenancePeriodId int32 } - -func (r ApiMonitorDeleteMaintenancePeriodFromMonitorRequest) Execute() (*_nethttp.Response, error) { +func (r ApiMonitorDeleteMaintenancePeriodFromMonitorRequest) Execute() (*http.Response, error) { return r.ApiService.MonitorDeleteMaintenancePeriodFromMonitorExecute(r) } /* MonitorDeleteMaintenancePeriodFromMonitor Deletes the specified maintenance period from the specified monitor - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGuid @param maintenancePeriodId @return ApiMonitorDeleteMaintenancePeriodFromMonitorRequest */ -func (a *MonitorApiService) MonitorDeleteMaintenancePeriodFromMonitor(ctx _context.Context, monitorGuid string, maintenancePeriodId int32) ApiMonitorDeleteMaintenancePeriodFromMonitorRequest { +func (a *MonitorApiService) MonitorDeleteMaintenancePeriodFromMonitor(ctx context.Context, monitorGuid string, maintenancePeriodId int32) ApiMonitorDeleteMaintenancePeriodFromMonitorRequest { return ApiMonitorDeleteMaintenancePeriodFromMonitorRequest{ ApiService: a, ctx: ctx, @@ -700,27 +687,25 @@ func (a *MonitorApiService) MonitorDeleteMaintenancePeriodFromMonitor(ctx _conte } // Execute executes the request -func (a *MonitorApiService) MonitorDeleteMaintenancePeriodFromMonitorExecute(r ApiMonitorDeleteMaintenancePeriodFromMonitorRequest) (*_nethttp.Response, error) { +func (a *MonitorApiService) MonitorDeleteMaintenancePeriodFromMonitorExecute(r ApiMonitorDeleteMaintenancePeriodFromMonitorRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorApiService.MonitorDeleteMaintenancePeriodFromMonitor") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Monitor/{monitorGuid}/MaintenancePeriod/{maintenancePeriodId}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"maintenancePeriodId"+"}", _neturl.PathEscape(parameterToString(r.maintenancePeriodId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"maintenancePeriodId"+"}", url.PathEscape(parameterToString(r.maintenancePeriodId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -739,7 +724,7 @@ func (a *MonitorApiService) MonitorDeleteMaintenancePeriodFromMonitorExecute(r A if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -749,15 +734,15 @@ func (a *MonitorApiService) MonitorDeleteMaintenancePeriodFromMonitorExecute(r A return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -768,7 +753,8 @@ func (a *MonitorApiService) MonitorDeleteMaintenancePeriodFromMonitorExecute(r A newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -778,7 +764,8 @@ func (a *MonitorApiService) MonitorDeleteMaintenancePeriodFromMonitorExecute(r A newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -787,24 +774,23 @@ func (a *MonitorApiService) MonitorDeleteMaintenancePeriodFromMonitorExecute(r A } type ApiMonitorDeleteMonitorRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorApiService monitorGuid string } - -func (r ApiMonitorDeleteMonitorRequest) Execute() (*_nethttp.Response, error) { +func (r ApiMonitorDeleteMonitorRequest) Execute() (*http.Response, error) { return r.ApiService.MonitorDeleteMonitorExecute(r) } /* MonitorDeleteMonitor Deletes the specified monitor. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGuid The guid of the monitor you want to delete. @return ApiMonitorDeleteMonitorRequest */ -func (a *MonitorApiService) MonitorDeleteMonitor(ctx _context.Context, monitorGuid string) ApiMonitorDeleteMonitorRequest { +func (a *MonitorApiService) MonitorDeleteMonitor(ctx context.Context, monitorGuid string) ApiMonitorDeleteMonitorRequest { return ApiMonitorDeleteMonitorRequest{ ApiService: a, ctx: ctx, @@ -813,26 +799,24 @@ func (a *MonitorApiService) MonitorDeleteMonitor(ctx _context.Context, monitorGu } // Execute executes the request -func (a *MonitorApiService) MonitorDeleteMonitorExecute(r ApiMonitorDeleteMonitorRequest) (*_nethttp.Response, error) { +func (a *MonitorApiService) MonitorDeleteMonitorExecute(r ApiMonitorDeleteMonitorRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorApiService.MonitorDeleteMonitor") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Monitor/{monitorGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -851,7 +835,7 @@ func (a *MonitorApiService) MonitorDeleteMonitorExecute(r ApiMonitorDeleteMonito if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -861,15 +845,15 @@ func (a *MonitorApiService) MonitorDeleteMonitorExecute(r ApiMonitorDeleteMonito return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -880,7 +864,8 @@ func (a *MonitorApiService) MonitorDeleteMonitorExecute(r ApiMonitorDeleteMonito newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -890,7 +875,8 @@ func (a *MonitorApiService) MonitorDeleteMonitorExecute(r ApiMonitorDeleteMonito newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -899,24 +885,23 @@ func (a *MonitorApiService) MonitorDeleteMonitorExecute(r ApiMonitorDeleteMonito } type ApiMonitorGetAllMaintenancePeriodsForMonitorRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorApiService monitorGuid string } - -func (r ApiMonitorGetAllMaintenancePeriodsForMonitorRequest) Execute() ([]MaintenancePeriod, *_nethttp.Response, error) { +func (r ApiMonitorGetAllMaintenancePeriodsForMonitorRequest) Execute() ([]MaintenancePeriod, *http.Response, error) { return r.ApiService.MonitorGetAllMaintenancePeriodsForMonitorExecute(r) } /* MonitorGetAllMaintenancePeriodsForMonitor Finds all maintenance periods for a monitor. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGuid The guid of the monitor you want to find the maintenance periods of. @return ApiMonitorGetAllMaintenancePeriodsForMonitorRequest */ -func (a *MonitorApiService) MonitorGetAllMaintenancePeriodsForMonitor(ctx _context.Context, monitorGuid string) ApiMonitorGetAllMaintenancePeriodsForMonitorRequest { +func (a *MonitorApiService) MonitorGetAllMaintenancePeriodsForMonitor(ctx context.Context, monitorGuid string) ApiMonitorGetAllMaintenancePeriodsForMonitorRequest { return ApiMonitorGetAllMaintenancePeriodsForMonitorRequest{ ApiService: a, ctx: ctx, @@ -926,27 +911,25 @@ func (a *MonitorApiService) MonitorGetAllMaintenancePeriodsForMonitor(ctx _conte // Execute executes the request // @return []MaintenancePeriod -func (a *MonitorApiService) MonitorGetAllMaintenancePeriodsForMonitorExecute(r ApiMonitorGetAllMaintenancePeriodsForMonitorRequest) ([]MaintenancePeriod, *_nethttp.Response, error) { +func (a *MonitorApiService) MonitorGetAllMaintenancePeriodsForMonitorExecute(r ApiMonitorGetAllMaintenancePeriodsForMonitorRequest) ([]MaintenancePeriod, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []MaintenancePeriod ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorApiService.MonitorGetAllMaintenancePeriodsForMonitor") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Monitor/{monitorGuid}/MaintenancePeriod" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -965,7 +948,7 @@ func (a *MonitorApiService) MonitorGetAllMaintenancePeriodsForMonitorExecute(r A if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -975,15 +958,15 @@ func (a *MonitorApiService) MonitorGetAllMaintenancePeriodsForMonitorExecute(r A return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -994,7 +977,8 @@ func (a *MonitorApiService) MonitorGetAllMaintenancePeriodsForMonitorExecute(r A newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1004,14 +988,15 @@ func (a *MonitorApiService) MonitorGetAllMaintenancePeriodsForMonitorExecute(r A newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1022,24 +1007,23 @@ func (a *MonitorApiService) MonitorGetAllMaintenancePeriodsForMonitorExecute(r A } type ApiMonitorGetAuthorizationsOfMonitorRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorApiService monitorGuid string } - -func (r ApiMonitorGetAuthorizationsOfMonitorRequest) Execute() ([]MonitorAuthorization, *_nethttp.Response, error) { +func (r ApiMonitorGetAuthorizationsOfMonitorRequest) Execute() ([]MonitorAuthorization, *http.Response, error) { return r.ApiService.MonitorGetAuthorizationsOfMonitorExecute(r) } /* MonitorGetAuthorizationsOfMonitor Get monitor authorizations of monitor - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGuid The monitor GUID @return ApiMonitorGetAuthorizationsOfMonitorRequest */ -func (a *MonitorApiService) MonitorGetAuthorizationsOfMonitor(ctx _context.Context, monitorGuid string) ApiMonitorGetAuthorizationsOfMonitorRequest { +func (a *MonitorApiService) MonitorGetAuthorizationsOfMonitor(ctx context.Context, monitorGuid string) ApiMonitorGetAuthorizationsOfMonitorRequest { return ApiMonitorGetAuthorizationsOfMonitorRequest{ ApiService: a, ctx: ctx, @@ -1049,27 +1033,25 @@ func (a *MonitorApiService) MonitorGetAuthorizationsOfMonitor(ctx _context.Conte // Execute executes the request // @return []MonitorAuthorization -func (a *MonitorApiService) MonitorGetAuthorizationsOfMonitorExecute(r ApiMonitorGetAuthorizationsOfMonitorRequest) ([]MonitorAuthorization, *_nethttp.Response, error) { +func (a *MonitorApiService) MonitorGetAuthorizationsOfMonitorExecute(r ApiMonitorGetAuthorizationsOfMonitorRequest) ([]MonitorAuthorization, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []MonitorAuthorization ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorApiService.MonitorGetAuthorizationsOfMonitor") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Monitor/{monitorGuid}/Authorizations" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1088,7 +1070,7 @@ func (a *MonitorApiService) MonitorGetAuthorizationsOfMonitorExecute(r ApiMonito if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1098,15 +1080,15 @@ func (a *MonitorApiService) MonitorGetAuthorizationsOfMonitorExecute(r ApiMonito return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1117,7 +1099,8 @@ func (a *MonitorApiService) MonitorGetAuthorizationsOfMonitorExecute(r ApiMonito newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1127,14 +1110,15 @@ func (a *MonitorApiService) MonitorGetAuthorizationsOfMonitorExecute(r ApiMonito newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1145,7 +1129,7 @@ func (a *MonitorApiService) MonitorGetAuthorizationsOfMonitorExecute(r ApiMonito } type ApiMonitorGetMonitorRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorApiService monitorGuid string filter *string @@ -1157,18 +1141,18 @@ func (r ApiMonitorGetMonitorRequest) Filter(filter string) ApiMonitorGetMonitorR return r } -func (r ApiMonitorGetMonitorRequest) Execute() (Monitor, *_nethttp.Response, error) { +func (r ApiMonitorGetMonitorRequest) Execute() (*Monitor, *http.Response, error) { return r.ApiService.MonitorGetMonitorExecute(r) } /* -MonitorGetMonitor Returns the definition of the specified monitor. +MonitorGetMonitor Returns the definition of the specified monitor. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGuid The Guid of the requested monitor. @return ApiMonitorGetMonitorRequest */ -func (a *MonitorApiService) MonitorGetMonitor(ctx _context.Context, monitorGuid string) ApiMonitorGetMonitorRequest { +func (a *MonitorApiService) MonitorGetMonitor(ctx context.Context, monitorGuid string) ApiMonitorGetMonitorRequest { return ApiMonitorGetMonitorRequest{ ApiService: a, ctx: ctx, @@ -1178,27 +1162,25 @@ func (a *MonitorApiService) MonitorGetMonitor(ctx _context.Context, monitorGuid // Execute executes the request // @return Monitor -func (a *MonitorApiService) MonitorGetMonitorExecute(r ApiMonitorGetMonitorRequest) (Monitor, *_nethttp.Response, error) { +func (a *MonitorApiService) MonitorGetMonitorExecute(r ApiMonitorGetMonitorRequest) (*Monitor, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Monitor + formFiles []formFile + localVarReturnValue *Monitor ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorApiService.MonitorGetMonitor") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Monitor/{monitorGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.filter != nil { localVarQueryParams.Add("filter", parameterToString(*r.filter, "")) @@ -1220,7 +1202,7 @@ func (a *MonitorApiService) MonitorGetMonitorExecute(r ApiMonitorGetMonitorReque if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1230,15 +1212,15 @@ func (a *MonitorApiService) MonitorGetMonitorExecute(r ApiMonitorGetMonitorReque return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1249,7 +1231,8 @@ func (a *MonitorApiService) MonitorGetMonitorExecute(r ApiMonitorGetMonitorReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1259,14 +1242,15 @@ func (a *MonitorApiService) MonitorGetMonitorExecute(r ApiMonitorGetMonitorReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1277,24 +1261,23 @@ func (a *MonitorApiService) MonitorGetMonitorExecute(r ApiMonitorGetMonitorReque } type ApiMonitorGetMonitorGroupsRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorApiService monitorGuid string } - -func (r ApiMonitorGetMonitorGroupsRequest) Execute() ([]string, *_nethttp.Response, error) { +func (r ApiMonitorGetMonitorGroupsRequest) Execute() ([]string, *http.Response, error) { return r.ApiService.MonitorGetMonitorGroupsExecute(r) } /* -MonitorGetMonitorGroups Returns the Guid of each monitor group where the specified monitor is a member of. +MonitorGetMonitorGroups Returns the Guid of each monitor group where the specified monitor is a member of. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGuid The Guid of the requested monitor. @return ApiMonitorGetMonitorGroupsRequest */ -func (a *MonitorApiService) MonitorGetMonitorGroups(ctx _context.Context, monitorGuid string) ApiMonitorGetMonitorGroupsRequest { +func (a *MonitorApiService) MonitorGetMonitorGroups(ctx context.Context, monitorGuid string) ApiMonitorGetMonitorGroupsRequest { return ApiMonitorGetMonitorGroupsRequest{ ApiService: a, ctx: ctx, @@ -1304,27 +1287,25 @@ func (a *MonitorApiService) MonitorGetMonitorGroups(ctx _context.Context, monito // Execute executes the request // @return []string -func (a *MonitorApiService) MonitorGetMonitorGroupsExecute(r ApiMonitorGetMonitorGroupsRequest) ([]string, *_nethttp.Response, error) { +func (a *MonitorApiService) MonitorGetMonitorGroupsExecute(r ApiMonitorGetMonitorGroupsRequest) ([]string, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorApiService.MonitorGetMonitorGroups") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Monitor/{monitorGuid}/MonitorGroup" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1343,7 +1324,7 @@ func (a *MonitorApiService) MonitorGetMonitorGroupsExecute(r ApiMonitorGetMonito if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1353,15 +1334,15 @@ func (a *MonitorApiService) MonitorGetMonitorGroupsExecute(r ApiMonitorGetMonito return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1372,7 +1353,8 @@ func (a *MonitorApiService) MonitorGetMonitorGroupsExecute(r ApiMonitorGetMonito newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1382,14 +1364,15 @@ func (a *MonitorApiService) MonitorGetMonitorGroupsExecute(r ApiMonitorGetMonito newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1400,7 +1383,7 @@ func (a *MonitorApiService) MonitorGetMonitorGroupsExecute(r ApiMonitorGetMonito } type ApiMonitorGetMonitorsRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorApiService filter *string } @@ -1411,17 +1394,17 @@ func (r ApiMonitorGetMonitorsRequest) Filter(filter string) ApiMonitorGetMonitor return r } -func (r ApiMonitorGetMonitorsRequest) Execute() ([]Monitor, *_nethttp.Response, error) { +func (r ApiMonitorGetMonitorsRequest) Execute() ([]Monitor, *http.Response, error) { return r.ApiService.MonitorGetMonitorsExecute(r) } /* MonitorGetMonitors Returns the definition of all monitors available in the account. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiMonitorGetMonitorsRequest */ -func (a *MonitorApiService) MonitorGetMonitors(ctx _context.Context) ApiMonitorGetMonitorsRequest { +func (a *MonitorApiService) MonitorGetMonitors(ctx context.Context) ApiMonitorGetMonitorsRequest { return ApiMonitorGetMonitorsRequest{ ApiService: a, ctx: ctx, @@ -1430,26 +1413,24 @@ func (a *MonitorApiService) MonitorGetMonitors(ctx _context.Context) ApiMonitorG // Execute executes the request // @return []Monitor -func (a *MonitorApiService) MonitorGetMonitorsExecute(r ApiMonitorGetMonitorsRequest) ([]Monitor, *_nethttp.Response, error) { +func (a *MonitorApiService) MonitorGetMonitorsExecute(r ApiMonitorGetMonitorsRequest) ([]Monitor, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Monitor ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorApiService.MonitorGetMonitors") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Monitor" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.filter != nil { localVarQueryParams.Add("filter", parameterToString(*r.filter, "")) @@ -1471,7 +1452,7 @@ func (a *MonitorApiService) MonitorGetMonitorsExecute(r ApiMonitorGetMonitorsReq if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1481,15 +1462,15 @@ func (a *MonitorApiService) MonitorGetMonitorsExecute(r ApiMonitorGetMonitorsReq return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1500,7 +1481,8 @@ func (a *MonitorApiService) MonitorGetMonitorsExecute(r ApiMonitorGetMonitorsReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1510,14 +1492,15 @@ func (a *MonitorApiService) MonitorGetMonitorsExecute(r ApiMonitorGetMonitorsReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1528,7 +1511,7 @@ func (a *MonitorApiService) MonitorGetMonitorsExecute(r ApiMonitorGetMonitorsReq } type ApiMonitorGetMonitorsByMonitorGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorApiService monitorGroupGuid string filter *string @@ -1540,18 +1523,18 @@ func (r ApiMonitorGetMonitorsByMonitorGroupRequest) Filter(filter string) ApiMon return r } -func (r ApiMonitorGetMonitorsByMonitorGroupRequest) Execute() ([]Monitor, *_nethttp.Response, error) { +func (r ApiMonitorGetMonitorsByMonitorGroupRequest) Execute() ([]Monitor, *http.Response, error) { return r.ApiService.MonitorGetMonitorsByMonitorGroupExecute(r) } /* MonitorGetMonitorsByMonitorGroup Returns the definition of all monitors available in the account that are a member of the specified monitor group. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGroupGuid The Guid of the requested monitor group to retrieve the monitors of. @return ApiMonitorGetMonitorsByMonitorGroupRequest */ -func (a *MonitorApiService) MonitorGetMonitorsByMonitorGroup(ctx _context.Context, monitorGroupGuid string) ApiMonitorGetMonitorsByMonitorGroupRequest { +func (a *MonitorApiService) MonitorGetMonitorsByMonitorGroup(ctx context.Context, monitorGroupGuid string) ApiMonitorGetMonitorsByMonitorGroupRequest { return ApiMonitorGetMonitorsByMonitorGroupRequest{ ApiService: a, ctx: ctx, @@ -1561,27 +1544,25 @@ func (a *MonitorApiService) MonitorGetMonitorsByMonitorGroup(ctx _context.Contex // Execute executes the request // @return []Monitor -func (a *MonitorApiService) MonitorGetMonitorsByMonitorGroupExecute(r ApiMonitorGetMonitorsByMonitorGroupRequest) ([]Monitor, *_nethttp.Response, error) { +func (a *MonitorApiService) MonitorGetMonitorsByMonitorGroupExecute(r ApiMonitorGetMonitorsByMonitorGroupRequest) ([]Monitor, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Monitor ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorApiService.MonitorGetMonitorsByMonitorGroup") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Monitor/MonitorGroup/{monitorGroupGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.filter != nil { localVarQueryParams.Add("filter", parameterToString(*r.filter, "")) @@ -1603,7 +1584,7 @@ func (a *MonitorApiService) MonitorGetMonitorsByMonitorGroupExecute(r ApiMonitor if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1613,15 +1594,15 @@ func (a *MonitorApiService) MonitorGetMonitorsByMonitorGroupExecute(r ApiMonitor return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1632,7 +1613,8 @@ func (a *MonitorApiService) MonitorGetMonitorsByMonitorGroupExecute(r ApiMonitor newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1642,14 +1624,15 @@ func (a *MonitorApiService) MonitorGetMonitorsByMonitorGroupExecute(r ApiMonitor newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1660,7 +1643,7 @@ func (a *MonitorApiService) MonitorGetMonitorsByMonitorGroupExecute(r ApiMonitor } type ApiMonitorPatchMonitorRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorApiService monitorGuid string monitor *Monitor @@ -1672,7 +1655,7 @@ func (r ApiMonitorPatchMonitorRequest) Monitor(monitor Monitor) ApiMonitorPatchM return r } -func (r ApiMonitorPatchMonitorRequest) Execute() (*_nethttp.Response, error) { +func (r ApiMonitorPatchMonitorRequest) Execute() (*http.Response, error) { return r.ApiService.MonitorPatchMonitorExecute(r) } @@ -1681,11 +1664,11 @@ MonitorPatchMonitor Partially updates the definition of the specified monitor. This methods accepts parts of a monitor definition. We recommend retrieving the existing definition first (using the GET method). You can then process the changes you want to make and send back these changes only using this PATCH method. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGuid The Guid of the monitor that should be updated. @return ApiMonitorPatchMonitorRequest */ -func (a *MonitorApiService) MonitorPatchMonitor(ctx _context.Context, monitorGuid string) ApiMonitorPatchMonitorRequest { +func (a *MonitorApiService) MonitorPatchMonitor(ctx context.Context, monitorGuid string) ApiMonitorPatchMonitorRequest { return ApiMonitorPatchMonitorRequest{ ApiService: a, ctx: ctx, @@ -1694,29 +1677,24 @@ func (a *MonitorApiService) MonitorPatchMonitor(ctx _context.Context, monitorGui } // Execute executes the request -func (a *MonitorApiService) MonitorPatchMonitorExecute(r ApiMonitorPatchMonitorRequest) (*_nethttp.Response, error) { +func (a *MonitorApiService) MonitorPatchMonitorExecute(r ApiMonitorPatchMonitorRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorApiService.MonitorPatchMonitor") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Monitor/{monitorGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.monitor == nil { - return nil, reportError("monitor is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -1737,7 +1715,7 @@ func (a *MonitorApiService) MonitorPatchMonitorExecute(r ApiMonitorPatchMonitorR } // body params localVarPostBody = r.monitor - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1747,15 +1725,15 @@ func (a *MonitorApiService) MonitorPatchMonitorExecute(r ApiMonitorPatchMonitorR return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1766,7 +1744,8 @@ func (a *MonitorApiService) MonitorPatchMonitorExecute(r ApiMonitorPatchMonitorR newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1776,7 +1755,8 @@ func (a *MonitorApiService) MonitorPatchMonitorExecute(r ApiMonitorPatchMonitorR newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -1785,7 +1765,7 @@ func (a *MonitorApiService) MonitorPatchMonitorExecute(r ApiMonitorPatchMonitorR } type ApiMonitorPostMonitorRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorApiService monitor *Monitor } @@ -1796,17 +1776,17 @@ func (r ApiMonitorPostMonitorRequest) Monitor(monitor Monitor) ApiMonitorPostMon return r } -func (r ApiMonitorPostMonitorRequest) Execute() (Monitor, *_nethttp.Response, error) { +func (r ApiMonitorPostMonitorRequest) Execute() (*Monitor, *http.Response, error) { return r.ApiService.MonitorPostMonitorExecute(r) } /* MonitorPostMonitor Creates a new monitor. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiMonitorPostMonitorRequest */ -func (a *MonitorApiService) MonitorPostMonitor(ctx _context.Context) ApiMonitorPostMonitorRequest { +func (a *MonitorApiService) MonitorPostMonitor(ctx context.Context) ApiMonitorPostMonitorRequest { return ApiMonitorPostMonitorRequest{ ApiService: a, ctx: ctx, @@ -1815,29 +1795,24 @@ func (a *MonitorApiService) MonitorPostMonitor(ctx _context.Context) ApiMonitorP // Execute executes the request // @return Monitor -func (a *MonitorApiService) MonitorPostMonitorExecute(r ApiMonitorPostMonitorRequest) (Monitor, *_nethttp.Response, error) { +func (a *MonitorApiService) MonitorPostMonitorExecute(r ApiMonitorPostMonitorRequest) (*Monitor, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Monitor + formFiles []formFile + localVarReturnValue *Monitor ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorApiService.MonitorPostMonitor") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Monitor" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.monitor == nil { - return localVarReturnValue, nil, reportError("monitor is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -1858,7 +1833,7 @@ func (a *MonitorApiService) MonitorPostMonitorExecute(r ApiMonitorPostMonitorReq } // body params localVarPostBody = r.monitor - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1868,15 +1843,15 @@ func (a *MonitorApiService) MonitorPostMonitorExecute(r ApiMonitorPostMonitorReq return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1887,14 +1862,15 @@ func (a *MonitorApiService) MonitorPostMonitorExecute(r ApiMonitorPostMonitorReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1905,7 +1881,7 @@ func (a *MonitorApiService) MonitorPostMonitorExecute(r ApiMonitorPostMonitorReq } type ApiMonitorPutMonitorRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorApiService monitorGuid string monitor *Monitor @@ -1917,7 +1893,7 @@ func (r ApiMonitorPutMonitorRequest) Monitor(monitor Monitor) ApiMonitorPutMonit return r } -func (r ApiMonitorPutMonitorRequest) Execute() (*_nethttp.Response, error) { +func (r ApiMonitorPutMonitorRequest) Execute() (*http.Response, error) { return r.ApiService.MonitorPutMonitorExecute(r) } @@ -1926,11 +1902,11 @@ MonitorPutMonitor Updates the definition of the specified monitor. This methods only accepts a complete monitor definition. We recommend retrieving the existing definition first (using the GET method). You can then process the changes you want to make and send back the updated definition using this PUT method. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGuid The Guid of the monitor that should be updated. @return ApiMonitorPutMonitorRequest */ -func (a *MonitorApiService) MonitorPutMonitor(ctx _context.Context, monitorGuid string) ApiMonitorPutMonitorRequest { +func (a *MonitorApiService) MonitorPutMonitor(ctx context.Context, monitorGuid string) ApiMonitorPutMonitorRequest { return ApiMonitorPutMonitorRequest{ ApiService: a, ctx: ctx, @@ -1939,29 +1915,24 @@ func (a *MonitorApiService) MonitorPutMonitor(ctx _context.Context, monitorGuid } // Execute executes the request -func (a *MonitorApiService) MonitorPutMonitorExecute(r ApiMonitorPutMonitorRequest) (*_nethttp.Response, error) { +func (a *MonitorApiService) MonitorPutMonitorExecute(r ApiMonitorPutMonitorRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorApiService.MonitorPutMonitor") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Monitor/{monitorGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.monitor == nil { - return nil, reportError("monitor is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -1982,7 +1953,7 @@ func (a *MonitorApiService) MonitorPutMonitorExecute(r ApiMonitorPutMonitorReque } // body params localVarPostBody = r.monitor - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1992,15 +1963,15 @@ func (a *MonitorApiService) MonitorPutMonitorExecute(r ApiMonitorPutMonitorReque return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2011,7 +1982,8 @@ func (a *MonitorApiService) MonitorPutMonitorExecute(r ApiMonitorPutMonitorReque newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -2021,7 +1993,8 @@ func (a *MonitorApiService) MonitorPutMonitorExecute(r ApiMonitorPutMonitorReque newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -2030,7 +2003,7 @@ func (a *MonitorApiService) MonitorPutMonitorExecute(r ApiMonitorPutMonitorReque } type ApiMonitorUpdateMaintenancePeriodForMonitorRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorApiService monitorGuid string maintenancePeriodId int32 @@ -2042,19 +2015,19 @@ func (r ApiMonitorUpdateMaintenancePeriodForMonitorRequest) MaintenancePeriod(ma return r } -func (r ApiMonitorUpdateMaintenancePeriodForMonitorRequest) Execute() (*_nethttp.Response, error) { +func (r ApiMonitorUpdateMaintenancePeriodForMonitorRequest) Execute() (*http.Response, error) { return r.ApiService.MonitorUpdateMaintenancePeriodForMonitorExecute(r) } /* MonitorUpdateMaintenancePeriodForMonitor Updates the specified maintenance schedule for the specified monitor - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGuid @param maintenancePeriodId @return ApiMonitorUpdateMaintenancePeriodForMonitorRequest */ -func (a *MonitorApiService) MonitorUpdateMaintenancePeriodForMonitor(ctx _context.Context, monitorGuid string, maintenancePeriodId int32) ApiMonitorUpdateMaintenancePeriodForMonitorRequest { +func (a *MonitorApiService) MonitorUpdateMaintenancePeriodForMonitor(ctx context.Context, monitorGuid string, maintenancePeriodId int32) ApiMonitorUpdateMaintenancePeriodForMonitorRequest { return ApiMonitorUpdateMaintenancePeriodForMonitorRequest{ ApiService: a, ctx: ctx, @@ -2064,30 +2037,25 @@ func (a *MonitorApiService) MonitorUpdateMaintenancePeriodForMonitor(ctx _contex } // Execute executes the request -func (a *MonitorApiService) MonitorUpdateMaintenancePeriodForMonitorExecute(r ApiMonitorUpdateMaintenancePeriodForMonitorRequest) (*_nethttp.Response, error) { +func (a *MonitorApiService) MonitorUpdateMaintenancePeriodForMonitorExecute(r ApiMonitorUpdateMaintenancePeriodForMonitorRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorApiService.MonitorUpdateMaintenancePeriodForMonitor") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Monitor/{monitorGuid}/MaintenancePeriod/{maintenancePeriodId}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"maintenancePeriodId"+"}", _neturl.PathEscape(parameterToString(r.maintenancePeriodId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"maintenancePeriodId"+"}", url.PathEscape(parameterToString(r.maintenancePeriodId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.maintenancePeriod == nil { - return nil, reportError("maintenancePeriod is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -2108,7 +2076,7 @@ func (a *MonitorApiService) MonitorUpdateMaintenancePeriodForMonitorExecute(r Ap } // body params localVarPostBody = r.maintenancePeriod - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -2118,15 +2086,15 @@ func (a *MonitorApiService) MonitorUpdateMaintenancePeriodForMonitorExecute(r Ap return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2137,7 +2105,8 @@ func (a *MonitorApiService) MonitorUpdateMaintenancePeriodForMonitorExecute(r Ap newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -2147,7 +2116,8 @@ func (a *MonitorApiService) MonitorUpdateMaintenancePeriodForMonitorExecute(r Ap newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_monitor_check.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_monitor_check.go index 027de0c9..46006dab 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/api_monitor_check.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_monitor_check.go @@ -12,32 +12,27 @@ package uptrends import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" - "time" ) -// Linger please -var ( - _ _context.Context -) // MonitorCheckApiService MonitorCheckApi service type MonitorCheckApiService service type ApiMonitorCheckGetAccountMonitorChecksRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorCheckApiService errorLevel *string showPartialMeasurements *bool cursor *string sorting *string take *int32 - start *time.Time - end *time.Time + start *interface{} + end *interface{} presetPeriod *string } @@ -46,53 +41,60 @@ func (r ApiMonitorCheckGetAccountMonitorChecksRequest) ErrorLevel(errorLevel str r.errorLevel = &errorLevel return r } + // Show partial measurements from concurrent monitors func (r ApiMonitorCheckGetAccountMonitorChecksRequest) ShowPartialMeasurements(showPartialMeasurements bool) ApiMonitorCheckGetAccountMonitorChecksRequest { r.showPartialMeasurements = &showPartialMeasurements return r } + // A cursor value that should be used for traversing the dataset. func (r ApiMonitorCheckGetAccountMonitorChecksRequest) Cursor(cursor string) ApiMonitorCheckGetAccountMonitorChecksRequest { r.cursor = &cursor return r } + // Sorting direction based on timestamp. func (r ApiMonitorCheckGetAccountMonitorChecksRequest) Sorting(sorting string) ApiMonitorCheckGetAccountMonitorChecksRequest { r.sorting = &sorting return r } + // The number of records to return (Max value = 100) func (r ApiMonitorCheckGetAccountMonitorChecksRequest) Take(take int32) ApiMonitorCheckGetAccountMonitorChecksRequest { r.take = &take return r } + // The start of a custom period (can't be used together with the PresetPeriod parameter) -func (r ApiMonitorCheckGetAccountMonitorChecksRequest) Start(start time.Time) ApiMonitorCheckGetAccountMonitorChecksRequest { +func (r ApiMonitorCheckGetAccountMonitorChecksRequest) Start(start interface{}) ApiMonitorCheckGetAccountMonitorChecksRequest { r.start = &start return r } + // The end of a custom period -func (r ApiMonitorCheckGetAccountMonitorChecksRequest) End(end time.Time) ApiMonitorCheckGetAccountMonitorChecksRequest { +func (r ApiMonitorCheckGetAccountMonitorChecksRequest) End(end interface{}) ApiMonitorCheckGetAccountMonitorChecksRequest { r.end = &end return r } + // The requested time period. func (r ApiMonitorCheckGetAccountMonitorChecksRequest) PresetPeriod(presetPeriod string) ApiMonitorCheckGetAccountMonitorChecksRequest { r.presetPeriod = &presetPeriod return r } -func (r ApiMonitorCheckGetAccountMonitorChecksRequest) Execute() (MonitorCheckResponse, *_nethttp.Response, error) { +func (r ApiMonitorCheckGetAccountMonitorChecksRequest) Execute() (*MonitorCheckResponse, *http.Response, error) { return r.ApiService.MonitorCheckGetAccountMonitorChecksExecute(r) } /* MonitorCheckGetAccountMonitorChecks Returns all monitor check data. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiMonitorCheckGetAccountMonitorChecksRequest */ -func (a *MonitorCheckApiService) MonitorCheckGetAccountMonitorChecks(ctx _context.Context) ApiMonitorCheckGetAccountMonitorChecksRequest { +func (a *MonitorCheckApiService) MonitorCheckGetAccountMonitorChecks(ctx context.Context) ApiMonitorCheckGetAccountMonitorChecksRequest { return ApiMonitorCheckGetAccountMonitorChecksRequest{ ApiService: a, ctx: ctx, @@ -101,26 +103,24 @@ func (a *MonitorCheckApiService) MonitorCheckGetAccountMonitorChecks(ctx _contex // Execute executes the request // @return MonitorCheckResponse -func (a *MonitorCheckApiService) MonitorCheckGetAccountMonitorChecksExecute(r ApiMonitorCheckGetAccountMonitorChecksRequest) (MonitorCheckResponse, *_nethttp.Response, error) { +func (a *MonitorCheckApiService) MonitorCheckGetAccountMonitorChecksExecute(r ApiMonitorCheckGetAccountMonitorChecksRequest) (*MonitorCheckResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MonitorCheckResponse + formFiles []formFile + localVarReturnValue *MonitorCheckResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorCheckApiService.MonitorCheckGetAccountMonitorChecks") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorCheck" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.errorLevel != nil { localVarQueryParams.Add("ErrorLevel", parameterToString(*r.errorLevel, "")) @@ -163,7 +163,7 @@ func (a *MonitorCheckApiService) MonitorCheckGetAccountMonitorChecksExecute(r Ap if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -173,15 +173,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetAccountMonitorChecksExecute(r Ap return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -192,14 +192,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetAccountMonitorChecksExecute(r Ap newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -210,24 +211,23 @@ func (a *MonitorCheckApiService) MonitorCheckGetAccountMonitorChecksExecute(r Ap } type ApiMonitorCheckGetConcurrentMonitorPartialChecksRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorCheckApiService monitorCheckId int64 } - -func (r ApiMonitorCheckGetConcurrentMonitorPartialChecksRequest) Execute() (MonitorCheckResponse, *_nethttp.Response, error) { +func (r ApiMonitorCheckGetConcurrentMonitorPartialChecksRequest) Execute() (*MonitorCheckResponse, *http.Response, error) { return r.ApiService.MonitorCheckGetConcurrentMonitorPartialChecksExecute(r) } /* MonitorCheckGetConcurrentMonitorPartialChecks Gets all partial checks for a concurrent monitor check - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorCheckId The monitor check Id to get the partial checks for. @return ApiMonitorCheckGetConcurrentMonitorPartialChecksRequest */ -func (a *MonitorCheckApiService) MonitorCheckGetConcurrentMonitorPartialChecks(ctx _context.Context, monitorCheckId int64) ApiMonitorCheckGetConcurrentMonitorPartialChecksRequest { +func (a *MonitorCheckApiService) MonitorCheckGetConcurrentMonitorPartialChecks(ctx context.Context, monitorCheckId int64) ApiMonitorCheckGetConcurrentMonitorPartialChecksRequest { return ApiMonitorCheckGetConcurrentMonitorPartialChecksRequest{ ApiService: a, ctx: ctx, @@ -237,27 +237,25 @@ func (a *MonitorCheckApiService) MonitorCheckGetConcurrentMonitorPartialChecks(c // Execute executes the request // @return MonitorCheckResponse -func (a *MonitorCheckApiService) MonitorCheckGetConcurrentMonitorPartialChecksExecute(r ApiMonitorCheckGetConcurrentMonitorPartialChecksRequest) (MonitorCheckResponse, *_nethttp.Response, error) { +func (a *MonitorCheckApiService) MonitorCheckGetConcurrentMonitorPartialChecksExecute(r ApiMonitorCheckGetConcurrentMonitorPartialChecksRequest) (*MonitorCheckResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MonitorCheckResponse + formFiles []formFile + localVarReturnValue *MonitorCheckResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorCheckApiService.MonitorCheckGetConcurrentMonitorPartialChecks") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorCheck/{monitorCheckId}/Concurrent" - localVarPath = strings.Replace(localVarPath, "{"+"monitorCheckId"+"}", _neturl.PathEscape(parameterToString(r.monitorCheckId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorCheckId"+"}", url.PathEscape(parameterToString(r.monitorCheckId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -276,7 +274,7 @@ func (a *MonitorCheckApiService) MonitorCheckGetConcurrentMonitorPartialChecksEx if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -286,15 +284,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetConcurrentMonitorPartialChecksEx return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -305,14 +303,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetConcurrentMonitorPartialChecksEx newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -323,7 +322,7 @@ func (a *MonitorCheckApiService) MonitorCheckGetConcurrentMonitorPartialChecksEx } type ApiMonitorCheckGetConsoleLogInfoRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorCheckApiService monitorCheckId int64 step *int32 @@ -335,18 +334,18 @@ func (r ApiMonitorCheckGetConsoleLogInfoRequest) Step(step int32) ApiMonitorChec return r } -func (r ApiMonitorCheckGetConsoleLogInfoRequest) Execute() (WaterfallResponse, *_nethttp.Response, error) { +func (r ApiMonitorCheckGetConsoleLogInfoRequest) Execute() (*WaterfallResponse, *http.Response, error) { return r.ApiService.MonitorCheckGetConsoleLogInfoExecute(r) } /* MonitorCheckGetConsoleLogInfo Returns console log information for a monitor check. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorCheckId The monitor check Id to get the detailed data for. @return ApiMonitorCheckGetConsoleLogInfoRequest */ -func (a *MonitorCheckApiService) MonitorCheckGetConsoleLogInfo(ctx _context.Context, monitorCheckId int64) ApiMonitorCheckGetConsoleLogInfoRequest { +func (a *MonitorCheckApiService) MonitorCheckGetConsoleLogInfo(ctx context.Context, monitorCheckId int64) ApiMonitorCheckGetConsoleLogInfoRequest { return ApiMonitorCheckGetConsoleLogInfoRequest{ ApiService: a, ctx: ctx, @@ -356,27 +355,25 @@ func (a *MonitorCheckApiService) MonitorCheckGetConsoleLogInfo(ctx _context.Cont // Execute executes the request // @return WaterfallResponse -func (a *MonitorCheckApiService) MonitorCheckGetConsoleLogInfoExecute(r ApiMonitorCheckGetConsoleLogInfoRequest) (WaterfallResponse, *_nethttp.Response, error) { +func (a *MonitorCheckApiService) MonitorCheckGetConsoleLogInfoExecute(r ApiMonitorCheckGetConsoleLogInfoRequest) (*WaterfallResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue WaterfallResponse + formFiles []formFile + localVarReturnValue *WaterfallResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorCheckApiService.MonitorCheckGetConsoleLogInfo") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorCheck/{monitorCheckId}/ConsoleLog" - localVarPath = strings.Replace(localVarPath, "{"+"monitorCheckId"+"}", _neturl.PathEscape(parameterToString(r.monitorCheckId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorCheckId"+"}", url.PathEscape(parameterToString(r.monitorCheckId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.step != nil { localVarQueryParams.Add("step", parameterToString(*r.step, "")) @@ -398,7 +395,7 @@ func (a *MonitorCheckApiService) MonitorCheckGetConsoleLogInfoExecute(r ApiMonit if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -408,15 +405,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetConsoleLogInfoExecute(r ApiMonit return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -427,14 +424,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetConsoleLogInfoExecute(r ApiMonit newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -445,24 +443,23 @@ func (a *MonitorCheckApiService) MonitorCheckGetConsoleLogInfoExecute(r ApiMonit } type ApiMonitorCheckGetHttpDetailsRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorCheckApiService monitorCheckId int64 } - -func (r ApiMonitorCheckGetHttpDetailsRequest) Execute() (HttpDetailsResponse, *_nethttp.Response, error) { +func (r ApiMonitorCheckGetHttpDetailsRequest) Execute() (*HttpDetailsResponse, *http.Response, error) { return r.ApiService.MonitorCheckGetHttpDetailsExecute(r) } /* MonitorCheckGetHttpDetails Returns HTTP details for a monitor check. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorCheckId The monitor check Id to get the detailed data for. @return ApiMonitorCheckGetHttpDetailsRequest */ -func (a *MonitorCheckApiService) MonitorCheckGetHttpDetails(ctx _context.Context, monitorCheckId int64) ApiMonitorCheckGetHttpDetailsRequest { +func (a *MonitorCheckApiService) MonitorCheckGetHttpDetails(ctx context.Context, monitorCheckId int64) ApiMonitorCheckGetHttpDetailsRequest { return ApiMonitorCheckGetHttpDetailsRequest{ ApiService: a, ctx: ctx, @@ -472,27 +469,25 @@ func (a *MonitorCheckApiService) MonitorCheckGetHttpDetails(ctx _context.Context // Execute executes the request // @return HttpDetailsResponse -func (a *MonitorCheckApiService) MonitorCheckGetHttpDetailsExecute(r ApiMonitorCheckGetHttpDetailsRequest) (HttpDetailsResponse, *_nethttp.Response, error) { +func (a *MonitorCheckApiService) MonitorCheckGetHttpDetailsExecute(r ApiMonitorCheckGetHttpDetailsRequest) (*HttpDetailsResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue HttpDetailsResponse + formFiles []formFile + localVarReturnValue *HttpDetailsResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorCheckApiService.MonitorCheckGetHttpDetails") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorCheck/{monitorCheckId}/Http" - localVarPath = strings.Replace(localVarPath, "{"+"monitorCheckId"+"}", _neturl.PathEscape(parameterToString(r.monitorCheckId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorCheckId"+"}", url.PathEscape(parameterToString(r.monitorCheckId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -511,7 +506,7 @@ func (a *MonitorCheckApiService) MonitorCheckGetHttpDetailsExecute(r ApiMonitorC if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -521,15 +516,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetHttpDetailsExecute(r ApiMonitorC return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -540,14 +535,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetHttpDetailsExecute(r ApiMonitorC newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -558,7 +554,7 @@ func (a *MonitorCheckApiService) MonitorCheckGetHttpDetailsExecute(r ApiMonitorC } type ApiMonitorCheckGetMonitorCheckRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorCheckApiService monitorGuid string errorLevel *string @@ -566,8 +562,8 @@ type ApiMonitorCheckGetMonitorCheckRequest struct { cursor *string sorting *string take *int32 - start *time.Time - end *time.Time + start *interface{} + end *interface{} presetPeriod *string } @@ -576,54 +572,61 @@ func (r ApiMonitorCheckGetMonitorCheckRequest) ErrorLevel(errorLevel string) Api r.errorLevel = &errorLevel return r } + // Show partial measurements from concurrent monitors func (r ApiMonitorCheckGetMonitorCheckRequest) ShowPartialMeasurements(showPartialMeasurements bool) ApiMonitorCheckGetMonitorCheckRequest { r.showPartialMeasurements = &showPartialMeasurements return r } + // A cursor value that should be used for traversing the dataset. func (r ApiMonitorCheckGetMonitorCheckRequest) Cursor(cursor string) ApiMonitorCheckGetMonitorCheckRequest { r.cursor = &cursor return r } + // Sorting direction based on timestamp. func (r ApiMonitorCheckGetMonitorCheckRequest) Sorting(sorting string) ApiMonitorCheckGetMonitorCheckRequest { r.sorting = &sorting return r } + // The number of records to return (Max value = 100) func (r ApiMonitorCheckGetMonitorCheckRequest) Take(take int32) ApiMonitorCheckGetMonitorCheckRequest { r.take = &take return r } + // The start of a custom period (can't be used together with the PresetPeriod parameter) -func (r ApiMonitorCheckGetMonitorCheckRequest) Start(start time.Time) ApiMonitorCheckGetMonitorCheckRequest { +func (r ApiMonitorCheckGetMonitorCheckRequest) Start(start interface{}) ApiMonitorCheckGetMonitorCheckRequest { r.start = &start return r } + // The end of a custom period -func (r ApiMonitorCheckGetMonitorCheckRequest) End(end time.Time) ApiMonitorCheckGetMonitorCheckRequest { +func (r ApiMonitorCheckGetMonitorCheckRequest) End(end interface{}) ApiMonitorCheckGetMonitorCheckRequest { r.end = &end return r } + // The requested time period. func (r ApiMonitorCheckGetMonitorCheckRequest) PresetPeriod(presetPeriod string) ApiMonitorCheckGetMonitorCheckRequest { r.presetPeriod = &presetPeriod return r } -func (r ApiMonitorCheckGetMonitorCheckRequest) Execute() (MonitorCheckResponse, *_nethttp.Response, error) { +func (r ApiMonitorCheckGetMonitorCheckRequest) Execute() (*MonitorCheckResponse, *http.Response, error) { return r.ApiService.MonitorCheckGetMonitorCheckExecute(r) } /* MonitorCheckGetMonitorCheck Returns monitor check data for a specific monitor. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGuid The Guid of the monitor to get monitor checks for. @return ApiMonitorCheckGetMonitorCheckRequest */ -func (a *MonitorCheckApiService) MonitorCheckGetMonitorCheck(ctx _context.Context, monitorGuid string) ApiMonitorCheckGetMonitorCheckRequest { +func (a *MonitorCheckApiService) MonitorCheckGetMonitorCheck(ctx context.Context, monitorGuid string) ApiMonitorCheckGetMonitorCheckRequest { return ApiMonitorCheckGetMonitorCheckRequest{ ApiService: a, ctx: ctx, @@ -633,27 +636,25 @@ func (a *MonitorCheckApiService) MonitorCheckGetMonitorCheck(ctx _context.Contex // Execute executes the request // @return MonitorCheckResponse -func (a *MonitorCheckApiService) MonitorCheckGetMonitorCheckExecute(r ApiMonitorCheckGetMonitorCheckRequest) (MonitorCheckResponse, *_nethttp.Response, error) { +func (a *MonitorCheckApiService) MonitorCheckGetMonitorCheckExecute(r ApiMonitorCheckGetMonitorCheckRequest) (*MonitorCheckResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MonitorCheckResponse + formFiles []formFile + localVarReturnValue *MonitorCheckResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorCheckApiService.MonitorCheckGetMonitorCheck") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorCheck/Monitor/{monitorGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.errorLevel != nil { localVarQueryParams.Add("ErrorLevel", parameterToString(*r.errorLevel, "")) @@ -696,7 +697,7 @@ func (a *MonitorCheckApiService) MonitorCheckGetMonitorCheckExecute(r ApiMonitor if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -706,15 +707,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetMonitorCheckExecute(r ApiMonitor return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -725,14 +726,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetMonitorCheckExecute(r ApiMonitor newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -743,7 +745,7 @@ func (a *MonitorCheckApiService) MonitorCheckGetMonitorCheckExecute(r ApiMonitor } type ApiMonitorCheckGetMonitorGroupDataRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorCheckApiService monitorGroupGuid string errorLevel *string @@ -751,8 +753,8 @@ type ApiMonitorCheckGetMonitorGroupDataRequest struct { cursor *string sorting *string take *int32 - start *time.Time - end *time.Time + start *interface{} + end *interface{} presetPeriod *string } @@ -761,54 +763,61 @@ func (r ApiMonitorCheckGetMonitorGroupDataRequest) ErrorLevel(errorLevel string) r.errorLevel = &errorLevel return r } + // Show partial measurements from concurrent monitors func (r ApiMonitorCheckGetMonitorGroupDataRequest) ShowPartialMeasurements(showPartialMeasurements bool) ApiMonitorCheckGetMonitorGroupDataRequest { r.showPartialMeasurements = &showPartialMeasurements return r } + // A cursor value that should be used for traversing the dataset. func (r ApiMonitorCheckGetMonitorGroupDataRequest) Cursor(cursor string) ApiMonitorCheckGetMonitorGroupDataRequest { r.cursor = &cursor return r } + // Sorting direction based on timestamp. func (r ApiMonitorCheckGetMonitorGroupDataRequest) Sorting(sorting string) ApiMonitorCheckGetMonitorGroupDataRequest { r.sorting = &sorting return r } + // The number of records to return (Max value = 100) func (r ApiMonitorCheckGetMonitorGroupDataRequest) Take(take int32) ApiMonitorCheckGetMonitorGroupDataRequest { r.take = &take return r } + // The start of a custom period (can't be used together with the PresetPeriod parameter) -func (r ApiMonitorCheckGetMonitorGroupDataRequest) Start(start time.Time) ApiMonitorCheckGetMonitorGroupDataRequest { +func (r ApiMonitorCheckGetMonitorGroupDataRequest) Start(start interface{}) ApiMonitorCheckGetMonitorGroupDataRequest { r.start = &start return r } + // The end of a custom period -func (r ApiMonitorCheckGetMonitorGroupDataRequest) End(end time.Time) ApiMonitorCheckGetMonitorGroupDataRequest { +func (r ApiMonitorCheckGetMonitorGroupDataRequest) End(end interface{}) ApiMonitorCheckGetMonitorGroupDataRequest { r.end = &end return r } + // The requested time period. func (r ApiMonitorCheckGetMonitorGroupDataRequest) PresetPeriod(presetPeriod string) ApiMonitorCheckGetMonitorGroupDataRequest { r.presetPeriod = &presetPeriod return r } -func (r ApiMonitorCheckGetMonitorGroupDataRequest) Execute() (MonitorCheckResponse, *_nethttp.Response, error) { +func (r ApiMonitorCheckGetMonitorGroupDataRequest) Execute() (*MonitorCheckResponse, *http.Response, error) { return r.ApiService.MonitorCheckGetMonitorGroupDataExecute(r) } /* MonitorCheckGetMonitorGroupData Returns monitor check data for a specific monitor group. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGroupGuid The Guid of the monitor group to get monitor checks for. @return ApiMonitorCheckGetMonitorGroupDataRequest */ -func (a *MonitorCheckApiService) MonitorCheckGetMonitorGroupData(ctx _context.Context, monitorGroupGuid string) ApiMonitorCheckGetMonitorGroupDataRequest { +func (a *MonitorCheckApiService) MonitorCheckGetMonitorGroupData(ctx context.Context, monitorGroupGuid string) ApiMonitorCheckGetMonitorGroupDataRequest { return ApiMonitorCheckGetMonitorGroupDataRequest{ ApiService: a, ctx: ctx, @@ -818,27 +827,25 @@ func (a *MonitorCheckApiService) MonitorCheckGetMonitorGroupData(ctx _context.Co // Execute executes the request // @return MonitorCheckResponse -func (a *MonitorCheckApiService) MonitorCheckGetMonitorGroupDataExecute(r ApiMonitorCheckGetMonitorGroupDataRequest) (MonitorCheckResponse, *_nethttp.Response, error) { +func (a *MonitorCheckApiService) MonitorCheckGetMonitorGroupDataExecute(r ApiMonitorCheckGetMonitorGroupDataRequest) (*MonitorCheckResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MonitorCheckResponse + formFiles []formFile + localVarReturnValue *MonitorCheckResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorCheckApiService.MonitorCheckGetMonitorGroupData") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorCheck/MonitorGroup/{monitorGroupGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.errorLevel != nil { localVarQueryParams.Add("ErrorLevel", parameterToString(*r.errorLevel, "")) @@ -881,7 +888,7 @@ func (a *MonitorCheckApiService) MonitorCheckGetMonitorGroupDataExecute(r ApiMon if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -891,15 +898,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetMonitorGroupDataExecute(r ApiMon return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -910,14 +917,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetMonitorGroupDataExecute(r ApiMon newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -928,24 +936,23 @@ func (a *MonitorCheckApiService) MonitorCheckGetMonitorGroupDataExecute(r ApiMon } type ApiMonitorCheckGetMultistepDetailsRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorCheckApiService monitorCheckId int64 } - -func (r ApiMonitorCheckGetMultistepDetailsRequest) Execute() (MsaDetailsResponse, *_nethttp.Response, error) { +func (r ApiMonitorCheckGetMultistepDetailsRequest) Execute() (*MsaDetailsResponse, *http.Response, error) { return r.ApiService.MonitorCheckGetMultistepDetailsExecute(r) } /* MonitorCheckGetMultistepDetails Returns Multi-Step API details for a monitor check. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorCheckId The monitor check Id to get the detailed data for. @return ApiMonitorCheckGetMultistepDetailsRequest */ -func (a *MonitorCheckApiService) MonitorCheckGetMultistepDetails(ctx _context.Context, monitorCheckId int64) ApiMonitorCheckGetMultistepDetailsRequest { +func (a *MonitorCheckApiService) MonitorCheckGetMultistepDetails(ctx context.Context, monitorCheckId int64) ApiMonitorCheckGetMultistepDetailsRequest { return ApiMonitorCheckGetMultistepDetailsRequest{ ApiService: a, ctx: ctx, @@ -955,27 +962,25 @@ func (a *MonitorCheckApiService) MonitorCheckGetMultistepDetails(ctx _context.Co // Execute executes the request // @return MsaDetailsResponse -func (a *MonitorCheckApiService) MonitorCheckGetMultistepDetailsExecute(r ApiMonitorCheckGetMultistepDetailsRequest) (MsaDetailsResponse, *_nethttp.Response, error) { +func (a *MonitorCheckApiService) MonitorCheckGetMultistepDetailsExecute(r ApiMonitorCheckGetMultistepDetailsRequest) (*MsaDetailsResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MsaDetailsResponse + formFiles []formFile + localVarReturnValue *MsaDetailsResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorCheckApiService.MonitorCheckGetMultistepDetails") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorCheck/{monitorCheckId}/MultiStepAPI" - localVarPath = strings.Replace(localVarPath, "{"+"monitorCheckId"+"}", _neturl.PathEscape(parameterToString(r.monitorCheckId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorCheckId"+"}", url.PathEscape(parameterToString(r.monitorCheckId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -994,7 +999,7 @@ func (a *MonitorCheckApiService) MonitorCheckGetMultistepDetailsExecute(r ApiMon if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1004,15 +1009,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetMultistepDetailsExecute(r ApiMon return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1023,14 +1028,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetMultistepDetailsExecute(r ApiMon newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1041,7 +1047,7 @@ func (a *MonitorCheckApiService) MonitorCheckGetMultistepDetailsExecute(r ApiMon } type ApiMonitorCheckGetPageSourceInfoRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorCheckApiService monitorCheckId int64 step *int32 @@ -1053,18 +1059,18 @@ func (r ApiMonitorCheckGetPageSourceInfoRequest) Step(step int32) ApiMonitorChec return r } -func (r ApiMonitorCheckGetPageSourceInfoRequest) Execute() (WaterfallResponse, *_nethttp.Response, error) { +func (r ApiMonitorCheckGetPageSourceInfoRequest) Execute() (*WaterfallResponse, *http.Response, error) { return r.ApiService.MonitorCheckGetPageSourceInfoExecute(r) } /* MonitorCheckGetPageSourceInfo Returns page source information for a monitor check. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorCheckId The monitor check Id to get the detailed data for. @return ApiMonitorCheckGetPageSourceInfoRequest */ -func (a *MonitorCheckApiService) MonitorCheckGetPageSourceInfo(ctx _context.Context, monitorCheckId int64) ApiMonitorCheckGetPageSourceInfoRequest { +func (a *MonitorCheckApiService) MonitorCheckGetPageSourceInfo(ctx context.Context, monitorCheckId int64) ApiMonitorCheckGetPageSourceInfoRequest { return ApiMonitorCheckGetPageSourceInfoRequest{ ApiService: a, ctx: ctx, @@ -1074,27 +1080,25 @@ func (a *MonitorCheckApiService) MonitorCheckGetPageSourceInfo(ctx _context.Cont // Execute executes the request // @return WaterfallResponse -func (a *MonitorCheckApiService) MonitorCheckGetPageSourceInfoExecute(r ApiMonitorCheckGetPageSourceInfoRequest) (WaterfallResponse, *_nethttp.Response, error) { +func (a *MonitorCheckApiService) MonitorCheckGetPageSourceInfoExecute(r ApiMonitorCheckGetPageSourceInfoRequest) (*WaterfallResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue WaterfallResponse + formFiles []formFile + localVarReturnValue *WaterfallResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorCheckApiService.MonitorCheckGetPageSourceInfo") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorCheck/{monitorCheckId}/PageSource" - localVarPath = strings.Replace(localVarPath, "{"+"monitorCheckId"+"}", _neturl.PathEscape(parameterToString(r.monitorCheckId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorCheckId"+"}", url.PathEscape(parameterToString(r.monitorCheckId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.step != nil { localVarQueryParams.Add("step", parameterToString(*r.step, "")) @@ -1116,7 +1120,7 @@ func (a *MonitorCheckApiService) MonitorCheckGetPageSourceInfoExecute(r ApiMonit if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1126,15 +1130,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetPageSourceInfoExecute(r ApiMonit return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1145,14 +1149,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetPageSourceInfoExecute(r ApiMonit newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1163,26 +1168,25 @@ func (a *MonitorCheckApiService) MonitorCheckGetPageSourceInfoExecute(r ApiMonit } type ApiMonitorCheckGetScreenshotsRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorCheckApiService monitorCheckId int64 screenshotId string } - -func (r ApiMonitorCheckGetScreenshotsRequest) Execute() (ScreenshotResponse, *_nethttp.Response, error) { +func (r ApiMonitorCheckGetScreenshotsRequest) Execute() (*ScreenshotResponse, *http.Response, error) { return r.ApiService.MonitorCheckGetScreenshotsExecute(r) } /* MonitorCheckGetScreenshots Gets a specific screenshot for a specified monitor check - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorCheckId The monitor check Id to get the screenshot data for. @param screenshotId The screenshot Id of the screenshot to get. @return ApiMonitorCheckGetScreenshotsRequest */ -func (a *MonitorCheckApiService) MonitorCheckGetScreenshots(ctx _context.Context, monitorCheckId int64, screenshotId string) ApiMonitorCheckGetScreenshotsRequest { +func (a *MonitorCheckApiService) MonitorCheckGetScreenshots(ctx context.Context, monitorCheckId int64, screenshotId string) ApiMonitorCheckGetScreenshotsRequest { return ApiMonitorCheckGetScreenshotsRequest{ ApiService: a, ctx: ctx, @@ -1193,28 +1197,26 @@ func (a *MonitorCheckApiService) MonitorCheckGetScreenshots(ctx _context.Context // Execute executes the request // @return ScreenshotResponse -func (a *MonitorCheckApiService) MonitorCheckGetScreenshotsExecute(r ApiMonitorCheckGetScreenshotsRequest) (ScreenshotResponse, *_nethttp.Response, error) { +func (a *MonitorCheckApiService) MonitorCheckGetScreenshotsExecute(r ApiMonitorCheckGetScreenshotsRequest) (*ScreenshotResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ScreenshotResponse + formFiles []formFile + localVarReturnValue *ScreenshotResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorCheckApiService.MonitorCheckGetScreenshots") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorCheck/{monitorCheckId}/Screenshot/{screenshotId}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorCheckId"+"}", _neturl.PathEscape(parameterToString(r.monitorCheckId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"screenshotId"+"}", _neturl.PathEscape(parameterToString(r.screenshotId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorCheckId"+"}", url.PathEscape(parameterToString(r.monitorCheckId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"screenshotId"+"}", url.PathEscape(parameterToString(r.screenshotId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1233,7 +1235,7 @@ func (a *MonitorCheckApiService) MonitorCheckGetScreenshotsExecute(r ApiMonitorC if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1243,15 +1245,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetScreenshotsExecute(r ApiMonitorC return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1262,14 +1264,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetScreenshotsExecute(r ApiMonitorC newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1280,24 +1283,23 @@ func (a *MonitorCheckApiService) MonitorCheckGetScreenshotsExecute(r ApiMonitorC } type ApiMonitorCheckGetSingleMonitorCheckRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorCheckApiService monitorCheckId int64 } - -func (r ApiMonitorCheckGetSingleMonitorCheckRequest) Execute() (SingleMonitorCheckResponse, *_nethttp.Response, error) { +func (r ApiMonitorCheckGetSingleMonitorCheckRequest) Execute() (*SingleMonitorCheckResponse, *http.Response, error) { return r.ApiService.MonitorCheckGetSingleMonitorCheckExecute(r) } /* MonitorCheckGetSingleMonitorCheck Returns a single monitor check. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorCheckId The Id of the monitor check to get the data for. @return ApiMonitorCheckGetSingleMonitorCheckRequest */ -func (a *MonitorCheckApiService) MonitorCheckGetSingleMonitorCheck(ctx _context.Context, monitorCheckId int64) ApiMonitorCheckGetSingleMonitorCheckRequest { +func (a *MonitorCheckApiService) MonitorCheckGetSingleMonitorCheck(ctx context.Context, monitorCheckId int64) ApiMonitorCheckGetSingleMonitorCheckRequest { return ApiMonitorCheckGetSingleMonitorCheckRequest{ ApiService: a, ctx: ctx, @@ -1307,27 +1309,25 @@ func (a *MonitorCheckApiService) MonitorCheckGetSingleMonitorCheck(ctx _context. // Execute executes the request // @return SingleMonitorCheckResponse -func (a *MonitorCheckApiService) MonitorCheckGetSingleMonitorCheckExecute(r ApiMonitorCheckGetSingleMonitorCheckRequest) (SingleMonitorCheckResponse, *_nethttp.Response, error) { +func (a *MonitorCheckApiService) MonitorCheckGetSingleMonitorCheckExecute(r ApiMonitorCheckGetSingleMonitorCheckRequest) (*SingleMonitorCheckResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue SingleMonitorCheckResponse + formFiles []formFile + localVarReturnValue *SingleMonitorCheckResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorCheckApiService.MonitorCheckGetSingleMonitorCheck") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorCheck/{monitorCheckId}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorCheckId"+"}", _neturl.PathEscape(parameterToString(r.monitorCheckId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorCheckId"+"}", url.PathEscape(parameterToString(r.monitorCheckId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1346,7 +1346,7 @@ func (a *MonitorCheckApiService) MonitorCheckGetSingleMonitorCheckExecute(r ApiM if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1356,15 +1356,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetSingleMonitorCheckExecute(r ApiM return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1375,14 +1375,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetSingleMonitorCheckExecute(r ApiM newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1393,24 +1394,23 @@ func (a *MonitorCheckApiService) MonitorCheckGetSingleMonitorCheckExecute(r ApiM } type ApiMonitorCheckGetTransactionDetailsRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorCheckApiService monitorCheckId int64 } - -func (r ApiMonitorCheckGetTransactionDetailsRequest) Execute() (TransactionDetailsResponse, *_nethttp.Response, error) { +func (r ApiMonitorCheckGetTransactionDetailsRequest) Execute() (*TransactionDetailsResponse, *http.Response, error) { return r.ApiService.MonitorCheckGetTransactionDetailsExecute(r) } /* MonitorCheckGetTransactionDetails Returns transaction step details for a monitor check. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorCheckId The monitor check Id to get the detailed data for. @return ApiMonitorCheckGetTransactionDetailsRequest */ -func (a *MonitorCheckApiService) MonitorCheckGetTransactionDetails(ctx _context.Context, monitorCheckId int64) ApiMonitorCheckGetTransactionDetailsRequest { +func (a *MonitorCheckApiService) MonitorCheckGetTransactionDetails(ctx context.Context, monitorCheckId int64) ApiMonitorCheckGetTransactionDetailsRequest { return ApiMonitorCheckGetTransactionDetailsRequest{ ApiService: a, ctx: ctx, @@ -1420,27 +1420,25 @@ func (a *MonitorCheckApiService) MonitorCheckGetTransactionDetails(ctx _context. // Execute executes the request // @return TransactionDetailsResponse -func (a *MonitorCheckApiService) MonitorCheckGetTransactionDetailsExecute(r ApiMonitorCheckGetTransactionDetailsRequest) (TransactionDetailsResponse, *_nethttp.Response, error) { +func (a *MonitorCheckApiService) MonitorCheckGetTransactionDetailsExecute(r ApiMonitorCheckGetTransactionDetailsRequest) (*TransactionDetailsResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue TransactionDetailsResponse + formFiles []formFile + localVarReturnValue *TransactionDetailsResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorCheckApiService.MonitorCheckGetTransactionDetails") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorCheck/{monitorCheckId}/Transaction" - localVarPath = strings.Replace(localVarPath, "{"+"monitorCheckId"+"}", _neturl.PathEscape(parameterToString(r.monitorCheckId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorCheckId"+"}", url.PathEscape(parameterToString(r.monitorCheckId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1459,7 +1457,7 @@ func (a *MonitorCheckApiService) MonitorCheckGetTransactionDetailsExecute(r ApiM if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1469,15 +1467,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetTransactionDetailsExecute(r ApiM return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1488,14 +1486,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetTransactionDetailsExecute(r ApiM newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1506,7 +1505,7 @@ func (a *MonitorCheckApiService) MonitorCheckGetTransactionDetailsExecute(r ApiM } type ApiMonitorCheckGetWaterfallInfoRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorCheckApiService monitorCheckId int64 step *int32 @@ -1518,18 +1517,18 @@ func (r ApiMonitorCheckGetWaterfallInfoRequest) Step(step int32) ApiMonitorCheck return r } -func (r ApiMonitorCheckGetWaterfallInfoRequest) Execute() (WaterfallResponse, *_nethttp.Response, error) { +func (r ApiMonitorCheckGetWaterfallInfoRequest) Execute() (*WaterfallResponse, *http.Response, error) { return r.ApiService.MonitorCheckGetWaterfallInfoExecute(r) } /* MonitorCheckGetWaterfallInfo Returns waterfall information for a monitor check. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorCheckId The monitor check Id to get the detailed data for. @return ApiMonitorCheckGetWaterfallInfoRequest */ -func (a *MonitorCheckApiService) MonitorCheckGetWaterfallInfo(ctx _context.Context, monitorCheckId int64) ApiMonitorCheckGetWaterfallInfoRequest { +func (a *MonitorCheckApiService) MonitorCheckGetWaterfallInfo(ctx context.Context, monitorCheckId int64) ApiMonitorCheckGetWaterfallInfoRequest { return ApiMonitorCheckGetWaterfallInfoRequest{ ApiService: a, ctx: ctx, @@ -1539,27 +1538,25 @@ func (a *MonitorCheckApiService) MonitorCheckGetWaterfallInfo(ctx _context.Conte // Execute executes the request // @return WaterfallResponse -func (a *MonitorCheckApiService) MonitorCheckGetWaterfallInfoExecute(r ApiMonitorCheckGetWaterfallInfoRequest) (WaterfallResponse, *_nethttp.Response, error) { +func (a *MonitorCheckApiService) MonitorCheckGetWaterfallInfoExecute(r ApiMonitorCheckGetWaterfallInfoRequest) (*WaterfallResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue WaterfallResponse + formFiles []formFile + localVarReturnValue *WaterfallResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorCheckApiService.MonitorCheckGetWaterfallInfo") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorCheck/{monitorCheckId}/Waterfall" - localVarPath = strings.Replace(localVarPath, "{"+"monitorCheckId"+"}", _neturl.PathEscape(parameterToString(r.monitorCheckId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorCheckId"+"}", url.PathEscape(parameterToString(r.monitorCheckId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.step != nil { localVarQueryParams.Add("step", parameterToString(*r.step, "")) @@ -1581,7 +1578,7 @@ func (a *MonitorCheckApiService) MonitorCheckGetWaterfallInfoExecute(r ApiMonito if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1591,15 +1588,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetWaterfallInfoExecute(r ApiMonito return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1610,14 +1607,15 @@ func (a *MonitorCheckApiService) MonitorCheckGetWaterfallInfoExecute(r ApiMonito newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_monitor_group.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_monitor_group.go index d6c35257..0195e1ee 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/api_monitor_group.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_monitor_group.go @@ -12,23 +12,19 @@ package uptrends import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // MonitorGroupApiService MonitorGroupApi service type MonitorGroupApiService service type ApiMonitorGroupAddMaintenancePeriodToAllMembersRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorGroupApiService monitorGroupGuid string maintenancePeriod *MaintenancePeriod @@ -39,18 +35,18 @@ func (r ApiMonitorGroupAddMaintenancePeriodToAllMembersRequest) MaintenancePerio return r } -func (r ApiMonitorGroupAddMaintenancePeriodToAllMembersRequest) Execute() (*_nethttp.Response, error) { +func (r ApiMonitorGroupAddMaintenancePeriodToAllMembersRequest) Execute() (*http.Response, error) { return r.ApiService.MonitorGroupAddMaintenancePeriodToAllMembersExecute(r) } /* -MonitorGroupAddMaintenancePeriodToAllMembers Adds the provided maintenance period to all monitors in the group specified +MonitorGroupAddMaintenancePeriodToAllMembers Adds the provided maintenance period to all monitors in the group specified - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGroupGuid @return ApiMonitorGroupAddMaintenancePeriodToAllMembersRequest */ -func (a *MonitorGroupApiService) MonitorGroupAddMaintenancePeriodToAllMembers(ctx _context.Context, monitorGroupGuid string) ApiMonitorGroupAddMaintenancePeriodToAllMembersRequest { +func (a *MonitorGroupApiService) MonitorGroupAddMaintenancePeriodToAllMembers(ctx context.Context, monitorGroupGuid string) ApiMonitorGroupAddMaintenancePeriodToAllMembersRequest { return ApiMonitorGroupAddMaintenancePeriodToAllMembersRequest{ ApiService: a, ctx: ctx, @@ -59,29 +55,24 @@ func (a *MonitorGroupApiService) MonitorGroupAddMaintenancePeriodToAllMembers(ct } // Execute executes the request -func (a *MonitorGroupApiService) MonitorGroupAddMaintenancePeriodToAllMembersExecute(r ApiMonitorGroupAddMaintenancePeriodToAllMembersRequest) (*_nethttp.Response, error) { +func (a *MonitorGroupApiService) MonitorGroupAddMaintenancePeriodToAllMembersExecute(r ApiMonitorGroupAddMaintenancePeriodToAllMembersRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorGroupApiService.MonitorGroupAddMaintenancePeriodToAllMembers") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorGroup/{monitorGroupGuid}/AddMaintenancePeriodToAllMembers" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.maintenancePeriod == nil { - return nil, reportError("maintenancePeriod is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -102,7 +93,7 @@ func (a *MonitorGroupApiService) MonitorGroupAddMaintenancePeriodToAllMembersExe } // body params localVarPostBody = r.maintenancePeriod - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -112,15 +103,15 @@ func (a *MonitorGroupApiService) MonitorGroupAddMaintenancePeriodToAllMembersExe return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -131,7 +122,8 @@ func (a *MonitorGroupApiService) MonitorGroupAddMaintenancePeriodToAllMembersExe newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -141,7 +133,8 @@ func (a *MonitorGroupApiService) MonitorGroupAddMaintenancePeriodToAllMembersExe newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -150,26 +143,25 @@ func (a *MonitorGroupApiService) MonitorGroupAddMaintenancePeriodToAllMembersExe } type ApiMonitorGroupAddMonitorToMonitorGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorGroupApiService monitorGroupGuid string monitorGuid string } - -func (r ApiMonitorGroupAddMonitorToMonitorGroupRequest) Execute() (*_nethttp.Response, error) { +func (r ApiMonitorGroupAddMonitorToMonitorGroupRequest) Execute() (*http.Response, error) { return r.ApiService.MonitorGroupAddMonitorToMonitorGroupExecute(r) } /* -MonitorGroupAddMonitorToMonitorGroup Adds the specified monitor to the monitor group +MonitorGroupAddMonitorToMonitorGroup Adds the specified monitor to the monitor group - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGroupGuid The Guid of the monitor group to add the monitor to @param monitorGuid The monitor Guid @return ApiMonitorGroupAddMonitorToMonitorGroupRequest */ -func (a *MonitorGroupApiService) MonitorGroupAddMonitorToMonitorGroup(ctx _context.Context, monitorGroupGuid string, monitorGuid string) ApiMonitorGroupAddMonitorToMonitorGroupRequest { +func (a *MonitorGroupApiService) MonitorGroupAddMonitorToMonitorGroup(ctx context.Context, monitorGroupGuid string, monitorGuid string) ApiMonitorGroupAddMonitorToMonitorGroupRequest { return ApiMonitorGroupAddMonitorToMonitorGroupRequest{ ApiService: a, ctx: ctx, @@ -179,27 +171,25 @@ func (a *MonitorGroupApiService) MonitorGroupAddMonitorToMonitorGroup(ctx _conte } // Execute executes the request -func (a *MonitorGroupApiService) MonitorGroupAddMonitorToMonitorGroupExecute(r ApiMonitorGroupAddMonitorToMonitorGroupRequest) (*_nethttp.Response, error) { +func (a *MonitorGroupApiService) MonitorGroupAddMonitorToMonitorGroupExecute(r ApiMonitorGroupAddMonitorToMonitorGroupRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorGroupApiService.MonitorGroupAddMonitorToMonitorGroup") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorGroup/{monitorGroupGuid}/Member/{monitorGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -218,7 +208,7 @@ func (a *MonitorGroupApiService) MonitorGroupAddMonitorToMonitorGroupExecute(r A if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -228,15 +218,15 @@ func (a *MonitorGroupApiService) MonitorGroupAddMonitorToMonitorGroupExecute(r A return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -247,7 +237,8 @@ func (a *MonitorGroupApiService) MonitorGroupAddMonitorToMonitorGroupExecute(r A newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -257,7 +248,8 @@ func (a *MonitorGroupApiService) MonitorGroupAddMonitorToMonitorGroupExecute(r A newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -266,7 +258,7 @@ func (a *MonitorGroupApiService) MonitorGroupAddMonitorToMonitorGroupExecute(r A } type ApiMonitorGroupCreateAuthorizationForMonitorGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorGroupApiService monitorGroupGuid string monitorGroupAuthorization *MonitorGroupAuthorization @@ -278,18 +270,18 @@ func (r ApiMonitorGroupCreateAuthorizationForMonitorGroupRequest) MonitorGroupAu return r } -func (r ApiMonitorGroupCreateAuthorizationForMonitorGroupRequest) Execute() ([]MonitorGroupAuthorization, *_nethttp.Response, error) { +func (r ApiMonitorGroupCreateAuthorizationForMonitorGroupRequest) Execute() ([]MonitorGroupAuthorization, *http.Response, error) { return r.ApiService.MonitorGroupCreateAuthorizationForMonitorGroupExecute(r) } /* MonitorGroupCreateAuthorizationForMonitorGroup Create monitor authorizations for monitor group If the wanted authorizations requires other authorizations, these will be added as well - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGroupGuid The monitor group GUID @return ApiMonitorGroupCreateAuthorizationForMonitorGroupRequest */ -func (a *MonitorGroupApiService) MonitorGroupCreateAuthorizationForMonitorGroup(ctx _context.Context, monitorGroupGuid string) ApiMonitorGroupCreateAuthorizationForMonitorGroupRequest { +func (a *MonitorGroupApiService) MonitorGroupCreateAuthorizationForMonitorGroup(ctx context.Context, monitorGroupGuid string) ApiMonitorGroupCreateAuthorizationForMonitorGroupRequest { return ApiMonitorGroupCreateAuthorizationForMonitorGroupRequest{ ApiService: a, ctx: ctx, @@ -299,30 +291,25 @@ func (a *MonitorGroupApiService) MonitorGroupCreateAuthorizationForMonitorGroup( // Execute executes the request // @return []MonitorGroupAuthorization -func (a *MonitorGroupApiService) MonitorGroupCreateAuthorizationForMonitorGroupExecute(r ApiMonitorGroupCreateAuthorizationForMonitorGroupRequest) ([]MonitorGroupAuthorization, *_nethttp.Response, error) { +func (a *MonitorGroupApiService) MonitorGroupCreateAuthorizationForMonitorGroupExecute(r ApiMonitorGroupCreateAuthorizationForMonitorGroupRequest) ([]MonitorGroupAuthorization, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []MonitorGroupAuthorization ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorGroupApiService.MonitorGroupCreateAuthorizationForMonitorGroup") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorGroup/{monitorGroupGuid}/Authorizations" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.monitorGroupAuthorization == nil { - return localVarReturnValue, nil, reportError("monitorGroupAuthorization is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -343,7 +330,7 @@ func (a *MonitorGroupApiService) MonitorGroupCreateAuthorizationForMonitorGroupE } // body params localVarPostBody = r.monitorGroupAuthorization - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -353,15 +340,15 @@ func (a *MonitorGroupApiService) MonitorGroupCreateAuthorizationForMonitorGroupE return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -372,7 +359,8 @@ func (a *MonitorGroupApiService) MonitorGroupCreateAuthorizationForMonitorGroupE newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -382,14 +370,15 @@ func (a *MonitorGroupApiService) MonitorGroupCreateAuthorizationForMonitorGroupE newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -400,7 +389,7 @@ func (a *MonitorGroupApiService) MonitorGroupCreateAuthorizationForMonitorGroupE } type ApiMonitorGroupCreateMonitorGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorGroupApiService monitorGroup *MonitorGroup } @@ -411,17 +400,17 @@ func (r ApiMonitorGroupCreateMonitorGroupRequest) MonitorGroup(monitorGroup Moni return r } -func (r ApiMonitorGroupCreateMonitorGroupRequest) Execute() (MonitorGroup, *_nethttp.Response, error) { +func (r ApiMonitorGroupCreateMonitorGroupRequest) Execute() (*MonitorGroup, *http.Response, error) { return r.ApiService.MonitorGroupCreateMonitorGroupExecute(r) } /* MonitorGroupCreateMonitorGroup Creates a new monitor group - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiMonitorGroupCreateMonitorGroupRequest */ -func (a *MonitorGroupApiService) MonitorGroupCreateMonitorGroup(ctx _context.Context) ApiMonitorGroupCreateMonitorGroupRequest { +func (a *MonitorGroupApiService) MonitorGroupCreateMonitorGroup(ctx context.Context) ApiMonitorGroupCreateMonitorGroupRequest { return ApiMonitorGroupCreateMonitorGroupRequest{ ApiService: a, ctx: ctx, @@ -430,29 +419,24 @@ func (a *MonitorGroupApiService) MonitorGroupCreateMonitorGroup(ctx _context.Con // Execute executes the request // @return MonitorGroup -func (a *MonitorGroupApiService) MonitorGroupCreateMonitorGroupExecute(r ApiMonitorGroupCreateMonitorGroupRequest) (MonitorGroup, *_nethttp.Response, error) { +func (a *MonitorGroupApiService) MonitorGroupCreateMonitorGroupExecute(r ApiMonitorGroupCreateMonitorGroupRequest) (*MonitorGroup, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MonitorGroup + formFiles []formFile + localVarReturnValue *MonitorGroup ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorGroupApiService.MonitorGroupCreateMonitorGroup") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorGroup" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.monitorGroup == nil { - return localVarReturnValue, nil, reportError("monitorGroup is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -473,7 +457,7 @@ func (a *MonitorGroupApiService) MonitorGroupCreateMonitorGroupExecute(r ApiMoni } // body params localVarPostBody = r.monitorGroup - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -483,15 +467,15 @@ func (a *MonitorGroupApiService) MonitorGroupCreateMonitorGroupExecute(r ApiMoni return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -502,14 +486,15 @@ func (a *MonitorGroupApiService) MonitorGroupCreateMonitorGroupExecute(r ApiMoni newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -520,26 +505,25 @@ func (a *MonitorGroupApiService) MonitorGroupCreateMonitorGroupExecute(r ApiMoni } type ApiMonitorGroupDeleteAuthorizationForMonitorGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorGroupApiService monitorGroupGuid string authorizationGuid string } - -func (r ApiMonitorGroupDeleteAuthorizationForMonitorGroupRequest) Execute() (*_nethttp.Response, error) { +func (r ApiMonitorGroupDeleteAuthorizationForMonitorGroupRequest) Execute() (*http.Response, error) { return r.ApiService.MonitorGroupDeleteAuthorizationForMonitorGroupExecute(r) } /* MonitorGroupDeleteAuthorizationForMonitorGroup Delete monitor authorization for monitor group - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGroupGuid The monitor group GUID @param authorizationGuid The authorization GUID that needs to be deleted @return ApiMonitorGroupDeleteAuthorizationForMonitorGroupRequest */ -func (a *MonitorGroupApiService) MonitorGroupDeleteAuthorizationForMonitorGroup(ctx _context.Context, monitorGroupGuid string, authorizationGuid string) ApiMonitorGroupDeleteAuthorizationForMonitorGroupRequest { +func (a *MonitorGroupApiService) MonitorGroupDeleteAuthorizationForMonitorGroup(ctx context.Context, monitorGroupGuid string, authorizationGuid string) ApiMonitorGroupDeleteAuthorizationForMonitorGroupRequest { return ApiMonitorGroupDeleteAuthorizationForMonitorGroupRequest{ ApiService: a, ctx: ctx, @@ -549,27 +533,25 @@ func (a *MonitorGroupApiService) MonitorGroupDeleteAuthorizationForMonitorGroup( } // Execute executes the request -func (a *MonitorGroupApiService) MonitorGroupDeleteAuthorizationForMonitorGroupExecute(r ApiMonitorGroupDeleteAuthorizationForMonitorGroupRequest) (*_nethttp.Response, error) { +func (a *MonitorGroupApiService) MonitorGroupDeleteAuthorizationForMonitorGroupExecute(r ApiMonitorGroupDeleteAuthorizationForMonitorGroupRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorGroupApiService.MonitorGroupDeleteAuthorizationForMonitorGroup") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorGroup/{monitorGroupGuid}/Authorizations/{authorizationGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"authorizationGuid"+"}", _neturl.PathEscape(parameterToString(r.authorizationGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"authorizationGuid"+"}", url.PathEscape(parameterToString(r.authorizationGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -588,7 +570,7 @@ func (a *MonitorGroupApiService) MonitorGroupDeleteAuthorizationForMonitorGroupE if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -598,15 +580,15 @@ func (a *MonitorGroupApiService) MonitorGroupDeleteAuthorizationForMonitorGroupE return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -617,7 +599,8 @@ func (a *MonitorGroupApiService) MonitorGroupDeleteAuthorizationForMonitorGroupE newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -627,7 +610,8 @@ func (a *MonitorGroupApiService) MonitorGroupDeleteAuthorizationForMonitorGroupE newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -636,24 +620,23 @@ func (a *MonitorGroupApiService) MonitorGroupDeleteAuthorizationForMonitorGroupE } type ApiMonitorGroupDeleteMonitorGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorGroupApiService monitorGroupGuid string } - -func (r ApiMonitorGroupDeleteMonitorGroupRequest) Execute() (*_nethttp.Response, error) { +func (r ApiMonitorGroupDeleteMonitorGroupRequest) Execute() (*http.Response, error) { return r.ApiService.MonitorGroupDeleteMonitorGroupExecute(r) } /* MonitorGroupDeleteMonitorGroup Deletes the specified monitor group - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGroupGuid The Guid of the monitor group to be deleted @return ApiMonitorGroupDeleteMonitorGroupRequest */ -func (a *MonitorGroupApiService) MonitorGroupDeleteMonitorGroup(ctx _context.Context, monitorGroupGuid string) ApiMonitorGroupDeleteMonitorGroupRequest { +func (a *MonitorGroupApiService) MonitorGroupDeleteMonitorGroup(ctx context.Context, monitorGroupGuid string) ApiMonitorGroupDeleteMonitorGroupRequest { return ApiMonitorGroupDeleteMonitorGroupRequest{ ApiService: a, ctx: ctx, @@ -662,26 +645,24 @@ func (a *MonitorGroupApiService) MonitorGroupDeleteMonitorGroup(ctx _context.Con } // Execute executes the request -func (a *MonitorGroupApiService) MonitorGroupDeleteMonitorGroupExecute(r ApiMonitorGroupDeleteMonitorGroupRequest) (*_nethttp.Response, error) { +func (a *MonitorGroupApiService) MonitorGroupDeleteMonitorGroupExecute(r ApiMonitorGroupDeleteMonitorGroupRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorGroupApiService.MonitorGroupDeleteMonitorGroup") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorGroup/{monitorGroupGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -700,7 +681,7 @@ func (a *MonitorGroupApiService) MonitorGroupDeleteMonitorGroupExecute(r ApiMoni if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -710,15 +691,15 @@ func (a *MonitorGroupApiService) MonitorGroupDeleteMonitorGroupExecute(r ApiMoni return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -729,7 +710,8 @@ func (a *MonitorGroupApiService) MonitorGroupDeleteMonitorGroupExecute(r ApiMoni newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -739,7 +721,8 @@ func (a *MonitorGroupApiService) MonitorGroupDeleteMonitorGroupExecute(r ApiMoni newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -748,22 +731,21 @@ func (a *MonitorGroupApiService) MonitorGroupDeleteMonitorGroupExecute(r ApiMoni } type ApiMonitorGroupGetAllMonitorGroupsRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorGroupApiService } - -func (r ApiMonitorGroupGetAllMonitorGroupsRequest) Execute() ([]MonitorGroup, *_nethttp.Response, error) { +func (r ApiMonitorGroupGetAllMonitorGroupsRequest) Execute() ([]MonitorGroup, *http.Response, error) { return r.ApiService.MonitorGroupGetAllMonitorGroupsExecute(r) } /* MonitorGroupGetAllMonitorGroups Gets all monitor groups - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiMonitorGroupGetAllMonitorGroupsRequest */ -func (a *MonitorGroupApiService) MonitorGroupGetAllMonitorGroups(ctx _context.Context) ApiMonitorGroupGetAllMonitorGroupsRequest { +func (a *MonitorGroupApiService) MonitorGroupGetAllMonitorGroups(ctx context.Context) ApiMonitorGroupGetAllMonitorGroupsRequest { return ApiMonitorGroupGetAllMonitorGroupsRequest{ ApiService: a, ctx: ctx, @@ -772,26 +754,24 @@ func (a *MonitorGroupApiService) MonitorGroupGetAllMonitorGroups(ctx _context.Co // Execute executes the request // @return []MonitorGroup -func (a *MonitorGroupApiService) MonitorGroupGetAllMonitorGroupsExecute(r ApiMonitorGroupGetAllMonitorGroupsRequest) ([]MonitorGroup, *_nethttp.Response, error) { +func (a *MonitorGroupApiService) MonitorGroupGetAllMonitorGroupsExecute(r ApiMonitorGroupGetAllMonitorGroupsRequest) ([]MonitorGroup, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []MonitorGroup ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorGroupApiService.MonitorGroupGetAllMonitorGroups") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorGroup" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -810,7 +790,7 @@ func (a *MonitorGroupApiService) MonitorGroupGetAllMonitorGroupsExecute(r ApiMon if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -820,15 +800,15 @@ func (a *MonitorGroupApiService) MonitorGroupGetAllMonitorGroupsExecute(r ApiMon return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -839,14 +819,15 @@ func (a *MonitorGroupApiService) MonitorGroupGetAllMonitorGroupsExecute(r ApiMon newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -857,24 +838,23 @@ func (a *MonitorGroupApiService) MonitorGroupGetAllMonitorGroupsExecute(r ApiMon } type ApiMonitorGroupGetAuthorizationsOfMonitorGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorGroupApiService monitorGroupGuid string } - -func (r ApiMonitorGroupGetAuthorizationsOfMonitorGroupRequest) Execute() ([]MonitorGroupAuthorization, *_nethttp.Response, error) { +func (r ApiMonitorGroupGetAuthorizationsOfMonitorGroupRequest) Execute() ([]MonitorGroupAuthorization, *http.Response, error) { return r.ApiService.MonitorGroupGetAuthorizationsOfMonitorGroupExecute(r) } /* MonitorGroupGetAuthorizationsOfMonitorGroup Get monitor authorizations of monitor group - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGroupGuid The monitor group GUID @return ApiMonitorGroupGetAuthorizationsOfMonitorGroupRequest */ -func (a *MonitorGroupApiService) MonitorGroupGetAuthorizationsOfMonitorGroup(ctx _context.Context, monitorGroupGuid string) ApiMonitorGroupGetAuthorizationsOfMonitorGroupRequest { +func (a *MonitorGroupApiService) MonitorGroupGetAuthorizationsOfMonitorGroup(ctx context.Context, monitorGroupGuid string) ApiMonitorGroupGetAuthorizationsOfMonitorGroupRequest { return ApiMonitorGroupGetAuthorizationsOfMonitorGroupRequest{ ApiService: a, ctx: ctx, @@ -884,27 +864,25 @@ func (a *MonitorGroupApiService) MonitorGroupGetAuthorizationsOfMonitorGroup(ctx // Execute executes the request // @return []MonitorGroupAuthorization -func (a *MonitorGroupApiService) MonitorGroupGetAuthorizationsOfMonitorGroupExecute(r ApiMonitorGroupGetAuthorizationsOfMonitorGroupRequest) ([]MonitorGroupAuthorization, *_nethttp.Response, error) { +func (a *MonitorGroupApiService) MonitorGroupGetAuthorizationsOfMonitorGroupExecute(r ApiMonitorGroupGetAuthorizationsOfMonitorGroupRequest) ([]MonitorGroupAuthorization, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []MonitorGroupAuthorization ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorGroupApiService.MonitorGroupGetAuthorizationsOfMonitorGroup") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorGroup/{monitorGroupGuid}/Authorizations" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -923,7 +901,7 @@ func (a *MonitorGroupApiService) MonitorGroupGetAuthorizationsOfMonitorGroupExec if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -933,15 +911,15 @@ func (a *MonitorGroupApiService) MonitorGroupGetAuthorizationsOfMonitorGroupExec return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -952,7 +930,8 @@ func (a *MonitorGroupApiService) MonitorGroupGetAuthorizationsOfMonitorGroupExec newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -962,14 +941,15 @@ func (a *MonitorGroupApiService) MonitorGroupGetAuthorizationsOfMonitorGroupExec newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -980,24 +960,23 @@ func (a *MonitorGroupApiService) MonitorGroupGetAuthorizationsOfMonitorGroupExec } type ApiMonitorGroupGetMonitorGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorGroupApiService monitorGroupGuid string } - -func (r ApiMonitorGroupGetMonitorGroupRequest) Execute() (MonitorGroup, *_nethttp.Response, error) { +func (r ApiMonitorGroupGetMonitorGroupRequest) Execute() (*MonitorGroup, *http.Response, error) { return r.ApiService.MonitorGroupGetMonitorGroupExecute(r) } /* MonitorGroupGetMonitorGroup Gets the details of a monitor group - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGroupGuid The Guid of the monitor group to be retrieved @return ApiMonitorGroupGetMonitorGroupRequest */ -func (a *MonitorGroupApiService) MonitorGroupGetMonitorGroup(ctx _context.Context, monitorGroupGuid string) ApiMonitorGroupGetMonitorGroupRequest { +func (a *MonitorGroupApiService) MonitorGroupGetMonitorGroup(ctx context.Context, monitorGroupGuid string) ApiMonitorGroupGetMonitorGroupRequest { return ApiMonitorGroupGetMonitorGroupRequest{ ApiService: a, ctx: ctx, @@ -1007,27 +986,25 @@ func (a *MonitorGroupApiService) MonitorGroupGetMonitorGroup(ctx _context.Contex // Execute executes the request // @return MonitorGroup -func (a *MonitorGroupApiService) MonitorGroupGetMonitorGroupExecute(r ApiMonitorGroupGetMonitorGroupRequest) (MonitorGroup, *_nethttp.Response, error) { +func (a *MonitorGroupApiService) MonitorGroupGetMonitorGroupExecute(r ApiMonitorGroupGetMonitorGroupRequest) (*MonitorGroup, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MonitorGroup + formFiles []formFile + localVarReturnValue *MonitorGroup ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorGroupApiService.MonitorGroupGetMonitorGroup") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorGroup/{monitorGroupGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1046,7 +1023,7 @@ func (a *MonitorGroupApiService) MonitorGroupGetMonitorGroupExecute(r ApiMonitor if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1056,15 +1033,15 @@ func (a *MonitorGroupApiService) MonitorGroupGetMonitorGroupExecute(r ApiMonitor return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1075,7 +1052,8 @@ func (a *MonitorGroupApiService) MonitorGroupGetMonitorGroupExecute(r ApiMonitor newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1085,14 +1063,15 @@ func (a *MonitorGroupApiService) MonitorGroupGetMonitorGroupExecute(r ApiMonitor newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1103,24 +1082,23 @@ func (a *MonitorGroupApiService) MonitorGroupGetMonitorGroupExecute(r ApiMonitor } type ApiMonitorGroupGetMonitorGroupMembersRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorGroupApiService monitorGroupGuid string } - -func (r ApiMonitorGroupGetMonitorGroupMembersRequest) Execute() (MonitorGroupMember, *_nethttp.Response, error) { +func (r ApiMonitorGroupGetMonitorGroupMembersRequest) Execute() (*MonitorGroupMember, *http.Response, error) { return r.ApiService.MonitorGroupGetMonitorGroupMembersExecute(r) } /* MonitorGroupGetMonitorGroupMembers Gets a list of all members of a monitor group - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGroupGuid The Guid of the monitor group to retrieve the members for @return ApiMonitorGroupGetMonitorGroupMembersRequest */ -func (a *MonitorGroupApiService) MonitorGroupGetMonitorGroupMembers(ctx _context.Context, monitorGroupGuid string) ApiMonitorGroupGetMonitorGroupMembersRequest { +func (a *MonitorGroupApiService) MonitorGroupGetMonitorGroupMembers(ctx context.Context, monitorGroupGuid string) ApiMonitorGroupGetMonitorGroupMembersRequest { return ApiMonitorGroupGetMonitorGroupMembersRequest{ ApiService: a, ctx: ctx, @@ -1130,27 +1108,25 @@ func (a *MonitorGroupApiService) MonitorGroupGetMonitorGroupMembers(ctx _context // Execute executes the request // @return MonitorGroupMember -func (a *MonitorGroupApiService) MonitorGroupGetMonitorGroupMembersExecute(r ApiMonitorGroupGetMonitorGroupMembersRequest) (MonitorGroupMember, *_nethttp.Response, error) { +func (a *MonitorGroupApiService) MonitorGroupGetMonitorGroupMembersExecute(r ApiMonitorGroupGetMonitorGroupMembersRequest) (*MonitorGroupMember, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MonitorGroupMember + formFiles []formFile + localVarReturnValue *MonitorGroupMember ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorGroupApiService.MonitorGroupGetMonitorGroupMembers") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorGroup/{monitorGroupGuid}/Member" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1169,7 +1145,7 @@ func (a *MonitorGroupApiService) MonitorGroupGetMonitorGroupMembersExecute(r Api if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1179,15 +1155,15 @@ func (a *MonitorGroupApiService) MonitorGroupGetMonitorGroupMembersExecute(r Api return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1198,7 +1174,8 @@ func (a *MonitorGroupApiService) MonitorGroupGetMonitorGroupMembersExecute(r Api newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1208,14 +1185,15 @@ func (a *MonitorGroupApiService) MonitorGroupGetMonitorGroupMembersExecute(r Api newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1226,26 +1204,25 @@ func (a *MonitorGroupApiService) MonitorGroupGetMonitorGroupMembersExecute(r Api } type ApiMonitorGroupRemoveMonitorFromMonitorGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorGroupApiService monitorGroupGuid string monitorGuid string } - -func (r ApiMonitorGroupRemoveMonitorFromMonitorGroupRequest) Execute() (*_nethttp.Response, error) { +func (r ApiMonitorGroupRemoveMonitorFromMonitorGroupRequest) Execute() (*http.Response, error) { return r.ApiService.MonitorGroupRemoveMonitorFromMonitorGroupExecute(r) } /* MonitorGroupRemoveMonitorFromMonitorGroup Removes the specified monitor from the monitor group - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGroupGuid The Guid of the monitor group to remove the monitor from @param monitorGuid The monitor Guid to be removed @return ApiMonitorGroupRemoveMonitorFromMonitorGroupRequest */ -func (a *MonitorGroupApiService) MonitorGroupRemoveMonitorFromMonitorGroup(ctx _context.Context, monitorGroupGuid string, monitorGuid string) ApiMonitorGroupRemoveMonitorFromMonitorGroupRequest { +func (a *MonitorGroupApiService) MonitorGroupRemoveMonitorFromMonitorGroup(ctx context.Context, monitorGroupGuid string, monitorGuid string) ApiMonitorGroupRemoveMonitorFromMonitorGroupRequest { return ApiMonitorGroupRemoveMonitorFromMonitorGroupRequest{ ApiService: a, ctx: ctx, @@ -1255,27 +1232,25 @@ func (a *MonitorGroupApiService) MonitorGroupRemoveMonitorFromMonitorGroup(ctx _ } // Execute executes the request -func (a *MonitorGroupApiService) MonitorGroupRemoveMonitorFromMonitorGroupExecute(r ApiMonitorGroupRemoveMonitorFromMonitorGroupRequest) (*_nethttp.Response, error) { +func (a *MonitorGroupApiService) MonitorGroupRemoveMonitorFromMonitorGroupExecute(r ApiMonitorGroupRemoveMonitorFromMonitorGroupRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorGroupApiService.MonitorGroupRemoveMonitorFromMonitorGroup") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorGroup/{monitorGroupGuid}/Member/{monitorGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1294,7 +1269,7 @@ func (a *MonitorGroupApiService) MonitorGroupRemoveMonitorFromMonitorGroupExecut if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1304,15 +1279,15 @@ func (a *MonitorGroupApiService) MonitorGroupRemoveMonitorFromMonitorGroupExecut return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1323,7 +1298,8 @@ func (a *MonitorGroupApiService) MonitorGroupRemoveMonitorFromMonitorGroupExecut newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1333,7 +1309,8 @@ func (a *MonitorGroupApiService) MonitorGroupRemoveMonitorFromMonitorGroupExecut newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -1342,24 +1319,23 @@ func (a *MonitorGroupApiService) MonitorGroupRemoveMonitorFromMonitorGroupExecut } type ApiMonitorGroupStartAllMonitorAlertsInGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorGroupApiService monitorGroupGuid string } - -func (r ApiMonitorGroupStartAllMonitorAlertsInGroupRequest) Execute() (*_nethttp.Response, error) { +func (r ApiMonitorGroupStartAllMonitorAlertsInGroupRequest) Execute() (*http.Response, error) { return r.ApiService.MonitorGroupStartAllMonitorAlertsInGroupExecute(r) } /* MonitorGroupStartAllMonitorAlertsInGroup Starts alerting for all monitors that are a member of the monitor group specified by the monitor group GUID - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGroupGuid The monitor group GUID @return ApiMonitorGroupStartAllMonitorAlertsInGroupRequest */ -func (a *MonitorGroupApiService) MonitorGroupStartAllMonitorAlertsInGroup(ctx _context.Context, monitorGroupGuid string) ApiMonitorGroupStartAllMonitorAlertsInGroupRequest { +func (a *MonitorGroupApiService) MonitorGroupStartAllMonitorAlertsInGroup(ctx context.Context, monitorGroupGuid string) ApiMonitorGroupStartAllMonitorAlertsInGroupRequest { return ApiMonitorGroupStartAllMonitorAlertsInGroupRequest{ ApiService: a, ctx: ctx, @@ -1368,26 +1344,24 @@ func (a *MonitorGroupApiService) MonitorGroupStartAllMonitorAlertsInGroup(ctx _c } // Execute executes the request -func (a *MonitorGroupApiService) MonitorGroupStartAllMonitorAlertsInGroupExecute(r ApiMonitorGroupStartAllMonitorAlertsInGroupRequest) (*_nethttp.Response, error) { +func (a *MonitorGroupApiService) MonitorGroupStartAllMonitorAlertsInGroupExecute(r ApiMonitorGroupStartAllMonitorAlertsInGroupRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorGroupApiService.MonitorGroupStartAllMonitorAlertsInGroup") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorGroup/{monitorGroupGuid}/StartAllMonitorAlerts" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1406,7 +1380,7 @@ func (a *MonitorGroupApiService) MonitorGroupStartAllMonitorAlertsInGroupExecute if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1416,15 +1390,15 @@ func (a *MonitorGroupApiService) MonitorGroupStartAllMonitorAlertsInGroupExecute return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1435,7 +1409,8 @@ func (a *MonitorGroupApiService) MonitorGroupStartAllMonitorAlertsInGroupExecute newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1445,7 +1420,8 @@ func (a *MonitorGroupApiService) MonitorGroupStartAllMonitorAlertsInGroupExecute newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -1454,24 +1430,23 @@ func (a *MonitorGroupApiService) MonitorGroupStartAllMonitorAlertsInGroupExecute } type ApiMonitorGroupStartAllMonitorsInGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorGroupApiService monitorGroupGuid string } - -func (r ApiMonitorGroupStartAllMonitorsInGroupRequest) Execute() (*_nethttp.Response, error) { +func (r ApiMonitorGroupStartAllMonitorsInGroupRequest) Execute() (*http.Response, error) { return r.ApiService.MonitorGroupStartAllMonitorsInGroupExecute(r) } /* MonitorGroupStartAllMonitorsInGroup Starts all monitors that are a member of the monitor group specified by the monitor group GUID - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGroupGuid The monitor group GUID @return ApiMonitorGroupStartAllMonitorsInGroupRequest */ -func (a *MonitorGroupApiService) MonitorGroupStartAllMonitorsInGroup(ctx _context.Context, monitorGroupGuid string) ApiMonitorGroupStartAllMonitorsInGroupRequest { +func (a *MonitorGroupApiService) MonitorGroupStartAllMonitorsInGroup(ctx context.Context, monitorGroupGuid string) ApiMonitorGroupStartAllMonitorsInGroupRequest { return ApiMonitorGroupStartAllMonitorsInGroupRequest{ ApiService: a, ctx: ctx, @@ -1480,26 +1455,24 @@ func (a *MonitorGroupApiService) MonitorGroupStartAllMonitorsInGroup(ctx _contex } // Execute executes the request -func (a *MonitorGroupApiService) MonitorGroupStartAllMonitorsInGroupExecute(r ApiMonitorGroupStartAllMonitorsInGroupRequest) (*_nethttp.Response, error) { +func (a *MonitorGroupApiService) MonitorGroupStartAllMonitorsInGroupExecute(r ApiMonitorGroupStartAllMonitorsInGroupRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorGroupApiService.MonitorGroupStartAllMonitorsInGroup") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorGroup/{monitorGroupGuid}/StartAllMonitors" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1518,7 +1491,7 @@ func (a *MonitorGroupApiService) MonitorGroupStartAllMonitorsInGroupExecute(r Ap if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1528,15 +1501,15 @@ func (a *MonitorGroupApiService) MonitorGroupStartAllMonitorsInGroupExecute(r Ap return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1547,7 +1520,8 @@ func (a *MonitorGroupApiService) MonitorGroupStartAllMonitorsInGroupExecute(r Ap newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1557,7 +1531,8 @@ func (a *MonitorGroupApiService) MonitorGroupStartAllMonitorsInGroupExecute(r Ap newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -1566,24 +1541,23 @@ func (a *MonitorGroupApiService) MonitorGroupStartAllMonitorsInGroupExecute(r Ap } type ApiMonitorGroupStopAllMonitorAlertsInGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorGroupApiService monitorGroupGuid string } - -func (r ApiMonitorGroupStopAllMonitorAlertsInGroupRequest) Execute() (*_nethttp.Response, error) { +func (r ApiMonitorGroupStopAllMonitorAlertsInGroupRequest) Execute() (*http.Response, error) { return r.ApiService.MonitorGroupStopAllMonitorAlertsInGroupExecute(r) } /* MonitorGroupStopAllMonitorAlertsInGroup Stops alerting for all monitors that are a member of the monitor group specified by the monitor group GUID - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGroupGuid The monitor group GUID @return ApiMonitorGroupStopAllMonitorAlertsInGroupRequest */ -func (a *MonitorGroupApiService) MonitorGroupStopAllMonitorAlertsInGroup(ctx _context.Context, monitorGroupGuid string) ApiMonitorGroupStopAllMonitorAlertsInGroupRequest { +func (a *MonitorGroupApiService) MonitorGroupStopAllMonitorAlertsInGroup(ctx context.Context, monitorGroupGuid string) ApiMonitorGroupStopAllMonitorAlertsInGroupRequest { return ApiMonitorGroupStopAllMonitorAlertsInGroupRequest{ ApiService: a, ctx: ctx, @@ -1592,26 +1566,24 @@ func (a *MonitorGroupApiService) MonitorGroupStopAllMonitorAlertsInGroup(ctx _co } // Execute executes the request -func (a *MonitorGroupApiService) MonitorGroupStopAllMonitorAlertsInGroupExecute(r ApiMonitorGroupStopAllMonitorAlertsInGroupRequest) (*_nethttp.Response, error) { +func (a *MonitorGroupApiService) MonitorGroupStopAllMonitorAlertsInGroupExecute(r ApiMonitorGroupStopAllMonitorAlertsInGroupRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorGroupApiService.MonitorGroupStopAllMonitorAlertsInGroup") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorGroup/{monitorGroupGuid}/StopAllMonitorAlerts" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1630,7 +1602,7 @@ func (a *MonitorGroupApiService) MonitorGroupStopAllMonitorAlertsInGroupExecute( if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1640,15 +1612,15 @@ func (a *MonitorGroupApiService) MonitorGroupStopAllMonitorAlertsInGroupExecute( return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1659,7 +1631,8 @@ func (a *MonitorGroupApiService) MonitorGroupStopAllMonitorAlertsInGroupExecute( newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1669,7 +1642,8 @@ func (a *MonitorGroupApiService) MonitorGroupStopAllMonitorAlertsInGroupExecute( newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -1678,24 +1652,23 @@ func (a *MonitorGroupApiService) MonitorGroupStopAllMonitorAlertsInGroupExecute( } type ApiMonitorGroupStopAllMonitorsInGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorGroupApiService monitorGroupGuid string } - -func (r ApiMonitorGroupStopAllMonitorsInGroupRequest) Execute() (*_nethttp.Response, error) { +func (r ApiMonitorGroupStopAllMonitorsInGroupRequest) Execute() (*http.Response, error) { return r.ApiService.MonitorGroupStopAllMonitorsInGroupExecute(r) } /* MonitorGroupStopAllMonitorsInGroup Stops all monitors that are a member of the monitor group specified by the monitor group GUID - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGroupGuid The monitor group GUID @return ApiMonitorGroupStopAllMonitorsInGroupRequest */ -func (a *MonitorGroupApiService) MonitorGroupStopAllMonitorsInGroup(ctx _context.Context, monitorGroupGuid string) ApiMonitorGroupStopAllMonitorsInGroupRequest { +func (a *MonitorGroupApiService) MonitorGroupStopAllMonitorsInGroup(ctx context.Context, monitorGroupGuid string) ApiMonitorGroupStopAllMonitorsInGroupRequest { return ApiMonitorGroupStopAllMonitorsInGroupRequest{ ApiService: a, ctx: ctx, @@ -1704,26 +1677,24 @@ func (a *MonitorGroupApiService) MonitorGroupStopAllMonitorsInGroup(ctx _context } // Execute executes the request -func (a *MonitorGroupApiService) MonitorGroupStopAllMonitorsInGroupExecute(r ApiMonitorGroupStopAllMonitorsInGroupRequest) (*_nethttp.Response, error) { +func (a *MonitorGroupApiService) MonitorGroupStopAllMonitorsInGroupExecute(r ApiMonitorGroupStopAllMonitorsInGroupRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorGroupApiService.MonitorGroupStopAllMonitorsInGroup") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorGroup/{monitorGroupGuid}/StopAllMonitors" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1742,7 +1713,7 @@ func (a *MonitorGroupApiService) MonitorGroupStopAllMonitorsInGroupExecute(r Api if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1752,15 +1723,15 @@ func (a *MonitorGroupApiService) MonitorGroupStopAllMonitorsInGroupExecute(r Api return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1771,7 +1742,8 @@ func (a *MonitorGroupApiService) MonitorGroupStopAllMonitorsInGroupExecute(r Api newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1781,7 +1753,8 @@ func (a *MonitorGroupApiService) MonitorGroupStopAllMonitorsInGroupExecute(r Api newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -1790,30 +1763,30 @@ func (a *MonitorGroupApiService) MonitorGroupStopAllMonitorsInGroupExecute(r Api } type ApiMonitorGroupUpdateMonitorGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *MonitorGroupApiService monitorGroupGuid string - item *MonitorGroup + monitorGroup *MonitorGroup } // The monitor group to be updated -func (r ApiMonitorGroupUpdateMonitorGroupRequest) Item(item MonitorGroup) ApiMonitorGroupUpdateMonitorGroupRequest { - r.item = &item +func (r ApiMonitorGroupUpdateMonitorGroupRequest) MonitorGroup(monitorGroup MonitorGroup) ApiMonitorGroupUpdateMonitorGroupRequest { + r.monitorGroup = &monitorGroup return r } -func (r ApiMonitorGroupUpdateMonitorGroupRequest) Execute() (*_nethttp.Response, error) { +func (r ApiMonitorGroupUpdateMonitorGroupRequest) Execute() (*http.Response, error) { return r.ApiService.MonitorGroupUpdateMonitorGroupExecute(r) } /* MonitorGroupUpdateMonitorGroup Updates the monitor group with the Guid specified - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGroupGuid The Guid of the monitor group to be updated @return ApiMonitorGroupUpdateMonitorGroupRequest */ -func (a *MonitorGroupApiService) MonitorGroupUpdateMonitorGroup(ctx _context.Context, monitorGroupGuid string) ApiMonitorGroupUpdateMonitorGroupRequest { +func (a *MonitorGroupApiService) MonitorGroupUpdateMonitorGroup(ctx context.Context, monitorGroupGuid string) ApiMonitorGroupUpdateMonitorGroupRequest { return ApiMonitorGroupUpdateMonitorGroupRequest{ ApiService: a, ctx: ctx, @@ -1822,29 +1795,24 @@ func (a *MonitorGroupApiService) MonitorGroupUpdateMonitorGroup(ctx _context.Con } // Execute executes the request -func (a *MonitorGroupApiService) MonitorGroupUpdateMonitorGroupExecute(r ApiMonitorGroupUpdateMonitorGroupRequest) (*_nethttp.Response, error) { +func (a *MonitorGroupApiService) MonitorGroupUpdateMonitorGroupExecute(r ApiMonitorGroupUpdateMonitorGroupRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitorGroupApiService.MonitorGroupUpdateMonitorGroup") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/MonitorGroup/{monitorGroupGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.item == nil { - return nil, reportError("item is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -1864,8 +1832,8 @@ func (a *MonitorGroupApiService) MonitorGroupUpdateMonitorGroupExecute(r ApiMoni localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.item - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.monitorGroup + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1875,15 +1843,15 @@ func (a *MonitorGroupApiService) MonitorGroupUpdateMonitorGroupExecute(r ApiMoni return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1894,7 +1862,8 @@ func (a *MonitorGroupApiService) MonitorGroupUpdateMonitorGroupExecute(r ApiMoni newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1904,7 +1873,8 @@ func (a *MonitorGroupApiService) MonitorGroupUpdateMonitorGroupExecute(r ApiMoni newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_operator.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_operator.go index 30bd6f41..2cb32cc1 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/api_operator.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_operator.go @@ -12,23 +12,19 @@ package uptrends import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // OperatorApiService OperatorApi service type OperatorApiService service type ApiOperatorAddDutyPeriodForOperatorRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService operatorGuid string schedule *OperatorDutySchedule @@ -40,18 +36,18 @@ func (r ApiOperatorAddDutyPeriodForOperatorRequest) Schedule(schedule OperatorDu return r } -func (r ApiOperatorAddDutyPeriodForOperatorRequest) Execute() (*_nethttp.Response, error) { +func (r ApiOperatorAddDutyPeriodForOperatorRequest) Execute() (*http.Response, error) { return r.ApiService.OperatorAddDutyPeriodForOperatorExecute(r) } /* OperatorAddDutyPeriodForOperator Adds a duty schedule to the specified operator. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGuid The Guid of the operator to add the duty schedule to @return ApiOperatorAddDutyPeriodForOperatorRequest */ -func (a *OperatorApiService) OperatorAddDutyPeriodForOperator(ctx _context.Context, operatorGuid string) ApiOperatorAddDutyPeriodForOperatorRequest { +func (a *OperatorApiService) OperatorAddDutyPeriodForOperator(ctx context.Context, operatorGuid string) ApiOperatorAddDutyPeriodForOperatorRequest { return ApiOperatorAddDutyPeriodForOperatorRequest{ ApiService: a, ctx: ctx, @@ -60,29 +56,24 @@ func (a *OperatorApiService) OperatorAddDutyPeriodForOperator(ctx _context.Conte } // Execute executes the request -func (a *OperatorApiService) OperatorAddDutyPeriodForOperatorExecute(r ApiOperatorAddDutyPeriodForOperatorRequest) (*_nethttp.Response, error) { +func (a *OperatorApiService) OperatorAddDutyPeriodForOperatorExecute(r ApiOperatorAddDutyPeriodForOperatorRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.OperatorAddDutyPeriodForOperator") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Operator/{operatorGuid}/DutySchedule" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", url.PathEscape(parameterToString(r.operatorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.schedule == nil { - return nil, reportError("schedule is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -103,7 +94,7 @@ func (a *OperatorApiService) OperatorAddDutyPeriodForOperatorExecute(r ApiOperat } // body params localVarPostBody = r.schedule - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -113,15 +104,15 @@ func (a *OperatorApiService) OperatorAddDutyPeriodForOperatorExecute(r ApiOperat return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -132,7 +123,8 @@ func (a *OperatorApiService) OperatorAddDutyPeriodForOperatorExecute(r ApiOperat newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -142,7 +134,8 @@ func (a *OperatorApiService) OperatorAddDutyPeriodForOperatorExecute(r ApiOperat newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -151,7 +144,7 @@ func (a *OperatorApiService) OperatorAddDutyPeriodForOperatorExecute(r ApiOperat } type ApiOperatorCreateOperatorRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService uptrendsOperator *Operator } @@ -162,17 +155,17 @@ func (r ApiOperatorCreateOperatorRequest) UptrendsOperator(uptrendsOperator Oper return r } -func (r ApiOperatorCreateOperatorRequest) Execute() (Operator, *_nethttp.Response, error) { +func (r ApiOperatorCreateOperatorRequest) Execute() (*Operator, *http.Response, error) { return r.ApiService.OperatorCreateOperatorExecute(r) } /* OperatorCreateOperator Creates a new operator. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiOperatorCreateOperatorRequest */ -func (a *OperatorApiService) OperatorCreateOperator(ctx _context.Context) ApiOperatorCreateOperatorRequest { +func (a *OperatorApiService) OperatorCreateOperator(ctx context.Context) ApiOperatorCreateOperatorRequest { return ApiOperatorCreateOperatorRequest{ ApiService: a, ctx: ctx, @@ -181,29 +174,24 @@ func (a *OperatorApiService) OperatorCreateOperator(ctx _context.Context) ApiOpe // Execute executes the request // @return Operator -func (a *OperatorApiService) OperatorCreateOperatorExecute(r ApiOperatorCreateOperatorRequest) (Operator, *_nethttp.Response, error) { +func (a *OperatorApiService) OperatorCreateOperatorExecute(r ApiOperatorCreateOperatorRequest) (*Operator, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Operator + formFiles []formFile + localVarReturnValue *Operator ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.OperatorCreateOperator") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Operator" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.uptrendsOperator == nil { - return localVarReturnValue, nil, reportError("uptrendsOperator is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -224,7 +212,7 @@ func (a *OperatorApiService) OperatorCreateOperatorExecute(r ApiOperatorCreateOp } // body params localVarPostBody = r.uptrendsOperator - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -234,15 +222,15 @@ func (a *OperatorApiService) OperatorCreateOperatorExecute(r ApiOperatorCreateOp return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -253,7 +241,8 @@ func (a *OperatorApiService) OperatorCreateOperatorExecute(r ApiOperatorCreateOp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -263,14 +252,15 @@ func (a *OperatorApiService) OperatorCreateOperatorExecute(r ApiOperatorCreateOp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -281,26 +271,25 @@ func (a *OperatorApiService) OperatorCreateOperatorExecute(r ApiOperatorCreateOp } type ApiOperatorDeleteAuthorizationForOperatorRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService operatorGuid string authorizationType string } - -func (r ApiOperatorDeleteAuthorizationForOperatorRequest) Execute() (*_nethttp.Response, error) { +func (r ApiOperatorDeleteAuthorizationForOperatorRequest) Execute() (*http.Response, error) { return r.ApiService.OperatorDeleteAuthorizationForOperatorExecute(r) } /* OperatorDeleteAuthorizationForOperator Removes the specified authorization of this operator. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGuid The Guid of the operator @param authorizationType The type of authorization @return ApiOperatorDeleteAuthorizationForOperatorRequest */ -func (a *OperatorApiService) OperatorDeleteAuthorizationForOperator(ctx _context.Context, operatorGuid string, authorizationType string) ApiOperatorDeleteAuthorizationForOperatorRequest { +func (a *OperatorApiService) OperatorDeleteAuthorizationForOperator(ctx context.Context, operatorGuid string, authorizationType string) ApiOperatorDeleteAuthorizationForOperatorRequest { return ApiOperatorDeleteAuthorizationForOperatorRequest{ ApiService: a, ctx: ctx, @@ -310,27 +299,25 @@ func (a *OperatorApiService) OperatorDeleteAuthorizationForOperator(ctx _context } // Execute executes the request -func (a *OperatorApiService) OperatorDeleteAuthorizationForOperatorExecute(r ApiOperatorDeleteAuthorizationForOperatorRequest) (*_nethttp.Response, error) { +func (a *OperatorApiService) OperatorDeleteAuthorizationForOperatorExecute(r ApiOperatorDeleteAuthorizationForOperatorRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.OperatorDeleteAuthorizationForOperator") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Operator/{operatorGuid}/Authorization/{authorizationType}" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"authorizationType"+"}", _neturl.PathEscape(parameterToString(r.authorizationType, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", url.PathEscape(parameterToString(r.operatorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"authorizationType"+"}", url.PathEscape(parameterToString(r.authorizationType, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -349,7 +336,7 @@ func (a *OperatorApiService) OperatorDeleteAuthorizationForOperatorExecute(r Api if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -359,15 +346,15 @@ func (a *OperatorApiService) OperatorDeleteAuthorizationForOperatorExecute(r Api return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -378,7 +365,8 @@ func (a *OperatorApiService) OperatorDeleteAuthorizationForOperatorExecute(r Api newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -388,7 +376,8 @@ func (a *OperatorApiService) OperatorDeleteAuthorizationForOperatorExecute(r Api newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -397,26 +386,25 @@ func (a *OperatorApiService) OperatorDeleteAuthorizationForOperatorExecute(r Api } type ApiOperatorDeleteDutyScheduleFromOperatorRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService operatorGuid string dutyScheduleId int32 } - -func (r ApiOperatorDeleteDutyScheduleFromOperatorRequest) Execute() (*_nethttp.Response, error) { +func (r ApiOperatorDeleteDutyScheduleFromOperatorRequest) Execute() (*http.Response, error) { return r.ApiService.OperatorDeleteDutyScheduleFromOperatorExecute(r) } /* OperatorDeleteDutyScheduleFromOperator Deletes the specified duty schedule of the specified operator. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGuid @param dutyScheduleId @return ApiOperatorDeleteDutyScheduleFromOperatorRequest */ -func (a *OperatorApiService) OperatorDeleteDutyScheduleFromOperator(ctx _context.Context, operatorGuid string, dutyScheduleId int32) ApiOperatorDeleteDutyScheduleFromOperatorRequest { +func (a *OperatorApiService) OperatorDeleteDutyScheduleFromOperator(ctx context.Context, operatorGuid string, dutyScheduleId int32) ApiOperatorDeleteDutyScheduleFromOperatorRequest { return ApiOperatorDeleteDutyScheduleFromOperatorRequest{ ApiService: a, ctx: ctx, @@ -426,27 +414,25 @@ func (a *OperatorApiService) OperatorDeleteDutyScheduleFromOperator(ctx _context } // Execute executes the request -func (a *OperatorApiService) OperatorDeleteDutyScheduleFromOperatorExecute(r ApiOperatorDeleteDutyScheduleFromOperatorRequest) (*_nethttp.Response, error) { +func (a *OperatorApiService) OperatorDeleteDutyScheduleFromOperatorExecute(r ApiOperatorDeleteDutyScheduleFromOperatorRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.OperatorDeleteDutyScheduleFromOperator") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Operator/{operatorGuid}/DutySchedule/{dutyScheduleId}" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dutyScheduleId"+"}", _neturl.PathEscape(parameterToString(r.dutyScheduleId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", url.PathEscape(parameterToString(r.operatorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dutyScheduleId"+"}", url.PathEscape(parameterToString(r.dutyScheduleId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -465,7 +451,7 @@ func (a *OperatorApiService) OperatorDeleteDutyScheduleFromOperatorExecute(r Api if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -475,15 +461,15 @@ func (a *OperatorApiService) OperatorDeleteDutyScheduleFromOperatorExecute(r Api return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -494,7 +480,8 @@ func (a *OperatorApiService) OperatorDeleteDutyScheduleFromOperatorExecute(r Api newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -504,7 +491,8 @@ func (a *OperatorApiService) OperatorDeleteDutyScheduleFromOperatorExecute(r Api newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -513,24 +501,23 @@ func (a *OperatorApiService) OperatorDeleteDutyScheduleFromOperatorExecute(r Api } type ApiOperatorDeleteOperatorRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService operatorGuid string } - -func (r ApiOperatorDeleteOperatorRequest) Execute() (*_nethttp.Response, error) { +func (r ApiOperatorDeleteOperatorRequest) Execute() (*http.Response, error) { return r.ApiService.OperatorDeleteOperatorExecute(r) } /* OperatorDeleteOperator Deletes an existing operator. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGuid The Guid of the operator to delete @return ApiOperatorDeleteOperatorRequest */ -func (a *OperatorApiService) OperatorDeleteOperator(ctx _context.Context, operatorGuid string) ApiOperatorDeleteOperatorRequest { +func (a *OperatorApiService) OperatorDeleteOperator(ctx context.Context, operatorGuid string) ApiOperatorDeleteOperatorRequest { return ApiOperatorDeleteOperatorRequest{ ApiService: a, ctx: ctx, @@ -539,26 +526,24 @@ func (a *OperatorApiService) OperatorDeleteOperator(ctx _context.Context, operat } // Execute executes the request -func (a *OperatorApiService) OperatorDeleteOperatorExecute(r ApiOperatorDeleteOperatorRequest) (*_nethttp.Response, error) { +func (a *OperatorApiService) OperatorDeleteOperatorExecute(r ApiOperatorDeleteOperatorRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.OperatorDeleteOperator") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Operator/{operatorGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", url.PathEscape(parameterToString(r.operatorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -577,7 +562,7 @@ func (a *OperatorApiService) OperatorDeleteOperatorExecute(r ApiOperatorDeleteOp if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -587,15 +572,15 @@ func (a *OperatorApiService) OperatorDeleteOperatorExecute(r ApiOperatorDeleteOp return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -606,7 +591,8 @@ func (a *OperatorApiService) OperatorDeleteOperatorExecute(r ApiOperatorDeleteOp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -616,7 +602,8 @@ func (a *OperatorApiService) OperatorDeleteOperatorExecute(r ApiOperatorDeleteOp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -626,7 +613,8 @@ func (a *OperatorApiService) OperatorDeleteOperatorExecute(r ApiOperatorDeleteOp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -635,22 +623,21 @@ func (a *OperatorApiService) OperatorDeleteOperatorExecute(r ApiOperatorDeleteOp } type ApiOperatorGetAllOperatorsRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService } - -func (r ApiOperatorGetAllOperatorsRequest) Execute() ([]Operator, *_nethttp.Response, error) { +func (r ApiOperatorGetAllOperatorsRequest) Execute() ([]Operator, *http.Response, error) { return r.ApiService.OperatorGetAllOperatorsExecute(r) } /* OperatorGetAllOperators Gets a list of all operators. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiOperatorGetAllOperatorsRequest */ -func (a *OperatorApiService) OperatorGetAllOperators(ctx _context.Context) ApiOperatorGetAllOperatorsRequest { +func (a *OperatorApiService) OperatorGetAllOperators(ctx context.Context) ApiOperatorGetAllOperatorsRequest { return ApiOperatorGetAllOperatorsRequest{ ApiService: a, ctx: ctx, @@ -659,26 +646,24 @@ func (a *OperatorApiService) OperatorGetAllOperators(ctx _context.Context) ApiOp // Execute executes the request // @return []Operator -func (a *OperatorApiService) OperatorGetAllOperatorsExecute(r ApiOperatorGetAllOperatorsRequest) ([]Operator, *_nethttp.Response, error) { +func (a *OperatorApiService) OperatorGetAllOperatorsExecute(r ApiOperatorGetAllOperatorsRequest) ([]Operator, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Operator ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.OperatorGetAllOperators") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Operator" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -697,7 +682,7 @@ func (a *OperatorApiService) OperatorGetAllOperatorsExecute(r ApiOperatorGetAllO if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -707,15 +692,15 @@ func (a *OperatorApiService) OperatorGetAllOperatorsExecute(r ApiOperatorGetAllO return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -726,14 +711,15 @@ func (a *OperatorApiService) OperatorGetAllOperatorsExecute(r ApiOperatorGetAllO newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -744,24 +730,23 @@ func (a *OperatorApiService) OperatorGetAllOperatorsExecute(r ApiOperatorGetAllO } type ApiOperatorGetAuthorizationsForOperatorRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService operatorGuid string } - -func (r ApiOperatorGetAuthorizationsForOperatorRequest) Execute() ([]OperatorAuthorizationType, *_nethttp.Response, error) { +func (r ApiOperatorGetAuthorizationsForOperatorRequest) Execute() ([]OperatorAuthorizationType, *http.Response, error) { return r.ApiService.OperatorGetAuthorizationsForOperatorExecute(r) } /* OperatorGetAuthorizationsForOperator Gets all authorizations for the specified operator. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGuid The Guid of the operator @return ApiOperatorGetAuthorizationsForOperatorRequest */ -func (a *OperatorApiService) OperatorGetAuthorizationsForOperator(ctx _context.Context, operatorGuid string) ApiOperatorGetAuthorizationsForOperatorRequest { +func (a *OperatorApiService) OperatorGetAuthorizationsForOperator(ctx context.Context, operatorGuid string) ApiOperatorGetAuthorizationsForOperatorRequest { return ApiOperatorGetAuthorizationsForOperatorRequest{ ApiService: a, ctx: ctx, @@ -771,27 +756,25 @@ func (a *OperatorApiService) OperatorGetAuthorizationsForOperator(ctx _context.C // Execute executes the request // @return []OperatorAuthorizationType -func (a *OperatorApiService) OperatorGetAuthorizationsForOperatorExecute(r ApiOperatorGetAuthorizationsForOperatorRequest) ([]OperatorAuthorizationType, *_nethttp.Response, error) { +func (a *OperatorApiService) OperatorGetAuthorizationsForOperatorExecute(r ApiOperatorGetAuthorizationsForOperatorRequest) ([]OperatorAuthorizationType, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []OperatorAuthorizationType ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.OperatorGetAuthorizationsForOperator") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Operator/{operatorGuid}/Authorization" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", url.PathEscape(parameterToString(r.operatorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -810,7 +793,7 @@ func (a *OperatorApiService) OperatorGetAuthorizationsForOperatorExecute(r ApiOp if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -820,15 +803,15 @@ func (a *OperatorApiService) OperatorGetAuthorizationsForOperatorExecute(r ApiOp return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -839,7 +822,8 @@ func (a *OperatorApiService) OperatorGetAuthorizationsForOperatorExecute(r ApiOp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -849,14 +833,15 @@ func (a *OperatorApiService) OperatorGetAuthorizationsForOperatorExecute(r ApiOp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -867,24 +852,23 @@ func (a *OperatorApiService) OperatorGetAuthorizationsForOperatorExecute(r ApiOp } type ApiOperatorGetDutyScheduleForOperatorRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService operatorGuid string } - -func (r ApiOperatorGetDutyScheduleForOperatorRequest) Execute() ([]OperatorDutySchedule, *_nethttp.Response, error) { +func (r ApiOperatorGetDutyScheduleForOperatorRequest) Execute() ([]OperatorDutySchedule, *http.Response, error) { return r.ApiService.OperatorGetDutyScheduleForOperatorExecute(r) } /* OperatorGetDutyScheduleForOperator Gets the duty schedules for an specified operator. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGuid The Guid of the operator to get the duty schedule for @return ApiOperatorGetDutyScheduleForOperatorRequest */ -func (a *OperatorApiService) OperatorGetDutyScheduleForOperator(ctx _context.Context, operatorGuid string) ApiOperatorGetDutyScheduleForOperatorRequest { +func (a *OperatorApiService) OperatorGetDutyScheduleForOperator(ctx context.Context, operatorGuid string) ApiOperatorGetDutyScheduleForOperatorRequest { return ApiOperatorGetDutyScheduleForOperatorRequest{ ApiService: a, ctx: ctx, @@ -894,27 +878,25 @@ func (a *OperatorApiService) OperatorGetDutyScheduleForOperator(ctx _context.Con // Execute executes the request // @return []OperatorDutySchedule -func (a *OperatorApiService) OperatorGetDutyScheduleForOperatorExecute(r ApiOperatorGetDutyScheduleForOperatorRequest) ([]OperatorDutySchedule, *_nethttp.Response, error) { +func (a *OperatorApiService) OperatorGetDutyScheduleForOperatorExecute(r ApiOperatorGetDutyScheduleForOperatorRequest) ([]OperatorDutySchedule, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []OperatorDutySchedule ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.OperatorGetDutyScheduleForOperator") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Operator/{operatorGuid}/DutySchedule" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", url.PathEscape(parameterToString(r.operatorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -933,7 +915,7 @@ func (a *OperatorApiService) OperatorGetDutyScheduleForOperatorExecute(r ApiOper if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -943,15 +925,15 @@ func (a *OperatorApiService) OperatorGetDutyScheduleForOperatorExecute(r ApiOper return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -962,7 +944,8 @@ func (a *OperatorApiService) OperatorGetDutyScheduleForOperatorExecute(r ApiOper newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -972,14 +955,15 @@ func (a *OperatorApiService) OperatorGetDutyScheduleForOperatorExecute(r ApiOper newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -990,24 +974,23 @@ func (a *OperatorApiService) OperatorGetDutyScheduleForOperatorExecute(r ApiOper } type ApiOperatorGetOperatorRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService operatorGuid string } - -func (r ApiOperatorGetOperatorRequest) Execute() (Operator, *_nethttp.Response, error) { +func (r ApiOperatorGetOperatorRequest) Execute() (*Operator, *http.Response, error) { return r.ApiService.OperatorGetOperatorExecute(r) } /* OperatorGetOperator Gets the details of the operator with the provided OperatorGuid. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGuid The Guid of the operator for which to retrieve the details @return ApiOperatorGetOperatorRequest */ -func (a *OperatorApiService) OperatorGetOperator(ctx _context.Context, operatorGuid string) ApiOperatorGetOperatorRequest { +func (a *OperatorApiService) OperatorGetOperator(ctx context.Context, operatorGuid string) ApiOperatorGetOperatorRequest { return ApiOperatorGetOperatorRequest{ ApiService: a, ctx: ctx, @@ -1017,27 +1000,25 @@ func (a *OperatorApiService) OperatorGetOperator(ctx _context.Context, operatorG // Execute executes the request // @return Operator -func (a *OperatorApiService) OperatorGetOperatorExecute(r ApiOperatorGetOperatorRequest) (Operator, *_nethttp.Response, error) { +func (a *OperatorApiService) OperatorGetOperatorExecute(r ApiOperatorGetOperatorRequest) (*Operator, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Operator + formFiles []formFile + localVarReturnValue *Operator ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.OperatorGetOperator") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Operator/{operatorGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", url.PathEscape(parameterToString(r.operatorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1056,7 +1037,7 @@ func (a *OperatorApiService) OperatorGetOperatorExecute(r ApiOperatorGetOperator if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1066,15 +1047,15 @@ func (a *OperatorApiService) OperatorGetOperatorExecute(r ApiOperatorGetOperator return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1085,7 +1066,8 @@ func (a *OperatorApiService) OperatorGetOperatorExecute(r ApiOperatorGetOperator newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1095,14 +1077,15 @@ func (a *OperatorApiService) OperatorGetOperatorExecute(r ApiOperatorGetOperator newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1113,24 +1096,23 @@ func (a *OperatorApiService) OperatorGetOperatorExecute(r ApiOperatorGetOperator } type ApiOperatorGetOperatorGroupsForOperatorRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService operatorGuid string } - -func (r ApiOperatorGetOperatorGroupsForOperatorRequest) Execute() ([]OperatorMember, *_nethttp.Response, error) { +func (r ApiOperatorGetOperatorGroupsForOperatorRequest) Execute() ([]OperatorMember, *http.Response, error) { return r.ApiService.OperatorGetOperatorGroupsForOperatorExecute(r) } /* OperatorGetOperatorGroupsForOperator Gets a list of all operator groups for the specified operator. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGuid The Guid of the operator for which to retrieve the operator group guids @return ApiOperatorGetOperatorGroupsForOperatorRequest */ -func (a *OperatorApiService) OperatorGetOperatorGroupsForOperator(ctx _context.Context, operatorGuid string) ApiOperatorGetOperatorGroupsForOperatorRequest { +func (a *OperatorApiService) OperatorGetOperatorGroupsForOperator(ctx context.Context, operatorGuid string) ApiOperatorGetOperatorGroupsForOperatorRequest { return ApiOperatorGetOperatorGroupsForOperatorRequest{ ApiService: a, ctx: ctx, @@ -1140,27 +1122,25 @@ func (a *OperatorApiService) OperatorGetOperatorGroupsForOperator(ctx _context.C // Execute executes the request // @return []OperatorMember -func (a *OperatorApiService) OperatorGetOperatorGroupsForOperatorExecute(r ApiOperatorGetOperatorGroupsForOperatorRequest) ([]OperatorMember, *_nethttp.Response, error) { +func (a *OperatorApiService) OperatorGetOperatorGroupsForOperatorExecute(r ApiOperatorGetOperatorGroupsForOperatorRequest) ([]OperatorMember, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []OperatorMember ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.OperatorGetOperatorGroupsForOperator") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Operator/{operatorGuid}/OperatorGroup" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", url.PathEscape(parameterToString(r.operatorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1179,7 +1159,7 @@ func (a *OperatorApiService) OperatorGetOperatorGroupsForOperatorExecute(r ApiOp if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1189,15 +1169,15 @@ func (a *OperatorApiService) OperatorGetOperatorGroupsForOperatorExecute(r ApiOp return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1208,7 +1188,8 @@ func (a *OperatorApiService) OperatorGetOperatorGroupsForOperatorExecute(r ApiOp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1218,14 +1199,15 @@ func (a *OperatorApiService) OperatorGetOperatorGroupsForOperatorExecute(r ApiOp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1236,26 +1218,25 @@ func (a *OperatorApiService) OperatorGetOperatorGroupsForOperatorExecute(r ApiOp } type ApiOperatorPostAuthorizationForOperatorRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService operatorGuid string authorizationType string } - -func (r ApiOperatorPostAuthorizationForOperatorRequest) Execute() (*_nethttp.Response, error) { +func (r ApiOperatorPostAuthorizationForOperatorRequest) Execute() (*http.Response, error) { return r.ApiService.OperatorPostAuthorizationForOperatorExecute(r) } /* OperatorPostAuthorizationForOperator Assigns the specified authorization to this operator. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGuid The Guid of the operator @param authorizationType The type of authorization @return ApiOperatorPostAuthorizationForOperatorRequest */ -func (a *OperatorApiService) OperatorPostAuthorizationForOperator(ctx _context.Context, operatorGuid string, authorizationType string) ApiOperatorPostAuthorizationForOperatorRequest { +func (a *OperatorApiService) OperatorPostAuthorizationForOperator(ctx context.Context, operatorGuid string, authorizationType string) ApiOperatorPostAuthorizationForOperatorRequest { return ApiOperatorPostAuthorizationForOperatorRequest{ ApiService: a, ctx: ctx, @@ -1265,27 +1246,25 @@ func (a *OperatorApiService) OperatorPostAuthorizationForOperator(ctx _context.C } // Execute executes the request -func (a *OperatorApiService) OperatorPostAuthorizationForOperatorExecute(r ApiOperatorPostAuthorizationForOperatorRequest) (*_nethttp.Response, error) { +func (a *OperatorApiService) OperatorPostAuthorizationForOperatorExecute(r ApiOperatorPostAuthorizationForOperatorRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.OperatorPostAuthorizationForOperator") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Operator/{operatorGuid}/Authorization/{authorizationType}" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"authorizationType"+"}", _neturl.PathEscape(parameterToString(r.authorizationType, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", url.PathEscape(parameterToString(r.operatorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"authorizationType"+"}", url.PathEscape(parameterToString(r.authorizationType, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1304,7 +1283,7 @@ func (a *OperatorApiService) OperatorPostAuthorizationForOperatorExecute(r ApiOp if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1314,15 +1293,15 @@ func (a *OperatorApiService) OperatorPostAuthorizationForOperatorExecute(r ApiOp return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1333,7 +1312,8 @@ func (a *OperatorApiService) OperatorPostAuthorizationForOperatorExecute(r ApiOp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1343,7 +1323,8 @@ func (a *OperatorApiService) OperatorPostAuthorizationForOperatorExecute(r ApiOp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -1352,7 +1333,7 @@ func (a *OperatorApiService) OperatorPostAuthorizationForOperatorExecute(r ApiOp } type ApiOperatorUpdateDutyPeriodForOperatorRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService operatorGuid string dutyScheduleId int32 @@ -1364,19 +1345,19 @@ func (r ApiOperatorUpdateDutyPeriodForOperatorRequest) Schedule(schedule Operato return r } -func (r ApiOperatorUpdateDutyPeriodForOperatorRequest) Execute() (*_nethttp.Response, error) { +func (r ApiOperatorUpdateDutyPeriodForOperatorRequest) Execute() (*http.Response, error) { return r.ApiService.OperatorUpdateDutyPeriodForOperatorExecute(r) } /* OperatorUpdateDutyPeriodForOperator Updates the specified duty schedule of the specified operator. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGuid @param dutyScheduleId @return ApiOperatorUpdateDutyPeriodForOperatorRequest */ -func (a *OperatorApiService) OperatorUpdateDutyPeriodForOperator(ctx _context.Context, operatorGuid string, dutyScheduleId int32) ApiOperatorUpdateDutyPeriodForOperatorRequest { +func (a *OperatorApiService) OperatorUpdateDutyPeriodForOperator(ctx context.Context, operatorGuid string, dutyScheduleId int32) ApiOperatorUpdateDutyPeriodForOperatorRequest { return ApiOperatorUpdateDutyPeriodForOperatorRequest{ ApiService: a, ctx: ctx, @@ -1386,30 +1367,25 @@ func (a *OperatorApiService) OperatorUpdateDutyPeriodForOperator(ctx _context.Co } // Execute executes the request -func (a *OperatorApiService) OperatorUpdateDutyPeriodForOperatorExecute(r ApiOperatorUpdateDutyPeriodForOperatorRequest) (*_nethttp.Response, error) { +func (a *OperatorApiService) OperatorUpdateDutyPeriodForOperatorExecute(r ApiOperatorUpdateDutyPeriodForOperatorRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.OperatorUpdateDutyPeriodForOperator") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Operator/{operatorGuid}/DutySchedule/{dutyScheduleId}" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dutyScheduleId"+"}", _neturl.PathEscape(parameterToString(r.dutyScheduleId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", url.PathEscape(parameterToString(r.operatorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dutyScheduleId"+"}", url.PathEscape(parameterToString(r.dutyScheduleId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.schedule == nil { - return nil, reportError("schedule is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -1430,7 +1406,7 @@ func (a *OperatorApiService) OperatorUpdateDutyPeriodForOperatorExecute(r ApiOpe } // body params localVarPostBody = r.schedule - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1440,15 +1416,15 @@ func (a *OperatorApiService) OperatorUpdateDutyPeriodForOperatorExecute(r ApiOpe return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1459,7 +1435,8 @@ func (a *OperatorApiService) OperatorUpdateDutyPeriodForOperatorExecute(r ApiOpe newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1469,7 +1446,8 @@ func (a *OperatorApiService) OperatorUpdateDutyPeriodForOperatorExecute(r ApiOpe newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -1478,7 +1456,7 @@ func (a *OperatorApiService) OperatorUpdateDutyPeriodForOperatorExecute(r ApiOpe } type ApiOperatorUpdateOperatorRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService operatorGuid string uptrendsOperator *Operator @@ -1490,18 +1468,18 @@ func (r ApiOperatorUpdateOperatorRequest) UptrendsOperator(uptrendsOperator Oper return r } -func (r ApiOperatorUpdateOperatorRequest) Execute() (*_nethttp.Response, error) { +func (r ApiOperatorUpdateOperatorRequest) Execute() (*http.Response, error) { return r.ApiService.OperatorUpdateOperatorExecute(r) } /* OperatorUpdateOperator Updates an existing operator. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGuid The Guid of the operator to update @return ApiOperatorUpdateOperatorRequest */ -func (a *OperatorApiService) OperatorUpdateOperator(ctx _context.Context, operatorGuid string) ApiOperatorUpdateOperatorRequest { +func (a *OperatorApiService) OperatorUpdateOperator(ctx context.Context, operatorGuid string) ApiOperatorUpdateOperatorRequest { return ApiOperatorUpdateOperatorRequest{ ApiService: a, ctx: ctx, @@ -1510,29 +1488,24 @@ func (a *OperatorApiService) OperatorUpdateOperator(ctx _context.Context, operat } // Execute executes the request -func (a *OperatorApiService) OperatorUpdateOperatorExecute(r ApiOperatorUpdateOperatorRequest) (*_nethttp.Response, error) { +func (a *OperatorApiService) OperatorUpdateOperatorExecute(r ApiOperatorUpdateOperatorRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.OperatorUpdateOperator") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Operator/{operatorGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", url.PathEscape(parameterToString(r.operatorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.uptrendsOperator == nil { - return nil, reportError("uptrendsOperator is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -1553,7 +1526,7 @@ func (a *OperatorApiService) OperatorUpdateOperatorExecute(r ApiOperatorUpdateOp } // body params localVarPostBody = r.uptrendsOperator - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1563,15 +1536,15 @@ func (a *OperatorApiService) OperatorUpdateOperatorExecute(r ApiOperatorUpdateOp return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1582,7 +1555,8 @@ func (a *OperatorApiService) OperatorUpdateOperatorExecute(r ApiOperatorUpdateOp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1592,7 +1566,8 @@ func (a *OperatorApiService) OperatorUpdateOperatorExecute(r ApiOperatorUpdateOp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -1601,7 +1576,7 @@ func (a *OperatorApiService) OperatorUpdateOperatorExecute(r ApiOperatorUpdateOp } type ApiOperatorUpdateOperatorWithPatchRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorApiService operatorGuid string uptrendsOperator *Operator @@ -1613,18 +1588,18 @@ func (r ApiOperatorUpdateOperatorWithPatchRequest) UptrendsOperator(uptrendsOper return r } -func (r ApiOperatorUpdateOperatorWithPatchRequest) Execute() (*_nethttp.Response, error) { +func (r ApiOperatorUpdateOperatorWithPatchRequest) Execute() (*http.Response, error) { return r.ApiService.OperatorUpdateOperatorWithPatchExecute(r) } /* OperatorUpdateOperatorWithPatch Updates an existing operator. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGuid The Guid of the operator to update @return ApiOperatorUpdateOperatorWithPatchRequest */ -func (a *OperatorApiService) OperatorUpdateOperatorWithPatch(ctx _context.Context, operatorGuid string) ApiOperatorUpdateOperatorWithPatchRequest { +func (a *OperatorApiService) OperatorUpdateOperatorWithPatch(ctx context.Context, operatorGuid string) ApiOperatorUpdateOperatorWithPatchRequest { return ApiOperatorUpdateOperatorWithPatchRequest{ ApiService: a, ctx: ctx, @@ -1633,29 +1608,24 @@ func (a *OperatorApiService) OperatorUpdateOperatorWithPatch(ctx _context.Contex } // Execute executes the request -func (a *OperatorApiService) OperatorUpdateOperatorWithPatchExecute(r ApiOperatorUpdateOperatorWithPatchRequest) (*_nethttp.Response, error) { +func (a *OperatorApiService) OperatorUpdateOperatorWithPatchExecute(r ApiOperatorUpdateOperatorWithPatchRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorApiService.OperatorUpdateOperatorWithPatch") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Operator/{operatorGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", url.PathEscape(parameterToString(r.operatorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.uptrendsOperator == nil { - return nil, reportError("uptrendsOperator is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -1676,7 +1646,7 @@ func (a *OperatorApiService) OperatorUpdateOperatorWithPatchExecute(r ApiOperato } // body params localVarPostBody = r.uptrendsOperator - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1686,15 +1656,15 @@ func (a *OperatorApiService) OperatorUpdateOperatorWithPatchExecute(r ApiOperato return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1705,7 +1675,8 @@ func (a *OperatorApiService) OperatorUpdateOperatorWithPatchExecute(r ApiOperato newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1715,7 +1686,8 @@ func (a *OperatorApiService) OperatorUpdateOperatorWithPatchExecute(r ApiOperato newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_operator_group.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_operator_group.go index 72110ff3..d7db9c77 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/api_operator_group.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_operator_group.go @@ -12,23 +12,19 @@ package uptrends import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // OperatorGroupApiService OperatorGroupApi service type OperatorGroupApiService service type ApiOperatorGroupAddDutyScheduleToAllMembersRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorGroupApiService operatorGroupGuid string dutySchedule *OperatorDutySchedule @@ -39,18 +35,18 @@ func (r ApiOperatorGroupAddDutyScheduleToAllMembersRequest) DutySchedule(dutySch return r } -func (r ApiOperatorGroupAddDutyScheduleToAllMembersRequest) Execute() (*_nethttp.Response, error) { +func (r ApiOperatorGroupAddDutyScheduleToAllMembersRequest) Execute() (*http.Response, error) { return r.ApiService.OperatorGroupAddDutyScheduleToAllMembersExecute(r) } /* -OperatorGroupAddDutyScheduleToAllMembers Adds the provided duty schedule to all operators in the group specified +OperatorGroupAddDutyScheduleToAllMembers Adds the provided duty schedule to all operators in the group specified - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGroupGuid @return ApiOperatorGroupAddDutyScheduleToAllMembersRequest */ -func (a *OperatorGroupApiService) OperatorGroupAddDutyScheduleToAllMembers(ctx _context.Context, operatorGroupGuid string) ApiOperatorGroupAddDutyScheduleToAllMembersRequest { +func (a *OperatorGroupApiService) OperatorGroupAddDutyScheduleToAllMembers(ctx context.Context, operatorGroupGuid string) ApiOperatorGroupAddDutyScheduleToAllMembersRequest { return ApiOperatorGroupAddDutyScheduleToAllMembersRequest{ ApiService: a, ctx: ctx, @@ -59,29 +55,24 @@ func (a *OperatorGroupApiService) OperatorGroupAddDutyScheduleToAllMembers(ctx _ } // Execute executes the request -func (a *OperatorGroupApiService) OperatorGroupAddDutyScheduleToAllMembersExecute(r ApiOperatorGroupAddDutyScheduleToAllMembersRequest) (*_nethttp.Response, error) { +func (a *OperatorGroupApiService) OperatorGroupAddDutyScheduleToAllMembersExecute(r ApiOperatorGroupAddDutyScheduleToAllMembersRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorGroupApiService.OperatorGroupAddDutyScheduleToAllMembers") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/OperatorGroup/{operatorGroupGuid}/DutySchedule/AddDutyScheduleForAllMembers" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", url.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.dutySchedule == nil { - return nil, reportError("dutySchedule is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -102,7 +93,7 @@ func (a *OperatorGroupApiService) OperatorGroupAddDutyScheduleToAllMembersExecut } // body params localVarPostBody = r.dutySchedule - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -112,15 +103,15 @@ func (a *OperatorGroupApiService) OperatorGroupAddDutyScheduleToAllMembersExecut return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -131,7 +122,8 @@ func (a *OperatorGroupApiService) OperatorGroupAddDutyScheduleToAllMembersExecut newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -141,7 +133,8 @@ func (a *OperatorGroupApiService) OperatorGroupAddDutyScheduleToAllMembersExecut newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -150,26 +143,25 @@ func (a *OperatorGroupApiService) OperatorGroupAddDutyScheduleToAllMembersExecut } type ApiOperatorGroupAddOperatorToOperatorGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorGroupApiService operatorGroupGuid string operatorGuid string } - -func (r ApiOperatorGroupAddOperatorToOperatorGroupRequest) Execute() (*_nethttp.Response, error) { +func (r ApiOperatorGroupAddOperatorToOperatorGroupRequest) Execute() (*http.Response, error) { return r.ApiService.OperatorGroupAddOperatorToOperatorGroupExecute(r) } /* -OperatorGroupAddOperatorToOperatorGroup Adds the specified operator to the operator group +OperatorGroupAddOperatorToOperatorGroup Adds the specified operator to the operator group - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGroupGuid The Guid of the operator group to add the operator to @param operatorGuid The operator Guid @return ApiOperatorGroupAddOperatorToOperatorGroupRequest */ -func (a *OperatorGroupApiService) OperatorGroupAddOperatorToOperatorGroup(ctx _context.Context, operatorGroupGuid string, operatorGuid string) ApiOperatorGroupAddOperatorToOperatorGroupRequest { +func (a *OperatorGroupApiService) OperatorGroupAddOperatorToOperatorGroup(ctx context.Context, operatorGroupGuid string, operatorGuid string) ApiOperatorGroupAddOperatorToOperatorGroupRequest { return ApiOperatorGroupAddOperatorToOperatorGroupRequest{ ApiService: a, ctx: ctx, @@ -179,27 +171,25 @@ func (a *OperatorGroupApiService) OperatorGroupAddOperatorToOperatorGroup(ctx _c } // Execute executes the request -func (a *OperatorGroupApiService) OperatorGroupAddOperatorToOperatorGroupExecute(r ApiOperatorGroupAddOperatorToOperatorGroupRequest) (*_nethttp.Response, error) { +func (a *OperatorGroupApiService) OperatorGroupAddOperatorToOperatorGroupExecute(r ApiOperatorGroupAddOperatorToOperatorGroupRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorGroupApiService.OperatorGroupAddOperatorToOperatorGroup") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/OperatorGroup/{operatorGroupGuid}/Member/{operatorGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", url.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", url.PathEscape(parameterToString(r.operatorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -218,7 +208,7 @@ func (a *OperatorGroupApiService) OperatorGroupAddOperatorToOperatorGroupExecute if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -228,15 +218,15 @@ func (a *OperatorGroupApiService) OperatorGroupAddOperatorToOperatorGroupExecute return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -247,7 +237,8 @@ func (a *OperatorGroupApiService) OperatorGroupAddOperatorToOperatorGroupExecute newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -257,7 +248,8 @@ func (a *OperatorGroupApiService) OperatorGroupAddOperatorToOperatorGroupExecute newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -266,24 +258,23 @@ func (a *OperatorGroupApiService) OperatorGroupAddOperatorToOperatorGroupExecute } type ApiOperatorGroupAllOperatorsInGroupOffDutyRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorGroupApiService operatorGroupGuid string } - -func (r ApiOperatorGroupAllOperatorsInGroupOffDutyRequest) Execute() (*_nethttp.Response, error) { +func (r ApiOperatorGroupAllOperatorsInGroupOffDutyRequest) Execute() (*http.Response, error) { return r.ApiService.OperatorGroupAllOperatorsInGroupOffDutyExecute(r) } /* OperatorGroupAllOperatorsInGroupOffDuty Set the OnDuty flag to off for all operators that are a member of the operator group specified by the operator group GUID - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGroupGuid The operator group GUID @return ApiOperatorGroupAllOperatorsInGroupOffDutyRequest */ -func (a *OperatorGroupApiService) OperatorGroupAllOperatorsInGroupOffDuty(ctx _context.Context, operatorGroupGuid string) ApiOperatorGroupAllOperatorsInGroupOffDutyRequest { +func (a *OperatorGroupApiService) OperatorGroupAllOperatorsInGroupOffDuty(ctx context.Context, operatorGroupGuid string) ApiOperatorGroupAllOperatorsInGroupOffDutyRequest { return ApiOperatorGroupAllOperatorsInGroupOffDutyRequest{ ApiService: a, ctx: ctx, @@ -292,26 +283,24 @@ func (a *OperatorGroupApiService) OperatorGroupAllOperatorsInGroupOffDuty(ctx _c } // Execute executes the request -func (a *OperatorGroupApiService) OperatorGroupAllOperatorsInGroupOffDutyExecute(r ApiOperatorGroupAllOperatorsInGroupOffDutyRequest) (*_nethttp.Response, error) { +func (a *OperatorGroupApiService) OperatorGroupAllOperatorsInGroupOffDutyExecute(r ApiOperatorGroupAllOperatorsInGroupOffDutyRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorGroupApiService.OperatorGroupAllOperatorsInGroupOffDuty") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/OperatorGroup/{operatorGroupGuid}/AllOperatorsOffDuty" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", url.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -330,7 +319,7 @@ func (a *OperatorGroupApiService) OperatorGroupAllOperatorsInGroupOffDutyExecute if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -340,15 +329,15 @@ func (a *OperatorGroupApiService) OperatorGroupAllOperatorsInGroupOffDutyExecute return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -359,7 +348,8 @@ func (a *OperatorGroupApiService) OperatorGroupAllOperatorsInGroupOffDutyExecute newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -369,7 +359,8 @@ func (a *OperatorGroupApiService) OperatorGroupAllOperatorsInGroupOffDutyExecute newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -378,24 +369,23 @@ func (a *OperatorGroupApiService) OperatorGroupAllOperatorsInGroupOffDutyExecute } type ApiOperatorGroupAllOperatorsInGroupOnDutyRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorGroupApiService operatorGroupGuid string } - -func (r ApiOperatorGroupAllOperatorsInGroupOnDutyRequest) Execute() (*_nethttp.Response, error) { +func (r ApiOperatorGroupAllOperatorsInGroupOnDutyRequest) Execute() (*http.Response, error) { return r.ApiService.OperatorGroupAllOperatorsInGroupOnDutyExecute(r) } /* OperatorGroupAllOperatorsInGroupOnDuty Set the OnDuty flag to on for all operators that are a member of the operator group specified by the operator group GUID - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGroupGuid The operator group GUID @return ApiOperatorGroupAllOperatorsInGroupOnDutyRequest */ -func (a *OperatorGroupApiService) OperatorGroupAllOperatorsInGroupOnDuty(ctx _context.Context, operatorGroupGuid string) ApiOperatorGroupAllOperatorsInGroupOnDutyRequest { +func (a *OperatorGroupApiService) OperatorGroupAllOperatorsInGroupOnDuty(ctx context.Context, operatorGroupGuid string) ApiOperatorGroupAllOperatorsInGroupOnDutyRequest { return ApiOperatorGroupAllOperatorsInGroupOnDutyRequest{ ApiService: a, ctx: ctx, @@ -404,26 +394,24 @@ func (a *OperatorGroupApiService) OperatorGroupAllOperatorsInGroupOnDuty(ctx _co } // Execute executes the request -func (a *OperatorGroupApiService) OperatorGroupAllOperatorsInGroupOnDutyExecute(r ApiOperatorGroupAllOperatorsInGroupOnDutyRequest) (*_nethttp.Response, error) { +func (a *OperatorGroupApiService) OperatorGroupAllOperatorsInGroupOnDutyExecute(r ApiOperatorGroupAllOperatorsInGroupOnDutyRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorGroupApiService.OperatorGroupAllOperatorsInGroupOnDuty") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/OperatorGroup/{operatorGroupGuid}/AllOperatorsOnDuty" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", url.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -442,7 +430,7 @@ func (a *OperatorGroupApiService) OperatorGroupAllOperatorsInGroupOnDutyExecute( if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -452,15 +440,15 @@ func (a *OperatorGroupApiService) OperatorGroupAllOperatorsInGroupOnDutyExecute( return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -471,7 +459,8 @@ func (a *OperatorGroupApiService) OperatorGroupAllOperatorsInGroupOnDutyExecute( newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -481,7 +470,8 @@ func (a *OperatorGroupApiService) OperatorGroupAllOperatorsInGroupOnDutyExecute( newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -490,7 +480,7 @@ func (a *OperatorGroupApiService) OperatorGroupAllOperatorsInGroupOnDutyExecute( } type ApiOperatorGroupCreateOperatorGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorGroupApiService operatorGroup *OperatorGroup } @@ -501,17 +491,17 @@ func (r ApiOperatorGroupCreateOperatorGroupRequest) OperatorGroup(operatorGroup return r } -func (r ApiOperatorGroupCreateOperatorGroupRequest) Execute() (OperatorGroup, *_nethttp.Response, error) { +func (r ApiOperatorGroupCreateOperatorGroupRequest) Execute() (*OperatorGroup, *http.Response, error) { return r.ApiService.OperatorGroupCreateOperatorGroupExecute(r) } /* OperatorGroupCreateOperatorGroup Creates a new operator group - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiOperatorGroupCreateOperatorGroupRequest */ -func (a *OperatorGroupApiService) OperatorGroupCreateOperatorGroup(ctx _context.Context) ApiOperatorGroupCreateOperatorGroupRequest { +func (a *OperatorGroupApiService) OperatorGroupCreateOperatorGroup(ctx context.Context) ApiOperatorGroupCreateOperatorGroupRequest { return ApiOperatorGroupCreateOperatorGroupRequest{ ApiService: a, ctx: ctx, @@ -520,29 +510,24 @@ func (a *OperatorGroupApiService) OperatorGroupCreateOperatorGroup(ctx _context. // Execute executes the request // @return OperatorGroup -func (a *OperatorGroupApiService) OperatorGroupCreateOperatorGroupExecute(r ApiOperatorGroupCreateOperatorGroupRequest) (OperatorGroup, *_nethttp.Response, error) { +func (a *OperatorGroupApiService) OperatorGroupCreateOperatorGroupExecute(r ApiOperatorGroupCreateOperatorGroupRequest) (*OperatorGroup, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue OperatorGroup + formFiles []formFile + localVarReturnValue *OperatorGroup ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorGroupApiService.OperatorGroupCreateOperatorGroup") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/OperatorGroup" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.operatorGroup == nil { - return localVarReturnValue, nil, reportError("operatorGroup is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -563,7 +548,7 @@ func (a *OperatorGroupApiService) OperatorGroupCreateOperatorGroupExecute(r ApiO } // body params localVarPostBody = r.operatorGroup - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -573,15 +558,15 @@ func (a *OperatorGroupApiService) OperatorGroupCreateOperatorGroupExecute(r ApiO return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -592,14 +577,15 @@ func (a *OperatorGroupApiService) OperatorGroupCreateOperatorGroupExecute(r ApiO newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -610,26 +596,25 @@ func (a *OperatorGroupApiService) OperatorGroupCreateOperatorGroupExecute(r ApiO } type ApiOperatorGroupDeleteAuthorizationForOperatorGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorGroupApiService operatorGroupGuid string authorizationType string } - -func (r ApiOperatorGroupDeleteAuthorizationForOperatorGroupRequest) Execute() (*_nethttp.Response, error) { +func (r ApiOperatorGroupDeleteAuthorizationForOperatorGroupRequest) Execute() (*http.Response, error) { return r.ApiService.OperatorGroupDeleteAuthorizationForOperatorGroupExecute(r) } /* OperatorGroupDeleteAuthorizationForOperatorGroup Removes the specified authorization of the operator group. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGroupGuid The Guid of the operator group @param authorizationType The type of authorization @return ApiOperatorGroupDeleteAuthorizationForOperatorGroupRequest */ -func (a *OperatorGroupApiService) OperatorGroupDeleteAuthorizationForOperatorGroup(ctx _context.Context, operatorGroupGuid string, authorizationType string) ApiOperatorGroupDeleteAuthorizationForOperatorGroupRequest { +func (a *OperatorGroupApiService) OperatorGroupDeleteAuthorizationForOperatorGroup(ctx context.Context, operatorGroupGuid string, authorizationType string) ApiOperatorGroupDeleteAuthorizationForOperatorGroupRequest { return ApiOperatorGroupDeleteAuthorizationForOperatorGroupRequest{ ApiService: a, ctx: ctx, @@ -639,27 +624,25 @@ func (a *OperatorGroupApiService) OperatorGroupDeleteAuthorizationForOperatorGro } // Execute executes the request -func (a *OperatorGroupApiService) OperatorGroupDeleteAuthorizationForOperatorGroupExecute(r ApiOperatorGroupDeleteAuthorizationForOperatorGroupRequest) (*_nethttp.Response, error) { +func (a *OperatorGroupApiService) OperatorGroupDeleteAuthorizationForOperatorGroupExecute(r ApiOperatorGroupDeleteAuthorizationForOperatorGroupRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorGroupApiService.OperatorGroupDeleteAuthorizationForOperatorGroup") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/OperatorGroup/{operatorGroupGuid}/Authorization/{authorizationType}" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"authorizationType"+"}", _neturl.PathEscape(parameterToString(r.authorizationType, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", url.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"authorizationType"+"}", url.PathEscape(parameterToString(r.authorizationType, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -678,7 +661,7 @@ func (a *OperatorGroupApiService) OperatorGroupDeleteAuthorizationForOperatorGro if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -688,15 +671,15 @@ func (a *OperatorGroupApiService) OperatorGroupDeleteAuthorizationForOperatorGro return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -707,7 +690,8 @@ func (a *OperatorGroupApiService) OperatorGroupDeleteAuthorizationForOperatorGro newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -717,7 +701,8 @@ func (a *OperatorGroupApiService) OperatorGroupDeleteAuthorizationForOperatorGro newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -726,24 +711,23 @@ func (a *OperatorGroupApiService) OperatorGroupDeleteAuthorizationForOperatorGro } type ApiOperatorGroupDeleteOperatorGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorGroupApiService operatorGroupGuid string } - -func (r ApiOperatorGroupDeleteOperatorGroupRequest) Execute() (*_nethttp.Response, error) { +func (r ApiOperatorGroupDeleteOperatorGroupRequest) Execute() (*http.Response, error) { return r.ApiService.OperatorGroupDeleteOperatorGroupExecute(r) } /* OperatorGroupDeleteOperatorGroup Deletes the specified operator group - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGroupGuid The Guid of the operator group to be deleted @return ApiOperatorGroupDeleteOperatorGroupRequest */ -func (a *OperatorGroupApiService) OperatorGroupDeleteOperatorGroup(ctx _context.Context, operatorGroupGuid string) ApiOperatorGroupDeleteOperatorGroupRequest { +func (a *OperatorGroupApiService) OperatorGroupDeleteOperatorGroup(ctx context.Context, operatorGroupGuid string) ApiOperatorGroupDeleteOperatorGroupRequest { return ApiOperatorGroupDeleteOperatorGroupRequest{ ApiService: a, ctx: ctx, @@ -752,26 +736,24 @@ func (a *OperatorGroupApiService) OperatorGroupDeleteOperatorGroup(ctx _context. } // Execute executes the request -func (a *OperatorGroupApiService) OperatorGroupDeleteOperatorGroupExecute(r ApiOperatorGroupDeleteOperatorGroupRequest) (*_nethttp.Response, error) { +func (a *OperatorGroupApiService) OperatorGroupDeleteOperatorGroupExecute(r ApiOperatorGroupDeleteOperatorGroupRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorGroupApiService.OperatorGroupDeleteOperatorGroup") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/OperatorGroup/{operatorGroupGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", url.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -790,7 +772,7 @@ func (a *OperatorGroupApiService) OperatorGroupDeleteOperatorGroupExecute(r ApiO if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -800,15 +782,15 @@ func (a *OperatorGroupApiService) OperatorGroupDeleteOperatorGroupExecute(r ApiO return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -819,7 +801,8 @@ func (a *OperatorGroupApiService) OperatorGroupDeleteOperatorGroupExecute(r ApiO newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -829,7 +812,8 @@ func (a *OperatorGroupApiService) OperatorGroupDeleteOperatorGroupExecute(r ApiO newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -838,22 +822,21 @@ func (a *OperatorGroupApiService) OperatorGroupDeleteOperatorGroupExecute(r ApiO } type ApiOperatorGroupGetAllOperatorGroupsRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorGroupApiService } - -func (r ApiOperatorGroupGetAllOperatorGroupsRequest) Execute() ([]OperatorGroup, *_nethttp.Response, error) { +func (r ApiOperatorGroupGetAllOperatorGroupsRequest) Execute() ([]OperatorGroup, *http.Response, error) { return r.ApiService.OperatorGroupGetAllOperatorGroupsExecute(r) } /* OperatorGroupGetAllOperatorGroups Gets all operator groups - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiOperatorGroupGetAllOperatorGroupsRequest */ -func (a *OperatorGroupApiService) OperatorGroupGetAllOperatorGroups(ctx _context.Context) ApiOperatorGroupGetAllOperatorGroupsRequest { +func (a *OperatorGroupApiService) OperatorGroupGetAllOperatorGroups(ctx context.Context) ApiOperatorGroupGetAllOperatorGroupsRequest { return ApiOperatorGroupGetAllOperatorGroupsRequest{ ApiService: a, ctx: ctx, @@ -862,26 +845,24 @@ func (a *OperatorGroupApiService) OperatorGroupGetAllOperatorGroups(ctx _context // Execute executes the request // @return []OperatorGroup -func (a *OperatorGroupApiService) OperatorGroupGetAllOperatorGroupsExecute(r ApiOperatorGroupGetAllOperatorGroupsRequest) ([]OperatorGroup, *_nethttp.Response, error) { +func (a *OperatorGroupApiService) OperatorGroupGetAllOperatorGroupsExecute(r ApiOperatorGroupGetAllOperatorGroupsRequest) ([]OperatorGroup, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []OperatorGroup ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorGroupApiService.OperatorGroupGetAllOperatorGroups") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/OperatorGroup" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -900,7 +881,7 @@ func (a *OperatorGroupApiService) OperatorGroupGetAllOperatorGroupsExecute(r Api if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -910,15 +891,15 @@ func (a *OperatorGroupApiService) OperatorGroupGetAllOperatorGroupsExecute(r Api return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -929,14 +910,15 @@ func (a *OperatorGroupApiService) OperatorGroupGetAllOperatorGroupsExecute(r Api newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -947,24 +929,23 @@ func (a *OperatorGroupApiService) OperatorGroupGetAllOperatorGroupsExecute(r Api } type ApiOperatorGroupGetAuthorizationsForOperatorGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorGroupApiService operatorGroupGuid string } - -func (r ApiOperatorGroupGetAuthorizationsForOperatorGroupRequest) Execute() ([]OperatorGroupAuthorizationType, *_nethttp.Response, error) { +func (r ApiOperatorGroupGetAuthorizationsForOperatorGroupRequest) Execute() ([]OperatorGroupAuthorizationType, *http.Response, error) { return r.ApiService.OperatorGroupGetAuthorizationsForOperatorGroupExecute(r) } /* OperatorGroupGetAuthorizationsForOperatorGroup Gets all authorizations for the specified operator group. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGroupGuid The Guid of the operator group @return ApiOperatorGroupGetAuthorizationsForOperatorGroupRequest */ -func (a *OperatorGroupApiService) OperatorGroupGetAuthorizationsForOperatorGroup(ctx _context.Context, operatorGroupGuid string) ApiOperatorGroupGetAuthorizationsForOperatorGroupRequest { +func (a *OperatorGroupApiService) OperatorGroupGetAuthorizationsForOperatorGroup(ctx context.Context, operatorGroupGuid string) ApiOperatorGroupGetAuthorizationsForOperatorGroupRequest { return ApiOperatorGroupGetAuthorizationsForOperatorGroupRequest{ ApiService: a, ctx: ctx, @@ -974,27 +955,25 @@ func (a *OperatorGroupApiService) OperatorGroupGetAuthorizationsForOperatorGroup // Execute executes the request // @return []OperatorGroupAuthorizationType -func (a *OperatorGroupApiService) OperatorGroupGetAuthorizationsForOperatorGroupExecute(r ApiOperatorGroupGetAuthorizationsForOperatorGroupRequest) ([]OperatorGroupAuthorizationType, *_nethttp.Response, error) { +func (a *OperatorGroupApiService) OperatorGroupGetAuthorizationsForOperatorGroupExecute(r ApiOperatorGroupGetAuthorizationsForOperatorGroupRequest) ([]OperatorGroupAuthorizationType, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []OperatorGroupAuthorizationType ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorGroupApiService.OperatorGroupGetAuthorizationsForOperatorGroup") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/OperatorGroup/{operatorGroupGuid}/Authorization" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", url.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1013,7 +992,7 @@ func (a *OperatorGroupApiService) OperatorGroupGetAuthorizationsForOperatorGroup if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1023,15 +1002,15 @@ func (a *OperatorGroupApiService) OperatorGroupGetAuthorizationsForOperatorGroup return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1042,7 +1021,8 @@ func (a *OperatorGroupApiService) OperatorGroupGetAuthorizationsForOperatorGroup newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1052,14 +1032,15 @@ func (a *OperatorGroupApiService) OperatorGroupGetAuthorizationsForOperatorGroup newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1070,24 +1051,23 @@ func (a *OperatorGroupApiService) OperatorGroupGetAuthorizationsForOperatorGroup } type ApiOperatorGroupGetOperatorGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorGroupApiService operatorGroupGuid string } - -func (r ApiOperatorGroupGetOperatorGroupRequest) Execute() (OperatorGroup, *_nethttp.Response, error) { +func (r ApiOperatorGroupGetOperatorGroupRequest) Execute() (*OperatorGroup, *http.Response, error) { return r.ApiService.OperatorGroupGetOperatorGroupExecute(r) } /* OperatorGroupGetOperatorGroup Gets the details of a operator group - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGroupGuid The Guid of the operator group to be retrieved @return ApiOperatorGroupGetOperatorGroupRequest */ -func (a *OperatorGroupApiService) OperatorGroupGetOperatorGroup(ctx _context.Context, operatorGroupGuid string) ApiOperatorGroupGetOperatorGroupRequest { +func (a *OperatorGroupApiService) OperatorGroupGetOperatorGroup(ctx context.Context, operatorGroupGuid string) ApiOperatorGroupGetOperatorGroupRequest { return ApiOperatorGroupGetOperatorGroupRequest{ ApiService: a, ctx: ctx, @@ -1097,27 +1077,25 @@ func (a *OperatorGroupApiService) OperatorGroupGetOperatorGroup(ctx _context.Con // Execute executes the request // @return OperatorGroup -func (a *OperatorGroupApiService) OperatorGroupGetOperatorGroupExecute(r ApiOperatorGroupGetOperatorGroupRequest) (OperatorGroup, *_nethttp.Response, error) { +func (a *OperatorGroupApiService) OperatorGroupGetOperatorGroupExecute(r ApiOperatorGroupGetOperatorGroupRequest) (*OperatorGroup, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue OperatorGroup + formFiles []formFile + localVarReturnValue *OperatorGroup ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorGroupApiService.OperatorGroupGetOperatorGroup") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/OperatorGroup/{operatorGroupGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", url.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1136,7 +1114,7 @@ func (a *OperatorGroupApiService) OperatorGroupGetOperatorGroupExecute(r ApiOper if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1146,15 +1124,15 @@ func (a *OperatorGroupApiService) OperatorGroupGetOperatorGroupExecute(r ApiOper return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1165,7 +1143,8 @@ func (a *OperatorGroupApiService) OperatorGroupGetOperatorGroupExecute(r ApiOper newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1175,14 +1154,15 @@ func (a *OperatorGroupApiService) OperatorGroupGetOperatorGroupExecute(r ApiOper newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1193,24 +1173,23 @@ func (a *OperatorGroupApiService) OperatorGroupGetOperatorGroupExecute(r ApiOper } type ApiOperatorGroupGetOperatorGroupMembersRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorGroupApiService operatorGroupGuid string } - -func (r ApiOperatorGroupGetOperatorGroupMembersRequest) Execute() (OperatorGroupMember, *_nethttp.Response, error) { +func (r ApiOperatorGroupGetOperatorGroupMembersRequest) Execute() (*OperatorGroupMember, *http.Response, error) { return r.ApiService.OperatorGroupGetOperatorGroupMembersExecute(r) } /* OperatorGroupGetOperatorGroupMembers Gets a list of all members of an operator group - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGroupGuid The Guid of the operator group to retrieve the members for @return ApiOperatorGroupGetOperatorGroupMembersRequest */ -func (a *OperatorGroupApiService) OperatorGroupGetOperatorGroupMembers(ctx _context.Context, operatorGroupGuid string) ApiOperatorGroupGetOperatorGroupMembersRequest { +func (a *OperatorGroupApiService) OperatorGroupGetOperatorGroupMembers(ctx context.Context, operatorGroupGuid string) ApiOperatorGroupGetOperatorGroupMembersRequest { return ApiOperatorGroupGetOperatorGroupMembersRequest{ ApiService: a, ctx: ctx, @@ -1220,27 +1199,25 @@ func (a *OperatorGroupApiService) OperatorGroupGetOperatorGroupMembers(ctx _cont // Execute executes the request // @return OperatorGroupMember -func (a *OperatorGroupApiService) OperatorGroupGetOperatorGroupMembersExecute(r ApiOperatorGroupGetOperatorGroupMembersRequest) (OperatorGroupMember, *_nethttp.Response, error) { +func (a *OperatorGroupApiService) OperatorGroupGetOperatorGroupMembersExecute(r ApiOperatorGroupGetOperatorGroupMembersRequest) (*OperatorGroupMember, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue OperatorGroupMember + formFiles []formFile + localVarReturnValue *OperatorGroupMember ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorGroupApiService.OperatorGroupGetOperatorGroupMembers") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/OperatorGroup/{operatorGroupGuid}/Member" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", url.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1259,7 +1236,7 @@ func (a *OperatorGroupApiService) OperatorGroupGetOperatorGroupMembersExecute(r if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1269,15 +1246,15 @@ func (a *OperatorGroupApiService) OperatorGroupGetOperatorGroupMembersExecute(r return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1288,7 +1265,8 @@ func (a *OperatorGroupApiService) OperatorGroupGetOperatorGroupMembersExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1298,14 +1276,15 @@ func (a *OperatorGroupApiService) OperatorGroupGetOperatorGroupMembersExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1316,26 +1295,25 @@ func (a *OperatorGroupApiService) OperatorGroupGetOperatorGroupMembersExecute(r } type ApiOperatorGroupPostAuthorizationForOperatorGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorGroupApiService operatorGroupGuid string authorizationType string } - -func (r ApiOperatorGroupPostAuthorizationForOperatorGroupRequest) Execute() (*_nethttp.Response, error) { +func (r ApiOperatorGroupPostAuthorizationForOperatorGroupRequest) Execute() (*http.Response, error) { return r.ApiService.OperatorGroupPostAuthorizationForOperatorGroupExecute(r) } /* OperatorGroupPostAuthorizationForOperatorGroup Assigns the specified authorization to the operator group. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGroupGuid The Guid of the operator group @param authorizationType The type of authorization @return ApiOperatorGroupPostAuthorizationForOperatorGroupRequest */ -func (a *OperatorGroupApiService) OperatorGroupPostAuthorizationForOperatorGroup(ctx _context.Context, operatorGroupGuid string, authorizationType string) ApiOperatorGroupPostAuthorizationForOperatorGroupRequest { +func (a *OperatorGroupApiService) OperatorGroupPostAuthorizationForOperatorGroup(ctx context.Context, operatorGroupGuid string, authorizationType string) ApiOperatorGroupPostAuthorizationForOperatorGroupRequest { return ApiOperatorGroupPostAuthorizationForOperatorGroupRequest{ ApiService: a, ctx: ctx, @@ -1345,27 +1323,25 @@ func (a *OperatorGroupApiService) OperatorGroupPostAuthorizationForOperatorGroup } // Execute executes the request -func (a *OperatorGroupApiService) OperatorGroupPostAuthorizationForOperatorGroupExecute(r ApiOperatorGroupPostAuthorizationForOperatorGroupRequest) (*_nethttp.Response, error) { +func (a *OperatorGroupApiService) OperatorGroupPostAuthorizationForOperatorGroupExecute(r ApiOperatorGroupPostAuthorizationForOperatorGroupRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorGroupApiService.OperatorGroupPostAuthorizationForOperatorGroup") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/OperatorGroup/{operatorGroupGuid}/Authorization/{authorizationType}" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"authorizationType"+"}", _neturl.PathEscape(parameterToString(r.authorizationType, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", url.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"authorizationType"+"}", url.PathEscape(parameterToString(r.authorizationType, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1384,7 +1360,7 @@ func (a *OperatorGroupApiService) OperatorGroupPostAuthorizationForOperatorGroup if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1394,15 +1370,15 @@ func (a *OperatorGroupApiService) OperatorGroupPostAuthorizationForOperatorGroup return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1413,7 +1389,8 @@ func (a *OperatorGroupApiService) OperatorGroupPostAuthorizationForOperatorGroup newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1423,7 +1400,8 @@ func (a *OperatorGroupApiService) OperatorGroupPostAuthorizationForOperatorGroup newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -1432,26 +1410,25 @@ func (a *OperatorGroupApiService) OperatorGroupPostAuthorizationForOperatorGroup } type ApiOperatorGroupRemoveOperatorFromOperatorGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorGroupApiService operatorGroupGuid string operatorGuid string } - -func (r ApiOperatorGroupRemoveOperatorFromOperatorGroupRequest) Execute() (*_nethttp.Response, error) { +func (r ApiOperatorGroupRemoveOperatorFromOperatorGroupRequest) Execute() (*http.Response, error) { return r.ApiService.OperatorGroupRemoveOperatorFromOperatorGroupExecute(r) } /* OperatorGroupRemoveOperatorFromOperatorGroup Removes the specified operator from the operator group - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGroupGuid The Guid of the operator group to remove the operator from @param operatorGuid The operator Guid to be removed @return ApiOperatorGroupRemoveOperatorFromOperatorGroupRequest */ -func (a *OperatorGroupApiService) OperatorGroupRemoveOperatorFromOperatorGroup(ctx _context.Context, operatorGroupGuid string, operatorGuid string) ApiOperatorGroupRemoveOperatorFromOperatorGroupRequest { +func (a *OperatorGroupApiService) OperatorGroupRemoveOperatorFromOperatorGroup(ctx context.Context, operatorGroupGuid string, operatorGuid string) ApiOperatorGroupRemoveOperatorFromOperatorGroupRequest { return ApiOperatorGroupRemoveOperatorFromOperatorGroupRequest{ ApiService: a, ctx: ctx, @@ -1461,27 +1438,25 @@ func (a *OperatorGroupApiService) OperatorGroupRemoveOperatorFromOperatorGroup(c } // Execute executes the request -func (a *OperatorGroupApiService) OperatorGroupRemoveOperatorFromOperatorGroupExecute(r ApiOperatorGroupRemoveOperatorFromOperatorGroupRequest) (*_nethttp.Response, error) { +func (a *OperatorGroupApiService) OperatorGroupRemoveOperatorFromOperatorGroupExecute(r ApiOperatorGroupRemoveOperatorFromOperatorGroupRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorGroupApiService.OperatorGroupRemoveOperatorFromOperatorGroup") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/OperatorGroup/{operatorGroupGuid}/Member/{operatorGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", url.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGuid"+"}", url.PathEscape(parameterToString(r.operatorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1500,7 +1475,7 @@ func (a *OperatorGroupApiService) OperatorGroupRemoveOperatorFromOperatorGroupEx if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1510,15 +1485,15 @@ func (a *OperatorGroupApiService) OperatorGroupRemoveOperatorFromOperatorGroupEx return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1529,7 +1504,8 @@ func (a *OperatorGroupApiService) OperatorGroupRemoveOperatorFromOperatorGroupEx newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1539,7 +1515,8 @@ func (a *OperatorGroupApiService) OperatorGroupRemoveOperatorFromOperatorGroupEx newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -1548,7 +1525,7 @@ func (a *OperatorGroupApiService) OperatorGroupRemoveOperatorFromOperatorGroupEx } type ApiOperatorGroupUpdateOperatorGroupRequest struct { - ctx _context.Context + ctx context.Context ApiService *OperatorGroupApiService operatorGroupGuid string operatorGroup *OperatorGroup @@ -1560,18 +1537,18 @@ func (r ApiOperatorGroupUpdateOperatorGroupRequest) OperatorGroup(operatorGroup return r } -func (r ApiOperatorGroupUpdateOperatorGroupRequest) Execute() (*_nethttp.Response, error) { +func (r ApiOperatorGroupUpdateOperatorGroupRequest) Execute() (*http.Response, error) { return r.ApiService.OperatorGroupUpdateOperatorGroupExecute(r) } /* OperatorGroupUpdateOperatorGroup Updates the operator group with the Guid specified - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param operatorGroupGuid The Guid of the operator group to be updated @return ApiOperatorGroupUpdateOperatorGroupRequest */ -func (a *OperatorGroupApiService) OperatorGroupUpdateOperatorGroup(ctx _context.Context, operatorGroupGuid string) ApiOperatorGroupUpdateOperatorGroupRequest { +func (a *OperatorGroupApiService) OperatorGroupUpdateOperatorGroup(ctx context.Context, operatorGroupGuid string) ApiOperatorGroupUpdateOperatorGroupRequest { return ApiOperatorGroupUpdateOperatorGroupRequest{ ApiService: a, ctx: ctx, @@ -1580,29 +1557,24 @@ func (a *OperatorGroupApiService) OperatorGroupUpdateOperatorGroup(ctx _context. } // Execute executes the request -func (a *OperatorGroupApiService) OperatorGroupUpdateOperatorGroupExecute(r ApiOperatorGroupUpdateOperatorGroupRequest) (*_nethttp.Response, error) { +func (a *OperatorGroupApiService) OperatorGroupUpdateOperatorGroupExecute(r ApiOperatorGroupUpdateOperatorGroupRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatorGroupApiService.OperatorGroupUpdateOperatorGroup") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/OperatorGroup/{operatorGroupGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"operatorGroupGuid"+"}", url.PathEscape(parameterToString(r.operatorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.operatorGroup == nil { - return nil, reportError("operatorGroup is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -1623,7 +1595,7 @@ func (a *OperatorGroupApiService) OperatorGroupUpdateOperatorGroupExecute(r ApiO } // body params localVarPostBody = r.operatorGroup - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1633,15 +1605,15 @@ func (a *OperatorGroupApiService) OperatorGroupUpdateOperatorGroupExecute(r ApiO return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1652,7 +1624,8 @@ func (a *OperatorGroupApiService) OperatorGroupUpdateOperatorGroupExecute(r ApiO newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1662,7 +1635,8 @@ func (a *OperatorGroupApiService) OperatorGroupUpdateOperatorGroupExecute(r ApiO newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_outgoing_phone_number.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_outgoing_phone_number.go new file mode 100644 index 00000000..bde47fd3 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_outgoing_phone_number.go @@ -0,0 +1,130 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" +) + + +// OutgoingPhoneNumberApiService OutgoingPhoneNumberApi service +type OutgoingPhoneNumberApiService service + +type ApiOutgoingPhoneNumberGetAllOutgoingPhoneNumbersRequest struct { + ctx context.Context + ApiService *OutgoingPhoneNumberApiService +} + +func (r ApiOutgoingPhoneNumberGetAllOutgoingPhoneNumbersRequest) Execute() ([]OutgoingPhoneNumberDetails, *http.Response, error) { + return r.ApiService.OutgoingPhoneNumberGetAllOutgoingPhoneNumbersExecute(r) +} + +/* +OutgoingPhoneNumberGetAllOutgoingPhoneNumbers Gets a list of all outgoing phone numbers available. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiOutgoingPhoneNumberGetAllOutgoingPhoneNumbersRequest +*/ +func (a *OutgoingPhoneNumberApiService) OutgoingPhoneNumberGetAllOutgoingPhoneNumbers(ctx context.Context) ApiOutgoingPhoneNumberGetAllOutgoingPhoneNumbersRequest { + return ApiOutgoingPhoneNumberGetAllOutgoingPhoneNumbersRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []OutgoingPhoneNumberDetails +func (a *OutgoingPhoneNumberApiService) OutgoingPhoneNumberGetAllOutgoingPhoneNumbersExecute(r ApiOutgoingPhoneNumberGetAllOutgoingPhoneNumbersRequest) ([]OutgoingPhoneNumberDetails, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []OutgoingPhoneNumberDetails + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutgoingPhoneNumberApiService.OutgoingPhoneNumberGetAllOutgoingPhoneNumbers") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/OutgoingPhoneNumber" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_public_status_page.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_public_status_page.go index 680b6564..0e0507d8 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/api_public_status_page.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_public_status_page.go @@ -12,23 +12,19 @@ package uptrends import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // PublicStatusPageApiService PublicStatusPageApi service type PublicStatusPageApiService service type ApiPublicStatusPageAddAuthorizationToPublicStatusPageRequest struct { - ctx _context.Context + ctx context.Context ApiService *PublicStatusPageApiService publicStatusPageGuid string authorization *PSPAuthorization @@ -40,7 +36,7 @@ func (r ApiPublicStatusPageAddAuthorizationToPublicStatusPageRequest) Authorizat return r } -func (r ApiPublicStatusPageAddAuthorizationToPublicStatusPageRequest) Execute() (PSPAuthorization, *_nethttp.Response, error) { +func (r ApiPublicStatusPageAddAuthorizationToPublicStatusPageRequest) Execute() (*PSPAuthorization, *http.Response, error) { return r.ApiService.PublicStatusPageAddAuthorizationToPublicStatusPageExecute(r) } @@ -49,11 +45,11 @@ PublicStatusPageAddAuthorizationToPublicStatusPage Creates a new authorization f The AuthorizationId attribute should be omitted in the request body. The newly created authorization will be returned in the response. An authorization should be granted to either an individual operator, or an operator group. Therefore, either specify the OperatorGuid attribute or the OperatorGroupGuid attribute. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param publicStatusPageGuid The Guid of the public status page. @return ApiPublicStatusPageAddAuthorizationToPublicStatusPageRequest */ -func (a *PublicStatusPageApiService) PublicStatusPageAddAuthorizationToPublicStatusPage(ctx _context.Context, publicStatusPageGuid string) ApiPublicStatusPageAddAuthorizationToPublicStatusPageRequest { +func (a *PublicStatusPageApiService) PublicStatusPageAddAuthorizationToPublicStatusPage(ctx context.Context, publicStatusPageGuid string) ApiPublicStatusPageAddAuthorizationToPublicStatusPageRequest { return ApiPublicStatusPageAddAuthorizationToPublicStatusPageRequest{ ApiService: a, ctx: ctx, @@ -63,30 +59,25 @@ func (a *PublicStatusPageApiService) PublicStatusPageAddAuthorizationToPublicSta // Execute executes the request // @return PSPAuthorization -func (a *PublicStatusPageApiService) PublicStatusPageAddAuthorizationToPublicStatusPageExecute(r ApiPublicStatusPageAddAuthorizationToPublicStatusPageRequest) (PSPAuthorization, *_nethttp.Response, error) { +func (a *PublicStatusPageApiService) PublicStatusPageAddAuthorizationToPublicStatusPageExecute(r ApiPublicStatusPageAddAuthorizationToPublicStatusPageRequest) (*PSPAuthorization, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue PSPAuthorization + formFiles []formFile + localVarReturnValue *PSPAuthorization ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicStatusPageApiService.PublicStatusPageAddAuthorizationToPublicStatusPage") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/PublicStatusPage/{publicStatusPageGuid}/Authorization" - localVarPath = strings.Replace(localVarPath, "{"+"publicStatusPageGuid"+"}", _neturl.PathEscape(parameterToString(r.publicStatusPageGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicStatusPageGuid"+"}", url.PathEscape(parameterToString(r.publicStatusPageGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.authorization == nil { - return localVarReturnValue, nil, reportError("authorization is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -107,7 +98,7 @@ func (a *PublicStatusPageApiService) PublicStatusPageAddAuthorizationToPublicSta } // body params localVarPostBody = r.authorization - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -117,15 +108,15 @@ func (a *PublicStatusPageApiService) PublicStatusPageAddAuthorizationToPublicSta return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -136,7 +127,8 @@ func (a *PublicStatusPageApiService) PublicStatusPageAddAuthorizationToPublicSta newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -146,14 +138,15 @@ func (a *PublicStatusPageApiService) PublicStatusPageAddAuthorizationToPublicSta newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -164,24 +157,23 @@ func (a *PublicStatusPageApiService) PublicStatusPageAddAuthorizationToPublicSta } type ApiPublicStatusPageDeletePublicStatusPageRequest struct { - ctx _context.Context + ctx context.Context ApiService *PublicStatusPageApiService publicStatusPageGuid string } - -func (r ApiPublicStatusPageDeletePublicStatusPageRequest) Execute() (*_nethttp.Response, error) { +func (r ApiPublicStatusPageDeletePublicStatusPageRequest) Execute() (*http.Response, error) { return r.ApiService.PublicStatusPageDeletePublicStatusPageExecute(r) } /* PublicStatusPageDeletePublicStatusPage Deletes the definition of the specified public status page. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param publicStatusPageGuid The Guid of the public status page that should be updated. @return ApiPublicStatusPageDeletePublicStatusPageRequest */ -func (a *PublicStatusPageApiService) PublicStatusPageDeletePublicStatusPage(ctx _context.Context, publicStatusPageGuid string) ApiPublicStatusPageDeletePublicStatusPageRequest { +func (a *PublicStatusPageApiService) PublicStatusPageDeletePublicStatusPage(ctx context.Context, publicStatusPageGuid string) ApiPublicStatusPageDeletePublicStatusPageRequest { return ApiPublicStatusPageDeletePublicStatusPageRequest{ ApiService: a, ctx: ctx, @@ -190,26 +182,24 @@ func (a *PublicStatusPageApiService) PublicStatusPageDeletePublicStatusPage(ctx } // Execute executes the request -func (a *PublicStatusPageApiService) PublicStatusPageDeletePublicStatusPageExecute(r ApiPublicStatusPageDeletePublicStatusPageRequest) (*_nethttp.Response, error) { +func (a *PublicStatusPageApiService) PublicStatusPageDeletePublicStatusPageExecute(r ApiPublicStatusPageDeletePublicStatusPageRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicStatusPageApiService.PublicStatusPageDeletePublicStatusPage") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/PublicStatusPage/{publicStatusPageGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"publicStatusPageGuid"+"}", _neturl.PathEscape(parameterToString(r.publicStatusPageGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicStatusPageGuid"+"}", url.PathEscape(parameterToString(r.publicStatusPageGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -228,7 +218,7 @@ func (a *PublicStatusPageApiService) PublicStatusPageDeletePublicStatusPageExecu if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -238,15 +228,15 @@ func (a *PublicStatusPageApiService) PublicStatusPageDeletePublicStatusPageExecu return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -257,7 +247,8 @@ func (a *PublicStatusPageApiService) PublicStatusPageDeletePublicStatusPageExecu newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -267,7 +258,8 @@ func (a *PublicStatusPageApiService) PublicStatusPageDeletePublicStatusPageExecu newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -276,24 +268,23 @@ func (a *PublicStatusPageApiService) PublicStatusPageDeletePublicStatusPageExecu } type ApiPublicStatusPageGetAuthorizationsForPublicStatusPageRequest struct { - ctx _context.Context + ctx context.Context ApiService *PublicStatusPageApiService publicStatusPageGuid string } - -func (r ApiPublicStatusPageGetAuthorizationsForPublicStatusPageRequest) Execute() ([]PSPAuthorization, *_nethttp.Response, error) { +func (r ApiPublicStatusPageGetAuthorizationsForPublicStatusPageRequest) Execute() ([]PSPAuthorization, *http.Response, error) { return r.ApiService.PublicStatusPageGetAuthorizationsForPublicStatusPageExecute(r) } /* PublicStatusPageGetAuthorizationsForPublicStatusPage Returns all authorizations for the specified public status page. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param publicStatusPageGuid The Guid of the public status page. @return ApiPublicStatusPageGetAuthorizationsForPublicStatusPageRequest */ -func (a *PublicStatusPageApiService) PublicStatusPageGetAuthorizationsForPublicStatusPage(ctx _context.Context, publicStatusPageGuid string) ApiPublicStatusPageGetAuthorizationsForPublicStatusPageRequest { +func (a *PublicStatusPageApiService) PublicStatusPageGetAuthorizationsForPublicStatusPage(ctx context.Context, publicStatusPageGuid string) ApiPublicStatusPageGetAuthorizationsForPublicStatusPageRequest { return ApiPublicStatusPageGetAuthorizationsForPublicStatusPageRequest{ ApiService: a, ctx: ctx, @@ -303,27 +294,25 @@ func (a *PublicStatusPageApiService) PublicStatusPageGetAuthorizationsForPublicS // Execute executes the request // @return []PSPAuthorization -func (a *PublicStatusPageApiService) PublicStatusPageGetAuthorizationsForPublicStatusPageExecute(r ApiPublicStatusPageGetAuthorizationsForPublicStatusPageRequest) ([]PSPAuthorization, *_nethttp.Response, error) { +func (a *PublicStatusPageApiService) PublicStatusPageGetAuthorizationsForPublicStatusPageExecute(r ApiPublicStatusPageGetAuthorizationsForPublicStatusPageRequest) ([]PSPAuthorization, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []PSPAuthorization ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicStatusPageApiService.PublicStatusPageGetAuthorizationsForPublicStatusPage") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/PublicStatusPage/{publicStatusPageGuid}/Authorization" - localVarPath = strings.Replace(localVarPath, "{"+"publicStatusPageGuid"+"}", _neturl.PathEscape(parameterToString(r.publicStatusPageGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicStatusPageGuid"+"}", url.PathEscape(parameterToString(r.publicStatusPageGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -342,7 +331,7 @@ func (a *PublicStatusPageApiService) PublicStatusPageGetAuthorizationsForPublicS if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -352,15 +341,15 @@ func (a *PublicStatusPageApiService) PublicStatusPageGetAuthorizationsForPublicS return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -371,7 +360,8 @@ func (a *PublicStatusPageApiService) PublicStatusPageGetAuthorizationsForPublicS newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -381,14 +371,15 @@ func (a *PublicStatusPageApiService) PublicStatusPageGetAuthorizationsForPublicS newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -399,24 +390,23 @@ func (a *PublicStatusPageApiService) PublicStatusPageGetAuthorizationsForPublicS } type ApiPublicStatusPageGetPublicStatusPageRequest struct { - ctx _context.Context + ctx context.Context ApiService *PublicStatusPageApiService publicStatusPageGuid string } - -func (r ApiPublicStatusPageGetPublicStatusPageRequest) Execute() (PublicStatusPage, *_nethttp.Response, error) { +func (r ApiPublicStatusPageGetPublicStatusPageRequest) Execute() (*PublicStatusPage, *http.Response, error) { return r.ApiService.PublicStatusPageGetPublicStatusPageExecute(r) } /* PublicStatusPageGetPublicStatusPage Returns the definition of the specified public status page. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param publicStatusPageGuid The Guid of the requested public status page. @return ApiPublicStatusPageGetPublicStatusPageRequest */ -func (a *PublicStatusPageApiService) PublicStatusPageGetPublicStatusPage(ctx _context.Context, publicStatusPageGuid string) ApiPublicStatusPageGetPublicStatusPageRequest { +func (a *PublicStatusPageApiService) PublicStatusPageGetPublicStatusPage(ctx context.Context, publicStatusPageGuid string) ApiPublicStatusPageGetPublicStatusPageRequest { return ApiPublicStatusPageGetPublicStatusPageRequest{ ApiService: a, ctx: ctx, @@ -426,27 +416,25 @@ func (a *PublicStatusPageApiService) PublicStatusPageGetPublicStatusPage(ctx _co // Execute executes the request // @return PublicStatusPage -func (a *PublicStatusPageApiService) PublicStatusPageGetPublicStatusPageExecute(r ApiPublicStatusPageGetPublicStatusPageRequest) (PublicStatusPage, *_nethttp.Response, error) { +func (a *PublicStatusPageApiService) PublicStatusPageGetPublicStatusPageExecute(r ApiPublicStatusPageGetPublicStatusPageRequest) (*PublicStatusPage, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue PublicStatusPage + formFiles []formFile + localVarReturnValue *PublicStatusPage ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicStatusPageApiService.PublicStatusPageGetPublicStatusPage") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/PublicStatusPage/{publicStatusPageGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"publicStatusPageGuid"+"}", _neturl.PathEscape(parameterToString(r.publicStatusPageGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicStatusPageGuid"+"}", url.PathEscape(parameterToString(r.publicStatusPageGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -465,7 +453,7 @@ func (a *PublicStatusPageApiService) PublicStatusPageGetPublicStatusPageExecute( if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -475,15 +463,15 @@ func (a *PublicStatusPageApiService) PublicStatusPageGetPublicStatusPageExecute( return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -494,7 +482,8 @@ func (a *PublicStatusPageApiService) PublicStatusPageGetPublicStatusPageExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -504,14 +493,15 @@ func (a *PublicStatusPageApiService) PublicStatusPageGetPublicStatusPageExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -522,22 +512,21 @@ func (a *PublicStatusPageApiService) PublicStatusPageGetPublicStatusPageExecute( } type ApiPublicStatusPageGetPublicStatusPagesRequest struct { - ctx _context.Context + ctx context.Context ApiService *PublicStatusPageApiService } - -func (r ApiPublicStatusPageGetPublicStatusPagesRequest) Execute() ([]PublicStatusPage, *_nethttp.Response, error) { +func (r ApiPublicStatusPageGetPublicStatusPagesRequest) Execute() ([]PublicStatusPage, *http.Response, error) { return r.ApiService.PublicStatusPageGetPublicStatusPagesExecute(r) } /* PublicStatusPageGetPublicStatusPages Returns the definition of all public status pages available in the account. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiPublicStatusPageGetPublicStatusPagesRequest */ -func (a *PublicStatusPageApiService) PublicStatusPageGetPublicStatusPages(ctx _context.Context) ApiPublicStatusPageGetPublicStatusPagesRequest { +func (a *PublicStatusPageApiService) PublicStatusPageGetPublicStatusPages(ctx context.Context) ApiPublicStatusPageGetPublicStatusPagesRequest { return ApiPublicStatusPageGetPublicStatusPagesRequest{ ApiService: a, ctx: ctx, @@ -546,26 +535,24 @@ func (a *PublicStatusPageApiService) PublicStatusPageGetPublicStatusPages(ctx _c // Execute executes the request // @return []PublicStatusPage -func (a *PublicStatusPageApiService) PublicStatusPageGetPublicStatusPagesExecute(r ApiPublicStatusPageGetPublicStatusPagesRequest) ([]PublicStatusPage, *_nethttp.Response, error) { +func (a *PublicStatusPageApiService) PublicStatusPageGetPublicStatusPagesExecute(r ApiPublicStatusPageGetPublicStatusPagesRequest) ([]PublicStatusPage, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []PublicStatusPage ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicStatusPageApiService.PublicStatusPageGetPublicStatusPages") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/PublicStatusPage" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -584,7 +571,7 @@ func (a *PublicStatusPageApiService) PublicStatusPageGetPublicStatusPagesExecute if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -594,15 +581,15 @@ func (a *PublicStatusPageApiService) PublicStatusPageGetPublicStatusPagesExecute return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -613,14 +600,15 @@ func (a *PublicStatusPageApiService) PublicStatusPageGetPublicStatusPagesExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -631,7 +619,7 @@ func (a *PublicStatusPageApiService) PublicStatusPageGetPublicStatusPagesExecute } type ApiPublicStatusPagePatchPublicStatusPageRequest struct { - ctx _context.Context + ctx context.Context ApiService *PublicStatusPageApiService publicStatusPageGuid string publicStatusPage *PublicStatusPage @@ -643,7 +631,7 @@ func (r ApiPublicStatusPagePatchPublicStatusPageRequest) PublicStatusPage(public return r } -func (r ApiPublicStatusPagePatchPublicStatusPageRequest) Execute() (*_nethttp.Response, error) { +func (r ApiPublicStatusPagePatchPublicStatusPageRequest) Execute() (*http.Response, error) { return r.ApiService.PublicStatusPagePatchPublicStatusPageExecute(r) } @@ -652,11 +640,11 @@ PublicStatusPagePatchPublicStatusPage Partially updates the definition of the sp This methods accepts parts of a public status page definition. We recommend retrieving the existing definition first (using the GET method). You can then process the changes you want to make and send back these changes only using this PATCH method. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param publicStatusPageGuid The Guid of the public status page that should be updated. @return ApiPublicStatusPagePatchPublicStatusPageRequest */ -func (a *PublicStatusPageApiService) PublicStatusPagePatchPublicStatusPage(ctx _context.Context, publicStatusPageGuid string) ApiPublicStatusPagePatchPublicStatusPageRequest { +func (a *PublicStatusPageApiService) PublicStatusPagePatchPublicStatusPage(ctx context.Context, publicStatusPageGuid string) ApiPublicStatusPagePatchPublicStatusPageRequest { return ApiPublicStatusPagePatchPublicStatusPageRequest{ ApiService: a, ctx: ctx, @@ -665,29 +653,24 @@ func (a *PublicStatusPageApiService) PublicStatusPagePatchPublicStatusPage(ctx _ } // Execute executes the request -func (a *PublicStatusPageApiService) PublicStatusPagePatchPublicStatusPageExecute(r ApiPublicStatusPagePatchPublicStatusPageRequest) (*_nethttp.Response, error) { +func (a *PublicStatusPageApiService) PublicStatusPagePatchPublicStatusPageExecute(r ApiPublicStatusPagePatchPublicStatusPageRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicStatusPageApiService.PublicStatusPagePatchPublicStatusPage") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/PublicStatusPage/{publicStatusPageGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"publicStatusPageGuid"+"}", _neturl.PathEscape(parameterToString(r.publicStatusPageGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicStatusPageGuid"+"}", url.PathEscape(parameterToString(r.publicStatusPageGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.publicStatusPage == nil { - return nil, reportError("publicStatusPage is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -708,7 +691,7 @@ func (a *PublicStatusPageApiService) PublicStatusPagePatchPublicStatusPageExecut } // body params localVarPostBody = r.publicStatusPage - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -718,15 +701,15 @@ func (a *PublicStatusPageApiService) PublicStatusPagePatchPublicStatusPageExecut return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -737,7 +720,8 @@ func (a *PublicStatusPageApiService) PublicStatusPagePatchPublicStatusPageExecut newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -747,7 +731,8 @@ func (a *PublicStatusPageApiService) PublicStatusPagePatchPublicStatusPageExecut newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -756,7 +741,7 @@ func (a *PublicStatusPageApiService) PublicStatusPagePatchPublicStatusPageExecut } type ApiPublicStatusPagePostPublicStatusPageRequest struct { - ctx _context.Context + ctx context.Context ApiService *PublicStatusPageApiService publicStatusPage *PublicStatusPage } @@ -767,17 +752,17 @@ func (r ApiPublicStatusPagePostPublicStatusPageRequest) PublicStatusPage(publicS return r } -func (r ApiPublicStatusPagePostPublicStatusPageRequest) Execute() (PublicStatusPage, *_nethttp.Response, error) { +func (r ApiPublicStatusPagePostPublicStatusPageRequest) Execute() (*PublicStatusPage, *http.Response, error) { return r.ApiService.PublicStatusPagePostPublicStatusPageExecute(r) } /* PublicStatusPagePostPublicStatusPage Creates a new public status page. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiPublicStatusPagePostPublicStatusPageRequest */ -func (a *PublicStatusPageApiService) PublicStatusPagePostPublicStatusPage(ctx _context.Context) ApiPublicStatusPagePostPublicStatusPageRequest { +func (a *PublicStatusPageApiService) PublicStatusPagePostPublicStatusPage(ctx context.Context) ApiPublicStatusPagePostPublicStatusPageRequest { return ApiPublicStatusPagePostPublicStatusPageRequest{ ApiService: a, ctx: ctx, @@ -786,29 +771,24 @@ func (a *PublicStatusPageApiService) PublicStatusPagePostPublicStatusPage(ctx _c // Execute executes the request // @return PublicStatusPage -func (a *PublicStatusPageApiService) PublicStatusPagePostPublicStatusPageExecute(r ApiPublicStatusPagePostPublicStatusPageRequest) (PublicStatusPage, *_nethttp.Response, error) { +func (a *PublicStatusPageApiService) PublicStatusPagePostPublicStatusPageExecute(r ApiPublicStatusPagePostPublicStatusPageRequest) (*PublicStatusPage, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue PublicStatusPage + formFiles []formFile + localVarReturnValue *PublicStatusPage ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicStatusPageApiService.PublicStatusPagePostPublicStatusPage") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/PublicStatusPage" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.publicStatusPage == nil { - return localVarReturnValue, nil, reportError("publicStatusPage is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -829,7 +809,7 @@ func (a *PublicStatusPageApiService) PublicStatusPagePostPublicStatusPageExecute } // body params localVarPostBody = r.publicStatusPage - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -839,15 +819,15 @@ func (a *PublicStatusPageApiService) PublicStatusPagePostPublicStatusPageExecute return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -858,7 +838,8 @@ func (a *PublicStatusPageApiService) PublicStatusPagePostPublicStatusPageExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -868,14 +849,15 @@ func (a *PublicStatusPageApiService) PublicStatusPagePostPublicStatusPageExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -886,7 +868,7 @@ func (a *PublicStatusPageApiService) PublicStatusPagePostPublicStatusPageExecute } type ApiPublicStatusPagePutPublicStatusPageRequest struct { - ctx _context.Context + ctx context.Context ApiService *PublicStatusPageApiService publicStatusPageGuid string publicStatusPage *PublicStatusPage @@ -898,7 +880,7 @@ func (r ApiPublicStatusPagePutPublicStatusPageRequest) PublicStatusPage(publicSt return r } -func (r ApiPublicStatusPagePutPublicStatusPageRequest) Execute() (*_nethttp.Response, error) { +func (r ApiPublicStatusPagePutPublicStatusPageRequest) Execute() (*http.Response, error) { return r.ApiService.PublicStatusPagePutPublicStatusPageExecute(r) } @@ -907,11 +889,11 @@ PublicStatusPagePutPublicStatusPage Updates the definition of the specified publ This methods only accepts a complete public status page definition. We recommend retrieving the existing definition first (using the GET method). You can then process the changes you want to make and send back the updated definition using this PUT method. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param publicStatusPageGuid The Guid of the public status page that should be updated. @return ApiPublicStatusPagePutPublicStatusPageRequest */ -func (a *PublicStatusPageApiService) PublicStatusPagePutPublicStatusPage(ctx _context.Context, publicStatusPageGuid string) ApiPublicStatusPagePutPublicStatusPageRequest { +func (a *PublicStatusPageApiService) PublicStatusPagePutPublicStatusPage(ctx context.Context, publicStatusPageGuid string) ApiPublicStatusPagePutPublicStatusPageRequest { return ApiPublicStatusPagePutPublicStatusPageRequest{ ApiService: a, ctx: ctx, @@ -920,29 +902,24 @@ func (a *PublicStatusPageApiService) PublicStatusPagePutPublicStatusPage(ctx _co } // Execute executes the request -func (a *PublicStatusPageApiService) PublicStatusPagePutPublicStatusPageExecute(r ApiPublicStatusPagePutPublicStatusPageRequest) (*_nethttp.Response, error) { +func (a *PublicStatusPageApiService) PublicStatusPagePutPublicStatusPageExecute(r ApiPublicStatusPagePutPublicStatusPageRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicStatusPageApiService.PublicStatusPagePutPublicStatusPage") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/PublicStatusPage/{publicStatusPageGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"publicStatusPageGuid"+"}", _neturl.PathEscape(parameterToString(r.publicStatusPageGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicStatusPageGuid"+"}", url.PathEscape(parameterToString(r.publicStatusPageGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.publicStatusPage == nil { - return nil, reportError("publicStatusPage is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -963,7 +940,7 @@ func (a *PublicStatusPageApiService) PublicStatusPagePutPublicStatusPageExecute( } // body params localVarPostBody = r.publicStatusPage - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -973,15 +950,15 @@ func (a *PublicStatusPageApiService) PublicStatusPagePutPublicStatusPageExecute( return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -992,7 +969,8 @@ func (a *PublicStatusPageApiService) PublicStatusPagePutPublicStatusPageExecute( newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1002,7 +980,8 @@ func (a *PublicStatusPageApiService) PublicStatusPagePutPublicStatusPageExecute( newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -1011,26 +990,25 @@ func (a *PublicStatusPageApiService) PublicStatusPagePutPublicStatusPageExecute( } type ApiPublicStatusPageRemoveAuthorizationFromPublicStatusPageRequest struct { - ctx _context.Context + ctx context.Context ApiService *PublicStatusPageApiService publicStatusPageGuid string authorizationGuid string } - -func (r ApiPublicStatusPageRemoveAuthorizationFromPublicStatusPageRequest) Execute() (*_nethttp.Response, error) { +func (r ApiPublicStatusPageRemoveAuthorizationFromPublicStatusPageRequest) Execute() (*http.Response, error) { return r.ApiService.PublicStatusPageRemoveAuthorizationFromPublicStatusPageExecute(r) } /* PublicStatusPageRemoveAuthorizationFromPublicStatusPage Removes an authorization from a public status page. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param publicStatusPageGuid The Guid of the public status page. @param authorizationGuid The Guid of the authorization. @return ApiPublicStatusPageRemoveAuthorizationFromPublicStatusPageRequest */ -func (a *PublicStatusPageApiService) PublicStatusPageRemoveAuthorizationFromPublicStatusPage(ctx _context.Context, publicStatusPageGuid string, authorizationGuid string) ApiPublicStatusPageRemoveAuthorizationFromPublicStatusPageRequest { +func (a *PublicStatusPageApiService) PublicStatusPageRemoveAuthorizationFromPublicStatusPage(ctx context.Context, publicStatusPageGuid string, authorizationGuid string) ApiPublicStatusPageRemoveAuthorizationFromPublicStatusPageRequest { return ApiPublicStatusPageRemoveAuthorizationFromPublicStatusPageRequest{ ApiService: a, ctx: ctx, @@ -1040,27 +1018,25 @@ func (a *PublicStatusPageApiService) PublicStatusPageRemoveAuthorizationFromPubl } // Execute executes the request -func (a *PublicStatusPageApiService) PublicStatusPageRemoveAuthorizationFromPublicStatusPageExecute(r ApiPublicStatusPageRemoveAuthorizationFromPublicStatusPageRequest) (*_nethttp.Response, error) { +func (a *PublicStatusPageApiService) PublicStatusPageRemoveAuthorizationFromPublicStatusPageExecute(r ApiPublicStatusPageRemoveAuthorizationFromPublicStatusPageRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicStatusPageApiService.PublicStatusPageRemoveAuthorizationFromPublicStatusPage") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/PublicStatusPage/{publicStatusPageGuid}/Authorization/{authorizationGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"publicStatusPageGuid"+"}", _neturl.PathEscape(parameterToString(r.publicStatusPageGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"authorizationGuid"+"}", _neturl.PathEscape(parameterToString(r.authorizationGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicStatusPageGuid"+"}", url.PathEscape(parameterToString(r.publicStatusPageGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"authorizationGuid"+"}", url.PathEscape(parameterToString(r.authorizationGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1079,7 +1055,7 @@ func (a *PublicStatusPageApiService) PublicStatusPageRemoveAuthorizationFromPubl if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1089,15 +1065,15 @@ func (a *PublicStatusPageApiService) PublicStatusPageRemoveAuthorizationFromPubl return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1108,7 +1084,8 @@ func (a *PublicStatusPageApiService) PublicStatusPageRemoveAuthorizationFromPubl newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1118,7 +1095,8 @@ func (a *PublicStatusPageApiService) PublicStatusPageRemoveAuthorizationFromPubl newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_register.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_register.go index 87acb52b..e5d7a76d 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/api_register.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_register.go @@ -12,27 +12,36 @@ package uptrends import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) // RegisterApiService RegisterApi service type RegisterApiService service type ApiRegisterPostRequest struct { - ctx _context.Context + ctx context.Context ApiService *RegisterApiService + description *string + operatorGuid *string +} + +// An optional description for the new API account, e.g. \"API\". If this is empty, it will be defaulted to \"API\" +func (r ApiRegisterPostRequest) Description(description string) ApiRegisterPostRequest { + r.description = &description + return r } +// The operator guid for which the new API account needs to be created. Leave empty to create an API acount for your own operator. +func (r ApiRegisterPostRequest) OperatorGuid(operatorGuid string) ApiRegisterPostRequest { + r.operatorGuid = &operatorGuid + return r +} -func (r ApiRegisterPostRequest) Execute() (RegistrationResponse, *_nethttp.Response, error) { +func (r ApiRegisterPostRequest) Execute() (*RegistrationResponse, *http.Response, error) { return r.ApiService.RegisterPostExecute(r) } @@ -41,10 +50,10 @@ RegisterPost Creates a new API account. This method requires that you specify the username and password of an Uptrends operator login as authentication. When registration is successful, please save the UserName and Password fields from the response; these are your new API credentials. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiRegisterPostRequest */ -func (a *RegisterApiService) RegisterPost(ctx _context.Context) ApiRegisterPostRequest { +func (a *RegisterApiService) RegisterPost(ctx context.Context) ApiRegisterPostRequest { return ApiRegisterPostRequest{ ApiService: a, ctx: ctx, @@ -53,27 +62,31 @@ func (a *RegisterApiService) RegisterPost(ctx _context.Context) ApiRegisterPostR // Execute executes the request // @return RegistrationResponse -func (a *RegisterApiService) RegisterPostExecute(r ApiRegisterPostRequest) (RegistrationResponse, *_nethttp.Response, error) { +func (a *RegisterApiService) RegisterPostExecute(r ApiRegisterPostRequest) (*RegistrationResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue RegistrationResponse + formFiles []formFile + localVarReturnValue *RegistrationResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RegisterApiService.RegisterPost") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Register" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.description != nil { + localVarQueryParams.Add("description", parameterToString(*r.description, "")) + } + if r.operatorGuid != nil { + localVarQueryParams.Add("operatorGuid", parameterToString(*r.operatorGuid, "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -91,7 +104,7 @@ func (a *RegisterApiService) RegisterPostExecute(r ApiRegisterPostRequest) (Regi if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -101,15 +114,15 @@ func (a *RegisterApiService) RegisterPostExecute(r ApiRegisterPostRequest) (Regi return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -118,7 +131,7 @@ func (a *RegisterApiService) RegisterPostExecute(r ApiRegisterPostRequest) (Regi err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_rum.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_rum.go new file mode 100644 index 00000000..35510da8 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_rum.go @@ -0,0 +1,430 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + + +// RUMApiService RUMApi service +type RUMApiService service + +type ApiRumGetRumMetricsForAllWebsitesRequest struct { + ctx context.Context + ApiService *RUMApiService + websiteFilter *string + start *interface{} + end *interface{} + presetPeriod *string +} + +// A search pattern to filter for matching RUM website descriptions. Wildcards (? and *) are allowed. To filter for multiple patterns, use the | symbol as separator. +func (r ApiRumGetRumMetricsForAllWebsitesRequest) WebsiteFilter(websiteFilter string) ApiRumGetRumMetricsForAllWebsitesRequest { + r.websiteFilter = &websiteFilter + return r +} + +// The start of a custom period (can't be used together with the PresetPeriod parameter) +func (r ApiRumGetRumMetricsForAllWebsitesRequest) Start(start interface{}) ApiRumGetRumMetricsForAllWebsitesRequest { + r.start = &start + return r +} + +// The end of a custom period +func (r ApiRumGetRumMetricsForAllWebsitesRequest) End(end interface{}) ApiRumGetRumMetricsForAllWebsitesRequest { + r.end = &end + return r +} + +// The requested time period. +func (r ApiRumGetRumMetricsForAllWebsitesRequest) PresetPeriod(presetPeriod string) ApiRumGetRumMetricsForAllWebsitesRequest { + r.presetPeriod = &presetPeriod + return r +} + +func (r ApiRumGetRumMetricsForAllWebsitesRequest) Execute() ([]RumWebsiteWithMetricValues, *http.Response, error) { + return r.ApiService.RumGetRumMetricsForAllWebsitesExecute(r) +} + +/* +RumGetRumMetricsForAllWebsites Returns all metrics of all RUM websites. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRumGetRumMetricsForAllWebsitesRequest +*/ +func (a *RUMApiService) RumGetRumMetricsForAllWebsites(ctx context.Context) ApiRumGetRumMetricsForAllWebsitesRequest { + return ApiRumGetRumMetricsForAllWebsitesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []RumWebsiteWithMetricValues +func (a *RUMApiService) RumGetRumMetricsForAllWebsitesExecute(r ApiRumGetRumMetricsForAllWebsitesRequest) ([]RumWebsiteWithMetricValues, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []RumWebsiteWithMetricValues + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RUMApiService.RumGetRumMetricsForAllWebsites") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/Rum/Website/Metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.websiteFilter != nil { + localVarQueryParams.Add("WebsiteFilter", parameterToString(*r.websiteFilter, "")) + } + if r.start != nil { + localVarQueryParams.Add("Start", parameterToString(*r.start, "")) + } + if r.end != nil { + localVarQueryParams.Add("End", parameterToString(*r.end, "")) + } + if r.presetPeriod != nil { + localVarQueryParams.Add("PresetPeriod", parameterToString(*r.presetPeriod, "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRumGetRumWebsiteMetricsRequest struct { + ctx context.Context + ApiService *RUMApiService + rumWebsiteGuid string + start *interface{} + end *interface{} + presetPeriod *string +} + +// The start of a custom period (can't be used together with the PresetPeriod parameter) +func (r ApiRumGetRumWebsiteMetricsRequest) Start(start interface{}) ApiRumGetRumWebsiteMetricsRequest { + r.start = &start + return r +} + +// The end of a custom period +func (r ApiRumGetRumWebsiteMetricsRequest) End(end interface{}) ApiRumGetRumWebsiteMetricsRequest { + r.end = &end + return r +} + +// The requested time period. +func (r ApiRumGetRumWebsiteMetricsRequest) PresetPeriod(presetPeriod string) ApiRumGetRumWebsiteMetricsRequest { + r.presetPeriod = &presetPeriod + return r +} + +func (r ApiRumGetRumWebsiteMetricsRequest) Execute() ([]RumMetricValues, *http.Response, error) { + return r.ApiService.RumGetRumWebsiteMetricsExecute(r) +} + +/* +RumGetRumWebsiteMetrics Returns all metrics of the specified RUM website. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param rumWebsiteGuid + @return ApiRumGetRumWebsiteMetricsRequest +*/ +func (a *RUMApiService) RumGetRumWebsiteMetrics(ctx context.Context, rumWebsiteGuid string) ApiRumGetRumWebsiteMetricsRequest { + return ApiRumGetRumWebsiteMetricsRequest{ + ApiService: a, + ctx: ctx, + rumWebsiteGuid: rumWebsiteGuid, + } +} + +// Execute executes the request +// @return []RumMetricValues +func (a *RUMApiService) RumGetRumWebsiteMetricsExecute(r ApiRumGetRumWebsiteMetricsRequest) ([]RumMetricValues, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []RumMetricValues + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RUMApiService.RumGetRumWebsiteMetrics") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/Rum/Website/{rumWebsiteGuid}/Metrics" + localVarPath = strings.Replace(localVarPath, "{"+"rumWebsiteGuid"+"}", url.PathEscape(parameterToString(r.rumWebsiteGuid, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.start != nil { + localVarQueryParams.Add("Start", parameterToString(*r.start, "")) + } + if r.end != nil { + localVarQueryParams.Add("End", parameterToString(*r.end, "")) + } + if r.presetPeriod != nil { + localVarQueryParams.Add("PresetPeriod", parameterToString(*r.presetPeriod, "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRumGetRumWebsitesRequest struct { + ctx context.Context + ApiService *RUMApiService +} + +func (r ApiRumGetRumWebsitesRequest) Execute() ([]RumWebsite, *http.Response, error) { + return r.ApiService.RumGetRumWebsitesExecute(r) +} + +/* +RumGetRumWebsites Returns the definition of all RUM websites available in the account. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRumGetRumWebsitesRequest +*/ +func (a *RUMApiService) RumGetRumWebsites(ctx context.Context) ApiRumGetRumWebsitesRequest { + return ApiRumGetRumWebsitesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []RumWebsite +func (a *RUMApiService) RumGetRumWebsitesExecute(r ApiRumGetRumWebsitesRequest) ([]RumWebsite, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []RumWebsite + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RUMApiService.RumGetRumWebsites") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/Rum/Website" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_scheduled_report.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_scheduled_report.go index 1a01c6d5..46c51eb0 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/api_scheduled_report.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_scheduled_report.go @@ -12,23 +12,19 @@ package uptrends import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // ScheduledReportApiService ScheduledReportApi service type ScheduledReportApiService service type ApiScheduledReportCreateScheduledReportRequest struct { - ctx _context.Context + ctx context.Context ApiService *ScheduledReportApiService scheduledReport *ScheduledReport } @@ -39,17 +35,17 @@ func (r ApiScheduledReportCreateScheduledReportRequest) ScheduledReport(schedule return r } -func (r ApiScheduledReportCreateScheduledReportRequest) Execute() (ScheduledReport, *_nethttp.Response, error) { +func (r ApiScheduledReportCreateScheduledReportRequest) Execute() (*ScheduledReport, *http.Response, error) { return r.ApiService.ScheduledReportCreateScheduledReportExecute(r) } /* ScheduledReportCreateScheduledReport Creates a new scheduled report. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiScheduledReportCreateScheduledReportRequest */ -func (a *ScheduledReportApiService) ScheduledReportCreateScheduledReport(ctx _context.Context) ApiScheduledReportCreateScheduledReportRequest { +func (a *ScheduledReportApiService) ScheduledReportCreateScheduledReport(ctx context.Context) ApiScheduledReportCreateScheduledReportRequest { return ApiScheduledReportCreateScheduledReportRequest{ ApiService: a, ctx: ctx, @@ -58,29 +54,24 @@ func (a *ScheduledReportApiService) ScheduledReportCreateScheduledReport(ctx _co // Execute executes the request // @return ScheduledReport -func (a *ScheduledReportApiService) ScheduledReportCreateScheduledReportExecute(r ApiScheduledReportCreateScheduledReportRequest) (ScheduledReport, *_nethttp.Response, error) { +func (a *ScheduledReportApiService) ScheduledReportCreateScheduledReportExecute(r ApiScheduledReportCreateScheduledReportRequest) (*ScheduledReport, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ScheduledReport + formFiles []formFile + localVarReturnValue *ScheduledReport ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScheduledReportApiService.ScheduledReportCreateScheduledReport") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/ScheduledReport" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.scheduledReport == nil { - return localVarReturnValue, nil, reportError("scheduledReport is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -101,7 +92,7 @@ func (a *ScheduledReportApiService) ScheduledReportCreateScheduledReportExecute( } // body params localVarPostBody = r.scheduledReport - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -111,15 +102,15 @@ func (a *ScheduledReportApiService) ScheduledReportCreateScheduledReportExecute( return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -130,14 +121,15 @@ func (a *ScheduledReportApiService) ScheduledReportCreateScheduledReportExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -148,24 +140,23 @@ func (a *ScheduledReportApiService) ScheduledReportCreateScheduledReportExecute( } type ApiScheduledReportDeleteSpecifiedScheduledReportRequest struct { - ctx _context.Context + ctx context.Context ApiService *ScheduledReportApiService scheduledReportGuid string } - -func (r ApiScheduledReportDeleteSpecifiedScheduledReportRequest) Execute() (*_nethttp.Response, error) { +func (r ApiScheduledReportDeleteSpecifiedScheduledReportRequest) Execute() (*http.Response, error) { return r.ApiService.ScheduledReportDeleteSpecifiedScheduledReportExecute(r) } /* ScheduledReportDeleteSpecifiedScheduledReport Delete the specified scheduled report. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param scheduledReportGuid The guid of the specified scheduled report. @return ApiScheduledReportDeleteSpecifiedScheduledReportRequest */ -func (a *ScheduledReportApiService) ScheduledReportDeleteSpecifiedScheduledReport(ctx _context.Context, scheduledReportGuid string) ApiScheduledReportDeleteSpecifiedScheduledReportRequest { +func (a *ScheduledReportApiService) ScheduledReportDeleteSpecifiedScheduledReport(ctx context.Context, scheduledReportGuid string) ApiScheduledReportDeleteSpecifiedScheduledReportRequest { return ApiScheduledReportDeleteSpecifiedScheduledReportRequest{ ApiService: a, ctx: ctx, @@ -174,26 +165,24 @@ func (a *ScheduledReportApiService) ScheduledReportDeleteSpecifiedScheduledRepor } // Execute executes the request -func (a *ScheduledReportApiService) ScheduledReportDeleteSpecifiedScheduledReportExecute(r ApiScheduledReportDeleteSpecifiedScheduledReportRequest) (*_nethttp.Response, error) { +func (a *ScheduledReportApiService) ScheduledReportDeleteSpecifiedScheduledReportExecute(r ApiScheduledReportDeleteSpecifiedScheduledReportRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScheduledReportApiService.ScheduledReportDeleteSpecifiedScheduledReport") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/ScheduledReport/{scheduledReportGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"scheduledReportGuid"+"}", _neturl.PathEscape(parameterToString(r.scheduledReportGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"scheduledReportGuid"+"}", url.PathEscape(parameterToString(r.scheduledReportGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -212,7 +201,7 @@ func (a *ScheduledReportApiService) ScheduledReportDeleteSpecifiedScheduledRepor if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -222,15 +211,15 @@ func (a *ScheduledReportApiService) ScheduledReportDeleteSpecifiedScheduledRepor return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -241,7 +230,8 @@ func (a *ScheduledReportApiService) ScheduledReportDeleteSpecifiedScheduledRepor newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -251,7 +241,8 @@ func (a *ScheduledReportApiService) ScheduledReportDeleteSpecifiedScheduledRepor newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -260,22 +251,21 @@ func (a *ScheduledReportApiService) ScheduledReportDeleteSpecifiedScheduledRepor } type ApiScheduledReportGetAllScheduledReportsRequest struct { - ctx _context.Context + ctx context.Context ApiService *ScheduledReportApiService } - -func (r ApiScheduledReportGetAllScheduledReportsRequest) Execute() ([]ScheduledReport, *_nethttp.Response, error) { +func (r ApiScheduledReportGetAllScheduledReportsRequest) Execute() ([]ScheduledReport, *http.Response, error) { return r.ApiService.ScheduledReportGetAllScheduledReportsExecute(r) } /* ScheduledReportGetAllScheduledReports Returns data for all scheduled reports. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiScheduledReportGetAllScheduledReportsRequest */ -func (a *ScheduledReportApiService) ScheduledReportGetAllScheduledReports(ctx _context.Context) ApiScheduledReportGetAllScheduledReportsRequest { +func (a *ScheduledReportApiService) ScheduledReportGetAllScheduledReports(ctx context.Context) ApiScheduledReportGetAllScheduledReportsRequest { return ApiScheduledReportGetAllScheduledReportsRequest{ ApiService: a, ctx: ctx, @@ -284,26 +274,24 @@ func (a *ScheduledReportApiService) ScheduledReportGetAllScheduledReports(ctx _c // Execute executes the request // @return []ScheduledReport -func (a *ScheduledReportApiService) ScheduledReportGetAllScheduledReportsExecute(r ApiScheduledReportGetAllScheduledReportsRequest) ([]ScheduledReport, *_nethttp.Response, error) { +func (a *ScheduledReportApiService) ScheduledReportGetAllScheduledReportsExecute(r ApiScheduledReportGetAllScheduledReportsRequest) ([]ScheduledReport, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []ScheduledReport ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScheduledReportApiService.ScheduledReportGetAllScheduledReports") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/ScheduledReport" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -322,7 +310,7 @@ func (a *ScheduledReportApiService) ScheduledReportGetAllScheduledReportsExecute if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -332,15 +320,15 @@ func (a *ScheduledReportApiService) ScheduledReportGetAllScheduledReportsExecute return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -351,14 +339,15 @@ func (a *ScheduledReportApiService) ScheduledReportGetAllScheduledReportsExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -369,24 +358,23 @@ func (a *ScheduledReportApiService) ScheduledReportGetAllScheduledReportsExecute } type ApiScheduledReportGetSpecifiedScheduledReportRequest struct { - ctx _context.Context + ctx context.Context ApiService *ScheduledReportApiService scheduledReportGuid string } - -func (r ApiScheduledReportGetSpecifiedScheduledReportRequest) Execute() (ScheduledReport, *_nethttp.Response, error) { +func (r ApiScheduledReportGetSpecifiedScheduledReportRequest) Execute() (*ScheduledReport, *http.Response, error) { return r.ApiService.ScheduledReportGetSpecifiedScheduledReportExecute(r) } /* ScheduledReportGetSpecifiedScheduledReport Returns data for the specified scheduled report. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param scheduledReportGuid The guid of the specified scheduled report. @return ApiScheduledReportGetSpecifiedScheduledReportRequest */ -func (a *ScheduledReportApiService) ScheduledReportGetSpecifiedScheduledReport(ctx _context.Context, scheduledReportGuid string) ApiScheduledReportGetSpecifiedScheduledReportRequest { +func (a *ScheduledReportApiService) ScheduledReportGetSpecifiedScheduledReport(ctx context.Context, scheduledReportGuid string) ApiScheduledReportGetSpecifiedScheduledReportRequest { return ApiScheduledReportGetSpecifiedScheduledReportRequest{ ApiService: a, ctx: ctx, @@ -396,27 +384,25 @@ func (a *ScheduledReportApiService) ScheduledReportGetSpecifiedScheduledReport(c // Execute executes the request // @return ScheduledReport -func (a *ScheduledReportApiService) ScheduledReportGetSpecifiedScheduledReportExecute(r ApiScheduledReportGetSpecifiedScheduledReportRequest) (ScheduledReport, *_nethttp.Response, error) { +func (a *ScheduledReportApiService) ScheduledReportGetSpecifiedScheduledReportExecute(r ApiScheduledReportGetSpecifiedScheduledReportRequest) (*ScheduledReport, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ScheduledReport + formFiles []formFile + localVarReturnValue *ScheduledReport ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScheduledReportApiService.ScheduledReportGetSpecifiedScheduledReport") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/ScheduledReport/{scheduledReportGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"scheduledReportGuid"+"}", _neturl.PathEscape(parameterToString(r.scheduledReportGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"scheduledReportGuid"+"}", url.PathEscape(parameterToString(r.scheduledReportGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -435,7 +421,7 @@ func (a *ScheduledReportApiService) ScheduledReportGetSpecifiedScheduledReportEx if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -445,15 +431,15 @@ func (a *ScheduledReportApiService) ScheduledReportGetSpecifiedScheduledReportEx return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -464,7 +450,8 @@ func (a *ScheduledReportApiService) ScheduledReportGetSpecifiedScheduledReportEx newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -474,14 +461,15 @@ func (a *ScheduledReportApiService) ScheduledReportGetSpecifiedScheduledReportEx newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -492,7 +480,7 @@ func (a *ScheduledReportApiService) ScheduledReportGetSpecifiedScheduledReportEx } type ApiScheduledReportPartiallyUpdateScheduledReportRequest struct { - ctx _context.Context + ctx context.Context ApiService *ScheduledReportApiService scheduledReportGuid string scheduledReport *ScheduledReport @@ -504,18 +492,18 @@ func (r ApiScheduledReportPartiallyUpdateScheduledReportRequest) ScheduledReport return r } -func (r ApiScheduledReportPartiallyUpdateScheduledReportRequest) Execute() (ScheduledReport, *_nethttp.Response, error) { +func (r ApiScheduledReportPartiallyUpdateScheduledReportRequest) Execute() (*ScheduledReport, *http.Response, error) { return r.ApiService.ScheduledReportPartiallyUpdateScheduledReportExecute(r) } /* ScheduledReportPartiallyUpdateScheduledReport Partially update the specified scheduled report. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param scheduledReportGuid The guid of the specified scheduled report. @return ApiScheduledReportPartiallyUpdateScheduledReportRequest */ -func (a *ScheduledReportApiService) ScheduledReportPartiallyUpdateScheduledReport(ctx _context.Context, scheduledReportGuid string) ApiScheduledReportPartiallyUpdateScheduledReportRequest { +func (a *ScheduledReportApiService) ScheduledReportPartiallyUpdateScheduledReport(ctx context.Context, scheduledReportGuid string) ApiScheduledReportPartiallyUpdateScheduledReportRequest { return ApiScheduledReportPartiallyUpdateScheduledReportRequest{ ApiService: a, ctx: ctx, @@ -525,30 +513,25 @@ func (a *ScheduledReportApiService) ScheduledReportPartiallyUpdateScheduledRepor // Execute executes the request // @return ScheduledReport -func (a *ScheduledReportApiService) ScheduledReportPartiallyUpdateScheduledReportExecute(r ApiScheduledReportPartiallyUpdateScheduledReportRequest) (ScheduledReport, *_nethttp.Response, error) { +func (a *ScheduledReportApiService) ScheduledReportPartiallyUpdateScheduledReportExecute(r ApiScheduledReportPartiallyUpdateScheduledReportRequest) (*ScheduledReport, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ScheduledReport + formFiles []formFile + localVarReturnValue *ScheduledReport ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScheduledReportApiService.ScheduledReportPartiallyUpdateScheduledReport") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/ScheduledReport/{scheduledReportGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"scheduledReportGuid"+"}", _neturl.PathEscape(parameterToString(r.scheduledReportGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"scheduledReportGuid"+"}", url.PathEscape(parameterToString(r.scheduledReportGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.scheduledReport == nil { - return localVarReturnValue, nil, reportError("scheduledReport is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -569,7 +552,7 @@ func (a *ScheduledReportApiService) ScheduledReportPartiallyUpdateScheduledRepor } // body params localVarPostBody = r.scheduledReport - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -579,15 +562,15 @@ func (a *ScheduledReportApiService) ScheduledReportPartiallyUpdateScheduledRepor return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -598,7 +581,8 @@ func (a *ScheduledReportApiService) ScheduledReportPartiallyUpdateScheduledRepor newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -608,14 +592,15 @@ func (a *ScheduledReportApiService) ScheduledReportPartiallyUpdateScheduledRepor newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -626,7 +611,7 @@ func (a *ScheduledReportApiService) ScheduledReportPartiallyUpdateScheduledRepor } type ApiScheduledReportUpdateScheduledReportRequest struct { - ctx _context.Context + ctx context.Context ApiService *ScheduledReportApiService scheduledReportGuid string scheduledReport *ScheduledReport @@ -638,18 +623,18 @@ func (r ApiScheduledReportUpdateScheduledReportRequest) ScheduledReport(schedule return r } -func (r ApiScheduledReportUpdateScheduledReportRequest) Execute() (ScheduledReport, *_nethttp.Response, error) { +func (r ApiScheduledReportUpdateScheduledReportRequest) Execute() (*ScheduledReport, *http.Response, error) { return r.ApiService.ScheduledReportUpdateScheduledReportExecute(r) } /* ScheduledReportUpdateScheduledReport Update the specified scheduled report. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param scheduledReportGuid The guid of the specified scheduled report. @return ApiScheduledReportUpdateScheduledReportRequest */ -func (a *ScheduledReportApiService) ScheduledReportUpdateScheduledReport(ctx _context.Context, scheduledReportGuid string) ApiScheduledReportUpdateScheduledReportRequest { +func (a *ScheduledReportApiService) ScheduledReportUpdateScheduledReport(ctx context.Context, scheduledReportGuid string) ApiScheduledReportUpdateScheduledReportRequest { return ApiScheduledReportUpdateScheduledReportRequest{ ApiService: a, ctx: ctx, @@ -659,30 +644,25 @@ func (a *ScheduledReportApiService) ScheduledReportUpdateScheduledReport(ctx _co // Execute executes the request // @return ScheduledReport -func (a *ScheduledReportApiService) ScheduledReportUpdateScheduledReportExecute(r ApiScheduledReportUpdateScheduledReportRequest) (ScheduledReport, *_nethttp.Response, error) { +func (a *ScheduledReportApiService) ScheduledReportUpdateScheduledReportExecute(r ApiScheduledReportUpdateScheduledReportRequest) (*ScheduledReport, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ScheduledReport + formFiles []formFile + localVarReturnValue *ScheduledReport ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScheduledReportApiService.ScheduledReportUpdateScheduledReport") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/ScheduledReport/{scheduledReportGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"scheduledReportGuid"+"}", _neturl.PathEscape(parameterToString(r.scheduledReportGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"scheduledReportGuid"+"}", url.PathEscape(parameterToString(r.scheduledReportGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.scheduledReport == nil { - return localVarReturnValue, nil, reportError("scheduledReport is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -703,7 +683,7 @@ func (a *ScheduledReportApiService) ScheduledReportUpdateScheduledReportExecute( } // body params localVarPostBody = r.scheduledReport - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -713,15 +693,15 @@ func (a *ScheduledReportApiService) ScheduledReportUpdateScheduledReportExecute( return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -732,7 +712,8 @@ func (a *ScheduledReportApiService) ScheduledReportUpdateScheduledReportExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -742,14 +723,15 @@ func (a *ScheduledReportApiService) ScheduledReportUpdateScheduledReportExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_sla.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_sla.go index e9af3b6a..823092eb 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/api_sla.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_sla.go @@ -12,23 +12,19 @@ package uptrends import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // SLAApiService SLAApi service type SLAApiService service type ApiSlaCreateSlaRequest struct { - ctx _context.Context + ctx context.Context ApiService *SLAApiService sla *Sla } @@ -39,17 +35,17 @@ func (r ApiSlaCreateSlaRequest) Sla(sla Sla) ApiSlaCreateSlaRequest { return r } -func (r ApiSlaCreateSlaRequest) Execute() (Sla, *_nethttp.Response, error) { +func (r ApiSlaCreateSlaRequest) Execute() (*Sla, *http.Response, error) { return r.ApiService.SlaCreateSlaExecute(r) } /* SlaCreateSla Creates a new SLA. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiSlaCreateSlaRequest */ -func (a *SLAApiService) SlaCreateSla(ctx _context.Context) ApiSlaCreateSlaRequest { +func (a *SLAApiService) SlaCreateSla(ctx context.Context) ApiSlaCreateSlaRequest { return ApiSlaCreateSlaRequest{ ApiService: a, ctx: ctx, @@ -58,29 +54,24 @@ func (a *SLAApiService) SlaCreateSla(ctx _context.Context) ApiSlaCreateSlaReques // Execute executes the request // @return Sla -func (a *SLAApiService) SlaCreateSlaExecute(r ApiSlaCreateSlaRequest) (Sla, *_nethttp.Response, error) { +func (a *SLAApiService) SlaCreateSlaExecute(r ApiSlaCreateSlaRequest) (*Sla, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Sla + formFiles []formFile + localVarReturnValue *Sla ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SLAApiService.SlaCreateSla") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Sla" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.sla == nil { - return localVarReturnValue, nil, reportError("sla is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -101,7 +92,7 @@ func (a *SLAApiService) SlaCreateSlaExecute(r ApiSlaCreateSlaRequest) (Sla, *_ne } // body params localVarPostBody = r.sla - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -111,15 +102,15 @@ func (a *SLAApiService) SlaCreateSlaExecute(r ApiSlaCreateSlaRequest) (Sla, *_ne return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -130,7 +121,8 @@ func (a *SLAApiService) SlaCreateSlaExecute(r ApiSlaCreateSlaRequest) (Sla, *_ne newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -140,14 +132,15 @@ func (a *SLAApiService) SlaCreateSlaExecute(r ApiSlaCreateSlaRequest) (Sla, *_ne newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -158,26 +151,25 @@ func (a *SLAApiService) SlaCreateSlaExecute(r ApiSlaCreateSlaRequest) (Sla, *_ne } type ApiSlaDeleteExclusionPeriodRequest struct { - ctx _context.Context + ctx context.Context ApiService *SLAApiService slaGuid string exclusionPeriodId int32 } - -func (r ApiSlaDeleteExclusionPeriodRequest) Execute() (*_nethttp.Response, error) { +func (r ApiSlaDeleteExclusionPeriodRequest) Execute() (*http.Response, error) { return r.ApiService.SlaDeleteExclusionPeriodExecute(r) } /* SlaDeleteExclusionPeriod Deletes the specified exclusion period for the specified SLA. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param slaGuid The Guid of the sla definition. @param exclusionPeriodId The id of the exclusion period. @return ApiSlaDeleteExclusionPeriodRequest */ -func (a *SLAApiService) SlaDeleteExclusionPeriod(ctx _context.Context, slaGuid string, exclusionPeriodId int32) ApiSlaDeleteExclusionPeriodRequest { +func (a *SLAApiService) SlaDeleteExclusionPeriod(ctx context.Context, slaGuid string, exclusionPeriodId int32) ApiSlaDeleteExclusionPeriodRequest { return ApiSlaDeleteExclusionPeriodRequest{ ApiService: a, ctx: ctx, @@ -187,27 +179,25 @@ func (a *SLAApiService) SlaDeleteExclusionPeriod(ctx _context.Context, slaGuid s } // Execute executes the request -func (a *SLAApiService) SlaDeleteExclusionPeriodExecute(r ApiSlaDeleteExclusionPeriodRequest) (*_nethttp.Response, error) { +func (a *SLAApiService) SlaDeleteExclusionPeriodExecute(r ApiSlaDeleteExclusionPeriodRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SLAApiService.SlaDeleteExclusionPeriod") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Sla/{slaGuid}/ExclusionPeriod/{exclusionPeriodId}" - localVarPath = strings.Replace(localVarPath, "{"+"slaGuid"+"}", _neturl.PathEscape(parameterToString(r.slaGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"exclusionPeriodId"+"}", _neturl.PathEscape(parameterToString(r.exclusionPeriodId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"slaGuid"+"}", url.PathEscape(parameterToString(r.slaGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"exclusionPeriodId"+"}", url.PathEscape(parameterToString(r.exclusionPeriodId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -226,7 +216,7 @@ func (a *SLAApiService) SlaDeleteExclusionPeriodExecute(r ApiSlaDeleteExclusionP if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -236,15 +226,15 @@ func (a *SLAApiService) SlaDeleteExclusionPeriodExecute(r ApiSlaDeleteExclusionP return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -255,7 +245,8 @@ func (a *SLAApiService) SlaDeleteExclusionPeriodExecute(r ApiSlaDeleteExclusionP newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -265,7 +256,8 @@ func (a *SLAApiService) SlaDeleteExclusionPeriodExecute(r ApiSlaDeleteExclusionP newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -274,24 +266,23 @@ func (a *SLAApiService) SlaDeleteExclusionPeriodExecute(r ApiSlaDeleteExclusionP } type ApiSlaDeleteSlaRequest struct { - ctx _context.Context + ctx context.Context ApiService *SLAApiService slaGuid string } - -func (r ApiSlaDeleteSlaRequest) Execute() (*_nethttp.Response, error) { +func (r ApiSlaDeleteSlaRequest) Execute() (*http.Response, error) { return r.ApiService.SlaDeleteSlaExecute(r) } /* SlaDeleteSla Deletes the specified SLA. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param slaGuid The Guid of the SLA definition that should be deleted. @return ApiSlaDeleteSlaRequest */ -func (a *SLAApiService) SlaDeleteSla(ctx _context.Context, slaGuid string) ApiSlaDeleteSlaRequest { +func (a *SLAApiService) SlaDeleteSla(ctx context.Context, slaGuid string) ApiSlaDeleteSlaRequest { return ApiSlaDeleteSlaRequest{ ApiService: a, ctx: ctx, @@ -300,26 +291,24 @@ func (a *SLAApiService) SlaDeleteSla(ctx _context.Context, slaGuid string) ApiSl } // Execute executes the request -func (a *SLAApiService) SlaDeleteSlaExecute(r ApiSlaDeleteSlaRequest) (*_nethttp.Response, error) { +func (a *SLAApiService) SlaDeleteSlaExecute(r ApiSlaDeleteSlaRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SLAApiService.SlaDeleteSla") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Sla/{slaGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"slaGuid"+"}", _neturl.PathEscape(parameterToString(r.slaGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"slaGuid"+"}", url.PathEscape(parameterToString(r.slaGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -338,7 +327,7 @@ func (a *SLAApiService) SlaDeleteSlaExecute(r ApiSlaDeleteSlaRequest) (*_nethttp if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -348,15 +337,15 @@ func (a *SLAApiService) SlaDeleteSlaExecute(r ApiSlaDeleteSlaRequest) (*_nethttp return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -367,7 +356,8 @@ func (a *SLAApiService) SlaDeleteSlaExecute(r ApiSlaDeleteSlaRequest) (*_nethttp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -377,7 +367,8 @@ func (a *SLAApiService) SlaDeleteSlaExecute(r ApiSlaDeleteSlaRequest) (*_nethttp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -387,7 +378,8 @@ func (a *SLAApiService) SlaDeleteSlaExecute(r ApiSlaDeleteSlaRequest) (*_nethttp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -396,26 +388,25 @@ func (a *SLAApiService) SlaDeleteSlaExecute(r ApiSlaDeleteSlaRequest) (*_nethttp } type ApiSlaGetExclusionPeriodRequest struct { - ctx _context.Context + ctx context.Context ApiService *SLAApiService slaGuid string exclusionPeriodId int32 } - -func (r ApiSlaGetExclusionPeriodRequest) Execute() (ExclusionPeriod, *_nethttp.Response, error) { +func (r ApiSlaGetExclusionPeriodRequest) Execute() (*ExclusionPeriod, *http.Response, error) { return r.ApiService.SlaGetExclusionPeriodExecute(r) } /* SlaGetExclusionPeriod Gets the specified exclusion period for the specified SLA. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param slaGuid The Guid of the SLA definition. @param exclusionPeriodId The id of the exclusion period. @return ApiSlaGetExclusionPeriodRequest */ -func (a *SLAApiService) SlaGetExclusionPeriod(ctx _context.Context, slaGuid string, exclusionPeriodId int32) ApiSlaGetExclusionPeriodRequest { +func (a *SLAApiService) SlaGetExclusionPeriod(ctx context.Context, slaGuid string, exclusionPeriodId int32) ApiSlaGetExclusionPeriodRequest { return ApiSlaGetExclusionPeriodRequest{ ApiService: a, ctx: ctx, @@ -426,28 +417,26 @@ func (a *SLAApiService) SlaGetExclusionPeriod(ctx _context.Context, slaGuid stri // Execute executes the request // @return ExclusionPeriod -func (a *SLAApiService) SlaGetExclusionPeriodExecute(r ApiSlaGetExclusionPeriodRequest) (ExclusionPeriod, *_nethttp.Response, error) { +func (a *SLAApiService) SlaGetExclusionPeriodExecute(r ApiSlaGetExclusionPeriodRequest) (*ExclusionPeriod, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ExclusionPeriod + formFiles []formFile + localVarReturnValue *ExclusionPeriod ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SLAApiService.SlaGetExclusionPeriod") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Sla/{slaGuid}/ExclusionPeriod/{exclusionPeriodId}" - localVarPath = strings.Replace(localVarPath, "{"+"slaGuid"+"}", _neturl.PathEscape(parameterToString(r.slaGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"exclusionPeriodId"+"}", _neturl.PathEscape(parameterToString(r.exclusionPeriodId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"slaGuid"+"}", url.PathEscape(parameterToString(r.slaGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"exclusionPeriodId"+"}", url.PathEscape(parameterToString(r.exclusionPeriodId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -466,7 +455,7 @@ func (a *SLAApiService) SlaGetExclusionPeriodExecute(r ApiSlaGetExclusionPeriodR if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -476,15 +465,15 @@ func (a *SLAApiService) SlaGetExclusionPeriodExecute(r ApiSlaGetExclusionPeriodR return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -495,7 +484,8 @@ func (a *SLAApiService) SlaGetExclusionPeriodExecute(r ApiSlaGetExclusionPeriodR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -505,14 +495,15 @@ func (a *SLAApiService) SlaGetExclusionPeriodExecute(r ApiSlaGetExclusionPeriodR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -523,24 +514,23 @@ func (a *SLAApiService) SlaGetExclusionPeriodExecute(r ApiSlaGetExclusionPeriodR } type ApiSlaGetExclusionPeriodsRequest struct { - ctx _context.Context + ctx context.Context ApiService *SLAApiService slaGuid string } - -func (r ApiSlaGetExclusionPeriodsRequest) Execute() ([]ExclusionPeriod, *_nethttp.Response, error) { +func (r ApiSlaGetExclusionPeriodsRequest) Execute() ([]ExclusionPeriod, *http.Response, error) { return r.ApiService.SlaGetExclusionPeriodsExecute(r) } /* SlaGetExclusionPeriods Gets a list of all exclusion periods for the specified SLA. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param slaGuid The Guid of the SLA definition. @return ApiSlaGetExclusionPeriodsRequest */ -func (a *SLAApiService) SlaGetExclusionPeriods(ctx _context.Context, slaGuid string) ApiSlaGetExclusionPeriodsRequest { +func (a *SLAApiService) SlaGetExclusionPeriods(ctx context.Context, slaGuid string) ApiSlaGetExclusionPeriodsRequest { return ApiSlaGetExclusionPeriodsRequest{ ApiService: a, ctx: ctx, @@ -550,27 +540,25 @@ func (a *SLAApiService) SlaGetExclusionPeriods(ctx _context.Context, slaGuid str // Execute executes the request // @return []ExclusionPeriod -func (a *SLAApiService) SlaGetExclusionPeriodsExecute(r ApiSlaGetExclusionPeriodsRequest) ([]ExclusionPeriod, *_nethttp.Response, error) { +func (a *SLAApiService) SlaGetExclusionPeriodsExecute(r ApiSlaGetExclusionPeriodsRequest) ([]ExclusionPeriod, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []ExclusionPeriod ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SLAApiService.SlaGetExclusionPeriods") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Sla/{slaGuid}/ExclusionPeriod" - localVarPath = strings.Replace(localVarPath, "{"+"slaGuid"+"}", _neturl.PathEscape(parameterToString(r.slaGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"slaGuid"+"}", url.PathEscape(parameterToString(r.slaGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -589,7 +577,7 @@ func (a *SLAApiService) SlaGetExclusionPeriodsExecute(r ApiSlaGetExclusionPeriod if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -599,15 +587,15 @@ func (a *SLAApiService) SlaGetExclusionPeriodsExecute(r ApiSlaGetExclusionPeriod return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -618,7 +606,8 @@ func (a *SLAApiService) SlaGetExclusionPeriodsExecute(r ApiSlaGetExclusionPeriod newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -628,14 +617,15 @@ func (a *SLAApiService) SlaGetExclusionPeriodsExecute(r ApiSlaGetExclusionPeriod newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -646,24 +636,23 @@ func (a *SLAApiService) SlaGetExclusionPeriodsExecute(r ApiSlaGetExclusionPeriod } type ApiSlaGetSlaRequest struct { - ctx _context.Context + ctx context.Context ApiService *SLAApiService slaGuid string } - -func (r ApiSlaGetSlaRequest) Execute() (Sla, *_nethttp.Response, error) { +func (r ApiSlaGetSlaRequest) Execute() (*Sla, *http.Response, error) { return r.ApiService.SlaGetSlaExecute(r) } /* SlaGetSla Gets the specified SLA definition. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param slaGuid The Guid of the SLA definition. @return ApiSlaGetSlaRequest */ -func (a *SLAApiService) SlaGetSla(ctx _context.Context, slaGuid string) ApiSlaGetSlaRequest { +func (a *SLAApiService) SlaGetSla(ctx context.Context, slaGuid string) ApiSlaGetSlaRequest { return ApiSlaGetSlaRequest{ ApiService: a, ctx: ctx, @@ -673,27 +662,25 @@ func (a *SLAApiService) SlaGetSla(ctx _context.Context, slaGuid string) ApiSlaGe // Execute executes the request // @return Sla -func (a *SLAApiService) SlaGetSlaExecute(r ApiSlaGetSlaRequest) (Sla, *_nethttp.Response, error) { +func (a *SLAApiService) SlaGetSlaExecute(r ApiSlaGetSlaRequest) (*Sla, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Sla + formFiles []formFile + localVarReturnValue *Sla ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SLAApiService.SlaGetSla") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Sla/{slaGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"slaGuid"+"}", _neturl.PathEscape(parameterToString(r.slaGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"slaGuid"+"}", url.PathEscape(parameterToString(r.slaGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -712,7 +699,7 @@ func (a *SLAApiService) SlaGetSlaExecute(r ApiSlaGetSlaRequest) (Sla, *_nethttp. if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -722,15 +709,15 @@ func (a *SLAApiService) SlaGetSlaExecute(r ApiSlaGetSlaRequest) (Sla, *_nethttp. return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -741,7 +728,8 @@ func (a *SLAApiService) SlaGetSlaExecute(r ApiSlaGetSlaRequest) (Sla, *_nethttp. newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -751,7 +739,8 @@ func (a *SLAApiService) SlaGetSlaExecute(r ApiSlaGetSlaRequest) (Sla, *_nethttp. newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -761,14 +750,15 @@ func (a *SLAApiService) SlaGetSlaExecute(r ApiSlaGetSlaRequest) (Sla, *_nethttp. newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -779,22 +769,21 @@ func (a *SLAApiService) SlaGetSlaExecute(r ApiSlaGetSlaRequest) (Sla, *_nethttp. } type ApiSlaGetSlasRequest struct { - ctx _context.Context + ctx context.Context ApiService *SLAApiService } - -func (r ApiSlaGetSlasRequest) Execute() ([]Sla, *_nethttp.Response, error) { +func (r ApiSlaGetSlasRequest) Execute() ([]Sla, *http.Response, error) { return r.ApiService.SlaGetSlasExecute(r) } /* SlaGetSlas Gets a list of all SLA definitions. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiSlaGetSlasRequest */ -func (a *SLAApiService) SlaGetSlas(ctx _context.Context) ApiSlaGetSlasRequest { +func (a *SLAApiService) SlaGetSlas(ctx context.Context) ApiSlaGetSlasRequest { return ApiSlaGetSlasRequest{ ApiService: a, ctx: ctx, @@ -803,26 +792,24 @@ func (a *SLAApiService) SlaGetSlas(ctx _context.Context) ApiSlaGetSlasRequest { // Execute executes the request // @return []Sla -func (a *SLAApiService) SlaGetSlasExecute(r ApiSlaGetSlasRequest) ([]Sla, *_nethttp.Response, error) { +func (a *SLAApiService) SlaGetSlasExecute(r ApiSlaGetSlasRequest) ([]Sla, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Sla ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SLAApiService.SlaGetSlas") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Sla" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -841,7 +828,7 @@ func (a *SLAApiService) SlaGetSlasExecute(r ApiSlaGetSlasRequest) ([]Sla, *_neth if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -851,15 +838,15 @@ func (a *SLAApiService) SlaGetSlasExecute(r ApiSlaGetSlasRequest) ([]Sla, *_neth return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -870,14 +857,15 @@ func (a *SLAApiService) SlaGetSlasExecute(r ApiSlaGetSlasRequest) ([]Sla, *_neth newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -888,7 +876,7 @@ func (a *SLAApiService) SlaGetSlasExecute(r ApiSlaGetSlasRequest) ([]Sla, *_neth } type ApiSlaPatchExclusionPeriodRequest struct { - ctx _context.Context + ctx context.Context ApiService *SLAApiService slaGuid string exclusionPeriodId int32 @@ -901,19 +889,19 @@ func (r ApiSlaPatchExclusionPeriodRequest) ExclusionPeriod(exclusionPeriod Exclu return r } -func (r ApiSlaPatchExclusionPeriodRequest) Execute() (*_nethttp.Response, error) { +func (r ApiSlaPatchExclusionPeriodRequest) Execute() (*http.Response, error) { return r.ApiService.SlaPatchExclusionPeriodExecute(r) } /* SlaPatchExclusionPeriod Partially updates the specified exclusion period for the specified SLA. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param slaGuid The Guid of the SLA definition. @param exclusionPeriodId The id of the exclusion period. @return ApiSlaPatchExclusionPeriodRequest */ -func (a *SLAApiService) SlaPatchExclusionPeriod(ctx _context.Context, slaGuid string, exclusionPeriodId int32) ApiSlaPatchExclusionPeriodRequest { +func (a *SLAApiService) SlaPatchExclusionPeriod(ctx context.Context, slaGuid string, exclusionPeriodId int32) ApiSlaPatchExclusionPeriodRequest { return ApiSlaPatchExclusionPeriodRequest{ ApiService: a, ctx: ctx, @@ -923,30 +911,25 @@ func (a *SLAApiService) SlaPatchExclusionPeriod(ctx _context.Context, slaGuid st } // Execute executes the request -func (a *SLAApiService) SlaPatchExclusionPeriodExecute(r ApiSlaPatchExclusionPeriodRequest) (*_nethttp.Response, error) { +func (a *SLAApiService) SlaPatchExclusionPeriodExecute(r ApiSlaPatchExclusionPeriodRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SLAApiService.SlaPatchExclusionPeriod") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Sla/{slaGuid}/ExclusionPeriod/{exclusionPeriodId}" - localVarPath = strings.Replace(localVarPath, "{"+"slaGuid"+"}", _neturl.PathEscape(parameterToString(r.slaGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"exclusionPeriodId"+"}", _neturl.PathEscape(parameterToString(r.exclusionPeriodId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"slaGuid"+"}", url.PathEscape(parameterToString(r.slaGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"exclusionPeriodId"+"}", url.PathEscape(parameterToString(r.exclusionPeriodId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.exclusionPeriod == nil { - return nil, reportError("exclusionPeriod is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -967,7 +950,7 @@ func (a *SLAApiService) SlaPatchExclusionPeriodExecute(r ApiSlaPatchExclusionPer } // body params localVarPostBody = r.exclusionPeriod - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -977,15 +960,15 @@ func (a *SLAApiService) SlaPatchExclusionPeriodExecute(r ApiSlaPatchExclusionPer return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -996,7 +979,8 @@ func (a *SLAApiService) SlaPatchExclusionPeriodExecute(r ApiSlaPatchExclusionPer newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1006,7 +990,8 @@ func (a *SLAApiService) SlaPatchExclusionPeriodExecute(r ApiSlaPatchExclusionPer newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -1015,7 +1000,7 @@ func (a *SLAApiService) SlaPatchExclusionPeriodExecute(r ApiSlaPatchExclusionPer } type ApiSlaPatchSlaRequest struct { - ctx _context.Context + ctx context.Context ApiService *SLAApiService slaGuid string sla *Sla @@ -1027,7 +1012,7 @@ func (r ApiSlaPatchSlaRequest) Sla(sla Sla) ApiSlaPatchSlaRequest { return r } -func (r ApiSlaPatchSlaRequest) Execute() (*_nethttp.Response, error) { +func (r ApiSlaPatchSlaRequest) Execute() (*http.Response, error) { return r.ApiService.SlaPatchSlaExecute(r) } @@ -1036,11 +1021,11 @@ SlaPatchSla Partially updates the definition of the specified SLA. This methods accepts parts of a SLA definition. We recommend retrieving the existing definition first (using the GET method). You can then process the changes you want to make and send back these changes only using this PATCH method. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param slaGuid The Guid of the SLA that should be updated. @return ApiSlaPatchSlaRequest */ -func (a *SLAApiService) SlaPatchSla(ctx _context.Context, slaGuid string) ApiSlaPatchSlaRequest { +func (a *SLAApiService) SlaPatchSla(ctx context.Context, slaGuid string) ApiSlaPatchSlaRequest { return ApiSlaPatchSlaRequest{ ApiService: a, ctx: ctx, @@ -1049,29 +1034,24 @@ func (a *SLAApiService) SlaPatchSla(ctx _context.Context, slaGuid string) ApiSla } // Execute executes the request -func (a *SLAApiService) SlaPatchSlaExecute(r ApiSlaPatchSlaRequest) (*_nethttp.Response, error) { +func (a *SLAApiService) SlaPatchSlaExecute(r ApiSlaPatchSlaRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SLAApiService.SlaPatchSla") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Sla/{slaGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"slaGuid"+"}", _neturl.PathEscape(parameterToString(r.slaGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"slaGuid"+"}", url.PathEscape(parameterToString(r.slaGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.sla == nil { - return nil, reportError("sla is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -1092,7 +1072,7 @@ func (a *SLAApiService) SlaPatchSlaExecute(r ApiSlaPatchSlaRequest) (*_nethttp.R } // body params localVarPostBody = r.sla - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1102,15 +1082,15 @@ func (a *SLAApiService) SlaPatchSlaExecute(r ApiSlaPatchSlaRequest) (*_nethttp.R return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1121,7 +1101,8 @@ func (a *SLAApiService) SlaPatchSlaExecute(r ApiSlaPatchSlaRequest) (*_nethttp.R newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1131,7 +1112,8 @@ func (a *SLAApiService) SlaPatchSlaExecute(r ApiSlaPatchSlaRequest) (*_nethttp.R newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -1140,7 +1122,7 @@ func (a *SLAApiService) SlaPatchSlaExecute(r ApiSlaPatchSlaRequest) (*_nethttp.R } type ApiSlaPostExclusionPeriodRequest struct { - ctx _context.Context + ctx context.Context ApiService *SLAApiService slaGuid string exclusionPeriod *ExclusionPeriod @@ -1152,18 +1134,18 @@ func (r ApiSlaPostExclusionPeriodRequest) ExclusionPeriod(exclusionPeriod Exclus return r } -func (r ApiSlaPostExclusionPeriodRequest) Execute() (ExclusionPeriod, *_nethttp.Response, error) { +func (r ApiSlaPostExclusionPeriodRequest) Execute() (*ExclusionPeriod, *http.Response, error) { return r.ApiService.SlaPostExclusionPeriodExecute(r) } /* SlaPostExclusionPeriod Creates a new exclusion period for the specified SLA. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param slaGuid The Guid of the SLA definition. @return ApiSlaPostExclusionPeriodRequest */ -func (a *SLAApiService) SlaPostExclusionPeriod(ctx _context.Context, slaGuid string) ApiSlaPostExclusionPeriodRequest { +func (a *SLAApiService) SlaPostExclusionPeriod(ctx context.Context, slaGuid string) ApiSlaPostExclusionPeriodRequest { return ApiSlaPostExclusionPeriodRequest{ ApiService: a, ctx: ctx, @@ -1173,30 +1155,25 @@ func (a *SLAApiService) SlaPostExclusionPeriod(ctx _context.Context, slaGuid str // Execute executes the request // @return ExclusionPeriod -func (a *SLAApiService) SlaPostExclusionPeriodExecute(r ApiSlaPostExclusionPeriodRequest) (ExclusionPeriod, *_nethttp.Response, error) { +func (a *SLAApiService) SlaPostExclusionPeriodExecute(r ApiSlaPostExclusionPeriodRequest) (*ExclusionPeriod, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ExclusionPeriod + formFiles []formFile + localVarReturnValue *ExclusionPeriod ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SLAApiService.SlaPostExclusionPeriod") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Sla/{slaGuid}/ExclusionPeriod" - localVarPath = strings.Replace(localVarPath, "{"+"slaGuid"+"}", _neturl.PathEscape(parameterToString(r.slaGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"slaGuid"+"}", url.PathEscape(parameterToString(r.slaGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.exclusionPeriod == nil { - return localVarReturnValue, nil, reportError("exclusionPeriod is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -1217,7 +1194,7 @@ func (a *SLAApiService) SlaPostExclusionPeriodExecute(r ApiSlaPostExclusionPerio } // body params localVarPostBody = r.exclusionPeriod - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1227,15 +1204,15 @@ func (a *SLAApiService) SlaPostExclusionPeriodExecute(r ApiSlaPostExclusionPerio return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1246,7 +1223,8 @@ func (a *SLAApiService) SlaPostExclusionPeriodExecute(r ApiSlaPostExclusionPerio newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1256,14 +1234,15 @@ func (a *SLAApiService) SlaPostExclusionPeriodExecute(r ApiSlaPostExclusionPerio newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1274,7 +1253,7 @@ func (a *SLAApiService) SlaPostExclusionPeriodExecute(r ApiSlaPostExclusionPerio } type ApiSlaPutExclusionPeriodRequest struct { - ctx _context.Context + ctx context.Context ApiService *SLAApiService slaGuid string exclusionPeriodId int32 @@ -1287,19 +1266,19 @@ func (r ApiSlaPutExclusionPeriodRequest) ExclusionPeriod(exclusionPeriod Exclusi return r } -func (r ApiSlaPutExclusionPeriodRequest) Execute() (*_nethttp.Response, error) { +func (r ApiSlaPutExclusionPeriodRequest) Execute() (*http.Response, error) { return r.ApiService.SlaPutExclusionPeriodExecute(r) } /* SlaPutExclusionPeriod Updates the specified exclusion period for the specified SLA. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param slaGuid The Guid of the SLA definition. @param exclusionPeriodId The id of the exclusion period. @return ApiSlaPutExclusionPeriodRequest */ -func (a *SLAApiService) SlaPutExclusionPeriod(ctx _context.Context, slaGuid string, exclusionPeriodId int32) ApiSlaPutExclusionPeriodRequest { +func (a *SLAApiService) SlaPutExclusionPeriod(ctx context.Context, slaGuid string, exclusionPeriodId int32) ApiSlaPutExclusionPeriodRequest { return ApiSlaPutExclusionPeriodRequest{ ApiService: a, ctx: ctx, @@ -1309,30 +1288,25 @@ func (a *SLAApiService) SlaPutExclusionPeriod(ctx _context.Context, slaGuid stri } // Execute executes the request -func (a *SLAApiService) SlaPutExclusionPeriodExecute(r ApiSlaPutExclusionPeriodRequest) (*_nethttp.Response, error) { +func (a *SLAApiService) SlaPutExclusionPeriodExecute(r ApiSlaPutExclusionPeriodRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SLAApiService.SlaPutExclusionPeriod") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Sla/{slaGuid}/ExclusionPeriod/{exclusionPeriodId}" - localVarPath = strings.Replace(localVarPath, "{"+"slaGuid"+"}", _neturl.PathEscape(parameterToString(r.slaGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"exclusionPeriodId"+"}", _neturl.PathEscape(parameterToString(r.exclusionPeriodId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"slaGuid"+"}", url.PathEscape(parameterToString(r.slaGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"exclusionPeriodId"+"}", url.PathEscape(parameterToString(r.exclusionPeriodId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.exclusionPeriod == nil { - return nil, reportError("exclusionPeriod is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -1353,7 +1327,7 @@ func (a *SLAApiService) SlaPutExclusionPeriodExecute(r ApiSlaPutExclusionPeriodR } // body params localVarPostBody = r.exclusionPeriod - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1363,15 +1337,15 @@ func (a *SLAApiService) SlaPutExclusionPeriodExecute(r ApiSlaPutExclusionPeriodR return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1382,7 +1356,8 @@ func (a *SLAApiService) SlaPutExclusionPeriodExecute(r ApiSlaPutExclusionPeriodR newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1392,7 +1367,8 @@ func (a *SLAApiService) SlaPutExclusionPeriodExecute(r ApiSlaPutExclusionPeriodR newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -1401,7 +1377,7 @@ func (a *SLAApiService) SlaPutExclusionPeriodExecute(r ApiSlaPutExclusionPeriodR } type ApiSlaPutSlaRequest struct { - ctx _context.Context + ctx context.Context ApiService *SLAApiService slaGuid string sla *Sla @@ -1413,7 +1389,7 @@ func (r ApiSlaPutSlaRequest) Sla(sla Sla) ApiSlaPutSlaRequest { return r } -func (r ApiSlaPutSlaRequest) Execute() (*_nethttp.Response, error) { +func (r ApiSlaPutSlaRequest) Execute() (*http.Response, error) { return r.ApiService.SlaPutSlaExecute(r) } @@ -1422,11 +1398,11 @@ SlaPutSla Updates the definition of the specified SLA. This methods only accepts a complete SLA definition. We recommend retrieving the existing definition first (using the GET method). You can then process the changes you want to make and send back the updated definition using this PUT method. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param slaGuid The Guid of the SLA that should be updated. @return ApiSlaPutSlaRequest */ -func (a *SLAApiService) SlaPutSla(ctx _context.Context, slaGuid string) ApiSlaPutSlaRequest { +func (a *SLAApiService) SlaPutSla(ctx context.Context, slaGuid string) ApiSlaPutSlaRequest { return ApiSlaPutSlaRequest{ ApiService: a, ctx: ctx, @@ -1435,29 +1411,24 @@ func (a *SLAApiService) SlaPutSla(ctx _context.Context, slaGuid string) ApiSlaPu } // Execute executes the request -func (a *SLAApiService) SlaPutSlaExecute(r ApiSlaPutSlaRequest) (*_nethttp.Response, error) { +func (a *SLAApiService) SlaPutSlaExecute(r ApiSlaPutSlaRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SLAApiService.SlaPutSla") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Sla/{slaGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"slaGuid"+"}", _neturl.PathEscape(parameterToString(r.slaGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"slaGuid"+"}", url.PathEscape(parameterToString(r.slaGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.sla == nil { - return nil, reportError("sla is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -1478,7 +1449,7 @@ func (a *SLAApiService) SlaPutSlaExecute(r ApiSlaPutSlaRequest) (*_nethttp.Respo } // body params localVarPostBody = r.sla - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1488,15 +1459,15 @@ func (a *SLAApiService) SlaPutSlaExecute(r ApiSlaPutSlaRequest) (*_nethttp.Respo return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1507,7 +1478,8 @@ func (a *SLAApiService) SlaPutSlaExecute(r ApiSlaPutSlaRequest) (*_nethttp.Respo newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1517,7 +1489,8 @@ func (a *SLAApiService) SlaPutSlaExecute(r ApiSlaPutSlaRequest) (*_nethttp.Respo newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_statistics.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_statistics.go index 6197d05a..ef0745d9 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/api_statistics.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_statistics.go @@ -12,29 +12,24 @@ package uptrends import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" - "time" ) -// Linger please -var ( - _ _context.Context -) // StatisticsApiService StatisticsApi service type StatisticsApiService service type ApiStatisticsGetMonitorGroupStatisticsRequest struct { - ctx _context.Context + ctx context.Context ApiService *StatisticsApiService monitorGroupGuid string filter *string - start *time.Time - end *time.Time + start *interface{} + end *interface{} presetPeriod *string } @@ -43,34 +38,37 @@ func (r ApiStatisticsGetMonitorGroupStatisticsRequest) Filter(filter string) Api r.filter = &filter return r } + // The start of a custom period (can't be used together with the PresetPeriod parameter) -func (r ApiStatisticsGetMonitorGroupStatisticsRequest) Start(start time.Time) ApiStatisticsGetMonitorGroupStatisticsRequest { +func (r ApiStatisticsGetMonitorGroupStatisticsRequest) Start(start interface{}) ApiStatisticsGetMonitorGroupStatisticsRequest { r.start = &start return r } + // The end of a custom period -func (r ApiStatisticsGetMonitorGroupStatisticsRequest) End(end time.Time) ApiStatisticsGetMonitorGroupStatisticsRequest { +func (r ApiStatisticsGetMonitorGroupStatisticsRequest) End(end interface{}) ApiStatisticsGetMonitorGroupStatisticsRequest { r.end = &end return r } + // The requested time period. func (r ApiStatisticsGetMonitorGroupStatisticsRequest) PresetPeriod(presetPeriod string) ApiStatisticsGetMonitorGroupStatisticsRequest { r.presetPeriod = &presetPeriod return r } -func (r ApiStatisticsGetMonitorGroupStatisticsRequest) Execute() (StatisticsResponse, *_nethttp.Response, error) { +func (r ApiStatisticsGetMonitorGroupStatisticsRequest) Execute() (*StatisticsResponse, *http.Response, error) { return r.ApiService.StatisticsGetMonitorGroupStatisticsExecute(r) } /* StatisticsGetMonitorGroupStatistics Gets the monitor group statistics. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGroupGuid The Guid of the monitor group. @return ApiStatisticsGetMonitorGroupStatisticsRequest */ -func (a *StatisticsApiService) StatisticsGetMonitorGroupStatistics(ctx _context.Context, monitorGroupGuid string) ApiStatisticsGetMonitorGroupStatisticsRequest { +func (a *StatisticsApiService) StatisticsGetMonitorGroupStatistics(ctx context.Context, monitorGroupGuid string) ApiStatisticsGetMonitorGroupStatisticsRequest { return ApiStatisticsGetMonitorGroupStatisticsRequest{ ApiService: a, ctx: ctx, @@ -80,27 +78,25 @@ func (a *StatisticsApiService) StatisticsGetMonitorGroupStatistics(ctx _context. // Execute executes the request // @return StatisticsResponse -func (a *StatisticsApiService) StatisticsGetMonitorGroupStatisticsExecute(r ApiStatisticsGetMonitorGroupStatisticsRequest) (StatisticsResponse, *_nethttp.Response, error) { +func (a *StatisticsApiService) StatisticsGetMonitorGroupStatisticsExecute(r ApiStatisticsGetMonitorGroupStatisticsRequest) (*StatisticsResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue StatisticsResponse + formFiles []formFile + localVarReturnValue *StatisticsResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StatisticsApiService.StatisticsGetMonitorGroupStatistics") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Statistics/MonitorGroup/{monitorGroupGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.filter != nil { localVarQueryParams.Add("Filter", parameterToString(*r.filter, "")) @@ -131,7 +127,7 @@ func (a *StatisticsApiService) StatisticsGetMonitorGroupStatisticsExecute(r ApiS if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -141,15 +137,15 @@ func (a *StatisticsApiService) StatisticsGetMonitorGroupStatisticsExecute(r ApiS return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -160,7 +156,8 @@ func (a *StatisticsApiService) StatisticsGetMonitorGroupStatisticsExecute(r ApiS newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -170,14 +167,15 @@ func (a *StatisticsApiService) StatisticsGetMonitorGroupStatisticsExecute(r ApiS newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -188,12 +186,12 @@ func (a *StatisticsApiService) StatisticsGetMonitorGroupStatisticsExecute(r ApiS } type ApiStatisticsGetMonitorStatisticsRequest struct { - ctx _context.Context + ctx context.Context ApiService *StatisticsApiService monitorGuid string filter *string - start *time.Time - end *time.Time + start *interface{} + end *interface{} presetPeriod *string } @@ -202,34 +200,37 @@ func (r ApiStatisticsGetMonitorStatisticsRequest) Filter(filter string) ApiStati r.filter = &filter return r } + // The start of a custom period (can't be used together with the PresetPeriod parameter) -func (r ApiStatisticsGetMonitorStatisticsRequest) Start(start time.Time) ApiStatisticsGetMonitorStatisticsRequest { +func (r ApiStatisticsGetMonitorStatisticsRequest) Start(start interface{}) ApiStatisticsGetMonitorStatisticsRequest { r.start = &start return r } + // The end of a custom period -func (r ApiStatisticsGetMonitorStatisticsRequest) End(end time.Time) ApiStatisticsGetMonitorStatisticsRequest { +func (r ApiStatisticsGetMonitorStatisticsRequest) End(end interface{}) ApiStatisticsGetMonitorStatisticsRequest { r.end = &end return r } + // The requested time period. func (r ApiStatisticsGetMonitorStatisticsRequest) PresetPeriod(presetPeriod string) ApiStatisticsGetMonitorStatisticsRequest { r.presetPeriod = &presetPeriod return r } -func (r ApiStatisticsGetMonitorStatisticsRequest) Execute() (StatisticsResponse, *_nethttp.Response, error) { +func (r ApiStatisticsGetMonitorStatisticsRequest) Execute() (*StatisticsResponse, *http.Response, error) { return r.ApiService.StatisticsGetMonitorStatisticsExecute(r) } /* StatisticsGetMonitorStatistics Gets the monitor statistics. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGuid The Guid of the monitor. @return ApiStatisticsGetMonitorStatisticsRequest */ -func (a *StatisticsApiService) StatisticsGetMonitorStatistics(ctx _context.Context, monitorGuid string) ApiStatisticsGetMonitorStatisticsRequest { +func (a *StatisticsApiService) StatisticsGetMonitorStatistics(ctx context.Context, monitorGuid string) ApiStatisticsGetMonitorStatisticsRequest { return ApiStatisticsGetMonitorStatisticsRequest{ ApiService: a, ctx: ctx, @@ -239,27 +240,25 @@ func (a *StatisticsApiService) StatisticsGetMonitorStatistics(ctx _context.Conte // Execute executes the request // @return StatisticsResponse -func (a *StatisticsApiService) StatisticsGetMonitorStatisticsExecute(r ApiStatisticsGetMonitorStatisticsRequest) (StatisticsResponse, *_nethttp.Response, error) { +func (a *StatisticsApiService) StatisticsGetMonitorStatisticsExecute(r ApiStatisticsGetMonitorStatisticsRequest) (*StatisticsResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue StatisticsResponse + formFiles []formFile + localVarReturnValue *StatisticsResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StatisticsApiService.StatisticsGetMonitorStatistics") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Statistics/Monitor/{monitorGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.filter != nil { localVarQueryParams.Add("Filter", parameterToString(*r.filter, "")) @@ -290,7 +289,7 @@ func (a *StatisticsApiService) StatisticsGetMonitorStatisticsExecute(r ApiStatis if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -300,15 +299,15 @@ func (a *StatisticsApiService) StatisticsGetMonitorStatisticsExecute(r ApiStatis return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -319,7 +318,8 @@ func (a *StatisticsApiService) StatisticsGetMonitorStatisticsExecute(r ApiStatis newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -329,14 +329,15 @@ func (a *StatisticsApiService) StatisticsGetMonitorStatisticsExecute(r ApiStatis newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_status.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_status.go index 28546f89..82abae4a 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/api_status.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_status.go @@ -12,23 +12,19 @@ package uptrends import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // StatusApiService StatusApi service type StatusApiService service type ApiStatusGetMonitorGroupStatusRequest struct { - ctx _context.Context + ctx context.Context ApiService *StatusApiService monitorGroupGuid string skip *int32 @@ -40,24 +36,25 @@ func (r ApiStatusGetMonitorGroupStatusRequest) Skip(skip int32) ApiStatusGetMoni r.skip = &skip return r } + // The maximum number of monitors in the monitor group to get data from. func (r ApiStatusGetMonitorGroupStatusRequest) Take(take int32) ApiStatusGetMonitorGroupStatusRequest { r.take = &take return r } -func (r ApiStatusGetMonitorGroupStatusRequest) Execute() (MonitorStatusListResponse, *_nethttp.Response, error) { +func (r ApiStatusGetMonitorGroupStatusRequest) Execute() (*MonitorStatusListResponse, *http.Response, error) { return r.ApiService.StatusGetMonitorGroupStatusExecute(r) } /* StatusGetMonitorGroupStatus Gets a list of all monitor group status data. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGroupGuid The Guid of the monitor group. @return ApiStatusGetMonitorGroupStatusRequest */ -func (a *StatusApiService) StatusGetMonitorGroupStatus(ctx _context.Context, monitorGroupGuid string) ApiStatusGetMonitorGroupStatusRequest { +func (a *StatusApiService) StatusGetMonitorGroupStatus(ctx context.Context, monitorGroupGuid string) ApiStatusGetMonitorGroupStatusRequest { return ApiStatusGetMonitorGroupStatusRequest{ ApiService: a, ctx: ctx, @@ -67,27 +64,25 @@ func (a *StatusApiService) StatusGetMonitorGroupStatus(ctx _context.Context, mon // Execute executes the request // @return MonitorStatusListResponse -func (a *StatusApiService) StatusGetMonitorGroupStatusExecute(r ApiStatusGetMonitorGroupStatusRequest) (MonitorStatusListResponse, *_nethttp.Response, error) { +func (a *StatusApiService) StatusGetMonitorGroupStatusExecute(r ApiStatusGetMonitorGroupStatusRequest) (*MonitorStatusListResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MonitorStatusListResponse + formFiles []formFile + localVarReturnValue *MonitorStatusListResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StatusApiService.StatusGetMonitorGroupStatus") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Status/MonitorGroup/{monitorGroupGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGroupGuid"+"}", url.PathEscape(parameterToString(r.monitorGroupGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.skip != nil { localVarQueryParams.Add("skip", parameterToString(*r.skip, "")) @@ -112,7 +107,7 @@ func (a *StatusApiService) StatusGetMonitorGroupStatusExecute(r ApiStatusGetMoni if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -122,15 +117,15 @@ func (a *StatusApiService) StatusGetMonitorGroupStatusExecute(r ApiStatusGetMoni return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -141,7 +136,8 @@ func (a *StatusApiService) StatusGetMonitorGroupStatusExecute(r ApiStatusGetMoni newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -151,14 +147,15 @@ func (a *StatusApiService) StatusGetMonitorGroupStatusExecute(r ApiStatusGetMoni newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -169,24 +166,23 @@ func (a *StatusApiService) StatusGetMonitorGroupStatusExecute(r ApiStatusGetMoni } type ApiStatusGetMonitorStatusRequest struct { - ctx _context.Context + ctx context.Context ApiService *StatusApiService monitorGuid string } - -func (r ApiStatusGetMonitorStatusRequest) Execute() (MonitorStatusResponse, *_nethttp.Response, error) { +func (r ApiStatusGetMonitorStatusRequest) Execute() (*MonitorStatusResponse, *http.Response, error) { return r.ApiService.StatusGetMonitorStatusExecute(r) } /* StatusGetMonitorStatus Gets all monitor status data. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param monitorGuid The Guid of the monitor. @return ApiStatusGetMonitorStatusRequest */ -func (a *StatusApiService) StatusGetMonitorStatus(ctx _context.Context, monitorGuid string) ApiStatusGetMonitorStatusRequest { +func (a *StatusApiService) StatusGetMonitorStatus(ctx context.Context, monitorGuid string) ApiStatusGetMonitorStatusRequest { return ApiStatusGetMonitorStatusRequest{ ApiService: a, ctx: ctx, @@ -196,27 +192,25 @@ func (a *StatusApiService) StatusGetMonitorStatus(ctx _context.Context, monitorG // Execute executes the request // @return MonitorStatusResponse -func (a *StatusApiService) StatusGetMonitorStatusExecute(r ApiStatusGetMonitorStatusRequest) (MonitorStatusResponse, *_nethttp.Response, error) { +func (a *StatusApiService) StatusGetMonitorStatusExecute(r ApiStatusGetMonitorStatusRequest) (*MonitorStatusResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MonitorStatusResponse + formFiles []formFile + localVarReturnValue *MonitorStatusResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StatusApiService.StatusGetMonitorStatus") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/Status/Monitor/{monitorGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", _neturl.PathEscape(parameterToString(r.monitorGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"monitorGuid"+"}", url.PathEscape(parameterToString(r.monitorGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -235,7 +229,7 @@ func (a *StatusApiService) StatusGetMonitorStatusExecute(r ApiStatusGetMonitorSt if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -245,15 +239,15 @@ func (a *StatusApiService) StatusGetMonitorStatusExecute(r ApiStatusGetMonitorSt return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -264,7 +258,8 @@ func (a *StatusApiService) StatusGetMonitorStatusExecute(r ApiStatusGetMonitorSt newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -274,14 +269,15 @@ func (a *StatusApiService) StatusGetMonitorStatusExecute(r ApiStatusGetMonitorSt newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_timezone.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_timezone.go new file mode 100644 index 00000000..87da5a0c --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_timezone.go @@ -0,0 +1,242 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + + +// TimezoneApiService TimezoneApi service +type TimezoneApiService service + +type ApiTimezoneGetAllTimezonesRequest struct { + ctx context.Context + ApiService *TimezoneApiService +} + +func (r ApiTimezoneGetAllTimezonesRequest) Execute() ([]Timezone, *http.Response, error) { + return r.ApiService.TimezoneGetAllTimezonesExecute(r) +} + +/* +TimezoneGetAllTimezones Gets all timezones available. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTimezoneGetAllTimezonesRequest +*/ +func (a *TimezoneApiService) TimezoneGetAllTimezones(ctx context.Context) ApiTimezoneGetAllTimezonesRequest { + return ApiTimezoneGetAllTimezonesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []Timezone +func (a *TimezoneApiService) TimezoneGetAllTimezonesExecute(r ApiTimezoneGetAllTimezonesRequest) ([]Timezone, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Timezone + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TimezoneApiService.TimezoneGetAllTimezones") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/Timezone" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTimezoneGetTimezoneByIdRequest struct { + ctx context.Context + ApiService *TimezoneApiService + timezoneId int32 +} + +func (r ApiTimezoneGetTimezoneByIdRequest) Execute() (*Timezone, *http.Response, error) { + return r.ApiService.TimezoneGetTimezoneByIdExecute(r) +} + +/* +TimezoneGetTimezoneById Gets the timezone with the specified Id. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param timezoneId + @return ApiTimezoneGetTimezoneByIdRequest +*/ +func (a *TimezoneApiService) TimezoneGetTimezoneById(ctx context.Context, timezoneId int32) ApiTimezoneGetTimezoneByIdRequest { + return ApiTimezoneGetTimezoneByIdRequest{ + ApiService: a, + ctx: ctx, + timezoneId: timezoneId, + } +} + +// Execute executes the request +// @return Timezone +func (a *TimezoneApiService) TimezoneGetTimezoneByIdExecute(r ApiTimezoneGetTimezoneByIdRequest) (*Timezone, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Timezone + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TimezoneApiService.TimezoneGetTimezoneById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/Timezone/{timezoneId}" + localVarPath = strings.Replace(localVarPath, "{"+"timezoneId"+"}", url.PathEscape(parameterToString(r.timezoneId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v MessageList + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/api_vault.go b/vendor/github.com/wasfree/uptrends-go-sdk/api_vault.go index baefd0e2..f73a9d1d 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/api_vault.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/api_vault.go @@ -12,23 +12,19 @@ package uptrends import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // VaultApiService VaultApi service type VaultApiService service type ApiVaultCreateAuthorizationForVaultSectionRequest struct { - ctx _context.Context + ctx context.Context ApiService *VaultApiService vaultSectionGuid string authorization *VaultSectionAuthorization @@ -39,20 +35,20 @@ func (r ApiVaultCreateAuthorizationForVaultSectionRequest) Authorization(authori return r } -func (r ApiVaultCreateAuthorizationForVaultSectionRequest) Execute() (VaultSectionAuthorization, *_nethttp.Response, error) { +func (r ApiVaultCreateAuthorizationForVaultSectionRequest) Execute() (*VaultSectionAuthorization, *http.Response, error) { return r.ApiService.VaultCreateAuthorizationForVaultSectionExecute(r) } /* -VaultCreateAuthorizationForVaultSection Creates a new authorization for the specified vault section. +VaultCreateAuthorizationForVaultSection Creates a new authorization for the specified vault section. The AuthorizationId attribute should be omitted in the request body. The newly created authorization will be returned in the response. An authorization should be granted to either an individual operator, or an operator group. Therefore, either specify the OperatorGuid attribute or the OperatorGroupGuid attribute. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param vaultSectionGuid The Guid of the vault section for which to create the new authorization. @return ApiVaultCreateAuthorizationForVaultSectionRequest */ -func (a *VaultApiService) VaultCreateAuthorizationForVaultSection(ctx _context.Context, vaultSectionGuid string) ApiVaultCreateAuthorizationForVaultSectionRequest { +func (a *VaultApiService) VaultCreateAuthorizationForVaultSection(ctx context.Context, vaultSectionGuid string) ApiVaultCreateAuthorizationForVaultSectionRequest { return ApiVaultCreateAuthorizationForVaultSectionRequest{ ApiService: a, ctx: ctx, @@ -62,30 +58,25 @@ func (a *VaultApiService) VaultCreateAuthorizationForVaultSection(ctx _context.C // Execute executes the request // @return VaultSectionAuthorization -func (a *VaultApiService) VaultCreateAuthorizationForVaultSectionExecute(r ApiVaultCreateAuthorizationForVaultSectionRequest) (VaultSectionAuthorization, *_nethttp.Response, error) { +func (a *VaultApiService) VaultCreateAuthorizationForVaultSectionExecute(r ApiVaultCreateAuthorizationForVaultSectionRequest) (*VaultSectionAuthorization, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue VaultSectionAuthorization + formFiles []formFile + localVarReturnValue *VaultSectionAuthorization ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VaultApiService.VaultCreateAuthorizationForVaultSection") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/VaultSection/{vaultSectionGuid}/Authorization" - localVarPath = strings.Replace(localVarPath, "{"+"vaultSectionGuid"+"}", _neturl.PathEscape(parameterToString(r.vaultSectionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"vaultSectionGuid"+"}", url.PathEscape(parameterToString(r.vaultSectionGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.authorization == nil { - return localVarReturnValue, nil, reportError("authorization is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -106,7 +97,7 @@ func (a *VaultApiService) VaultCreateAuthorizationForVaultSectionExecute(r ApiVa } // body params localVarPostBody = r.authorization - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -116,15 +107,15 @@ func (a *VaultApiService) VaultCreateAuthorizationForVaultSectionExecute(r ApiVa return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -135,7 +126,8 @@ func (a *VaultApiService) VaultCreateAuthorizationForVaultSectionExecute(r ApiVa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -145,14 +137,15 @@ func (a *VaultApiService) VaultCreateAuthorizationForVaultSectionExecute(r ApiVa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -163,7 +156,7 @@ func (a *VaultApiService) VaultCreateAuthorizationForVaultSectionExecute(r ApiVa } type ApiVaultCreateNewVaultItemRequest struct { - ctx _context.Context + ctx context.Context ApiService *VaultApiService item *VaultItem } @@ -174,7 +167,7 @@ func (r ApiVaultCreateNewVaultItemRequest) Item(item VaultItem) ApiVaultCreateNe return r } -func (r ApiVaultCreateNewVaultItemRequest) Execute() (VaultItem, *_nethttp.Response, error) { +func (r ApiVaultCreateNewVaultItemRequest) Execute() (*VaultItem, *http.Response, error) { return r.ApiService.VaultCreateNewVaultItemExecute(r) } @@ -183,10 +176,10 @@ VaultCreateNewVaultItem Creates a new vault item. The VaultItemGuid field should be omitted - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiVaultCreateNewVaultItemRequest */ -func (a *VaultApiService) VaultCreateNewVaultItem(ctx _context.Context) ApiVaultCreateNewVaultItemRequest { +func (a *VaultApiService) VaultCreateNewVaultItem(ctx context.Context) ApiVaultCreateNewVaultItemRequest { return ApiVaultCreateNewVaultItemRequest{ ApiService: a, ctx: ctx, @@ -195,29 +188,24 @@ func (a *VaultApiService) VaultCreateNewVaultItem(ctx _context.Context) ApiVault // Execute executes the request // @return VaultItem -func (a *VaultApiService) VaultCreateNewVaultItemExecute(r ApiVaultCreateNewVaultItemRequest) (VaultItem, *_nethttp.Response, error) { +func (a *VaultApiService) VaultCreateNewVaultItemExecute(r ApiVaultCreateNewVaultItemRequest) (*VaultItem, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue VaultItem + formFiles []formFile + localVarReturnValue *VaultItem ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VaultApiService.VaultCreateNewVaultItem") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/VaultItem" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.item == nil { - return localVarReturnValue, nil, reportError("item is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -238,7 +226,7 @@ func (a *VaultApiService) VaultCreateNewVaultItemExecute(r ApiVaultCreateNewVaul } // body params localVarPostBody = r.item - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -248,15 +236,15 @@ func (a *VaultApiService) VaultCreateNewVaultItemExecute(r ApiVaultCreateNewVaul return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -267,14 +255,15 @@ func (a *VaultApiService) VaultCreateNewVaultItemExecute(r ApiVaultCreateNewVaul newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -285,7 +274,7 @@ func (a *VaultApiService) VaultCreateNewVaultItemExecute(r ApiVaultCreateNewVaul } type ApiVaultCreateNewVaultSectionRequest struct { - ctx _context.Context + ctx context.Context ApiService *VaultApiService section *VaultSection } @@ -296,7 +285,7 @@ func (r ApiVaultCreateNewVaultSectionRequest) Section(section VaultSection) ApiV return r } -func (r ApiVaultCreateNewVaultSectionRequest) Execute() (VaultSection, *_nethttp.Response, error) { +func (r ApiVaultCreateNewVaultSectionRequest) Execute() (*VaultSection, *http.Response, error) { return r.ApiService.VaultCreateNewVaultSectionExecute(r) } @@ -305,10 +294,10 @@ VaultCreateNewVaultSection Creates a new vault section. When a new vault section is created, the user that created the section is granted View and Edit authorizations to that section. The VaultSectionGuid attribute should be omitted in the request body. The Guid of the newly created section will be returned in the response. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiVaultCreateNewVaultSectionRequest */ -func (a *VaultApiService) VaultCreateNewVaultSection(ctx _context.Context) ApiVaultCreateNewVaultSectionRequest { +func (a *VaultApiService) VaultCreateNewVaultSection(ctx context.Context) ApiVaultCreateNewVaultSectionRequest { return ApiVaultCreateNewVaultSectionRequest{ ApiService: a, ctx: ctx, @@ -317,29 +306,24 @@ func (a *VaultApiService) VaultCreateNewVaultSection(ctx _context.Context) ApiVa // Execute executes the request // @return VaultSection -func (a *VaultApiService) VaultCreateNewVaultSectionExecute(r ApiVaultCreateNewVaultSectionRequest) (VaultSection, *_nethttp.Response, error) { +func (a *VaultApiService) VaultCreateNewVaultSectionExecute(r ApiVaultCreateNewVaultSectionRequest) (*VaultSection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue VaultSection + formFiles []formFile + localVarReturnValue *VaultSection ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VaultApiService.VaultCreateNewVaultSection") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/VaultSection" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.section == nil { - return localVarReturnValue, nil, reportError("section is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -360,7 +344,7 @@ func (a *VaultApiService) VaultCreateNewVaultSectionExecute(r ApiVaultCreateNewV } // body params localVarPostBody = r.section - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -370,15 +354,15 @@ func (a *VaultApiService) VaultCreateNewVaultSectionExecute(r ApiVaultCreateNewV return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -389,14 +373,15 @@ func (a *VaultApiService) VaultCreateNewVaultSectionExecute(r ApiVaultCreateNewV newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -407,26 +392,25 @@ func (a *VaultApiService) VaultCreateNewVaultSectionExecute(r ApiVaultCreateNewV } type ApiVaultDeleteAuthorizationForVaultSectionRequest struct { - ctx _context.Context + ctx context.Context ApiService *VaultApiService vaultSectionGuid string authorizationGuid string } - -func (r ApiVaultDeleteAuthorizationForVaultSectionRequest) Execute() (*_nethttp.Response, error) { +func (r ApiVaultDeleteAuthorizationForVaultSectionRequest) Execute() (*http.Response, error) { return r.ApiService.VaultDeleteAuthorizationForVaultSectionExecute(r) } /* -VaultDeleteAuthorizationForVaultSection Deletes the specified authorization for the specified vault section. +VaultDeleteAuthorizationForVaultSection Deletes the specified authorization for the specified vault section. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param vaultSectionGuid The Guid of the vault section for which the authorization should be deleted. @param authorizationGuid The Guid of the authorization that should be deleted. @return ApiVaultDeleteAuthorizationForVaultSectionRequest */ -func (a *VaultApiService) VaultDeleteAuthorizationForVaultSection(ctx _context.Context, vaultSectionGuid string, authorizationGuid string) ApiVaultDeleteAuthorizationForVaultSectionRequest { +func (a *VaultApiService) VaultDeleteAuthorizationForVaultSection(ctx context.Context, vaultSectionGuid string, authorizationGuid string) ApiVaultDeleteAuthorizationForVaultSectionRequest { return ApiVaultDeleteAuthorizationForVaultSectionRequest{ ApiService: a, ctx: ctx, @@ -436,27 +420,25 @@ func (a *VaultApiService) VaultDeleteAuthorizationForVaultSection(ctx _context.C } // Execute executes the request -func (a *VaultApiService) VaultDeleteAuthorizationForVaultSectionExecute(r ApiVaultDeleteAuthorizationForVaultSectionRequest) (*_nethttp.Response, error) { +func (a *VaultApiService) VaultDeleteAuthorizationForVaultSectionExecute(r ApiVaultDeleteAuthorizationForVaultSectionRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VaultApiService.VaultDeleteAuthorizationForVaultSection") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/VaultSection/{vaultSectionGuid}/Authorization/{authorizationGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"vaultSectionGuid"+"}", _neturl.PathEscape(parameterToString(r.vaultSectionGuid, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"authorizationGuid"+"}", _neturl.PathEscape(parameterToString(r.authorizationGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"vaultSectionGuid"+"}", url.PathEscape(parameterToString(r.vaultSectionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"authorizationGuid"+"}", url.PathEscape(parameterToString(r.authorizationGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -475,7 +457,7 @@ func (a *VaultApiService) VaultDeleteAuthorizationForVaultSectionExecute(r ApiVa if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -485,15 +467,15 @@ func (a *VaultApiService) VaultDeleteAuthorizationForVaultSectionExecute(r ApiVa return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -504,7 +486,8 @@ func (a *VaultApiService) VaultDeleteAuthorizationForVaultSectionExecute(r ApiVa newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -514,7 +497,8 @@ func (a *VaultApiService) VaultDeleteAuthorizationForVaultSectionExecute(r ApiVa newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -523,24 +507,23 @@ func (a *VaultApiService) VaultDeleteAuthorizationForVaultSectionExecute(r ApiVa } type ApiVaultDeleteVaultItemRequest struct { - ctx _context.Context + ctx context.Context ApiService *VaultApiService vaultItemGuid string } - -func (r ApiVaultDeleteVaultItemRequest) Execute() (*_nethttp.Response, error) { +func (r ApiVaultDeleteVaultItemRequest) Execute() (*http.Response, error) { return r.ApiService.VaultDeleteVaultItemExecute(r) } /* VaultDeleteVaultItem Deletes the specified vault item. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param vaultItemGuid The Guid of the vault item that should be deleted. @return ApiVaultDeleteVaultItemRequest */ -func (a *VaultApiService) VaultDeleteVaultItem(ctx _context.Context, vaultItemGuid string) ApiVaultDeleteVaultItemRequest { +func (a *VaultApiService) VaultDeleteVaultItem(ctx context.Context, vaultItemGuid string) ApiVaultDeleteVaultItemRequest { return ApiVaultDeleteVaultItemRequest{ ApiService: a, ctx: ctx, @@ -549,26 +532,24 @@ func (a *VaultApiService) VaultDeleteVaultItem(ctx _context.Context, vaultItemGu } // Execute executes the request -func (a *VaultApiService) VaultDeleteVaultItemExecute(r ApiVaultDeleteVaultItemRequest) (*_nethttp.Response, error) { +func (a *VaultApiService) VaultDeleteVaultItemExecute(r ApiVaultDeleteVaultItemRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VaultApiService.VaultDeleteVaultItem") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/VaultItem/{vaultItemGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"vaultItemGuid"+"}", _neturl.PathEscape(parameterToString(r.vaultItemGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"vaultItemGuid"+"}", url.PathEscape(parameterToString(r.vaultItemGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -587,7 +568,7 @@ func (a *VaultApiService) VaultDeleteVaultItemExecute(r ApiVaultDeleteVaultItemR if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -597,15 +578,15 @@ func (a *VaultApiService) VaultDeleteVaultItemExecute(r ApiVaultDeleteVaultItemR return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -616,7 +597,8 @@ func (a *VaultApiService) VaultDeleteVaultItemExecute(r ApiVaultDeleteVaultItemR newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -626,7 +608,8 @@ func (a *VaultApiService) VaultDeleteVaultItemExecute(r ApiVaultDeleteVaultItemR newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -635,24 +618,23 @@ func (a *VaultApiService) VaultDeleteVaultItemExecute(r ApiVaultDeleteVaultItemR } type ApiVaultDeleteVaultSectionRequest struct { - ctx _context.Context + ctx context.Context ApiService *VaultApiService vaultSectionGuid string } - -func (r ApiVaultDeleteVaultSectionRequest) Execute() (*_nethttp.Response, error) { +func (r ApiVaultDeleteVaultSectionRequest) Execute() (*http.Response, error) { return r.ApiService.VaultDeleteVaultSectionExecute(r) } /* VaultDeleteVaultSection Deletes the specified vault section. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param vaultSectionGuid The Guid of the vault section that should be deleted. @return ApiVaultDeleteVaultSectionRequest */ -func (a *VaultApiService) VaultDeleteVaultSection(ctx _context.Context, vaultSectionGuid string) ApiVaultDeleteVaultSectionRequest { +func (a *VaultApiService) VaultDeleteVaultSection(ctx context.Context, vaultSectionGuid string) ApiVaultDeleteVaultSectionRequest { return ApiVaultDeleteVaultSectionRequest{ ApiService: a, ctx: ctx, @@ -661,26 +643,24 @@ func (a *VaultApiService) VaultDeleteVaultSection(ctx _context.Context, vaultSec } // Execute executes the request -func (a *VaultApiService) VaultDeleteVaultSectionExecute(r ApiVaultDeleteVaultSectionRequest) (*_nethttp.Response, error) { +func (a *VaultApiService) VaultDeleteVaultSectionExecute(r ApiVaultDeleteVaultSectionRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VaultApiService.VaultDeleteVaultSection") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/VaultSection/{vaultSectionGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"vaultSectionGuid"+"}", _neturl.PathEscape(parameterToString(r.vaultSectionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"vaultSectionGuid"+"}", url.PathEscape(parameterToString(r.vaultSectionGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -699,7 +679,7 @@ func (a *VaultApiService) VaultDeleteVaultSectionExecute(r ApiVaultDeleteVaultSe if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -709,15 +689,15 @@ func (a *VaultApiService) VaultDeleteVaultSectionExecute(r ApiVaultDeleteVaultSe return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -728,7 +708,8 @@ func (a *VaultApiService) VaultDeleteVaultSectionExecute(r ApiVaultDeleteVaultSe newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -738,7 +719,8 @@ func (a *VaultApiService) VaultDeleteVaultSectionExecute(r ApiVaultDeleteVaultSe newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -747,22 +729,21 @@ func (a *VaultApiService) VaultDeleteVaultSectionExecute(r ApiVaultDeleteVaultSe } type ApiVaultGetAllVaultItemsRequest struct { - ctx _context.Context + ctx context.Context ApiService *VaultApiService } - -func (r ApiVaultGetAllVaultItemsRequest) Execute() ([]VaultItem, *_nethttp.Response, error) { +func (r ApiVaultGetAllVaultItemsRequest) Execute() ([]VaultItem, *http.Response, error) { return r.ApiService.VaultGetAllVaultItemsExecute(r) } /* VaultGetAllVaultItems Returns all vault items. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiVaultGetAllVaultItemsRequest */ -func (a *VaultApiService) VaultGetAllVaultItems(ctx _context.Context) ApiVaultGetAllVaultItemsRequest { +func (a *VaultApiService) VaultGetAllVaultItems(ctx context.Context) ApiVaultGetAllVaultItemsRequest { return ApiVaultGetAllVaultItemsRequest{ ApiService: a, ctx: ctx, @@ -771,26 +752,24 @@ func (a *VaultApiService) VaultGetAllVaultItems(ctx _context.Context) ApiVaultGe // Execute executes the request // @return []VaultItem -func (a *VaultApiService) VaultGetAllVaultItemsExecute(r ApiVaultGetAllVaultItemsRequest) ([]VaultItem, *_nethttp.Response, error) { +func (a *VaultApiService) VaultGetAllVaultItemsExecute(r ApiVaultGetAllVaultItemsRequest) ([]VaultItem, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []VaultItem ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VaultApiService.VaultGetAllVaultItems") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/VaultItem" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -809,7 +788,7 @@ func (a *VaultApiService) VaultGetAllVaultItemsExecute(r ApiVaultGetAllVaultItem if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -819,15 +798,15 @@ func (a *VaultApiService) VaultGetAllVaultItemsExecute(r ApiVaultGetAllVaultItem return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -838,14 +817,15 @@ func (a *VaultApiService) VaultGetAllVaultItemsExecute(r ApiVaultGetAllVaultItem newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -856,22 +836,21 @@ func (a *VaultApiService) VaultGetAllVaultItemsExecute(r ApiVaultGetAllVaultItem } type ApiVaultGetAllVaultSectionsRequest struct { - ctx _context.Context + ctx context.Context ApiService *VaultApiService } - -func (r ApiVaultGetAllVaultSectionsRequest) Execute() ([]VaultSection, *_nethttp.Response, error) { +func (r ApiVaultGetAllVaultSectionsRequest) Execute() ([]VaultSection, *http.Response, error) { return r.ApiService.VaultGetAllVaultSectionsExecute(r) } /* VaultGetAllVaultSections Returns all vault sections. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiVaultGetAllVaultSectionsRequest */ -func (a *VaultApiService) VaultGetAllVaultSections(ctx _context.Context) ApiVaultGetAllVaultSectionsRequest { +func (a *VaultApiService) VaultGetAllVaultSections(ctx context.Context) ApiVaultGetAllVaultSectionsRequest { return ApiVaultGetAllVaultSectionsRequest{ ApiService: a, ctx: ctx, @@ -880,26 +859,24 @@ func (a *VaultApiService) VaultGetAllVaultSections(ctx _context.Context) ApiVaul // Execute executes the request // @return []VaultSection -func (a *VaultApiService) VaultGetAllVaultSectionsExecute(r ApiVaultGetAllVaultSectionsRequest) ([]VaultSection, *_nethttp.Response, error) { +func (a *VaultApiService) VaultGetAllVaultSectionsExecute(r ApiVaultGetAllVaultSectionsRequest) ([]VaultSection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []VaultSection ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VaultApiService.VaultGetAllVaultSections") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/VaultSection" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -918,7 +895,7 @@ func (a *VaultApiService) VaultGetAllVaultSectionsExecute(r ApiVaultGetAllVaultS if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -928,15 +905,15 @@ func (a *VaultApiService) VaultGetAllVaultSectionsExecute(r ApiVaultGetAllVaultS return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -947,14 +924,15 @@ func (a *VaultApiService) VaultGetAllVaultSectionsExecute(r ApiVaultGetAllVaultS newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -965,24 +943,23 @@ func (a *VaultApiService) VaultGetAllVaultSectionsExecute(r ApiVaultGetAllVaultS } type ApiVaultGetAuthorizationsForVaultSectionRequest struct { - ctx _context.Context + ctx context.Context ApiService *VaultApiService vaultSectionGuid string } - -func (r ApiVaultGetAuthorizationsForVaultSectionRequest) Execute() (VaultSectionAuthorization, *_nethttp.Response, error) { +func (r ApiVaultGetAuthorizationsForVaultSectionRequest) Execute() (*VaultSectionAuthorization, *http.Response, error) { return r.ApiService.VaultGetAuthorizationsForVaultSectionExecute(r) } /* VaultGetAuthorizationsForVaultSection Returns all authorizations for the specified vault section. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param vaultSectionGuid The Guid of the vault section for which to return authorizations. @return ApiVaultGetAuthorizationsForVaultSectionRequest */ -func (a *VaultApiService) VaultGetAuthorizationsForVaultSection(ctx _context.Context, vaultSectionGuid string) ApiVaultGetAuthorizationsForVaultSectionRequest { +func (a *VaultApiService) VaultGetAuthorizationsForVaultSection(ctx context.Context, vaultSectionGuid string) ApiVaultGetAuthorizationsForVaultSectionRequest { return ApiVaultGetAuthorizationsForVaultSectionRequest{ ApiService: a, ctx: ctx, @@ -992,27 +969,25 @@ func (a *VaultApiService) VaultGetAuthorizationsForVaultSection(ctx _context.Con // Execute executes the request // @return VaultSectionAuthorization -func (a *VaultApiService) VaultGetAuthorizationsForVaultSectionExecute(r ApiVaultGetAuthorizationsForVaultSectionRequest) (VaultSectionAuthorization, *_nethttp.Response, error) { +func (a *VaultApiService) VaultGetAuthorizationsForVaultSectionExecute(r ApiVaultGetAuthorizationsForVaultSectionRequest) (*VaultSectionAuthorization, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue VaultSectionAuthorization + formFiles []formFile + localVarReturnValue *VaultSectionAuthorization ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VaultApiService.VaultGetAuthorizationsForVaultSection") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/VaultSection/{vaultSectionGuid}/Authorization" - localVarPath = strings.Replace(localVarPath, "{"+"vaultSectionGuid"+"}", _neturl.PathEscape(parameterToString(r.vaultSectionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"vaultSectionGuid"+"}", url.PathEscape(parameterToString(r.vaultSectionGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1031,7 +1006,7 @@ func (a *VaultApiService) VaultGetAuthorizationsForVaultSectionExecute(r ApiVaul if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1041,15 +1016,15 @@ func (a *VaultApiService) VaultGetAuthorizationsForVaultSectionExecute(r ApiVaul return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1060,7 +1035,8 @@ func (a *VaultApiService) VaultGetAuthorizationsForVaultSectionExecute(r ApiVaul newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1070,14 +1046,15 @@ func (a *VaultApiService) VaultGetAuthorizationsForVaultSectionExecute(r ApiVaul newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1088,24 +1065,23 @@ func (a *VaultApiService) VaultGetAuthorizationsForVaultSectionExecute(r ApiVaul } type ApiVaultGetVaultItemRequest struct { - ctx _context.Context + ctx context.Context ApiService *VaultApiService vaultItemGuid string } - -func (r ApiVaultGetVaultItemRequest) Execute() (VaultItem, *_nethttp.Response, error) { +func (r ApiVaultGetVaultItemRequest) Execute() (*VaultItem, *http.Response, error) { return r.ApiService.VaultGetVaultItemExecute(r) } /* VaultGetVaultItem Returns the specified vault item. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param vaultItemGuid The Guid of the requested vault item. @return ApiVaultGetVaultItemRequest */ -func (a *VaultApiService) VaultGetVaultItem(ctx _context.Context, vaultItemGuid string) ApiVaultGetVaultItemRequest { +func (a *VaultApiService) VaultGetVaultItem(ctx context.Context, vaultItemGuid string) ApiVaultGetVaultItemRequest { return ApiVaultGetVaultItemRequest{ ApiService: a, ctx: ctx, @@ -1115,27 +1091,25 @@ func (a *VaultApiService) VaultGetVaultItem(ctx _context.Context, vaultItemGuid // Execute executes the request // @return VaultItem -func (a *VaultApiService) VaultGetVaultItemExecute(r ApiVaultGetVaultItemRequest) (VaultItem, *_nethttp.Response, error) { +func (a *VaultApiService) VaultGetVaultItemExecute(r ApiVaultGetVaultItemRequest) (*VaultItem, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue VaultItem + formFiles []formFile + localVarReturnValue *VaultItem ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VaultApiService.VaultGetVaultItem") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/VaultItem/{vaultItemGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"vaultItemGuid"+"}", _neturl.PathEscape(parameterToString(r.vaultItemGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"vaultItemGuid"+"}", url.PathEscape(parameterToString(r.vaultItemGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1154,7 +1128,7 @@ func (a *VaultApiService) VaultGetVaultItemExecute(r ApiVaultGetVaultItemRequest if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1164,15 +1138,15 @@ func (a *VaultApiService) VaultGetVaultItemExecute(r ApiVaultGetVaultItemRequest return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1183,7 +1157,8 @@ func (a *VaultApiService) VaultGetVaultItemExecute(r ApiVaultGetVaultItemRequest newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1193,14 +1168,15 @@ func (a *VaultApiService) VaultGetVaultItemExecute(r ApiVaultGetVaultItemRequest newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1211,24 +1187,23 @@ func (a *VaultApiService) VaultGetVaultItemExecute(r ApiVaultGetVaultItemRequest } type ApiVaultGetVaultSectionRequest struct { - ctx _context.Context + ctx context.Context ApiService *VaultApiService vaultSectionGuid string } - -func (r ApiVaultGetVaultSectionRequest) Execute() (VaultSection, *_nethttp.Response, error) { +func (r ApiVaultGetVaultSectionRequest) Execute() (*VaultSection, *http.Response, error) { return r.ApiService.VaultGetVaultSectionExecute(r) } /* VaultGetVaultSection Returns the specified vault section. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param vaultSectionGuid The Guid of the requested vault section. @return ApiVaultGetVaultSectionRequest */ -func (a *VaultApiService) VaultGetVaultSection(ctx _context.Context, vaultSectionGuid string) ApiVaultGetVaultSectionRequest { +func (a *VaultApiService) VaultGetVaultSection(ctx context.Context, vaultSectionGuid string) ApiVaultGetVaultSectionRequest { return ApiVaultGetVaultSectionRequest{ ApiService: a, ctx: ctx, @@ -1238,27 +1213,25 @@ func (a *VaultApiService) VaultGetVaultSection(ctx _context.Context, vaultSectio // Execute executes the request // @return VaultSection -func (a *VaultApiService) VaultGetVaultSectionExecute(r ApiVaultGetVaultSectionRequest) (VaultSection, *_nethttp.Response, error) { +func (a *VaultApiService) VaultGetVaultSectionExecute(r ApiVaultGetVaultSectionRequest) (*VaultSection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue VaultSection + formFiles []formFile + localVarReturnValue *VaultSection ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VaultApiService.VaultGetVaultSection") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/VaultSection/{vaultSectionGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"vaultSectionGuid"+"}", _neturl.PathEscape(parameterToString(r.vaultSectionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"vaultSectionGuid"+"}", url.PathEscape(parameterToString(r.vaultSectionGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1277,7 +1250,7 @@ func (a *VaultApiService) VaultGetVaultSectionExecute(r ApiVaultGetVaultSectionR if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1287,15 +1260,15 @@ func (a *VaultApiService) VaultGetVaultSectionExecute(r ApiVaultGetVaultSectionR return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1306,7 +1279,8 @@ func (a *VaultApiService) VaultGetVaultSectionExecute(r ApiVaultGetVaultSectionR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1316,14 +1290,15 @@ func (a *VaultApiService) VaultGetVaultSectionExecute(r ApiVaultGetVaultSectionR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1334,7 +1309,7 @@ func (a *VaultApiService) VaultGetVaultSectionExecute(r ApiVaultGetVaultSectionR } type ApiVaultPartiallyUpdateVaultItemRequest struct { - ctx _context.Context + ctx context.Context ApiService *VaultApiService vaultItemGuid string item *VaultItem @@ -1346,7 +1321,7 @@ func (r ApiVaultPartiallyUpdateVaultItemRequest) Item(item VaultItem) ApiVaultPa return r } -func (r ApiVaultPartiallyUpdateVaultItemRequest) Execute() (*_nethttp.Response, error) { +func (r ApiVaultPartiallyUpdateVaultItemRequest) Execute() (*http.Response, error) { return r.ApiService.VaultPartiallyUpdateVaultItemExecute(r) } @@ -1355,11 +1330,11 @@ VaultPartiallyUpdateVaultItem Partially updates the specified vault item. The vault item type cannot be changed with this operation. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param vaultItemGuid The Guid of the vault item that should be updated. @return ApiVaultPartiallyUpdateVaultItemRequest */ -func (a *VaultApiService) VaultPartiallyUpdateVaultItem(ctx _context.Context, vaultItemGuid string) ApiVaultPartiallyUpdateVaultItemRequest { +func (a *VaultApiService) VaultPartiallyUpdateVaultItem(ctx context.Context, vaultItemGuid string) ApiVaultPartiallyUpdateVaultItemRequest { return ApiVaultPartiallyUpdateVaultItemRequest{ ApiService: a, ctx: ctx, @@ -1368,29 +1343,24 @@ func (a *VaultApiService) VaultPartiallyUpdateVaultItem(ctx _context.Context, va } // Execute executes the request -func (a *VaultApiService) VaultPartiallyUpdateVaultItemExecute(r ApiVaultPartiallyUpdateVaultItemRequest) (*_nethttp.Response, error) { +func (a *VaultApiService) VaultPartiallyUpdateVaultItemExecute(r ApiVaultPartiallyUpdateVaultItemRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VaultApiService.VaultPartiallyUpdateVaultItem") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/VaultItem/{vaultItemGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"vaultItemGuid"+"}", _neturl.PathEscape(parameterToString(r.vaultItemGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"vaultItemGuid"+"}", url.PathEscape(parameterToString(r.vaultItemGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.item == nil { - return nil, reportError("item is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -1411,7 +1381,7 @@ func (a *VaultApiService) VaultPartiallyUpdateVaultItemExecute(r ApiVaultPartial } // body params localVarPostBody = r.item - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1421,15 +1391,15 @@ func (a *VaultApiService) VaultPartiallyUpdateVaultItemExecute(r ApiVaultPartial return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1440,7 +1410,8 @@ func (a *VaultApiService) VaultPartiallyUpdateVaultItemExecute(r ApiVaultPartial newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1450,7 +1421,8 @@ func (a *VaultApiService) VaultPartiallyUpdateVaultItemExecute(r ApiVaultPartial newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -1459,7 +1431,7 @@ func (a *VaultApiService) VaultPartiallyUpdateVaultItemExecute(r ApiVaultPartial } type ApiVaultUpdateVaultItemRequest struct { - ctx _context.Context + ctx context.Context ApiService *VaultApiService vaultItemGuid string item *VaultItem @@ -1471,7 +1443,7 @@ func (r ApiVaultUpdateVaultItemRequest) Item(item VaultItem) ApiVaultUpdateVault return r } -func (r ApiVaultUpdateVaultItemRequest) Execute() (*_nethttp.Response, error) { +func (r ApiVaultUpdateVaultItemRequest) Execute() (*http.Response, error) { return r.ApiService.VaultUpdateVaultItemExecute(r) } @@ -1480,11 +1452,11 @@ VaultUpdateVaultItem Updates the specified vault item. Only complete definitions are accepted. Fields not specified will be NULLed. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param vaultItemGuid The Guid of the vault item that should be updated. @return ApiVaultUpdateVaultItemRequest */ -func (a *VaultApiService) VaultUpdateVaultItem(ctx _context.Context, vaultItemGuid string) ApiVaultUpdateVaultItemRequest { +func (a *VaultApiService) VaultUpdateVaultItem(ctx context.Context, vaultItemGuid string) ApiVaultUpdateVaultItemRequest { return ApiVaultUpdateVaultItemRequest{ ApiService: a, ctx: ctx, @@ -1493,29 +1465,24 @@ func (a *VaultApiService) VaultUpdateVaultItem(ctx _context.Context, vaultItemGu } // Execute executes the request -func (a *VaultApiService) VaultUpdateVaultItemExecute(r ApiVaultUpdateVaultItemRequest) (*_nethttp.Response, error) { +func (a *VaultApiService) VaultUpdateVaultItemExecute(r ApiVaultUpdateVaultItemRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VaultApiService.VaultUpdateVaultItem") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/VaultItem/{vaultItemGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"vaultItemGuid"+"}", _neturl.PathEscape(parameterToString(r.vaultItemGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"vaultItemGuid"+"}", url.PathEscape(parameterToString(r.vaultItemGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.item == nil { - return nil, reportError("item is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -1536,7 +1503,7 @@ func (a *VaultApiService) VaultUpdateVaultItemExecute(r ApiVaultUpdateVaultItemR } // body params localVarPostBody = r.item - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1546,15 +1513,15 @@ func (a *VaultApiService) VaultUpdateVaultItemExecute(r ApiVaultUpdateVaultItemR return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1565,7 +1532,8 @@ func (a *VaultApiService) VaultUpdateVaultItemExecute(r ApiVaultUpdateVaultItemR newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1575,7 +1543,8 @@ func (a *VaultApiService) VaultUpdateVaultItemExecute(r ApiVaultUpdateVaultItemR newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -1584,7 +1553,7 @@ func (a *VaultApiService) VaultUpdateVaultItemExecute(r ApiVaultUpdateVaultItemR } type ApiVaultUpdateVaultSectionRequest struct { - ctx _context.Context + ctx context.Context ApiService *VaultApiService vaultSectionGuid string item *VaultSection @@ -1595,18 +1564,18 @@ func (r ApiVaultUpdateVaultSectionRequest) Item(item VaultSection) ApiVaultUpdat return r } -func (r ApiVaultUpdateVaultSectionRequest) Execute() (*_nethttp.Response, error) { +func (r ApiVaultUpdateVaultSectionRequest) Execute() (*http.Response, error) { return r.ApiService.VaultUpdateVaultSectionExecute(r) } /* VaultUpdateVaultSection Updates the specified vault section. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param vaultSectionGuid The Guid of the vault section that should be updated. @return ApiVaultUpdateVaultSectionRequest */ -func (a *VaultApiService) VaultUpdateVaultSection(ctx _context.Context, vaultSectionGuid string) ApiVaultUpdateVaultSectionRequest { +func (a *VaultApiService) VaultUpdateVaultSection(ctx context.Context, vaultSectionGuid string) ApiVaultUpdateVaultSectionRequest { return ApiVaultUpdateVaultSectionRequest{ ApiService: a, ctx: ctx, @@ -1615,29 +1584,24 @@ func (a *VaultApiService) VaultUpdateVaultSection(ctx _context.Context, vaultSec } // Execute executes the request -func (a *VaultApiService) VaultUpdateVaultSectionExecute(r ApiVaultUpdateVaultSectionRequest) (*_nethttp.Response, error) { +func (a *VaultApiService) VaultUpdateVaultSectionExecute(r ApiVaultUpdateVaultSectionRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VaultApiService.VaultUpdateVaultSection") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/VaultSection/{vaultSectionGuid}" - localVarPath = strings.Replace(localVarPath, "{"+"vaultSectionGuid"+"}", _neturl.PathEscape(parameterToString(r.vaultSectionGuid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"vaultSectionGuid"+"}", url.PathEscape(parameterToString(r.vaultSectionGuid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.item == nil { - return nil, reportError("item is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -1658,7 +1622,7 @@ func (a *VaultApiService) VaultUpdateVaultSectionExecute(r ApiVaultUpdateVaultSe } // body params localVarPostBody = r.item - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1668,15 +1632,15 @@ func (a *VaultApiService) VaultUpdateVaultSectionExecute(r ApiVaultUpdateVaultSe return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1687,7 +1651,8 @@ func (a *VaultApiService) VaultUpdateVaultSectionExecute(r ApiVaultUpdateVaultSe newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1697,7 +1662,8 @@ func (a *VaultApiService) VaultUpdateVaultSectionExecute(r ApiVaultUpdateVaultSe newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/client.go b/vendor/github.com/wasfree/uptrends-go-sdk/client.go index 0cae8bc1..7d54543e 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/client.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/client.go @@ -61,8 +61,6 @@ type APIClient struct { IntegrationApi *IntegrationApiService - MiscellaneousApi *MiscellaneousApiService - MonitorApi *MonitorApiService MonitorCheckApi *MonitorCheckApiService @@ -73,8 +71,12 @@ type APIClient struct { OperatorGroupApi *OperatorGroupApiService + OutgoingPhoneNumberApi *OutgoingPhoneNumberApiService + PublicStatusPageApi *PublicStatusPageApiService + RUMApi *RUMApiService + RegisterApi *RegisterApiService SLAApi *SLAApiService @@ -85,6 +87,8 @@ type APIClient struct { StatusApi *StatusApiService + TimezoneApi *TimezoneApiService + VaultApi *VaultApiService } @@ -110,18 +114,20 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.CheckpointApi = (*CheckpointApiService)(&c.common) c.DashboardApi = (*DashboardApiService)(&c.common) c.IntegrationApi = (*IntegrationApiService)(&c.common) - c.MiscellaneousApi = (*MiscellaneousApiService)(&c.common) c.MonitorApi = (*MonitorApiService)(&c.common) c.MonitorCheckApi = (*MonitorCheckApiService)(&c.common) c.MonitorGroupApi = (*MonitorGroupApiService)(&c.common) c.OperatorApi = (*OperatorApiService)(&c.common) c.OperatorGroupApi = (*OperatorGroupApiService)(&c.common) + c.OutgoingPhoneNumberApi = (*OutgoingPhoneNumberApiService)(&c.common) c.PublicStatusPageApi = (*PublicStatusPageApiService)(&c.common) + c.RUMApi = (*RUMApiService)(&c.common) c.RegisterApi = (*RegisterApiService)(&c.common) c.SLAApi = (*SLAApiService)(&c.common) c.ScheduledReportApi = (*ScheduledReportApiService)(&c.common) c.StatisticsApi = (*StatisticsApiService)(&c.common) c.StatusApi = (*StatusApiService)(&c.common) + c.TimezoneApi = (*TimezoneApiService)(&c.common) c.VaultApi = (*VaultApiService)(&c.common) return c @@ -158,7 +164,7 @@ func selectHeaderAccept(accepts []string) string { // contains is a case insensitive match, finding needle in a haystack func contains(haystack []string, needle string) bool { for _, a := range haystack { - if strings.ToLower(a) == strings.ToLower(needle) { + if strings.EqualFold(a, needle) { return true } } @@ -174,7 +180,7 @@ func typeCheckParameter(obj interface{}, expected string, name string) error { // Check the type is as expected. if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) } return nil } @@ -243,6 +249,12 @@ func (c *APIClient) GetConfig() *Configuration { return c.cfg } +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + // prepareRequest build the request func (c *APIClient) prepareRequest( ctx context.Context, @@ -251,9 +263,7 @@ func (c *APIClient) prepareRequest( headerParams map[string]string, queryParams url.Values, formParams url.Values, - formFileName string, - fileName string, - fileBytes []byte) (localVarRequest *http.Request, err error) { + formFiles []formFile) (localVarRequest *http.Request, err error) { var body *bytes.Buffer @@ -272,7 +282,7 @@ func (c *APIClient) prepareRequest( } // add form parameters and file if available. - if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { if body != nil { return nil, errors.New("Cannot specify postBody and multipart form at the same time.") } @@ -291,16 +301,17 @@ func (c *APIClient) prepareRequest( } } } - if len(fileBytes) > 0 && fileName != "" { - w.Boundary() - //_, fileNm := filepath.Split(fileName) - part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(fileBytes) - if err != nil { - return nil, err + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } } } @@ -363,7 +374,7 @@ func (c *APIClient) prepareRequest( if len(headerParams) > 0 { headers := http.Header{} for h, v := range headerParams { - headers.Set(h, v) + headers[h] = []string{v} } localVarRequest.Header = headers } @@ -420,6 +431,9 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err return } _, err = (*f).Write(b) + if err != nil { + return + } _, err = (*f).Seek(0, io.SeekStart) return } @@ -448,11 +462,14 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err // Add a file to the multipart request func addFile(w *multipart.Writer, fieldName, path string) error { - file, err := os.Open(path) + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() if err != nil { return err } - defer file.Close() part, err := w.CreateFormFile(fieldName, filepath.Base(path)) if err != nil { @@ -468,6 +485,13 @@ func reportError(format string, a ...interface{}) error { return fmt.Errorf(format, a...) } +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + // Set request body from an interface{} func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { if bodyBuf == nil { @@ -495,7 +519,7 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e } if bodyBuf.Len() == 0 { - err = fmt.Errorf("Invalid body type %s\n", contentType) + err = fmt.Errorf("invalid body type %s\n", contentType) return nil, err } return bodyBuf, nil @@ -597,3 +621,23 @@ func (e GenericOpenAPIError) Body() []byte { func (e GenericOpenAPIError) Model() interface{} { return e.model } + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + + str := "" + metaValue := reflect.ValueOf(v).Elem() + + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + + // status title (detail) + return fmt.Sprintf("%s %s", status, str) +} diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/configuration.go b/vendor/github.com/wasfree/uptrends-go-sdk/configuration.go index 82f676c2..1752785d 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/configuration.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/configuration.go @@ -123,7 +123,7 @@ func (c *Configuration) AddDefaultHeader(key string, value string) { // URL formats template on a index using given variables func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { if index < 0 || len(sc) <= index { - return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) } server := sc[index] url := server.URL @@ -138,7 +138,7 @@ func (sc ServerConfigurations) URL(index int, variables map[string]string) (stri } } if !found { - return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) } url = strings.Replace(url, "{"+name+"}", value, -1) } else { diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/git_push.sh b/vendor/github.com/wasfree/uptrends-go-sdk/git_push.sh index ced3be2b..f53a75d4 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/git_push.sh +++ b/vendor/github.com/wasfree/uptrends-go-sdk/git_push.sh @@ -1,7 +1,7 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 @@ -38,14 +38,14 @@ git add . git commit -m "$release_note" # Sets the new remote -git_remote=`git remote` +git_remote=$(git remote) if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_account_settings.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_account_settings.go new file mode 100644 index 00000000..983d2eb1 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_account_settings.go @@ -0,0 +1,108 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// AccountSettings struct for AccountSettings +type AccountSettings struct { + TimezoneId int32 `json:"TimezoneId"` +} + +// NewAccountSettings instantiates a new AccountSettings object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAccountSettings(timezoneId int32) *AccountSettings { + this := AccountSettings{} + this.TimezoneId = timezoneId + return &this +} + +// NewAccountSettingsWithDefaults instantiates a new AccountSettings object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAccountSettingsWithDefaults() *AccountSettings { + this := AccountSettings{} + return &this +} + +// GetTimezoneId returns the TimezoneId field value +func (o *AccountSettings) GetTimezoneId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.TimezoneId +} + +// GetTimezoneIdOk returns a tuple with the TimezoneId field value +// and a boolean to check if the value has been set. +func (o *AccountSettings) GetTimezoneIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TimezoneId, true +} + +// SetTimezoneId sets field value +func (o *AccountSettings) SetTimezoneId(v int32) { + o.TimezoneId = v +} + +func (o AccountSettings) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["TimezoneId"] = o.TimezoneId + } + return json.Marshal(toSerialize) +} + +type NullableAccountSettings struct { + value *AccountSettings + isSet bool +} + +func (v NullableAccountSettings) Get() *AccountSettings { + return v.value +} + +func (v *NullableAccountSettings) Set(val *AccountSettings) { + v.value = val + v.isSet = true +} + +func (v NullableAccountSettings) IsSet() bool { + return v.isSet +} + +func (v *NullableAccountSettings) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccountSettings(val *AccountSettings) *NullableAccountSettings { + return &NullableAccountSettings{value: val, isSet: true} +} + +func (v NullableAccountSettings) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccountSettings) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_account_statistics.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_account_statistics.go index 58fb71f8..854b8924 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_account_statistics.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_account_statistics.go @@ -12,13 +12,12 @@ package uptrends import ( "encoding/json" - "time" ) // AccountStatistics struct for AccountStatistics type AccountStatistics struct { AccountId *string `json:"AccountId,omitempty"` - ExpirationDate *time.Time `json:"ExpirationDate,omitempty"` + ExpirationDate map[string]interface{} `json:"ExpirationDate,omitempty"` MonitorQuota *MonitorQuota `json:"MonitorQuota,omitempty"` OperatorQuota *OperatorQuota `json:"OperatorQuota,omitempty"` RemainingMessageCredits *int32 `json:"RemainingMessageCredits,omitempty"` @@ -43,7 +42,7 @@ func NewAccountStatisticsWithDefaults() *AccountStatistics { // GetAccountId returns the AccountId field value if set, zero value otherwise. func (o *AccountStatistics) GetAccountId() string { - if o == nil || o.AccountId == nil { + if o == nil || isNil(o.AccountId) { var ret string return ret } @@ -53,15 +52,15 @@ func (o *AccountStatistics) GetAccountId() string { // GetAccountIdOk returns a tuple with the AccountId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AccountStatistics) GetAccountIdOk() (*string, bool) { - if o == nil || o.AccountId == nil { - return nil, false + if o == nil || isNil(o.AccountId) { + return nil, false } return o.AccountId, true } // HasAccountId returns a boolean if a field has been set. func (o *AccountStatistics) HasAccountId() bool { - if o != nil && o.AccountId != nil { + if o != nil && !isNil(o.AccountId) { return true } @@ -74,40 +73,40 @@ func (o *AccountStatistics) SetAccountId(v string) { } // GetExpirationDate returns the ExpirationDate field value if set, zero value otherwise. -func (o *AccountStatistics) GetExpirationDate() time.Time { - if o == nil || o.ExpirationDate == nil { - var ret time.Time +func (o *AccountStatistics) GetExpirationDate() map[string]interface{} { + if o == nil || isNil(o.ExpirationDate) { + var ret map[string]interface{} return ret } - return *o.ExpirationDate + return o.ExpirationDate } // GetExpirationDateOk returns a tuple with the ExpirationDate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AccountStatistics) GetExpirationDateOk() (*time.Time, bool) { - if o == nil || o.ExpirationDate == nil { - return nil, false +func (o *AccountStatistics) GetExpirationDateOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.ExpirationDate) { + return map[string]interface{}{}, false } return o.ExpirationDate, true } // HasExpirationDate returns a boolean if a field has been set. func (o *AccountStatistics) HasExpirationDate() bool { - if o != nil && o.ExpirationDate != nil { + if o != nil && !isNil(o.ExpirationDate) { return true } return false } -// SetExpirationDate gets a reference to the given time.Time and assigns it to the ExpirationDate field. -func (o *AccountStatistics) SetExpirationDate(v time.Time) { - o.ExpirationDate = &v +// SetExpirationDate gets a reference to the given map[string]interface{} and assigns it to the ExpirationDate field. +func (o *AccountStatistics) SetExpirationDate(v map[string]interface{}) { + o.ExpirationDate = v } // GetMonitorQuota returns the MonitorQuota field value if set, zero value otherwise. func (o *AccountStatistics) GetMonitorQuota() MonitorQuota { - if o == nil || o.MonitorQuota == nil { + if o == nil || isNil(o.MonitorQuota) { var ret MonitorQuota return ret } @@ -117,15 +116,15 @@ func (o *AccountStatistics) GetMonitorQuota() MonitorQuota { // GetMonitorQuotaOk returns a tuple with the MonitorQuota field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AccountStatistics) GetMonitorQuotaOk() (*MonitorQuota, bool) { - if o == nil || o.MonitorQuota == nil { - return nil, false + if o == nil || isNil(o.MonitorQuota) { + return nil, false } return o.MonitorQuota, true } // HasMonitorQuota returns a boolean if a field has been set. func (o *AccountStatistics) HasMonitorQuota() bool { - if o != nil && o.MonitorQuota != nil { + if o != nil && !isNil(o.MonitorQuota) { return true } @@ -139,7 +138,7 @@ func (o *AccountStatistics) SetMonitorQuota(v MonitorQuota) { // GetOperatorQuota returns the OperatorQuota field value if set, zero value otherwise. func (o *AccountStatistics) GetOperatorQuota() OperatorQuota { - if o == nil || o.OperatorQuota == nil { + if o == nil || isNil(o.OperatorQuota) { var ret OperatorQuota return ret } @@ -149,15 +148,15 @@ func (o *AccountStatistics) GetOperatorQuota() OperatorQuota { // GetOperatorQuotaOk returns a tuple with the OperatorQuota field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AccountStatistics) GetOperatorQuotaOk() (*OperatorQuota, bool) { - if o == nil || o.OperatorQuota == nil { - return nil, false + if o == nil || isNil(o.OperatorQuota) { + return nil, false } return o.OperatorQuota, true } // HasOperatorQuota returns a boolean if a field has been set. func (o *AccountStatistics) HasOperatorQuota() bool { - if o != nil && o.OperatorQuota != nil { + if o != nil && !isNil(o.OperatorQuota) { return true } @@ -171,7 +170,7 @@ func (o *AccountStatistics) SetOperatorQuota(v OperatorQuota) { // GetRemainingMessageCredits returns the RemainingMessageCredits field value if set, zero value otherwise. func (o *AccountStatistics) GetRemainingMessageCredits() int32 { - if o == nil || o.RemainingMessageCredits == nil { + if o == nil || isNil(o.RemainingMessageCredits) { var ret int32 return ret } @@ -181,15 +180,15 @@ func (o *AccountStatistics) GetRemainingMessageCredits() int32 { // GetRemainingMessageCreditsOk returns a tuple with the RemainingMessageCredits field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AccountStatistics) GetRemainingMessageCreditsOk() (*int32, bool) { - if o == nil || o.RemainingMessageCredits == nil { - return nil, false + if o == nil || isNil(o.RemainingMessageCredits) { + return nil, false } return o.RemainingMessageCredits, true } // HasRemainingMessageCredits returns a boolean if a field has been set. func (o *AccountStatistics) HasRemainingMessageCredits() bool { - if o != nil && o.RemainingMessageCredits != nil { + if o != nil && !isNil(o.RemainingMessageCredits) { return true } @@ -203,19 +202,19 @@ func (o *AccountStatistics) SetRemainingMessageCredits(v int32) { func (o AccountStatistics) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.AccountId != nil { + if !isNil(o.AccountId) { toSerialize["AccountId"] = o.AccountId } - if o.ExpirationDate != nil { + if !isNil(o.ExpirationDate) { toSerialize["ExpirationDate"] = o.ExpirationDate } - if o.MonitorQuota != nil { + if !isNil(o.MonitorQuota) { toSerialize["MonitorQuota"] = o.MonitorQuota } - if o.OperatorQuota != nil { + if !isNil(o.OperatorQuota) { toSerialize["OperatorQuota"] = o.OperatorQuota } - if o.RemainingMessageCredits != nil { + if !isNil(o.RemainingMessageCredits) { toSerialize["RemainingMessageCredits"] = o.RemainingMessageCredits } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert.go index 684cb1cc..7c405c0c 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert.go @@ -17,9 +17,12 @@ import ( // Alert Represents the values/results of a single check done by a monitor type Alert struct { Attributes *AlertAttributes `json:"Attributes,omitempty"` + // Identifier Id string `json:"Id"` Type *string `json:"Type,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + // Links related to the object Links *map[string]string `json:"Links,omitempty"` } @@ -43,7 +46,7 @@ func NewAlertWithDefaults() *Alert { // GetAttributes returns the Attributes field value if set, zero value otherwise. func (o *Alert) GetAttributes() AlertAttributes { - if o == nil || o.Attributes == nil { + if o == nil || isNil(o.Attributes) { var ret AlertAttributes return ret } @@ -53,15 +56,15 @@ func (o *Alert) GetAttributes() AlertAttributes { // GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Alert) GetAttributesOk() (*AlertAttributes, bool) { - if o == nil || o.Attributes == nil { - return nil, false + if o == nil || isNil(o.Attributes) { + return nil, false } return o.Attributes, true } // HasAttributes returns a boolean if a field has been set. func (o *Alert) HasAttributes() bool { - if o != nil && o.Attributes != nil { + if o != nil && !isNil(o.Attributes) { return true } @@ -86,8 +89,8 @@ func (o *Alert) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *Alert) GetIdOk() (*string, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Id, true } @@ -99,7 +102,7 @@ func (o *Alert) SetId(v string) { // GetType returns the Type field value if set, zero value otherwise. func (o *Alert) GetType() string { - if o == nil || o.Type == nil { + if o == nil || isNil(o.Type) { var ret string return ret } @@ -109,15 +112,15 @@ func (o *Alert) GetType() string { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Alert) GetTypeOk() (*string, bool) { - if o == nil || o.Type == nil { - return nil, false + if o == nil || isNil(o.Type) { + return nil, false } return o.Type, true } // HasType returns a boolean if a field has been set. func (o *Alert) HasType() bool { - if o != nil && o.Type != nil { + if o != nil && !isNil(o.Type) { return true } @@ -131,25 +134,25 @@ func (o *Alert) SetType(v string) { // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *Alert) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Alert) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *Alert) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *Alert) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -158,12 +161,12 @@ func (o *Alert) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *Alert) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetLinks returns the Links field value if set, zero value otherwise. func (o *Alert) GetLinks() map[string]string { - if o == nil || o.Links == nil { + if o == nil || isNil(o.Links) { var ret map[string]string return ret } @@ -173,15 +176,15 @@ func (o *Alert) GetLinks() map[string]string { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Alert) GetLinksOk() (*map[string]string, bool) { - if o == nil || o.Links == nil { - return nil, false + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *Alert) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } @@ -195,19 +198,19 @@ func (o *Alert) SetLinks(v map[string]string) { func (o Alert) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Attributes != nil { + if !isNil(o.Attributes) { toSerialize["Attributes"] = o.Attributes } if true { toSerialize["Id"] = o.Id } - if o.Type != nil { + if !isNil(o.Type) { toSerialize["Type"] = o.Type } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_attributes.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_attributes.go index f34de192..53cf572e 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_attributes.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_attributes.go @@ -12,19 +12,18 @@ package uptrends import ( "encoding/json" - "time" ) -// AlertAttributes Alert attributes +// AlertAttributes Object attributes type AlertAttributes struct { // Alert type indicating if this was an Error or Ok alert. AlertType AlertType `json:"AlertType"` // The monitor identifier. MonitorGuid string `json:"MonitorGuid"` // Date/time stamp of the alert. - Timestamp time.Time `json:"Timestamp"` + Timestamp map[string]interface{} `json:"Timestamp"` // Date/time stamp of the first monitor check. - FirstError time.Time `json:"FirstError"` + FirstError map[string]interface{} `json:"FirstError"` // The Id of the monitor check that triggered this alert. MonitorCheckId int64 `json:"MonitorCheckId"` // The Id of the first monitor check error that led to this alert. @@ -41,7 +40,7 @@ type AlertAttributes struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewAlertAttributes(alertType AlertType, monitorGuid string, timestamp time.Time, firstError time.Time, monitorCheckId int64, firstErrorMonitorCheckId int64) *AlertAttributes { +func NewAlertAttributes(alertType AlertType, monitorGuid string, timestamp map[string]interface{}, firstError map[string]interface{}, monitorCheckId int64, firstErrorMonitorCheckId int64) *AlertAttributes { this := AlertAttributes{} this.AlertType = alertType this.MonitorGuid = monitorGuid @@ -73,8 +72,8 @@ func (o *AlertAttributes) GetAlertType() AlertType { // GetAlertTypeOk returns a tuple with the AlertType field value // and a boolean to check if the value has been set. func (o *AlertAttributes) GetAlertTypeOk() (*AlertType, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.AlertType, true } @@ -97,8 +96,8 @@ func (o *AlertAttributes) GetMonitorGuid() string { // GetMonitorGuidOk returns a tuple with the MonitorGuid field value // and a boolean to check if the value has been set. func (o *AlertAttributes) GetMonitorGuidOk() (*string, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.MonitorGuid, true } @@ -109,9 +108,9 @@ func (o *AlertAttributes) SetMonitorGuid(v string) { } // GetTimestamp returns the Timestamp field value -func (o *AlertAttributes) GetTimestamp() time.Time { +func (o *AlertAttributes) GetTimestamp() map[string]interface{} { if o == nil { - var ret time.Time + var ret map[string]interface{} return ret } @@ -120,22 +119,22 @@ func (o *AlertAttributes) GetTimestamp() time.Time { // GetTimestampOk returns a tuple with the Timestamp field value // and a boolean to check if the value has been set. -func (o *AlertAttributes) GetTimestampOk() (*time.Time, bool) { - if o == nil { - return nil, false +func (o *AlertAttributes) GetTimestampOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false } - return &o.Timestamp, true + return o.Timestamp, true } // SetTimestamp sets field value -func (o *AlertAttributes) SetTimestamp(v time.Time) { +func (o *AlertAttributes) SetTimestamp(v map[string]interface{}) { o.Timestamp = v } // GetFirstError returns the FirstError field value -func (o *AlertAttributes) GetFirstError() time.Time { +func (o *AlertAttributes) GetFirstError() map[string]interface{} { if o == nil { - var ret time.Time + var ret map[string]interface{} return ret } @@ -144,15 +143,15 @@ func (o *AlertAttributes) GetFirstError() time.Time { // GetFirstErrorOk returns a tuple with the FirstError field value // and a boolean to check if the value has been set. -func (o *AlertAttributes) GetFirstErrorOk() (*time.Time, bool) { - if o == nil { - return nil, false +func (o *AlertAttributes) GetFirstErrorOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false } - return &o.FirstError, true + return o.FirstError, true } // SetFirstError sets field value -func (o *AlertAttributes) SetFirstError(v time.Time) { +func (o *AlertAttributes) SetFirstError(v map[string]interface{}) { o.FirstError = v } @@ -169,8 +168,8 @@ func (o *AlertAttributes) GetMonitorCheckId() int64 { // GetMonitorCheckIdOk returns a tuple with the MonitorCheckId field value // and a boolean to check if the value has been set. func (o *AlertAttributes) GetMonitorCheckIdOk() (*int64, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.MonitorCheckId, true } @@ -193,8 +192,8 @@ func (o *AlertAttributes) GetFirstErrorMonitorCheckId() int64 { // GetFirstErrorMonitorCheckIdOk returns a tuple with the FirstErrorMonitorCheckId field value // and a boolean to check if the value has been set. func (o *AlertAttributes) GetFirstErrorMonitorCheckIdOk() (*int64, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.FirstErrorMonitorCheckId, true } @@ -206,7 +205,7 @@ func (o *AlertAttributes) SetFirstErrorMonitorCheckId(v int64) { // GetErrorDescription returns the ErrorDescription field value if set, zero value otherwise. func (o *AlertAttributes) GetErrorDescription() string { - if o == nil || o.ErrorDescription == nil { + if o == nil || isNil(o.ErrorDescription) { var ret string return ret } @@ -216,15 +215,15 @@ func (o *AlertAttributes) GetErrorDescription() string { // GetErrorDescriptionOk returns a tuple with the ErrorDescription field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AlertAttributes) GetErrorDescriptionOk() (*string, bool) { - if o == nil || o.ErrorDescription == nil { - return nil, false + if o == nil || isNil(o.ErrorDescription) { + return nil, false } return o.ErrorDescription, true } // HasErrorDescription returns a boolean if a field has been set. func (o *AlertAttributes) HasErrorDescription() bool { - if o != nil && o.ErrorDescription != nil { + if o != nil && !isNil(o.ErrorDescription) { return true } @@ -238,7 +237,7 @@ func (o *AlertAttributes) SetErrorDescription(v string) { // GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. func (o *AlertAttributes) GetErrorMessage() string { - if o == nil || o.ErrorMessage == nil { + if o == nil || isNil(o.ErrorMessage) { var ret string return ret } @@ -248,15 +247,15 @@ func (o *AlertAttributes) GetErrorMessage() string { // GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AlertAttributes) GetErrorMessageOk() (*string, bool) { - if o == nil || o.ErrorMessage == nil { - return nil, false + if o == nil || isNil(o.ErrorMessage) { + return nil, false } return o.ErrorMessage, true } // HasErrorMessage returns a boolean if a field has been set. func (o *AlertAttributes) HasErrorMessage() bool { - if o != nil && o.ErrorMessage != nil { + if o != nil && !isNil(o.ErrorMessage) { return true } @@ -270,7 +269,7 @@ func (o *AlertAttributes) SetErrorMessage(v string) { // GetIncidentKey returns the IncidentKey field value if set, zero value otherwise. func (o *AlertAttributes) GetIncidentKey() string { - if o == nil || o.IncidentKey == nil { + if o == nil || isNil(o.IncidentKey) { var ret string return ret } @@ -280,15 +279,15 @@ func (o *AlertAttributes) GetIncidentKey() string { // GetIncidentKeyOk returns a tuple with the IncidentKey field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AlertAttributes) GetIncidentKeyOk() (*string, bool) { - if o == nil || o.IncidentKey == nil { - return nil, false + if o == nil || isNil(o.IncidentKey) { + return nil, false } return o.IncidentKey, true } // HasIncidentKey returns a boolean if a field has been set. func (o *AlertAttributes) HasIncidentKey() bool { - if o != nil && o.IncidentKey != nil { + if o != nil && !isNil(o.IncidentKey) { return true } @@ -320,13 +319,13 @@ func (o AlertAttributes) MarshalJSON() ([]byte, error) { if true { toSerialize["FirstErrorMonitorCheckId"] = o.FirstErrorMonitorCheckId } - if o.ErrorDescription != nil { + if !isNil(o.ErrorDescription) { toSerialize["ErrorDescription"] = o.ErrorDescription } - if o.ErrorMessage != nil { + if !isNil(o.ErrorMessage) { toSerialize["ErrorMessage"] = o.ErrorMessage } - if o.IncidentKey != nil { + if !isNil(o.IncidentKey) { toSerialize["IncidentKey"] = o.IncidentKey } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition.go index 70363596..2db72eed 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition.go @@ -45,7 +45,7 @@ func NewAlertDefinitionWithDefaults() *AlertDefinition { // GetAlertDefinitionGuid returns the AlertDefinitionGuid field value if set, zero value otherwise. func (o *AlertDefinition) GetAlertDefinitionGuid() string { - if o == nil || o.AlertDefinitionGuid == nil { + if o == nil || isNil(o.AlertDefinitionGuid) { var ret string return ret } @@ -55,15 +55,15 @@ func (o *AlertDefinition) GetAlertDefinitionGuid() string { // GetAlertDefinitionGuidOk returns a tuple with the AlertDefinitionGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AlertDefinition) GetAlertDefinitionGuidOk() (*string, bool) { - if o == nil || o.AlertDefinitionGuid == nil { - return nil, false + if o == nil || isNil(o.AlertDefinitionGuid) { + return nil, false } return o.AlertDefinitionGuid, true } // HasAlertDefinitionGuid returns a boolean if a field has been set. func (o *AlertDefinition) HasAlertDefinitionGuid() bool { - if o != nil && o.AlertDefinitionGuid != nil { + if o != nil && !isNil(o.AlertDefinitionGuid) { return true } @@ -77,7 +77,7 @@ func (o *AlertDefinition) SetAlertDefinitionGuid(v string) { // GetHash returns the Hash field value if set, zero value otherwise. func (o *AlertDefinition) GetHash() string { - if o == nil || o.Hash == nil { + if o == nil || isNil(o.Hash) { var ret string return ret } @@ -87,15 +87,15 @@ func (o *AlertDefinition) GetHash() string { // GetHashOk returns a tuple with the Hash field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AlertDefinition) GetHashOk() (*string, bool) { - if o == nil || o.Hash == nil { - return nil, false + if o == nil || isNil(o.Hash) { + return nil, false } return o.Hash, true } // HasHash returns a boolean if a field has been set. func (o *AlertDefinition) HasHash() bool { - if o != nil && o.Hash != nil { + if o != nil && !isNil(o.Hash) { return true } @@ -109,7 +109,7 @@ func (o *AlertDefinition) SetHash(v string) { // GetAlertName returns the AlertName field value if set, zero value otherwise. func (o *AlertDefinition) GetAlertName() string { - if o == nil || o.AlertName == nil { + if o == nil || isNil(o.AlertName) { var ret string return ret } @@ -119,15 +119,15 @@ func (o *AlertDefinition) GetAlertName() string { // GetAlertNameOk returns a tuple with the AlertName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AlertDefinition) GetAlertNameOk() (*string, bool) { - if o == nil || o.AlertName == nil { - return nil, false + if o == nil || isNil(o.AlertName) { + return nil, false } return o.AlertName, true } // HasAlertName returns a boolean if a field has been set. func (o *AlertDefinition) HasAlertName() bool { - if o != nil && o.AlertName != nil { + if o != nil && !isNil(o.AlertName) { return true } @@ -141,7 +141,7 @@ func (o *AlertDefinition) SetAlertName(v string) { // GetIsActive returns the IsActive field value if set, zero value otherwise. func (o *AlertDefinition) GetIsActive() bool { - if o == nil || o.IsActive == nil { + if o == nil || isNil(o.IsActive) { var ret bool return ret } @@ -151,15 +151,15 @@ func (o *AlertDefinition) GetIsActive() bool { // GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AlertDefinition) GetIsActiveOk() (*bool, bool) { - if o == nil || o.IsActive == nil { - return nil, false + if o == nil || isNil(o.IsActive) { + return nil, false } return o.IsActive, true } // HasIsActive returns a boolean if a field has been set. func (o *AlertDefinition) HasIsActive() bool { - if o != nil && o.IsActive != nil { + if o != nil && !isNil(o.IsActive) { return true } @@ -173,16 +173,16 @@ func (o *AlertDefinition) SetIsActive(v bool) { func (o AlertDefinition) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.AlertDefinitionGuid != nil { + if !isNil(o.AlertDefinitionGuid) { toSerialize["AlertDefinitionGuid"] = o.AlertDefinitionGuid } - if o.Hash != nil { + if !isNil(o.Hash) { toSerialize["Hash"] = o.Hash } - if o.AlertName != nil { + if !isNil(o.AlertName) { toSerialize["AlertName"] = o.AlertName } - if o.IsActive != nil { + if !isNil(o.IsActive) { toSerialize["IsActive"] = o.IsActive } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_authorization.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_authorization.go new file mode 100644 index 00000000..ea87cc9d --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_authorization.go @@ -0,0 +1,220 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// AlertDefinitionAuthorization Alert definition authorization +type AlertDefinitionAuthorization struct { + // The unique ID of this authorization + AuthorizationId *string `json:"AuthorizationId,omitempty"` + // The authorization type + AuthorizationType AlertDefinitionAuthorizationType `json:"AuthorizationType"` + // The GUID of the operator (NULL if this authorization is for an operator group) + OperatorGuid *string `json:"OperatorGuid,omitempty"` + // The GUID of the operator group (NULL if this authorization is for an operator) + OperatorGroupGuid *string `json:"OperatorGroupGuid,omitempty"` +} + +// NewAlertDefinitionAuthorization instantiates a new AlertDefinitionAuthorization object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAlertDefinitionAuthorization(authorizationType AlertDefinitionAuthorizationType) *AlertDefinitionAuthorization { + this := AlertDefinitionAuthorization{} + this.AuthorizationType = authorizationType + return &this +} + +// NewAlertDefinitionAuthorizationWithDefaults instantiates a new AlertDefinitionAuthorization object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAlertDefinitionAuthorizationWithDefaults() *AlertDefinitionAuthorization { + this := AlertDefinitionAuthorization{} + return &this +} + +// GetAuthorizationId returns the AuthorizationId field value if set, zero value otherwise. +func (o *AlertDefinitionAuthorization) GetAuthorizationId() string { + if o == nil || isNil(o.AuthorizationId) { + var ret string + return ret + } + return *o.AuthorizationId +} + +// GetAuthorizationIdOk returns a tuple with the AuthorizationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AlertDefinitionAuthorization) GetAuthorizationIdOk() (*string, bool) { + if o == nil || isNil(o.AuthorizationId) { + return nil, false + } + return o.AuthorizationId, true +} + +// HasAuthorizationId returns a boolean if a field has been set. +func (o *AlertDefinitionAuthorization) HasAuthorizationId() bool { + if o != nil && !isNil(o.AuthorizationId) { + return true + } + + return false +} + +// SetAuthorizationId gets a reference to the given string and assigns it to the AuthorizationId field. +func (o *AlertDefinitionAuthorization) SetAuthorizationId(v string) { + o.AuthorizationId = &v +} + +// GetAuthorizationType returns the AuthorizationType field value +func (o *AlertDefinitionAuthorization) GetAuthorizationType() AlertDefinitionAuthorizationType { + if o == nil { + var ret AlertDefinitionAuthorizationType + return ret + } + + return o.AuthorizationType +} + +// GetAuthorizationTypeOk returns a tuple with the AuthorizationType field value +// and a boolean to check if the value has been set. +func (o *AlertDefinitionAuthorization) GetAuthorizationTypeOk() (*AlertDefinitionAuthorizationType, bool) { + if o == nil { + return nil, false + } + return &o.AuthorizationType, true +} + +// SetAuthorizationType sets field value +func (o *AlertDefinitionAuthorization) SetAuthorizationType(v AlertDefinitionAuthorizationType) { + o.AuthorizationType = v +} + +// GetOperatorGuid returns the OperatorGuid field value if set, zero value otherwise. +func (o *AlertDefinitionAuthorization) GetOperatorGuid() string { + if o == nil || isNil(o.OperatorGuid) { + var ret string + return ret + } + return *o.OperatorGuid +} + +// GetOperatorGuidOk returns a tuple with the OperatorGuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AlertDefinitionAuthorization) GetOperatorGuidOk() (*string, bool) { + if o == nil || isNil(o.OperatorGuid) { + return nil, false + } + return o.OperatorGuid, true +} + +// HasOperatorGuid returns a boolean if a field has been set. +func (o *AlertDefinitionAuthorization) HasOperatorGuid() bool { + if o != nil && !isNil(o.OperatorGuid) { + return true + } + + return false +} + +// SetOperatorGuid gets a reference to the given string and assigns it to the OperatorGuid field. +func (o *AlertDefinitionAuthorization) SetOperatorGuid(v string) { + o.OperatorGuid = &v +} + +// GetOperatorGroupGuid returns the OperatorGroupGuid field value if set, zero value otherwise. +func (o *AlertDefinitionAuthorization) GetOperatorGroupGuid() string { + if o == nil || isNil(o.OperatorGroupGuid) { + var ret string + return ret + } + return *o.OperatorGroupGuid +} + +// GetOperatorGroupGuidOk returns a tuple with the OperatorGroupGuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AlertDefinitionAuthorization) GetOperatorGroupGuidOk() (*string, bool) { + if o == nil || isNil(o.OperatorGroupGuid) { + return nil, false + } + return o.OperatorGroupGuid, true +} + +// HasOperatorGroupGuid returns a boolean if a field has been set. +func (o *AlertDefinitionAuthorization) HasOperatorGroupGuid() bool { + if o != nil && !isNil(o.OperatorGroupGuid) { + return true + } + + return false +} + +// SetOperatorGroupGuid gets a reference to the given string and assigns it to the OperatorGroupGuid field. +func (o *AlertDefinitionAuthorization) SetOperatorGroupGuid(v string) { + o.OperatorGroupGuid = &v +} + +func (o AlertDefinitionAuthorization) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.AuthorizationId) { + toSerialize["AuthorizationId"] = o.AuthorizationId + } + if true { + toSerialize["AuthorizationType"] = o.AuthorizationType + } + if !isNil(o.OperatorGuid) { + toSerialize["OperatorGuid"] = o.OperatorGuid + } + if !isNil(o.OperatorGroupGuid) { + toSerialize["OperatorGroupGuid"] = o.OperatorGroupGuid + } + return json.Marshal(toSerialize) +} + +type NullableAlertDefinitionAuthorization struct { + value *AlertDefinitionAuthorization + isSet bool +} + +func (v NullableAlertDefinitionAuthorization) Get() *AlertDefinitionAuthorization { + return v.value +} + +func (v *NullableAlertDefinitionAuthorization) Set(val *AlertDefinitionAuthorization) { + v.value = val + v.isSet = true +} + +func (v NullableAlertDefinitionAuthorization) IsSet() bool { + return v.isSet +} + +func (v *NullableAlertDefinitionAuthorization) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAlertDefinitionAuthorization(val *AlertDefinitionAuthorization) *NullableAlertDefinitionAuthorization { + return &NullableAlertDefinitionAuthorization{value: val, isSet: true} +} + +func (v NullableAlertDefinitionAuthorization) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAlertDefinitionAuthorization) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_authorization_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_authorization_type.go new file mode 100644 index 00000000..abaebb06 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_authorization_type.go @@ -0,0 +1,109 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" + "fmt" +) + +// AlertDefinitionAuthorizationType +type AlertDefinitionAuthorizationType string + +// List of AlertDefinitionAuthorizationType +const ( + ALERTDEFINITIONAUTHORIZATIONTYPE_EDIT_ALERT_DEFINITION AlertDefinitionAuthorizationType = "EditAlertDefinition" +) + +// All allowed values of AlertDefinitionAuthorizationType enum +var AllowedAlertDefinitionAuthorizationTypeEnumValues = []AlertDefinitionAuthorizationType{ + "EditAlertDefinition", +} + +func (v *AlertDefinitionAuthorizationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AlertDefinitionAuthorizationType(value) + for _, existing := range AllowedAlertDefinitionAuthorizationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid AlertDefinitionAuthorizationType", value) +} + +// NewAlertDefinitionAuthorizationTypeFromValue returns a pointer to a valid AlertDefinitionAuthorizationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAlertDefinitionAuthorizationTypeFromValue(v string) (*AlertDefinitionAuthorizationType, error) { + ev := AlertDefinitionAuthorizationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AlertDefinitionAuthorizationType: valid values are %v", v, AllowedAlertDefinitionAuthorizationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AlertDefinitionAuthorizationType) IsValid() bool { + for _, existing := range AllowedAlertDefinitionAuthorizationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AlertDefinitionAuthorizationType value +func (v AlertDefinitionAuthorizationType) Ptr() *AlertDefinitionAuthorizationType { + return &v +} + +type NullableAlertDefinitionAuthorizationType struct { + value *AlertDefinitionAuthorizationType + isSet bool +} + +func (v NullableAlertDefinitionAuthorizationType) Get() *AlertDefinitionAuthorizationType { + return v.value +} + +func (v *NullableAlertDefinitionAuthorizationType) Set(val *AlertDefinitionAuthorizationType) { + v.value = val + v.isSet = true +} + +func (v NullableAlertDefinitionAuthorizationType) IsSet() bool { + return v.isSet +} + +func (v *NullableAlertDefinitionAuthorizationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAlertDefinitionAuthorizationType(val *AlertDefinitionAuthorizationType) *NullableAlertDefinitionAuthorizationType { + return &NullableAlertDefinitionAuthorizationType{value: val, isSet: true} +} + +func (v NullableAlertDefinitionAuthorizationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAlertDefinitionAuthorizationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_member.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_member.go index 6f0d2954..88d25ab7 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_member.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_member.go @@ -41,7 +41,7 @@ func NewAlertDefinitionMemberWithDefaults() *AlertDefinitionMember { // GetMonitorGuid returns the MonitorGuid field value if set, zero value otherwise. func (o *AlertDefinitionMember) GetMonitorGuid() string { - if o == nil || o.MonitorGuid == nil { + if o == nil || isNil(o.MonitorGuid) { var ret string return ret } @@ -51,15 +51,15 @@ func (o *AlertDefinitionMember) GetMonitorGuid() string { // GetMonitorGuidOk returns a tuple with the MonitorGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AlertDefinitionMember) GetMonitorGuidOk() (*string, bool) { - if o == nil || o.MonitorGuid == nil { - return nil, false + if o == nil || isNil(o.MonitorGuid) { + return nil, false } return o.MonitorGuid, true } // HasMonitorGuid returns a boolean if a field has been set. func (o *AlertDefinitionMember) HasMonitorGuid() bool { - if o != nil && o.MonitorGuid != nil { + if o != nil && !isNil(o.MonitorGuid) { return true } @@ -73,7 +73,7 @@ func (o *AlertDefinitionMember) SetMonitorGuid(v string) { // GetMonitorGroupGuid returns the MonitorGroupGuid field value if set, zero value otherwise. func (o *AlertDefinitionMember) GetMonitorGroupGuid() string { - if o == nil || o.MonitorGroupGuid == nil { + if o == nil || isNil(o.MonitorGroupGuid) { var ret string return ret } @@ -83,15 +83,15 @@ func (o *AlertDefinitionMember) GetMonitorGroupGuid() string { // GetMonitorGroupGuidOk returns a tuple with the MonitorGroupGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AlertDefinitionMember) GetMonitorGroupGuidOk() (*string, bool) { - if o == nil || o.MonitorGroupGuid == nil { - return nil, false + if o == nil || isNil(o.MonitorGroupGuid) { + return nil, false } return o.MonitorGroupGuid, true } // HasMonitorGroupGuid returns a boolean if a field has been set. func (o *AlertDefinitionMember) HasMonitorGroupGuid() bool { - if o != nil && o.MonitorGroupGuid != nil { + if o != nil && !isNil(o.MonitorGroupGuid) { return true } @@ -105,10 +105,10 @@ func (o *AlertDefinitionMember) SetMonitorGroupGuid(v string) { func (o AlertDefinitionMember) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.MonitorGuid != nil { + if !isNil(o.MonitorGuid) { toSerialize["MonitorGuid"] = o.MonitorGuid } - if o.MonitorGroupGuid != nil { + if !isNil(o.MonitorGroupGuid) { toSerialize["MonitorGroupGuid"] = o.MonitorGroupGuid } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_monitor.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_monitor.go index 1e024d34..a8e9a1c3 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_monitor.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_monitor.go @@ -52,8 +52,8 @@ func (o *AlertDefinitionMonitor) GetAlertDefinition() string { // GetAlertDefinitionOk returns a tuple with the AlertDefinition field value // and a boolean to check if the value has been set. func (o *AlertDefinitionMonitor) GetAlertDefinitionOk() (*string, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.AlertDefinition, true } @@ -76,8 +76,8 @@ func (o *AlertDefinitionMonitor) GetMonitor() string { // GetMonitorOk returns a tuple with the Monitor field value // and a boolean to check if the value has been set. func (o *AlertDefinitionMonitor) GetMonitorOk() (*string, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Monitor, true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_monitor_group.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_monitor_group.go index ebdaa279..46994dd5 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_monitor_group.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_monitor_group.go @@ -52,8 +52,8 @@ func (o *AlertDefinitionMonitorGroup) GetAlertDefinition() string { // GetAlertDefinitionOk returns a tuple with the AlertDefinition field value // and a boolean to check if the value has been set. func (o *AlertDefinitionMonitorGroup) GetAlertDefinitionOk() (*string, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.AlertDefinition, true } @@ -76,8 +76,8 @@ func (o *AlertDefinitionMonitorGroup) GetMonitorGroup() string { // GetMonitorGroupOk returns a tuple with the MonitorGroup field value // and a boolean to check if the value has been set. func (o *AlertDefinitionMonitorGroup) GetMonitorGroupOk() (*string, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.MonitorGroup, true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_operator.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_operator.go index 4cdf682e..2e606d4e 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_operator.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_operator.go @@ -54,8 +54,8 @@ func (o *AlertDefinitionOperator) GetAlertDefinition() string { // GetAlertDefinitionOk returns a tuple with the AlertDefinition field value // and a boolean to check if the value has been set. func (o *AlertDefinitionOperator) GetAlertDefinitionOk() (*string, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.AlertDefinition, true } @@ -78,8 +78,8 @@ func (o *AlertDefinitionOperator) GetEscalationlevel() int32 { // GetEscalationlevelOk returns a tuple with the Escalationlevel field value // and a boolean to check if the value has been set. func (o *AlertDefinitionOperator) GetEscalationlevelOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Escalationlevel, true } @@ -102,8 +102,8 @@ func (o *AlertDefinitionOperator) GetOperator() string { // GetOperatorOk returns a tuple with the Operator field value // and a boolean to check if the value has been set. func (o *AlertDefinitionOperator) GetOperatorOk() (*string, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Operator, true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_operator_group.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_operator_group.go index a3597faf..d12f7dd6 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_operator_group.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_definition_operator_group.go @@ -54,8 +54,8 @@ func (o *AlertDefinitionOperatorGroup) GetAlertDefinition() string { // GetAlertDefinitionOk returns a tuple with the AlertDefinition field value // and a boolean to check if the value has been set. func (o *AlertDefinitionOperatorGroup) GetAlertDefinitionOk() (*string, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.AlertDefinition, true } @@ -78,8 +78,8 @@ func (o *AlertDefinitionOperatorGroup) GetEscalationlevel() int32 { // GetEscalationlevelOk returns a tuple with the Escalationlevel field value // and a boolean to check if the value has been set. func (o *AlertDefinitionOperatorGroup) GetEscalationlevelOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Escalationlevel, true } @@ -102,8 +102,8 @@ func (o *AlertDefinitionOperatorGroup) GetOperatorGroup() string { // GetOperatorGroupOk returns a tuple with the OperatorGroup field value // and a boolean to check if the value has been set. func (o *AlertDefinitionOperatorGroup) GetOperatorGroupOk() (*string, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.OperatorGroup, true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_escalation_level_member.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_escalation_level_member.go index 2d7a24a1..6b5f91d4 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_escalation_level_member.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_escalation_level_member.go @@ -41,7 +41,7 @@ func NewAlertEscalationLevelMemberWithDefaults() *AlertEscalationLevelMember { // GetOperatorGuid returns the OperatorGuid field value if set, zero value otherwise. func (o *AlertEscalationLevelMember) GetOperatorGuid() string { - if o == nil || o.OperatorGuid == nil { + if o == nil || isNil(o.OperatorGuid) { var ret string return ret } @@ -51,15 +51,15 @@ func (o *AlertEscalationLevelMember) GetOperatorGuid() string { // GetOperatorGuidOk returns a tuple with the OperatorGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AlertEscalationLevelMember) GetOperatorGuidOk() (*string, bool) { - if o == nil || o.OperatorGuid == nil { - return nil, false + if o == nil || isNil(o.OperatorGuid) { + return nil, false } return o.OperatorGuid, true } // HasOperatorGuid returns a boolean if a field has been set. func (o *AlertEscalationLevelMember) HasOperatorGuid() bool { - if o != nil && o.OperatorGuid != nil { + if o != nil && !isNil(o.OperatorGuid) { return true } @@ -73,7 +73,7 @@ func (o *AlertEscalationLevelMember) SetOperatorGuid(v string) { // GetOperatorGroupGuid returns the OperatorGroupGuid field value if set, zero value otherwise. func (o *AlertEscalationLevelMember) GetOperatorGroupGuid() string { - if o == nil || o.OperatorGroupGuid == nil { + if o == nil || isNil(o.OperatorGroupGuid) { var ret string return ret } @@ -83,15 +83,15 @@ func (o *AlertEscalationLevelMember) GetOperatorGroupGuid() string { // GetOperatorGroupGuidOk returns a tuple with the OperatorGroupGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AlertEscalationLevelMember) GetOperatorGroupGuidOk() (*string, bool) { - if o == nil || o.OperatorGroupGuid == nil { - return nil, false + if o == nil || isNil(o.OperatorGroupGuid) { + return nil, false } return o.OperatorGroupGuid, true } // HasOperatorGroupGuid returns a boolean if a field has been set. func (o *AlertEscalationLevelMember) HasOperatorGroupGuid() bool { - if o != nil && o.OperatorGroupGuid != nil { + if o != nil && !isNil(o.OperatorGroupGuid) { return true } @@ -105,10 +105,10 @@ func (o *AlertEscalationLevelMember) SetOperatorGroupGuid(v string) { func (o AlertEscalationLevelMember) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.OperatorGuid != nil { + if !isNil(o.OperatorGuid) { toSerialize["OperatorGuid"] = o.OperatorGuid } - if o.OperatorGroupGuid != nil { + if !isNil(o.OperatorGroupGuid) { toSerialize["OperatorGroupGuid"] = o.OperatorGroupGuid } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_response.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_response.go index 674a6528..cda7503d 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_response.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_response.go @@ -16,12 +16,13 @@ import ( // AlertResponse struct for AlertResponse type AlertResponse struct { - Data *[]Alert `json:"Data,omitempty"` - Links *LinksData `json:"Links,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` - Meta *MetaData `json:"Meta,omitempty"` - // Cursors can be used to navigate the dataset in a fixed manner - Cursors *CursorsData `json:"Cursors,omitempty"` + // The resposne data/monitor checks + Data []Alert `json:"Data,omitempty"` + Links *StatisticsResponseLinks `json:"Links,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + Meta *StatisticsResponseMeta `json:"Meta,omitempty"` + Cursors *AlertResponseCursors `json:"Cursors,omitempty"` } // NewAlertResponse instantiates a new AlertResponse object @@ -43,25 +44,25 @@ func NewAlertResponseWithDefaults() *AlertResponse { // GetData returns the Data field value if set, zero value otherwise. func (o *AlertResponse) GetData() []Alert { - if o == nil || o.Data == nil { + if o == nil || isNil(o.Data) { var ret []Alert return ret } - return *o.Data + return o.Data } // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AlertResponse) GetDataOk() (*[]Alert, bool) { - if o == nil || o.Data == nil { - return nil, false +func (o *AlertResponse) GetDataOk() ([]Alert, bool) { + if o == nil || isNil(o.Data) { + return nil, false } return o.Data, true } // HasData returns a boolean if a field has been set. func (o *AlertResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && !isNil(o.Data) { return true } @@ -70,13 +71,13 @@ func (o *AlertResponse) HasData() bool { // SetData gets a reference to the given []Alert and assigns it to the Data field. func (o *AlertResponse) SetData(v []Alert) { - o.Data = &v + o.Data = v } // GetLinks returns the Links field value if set, zero value otherwise. -func (o *AlertResponse) GetLinks() LinksData { - if o == nil || o.Links == nil { - var ret LinksData +func (o *AlertResponse) GetLinks() StatisticsResponseLinks { + if o == nil || isNil(o.Links) { + var ret StatisticsResponseLinks return ret } return *o.Links @@ -84,48 +85,48 @@ func (o *AlertResponse) GetLinks() LinksData { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AlertResponse) GetLinksOk() (*LinksData, bool) { - if o == nil || o.Links == nil { - return nil, false +func (o *AlertResponse) GetLinksOk() (*StatisticsResponseLinks, bool) { + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *AlertResponse) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } return false } -// SetLinks gets a reference to the given LinksData and assigns it to the Links field. -func (o *AlertResponse) SetLinks(v LinksData) { +// SetLinks gets a reference to the given StatisticsResponseLinks and assigns it to the Links field. +func (o *AlertResponse) SetLinks(v StatisticsResponseLinks) { o.Links = &v } // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *AlertResponse) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AlertResponse) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *AlertResponse) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *AlertResponse) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -134,13 +135,13 @@ func (o *AlertResponse) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *AlertResponse) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetMeta returns the Meta field value if set, zero value otherwise. -func (o *AlertResponse) GetMeta() MetaData { - if o == nil || o.Meta == nil { - var ret MetaData +func (o *AlertResponse) GetMeta() StatisticsResponseMeta { + if o == nil || isNil(o.Meta) { + var ret StatisticsResponseMeta return ret } return *o.Meta @@ -148,31 +149,31 @@ func (o *AlertResponse) GetMeta() MetaData { // GetMetaOk returns a tuple with the Meta field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AlertResponse) GetMetaOk() (*MetaData, bool) { - if o == nil || o.Meta == nil { - return nil, false +func (o *AlertResponse) GetMetaOk() (*StatisticsResponseMeta, bool) { + if o == nil || isNil(o.Meta) { + return nil, false } return o.Meta, true } // HasMeta returns a boolean if a field has been set. func (o *AlertResponse) HasMeta() bool { - if o != nil && o.Meta != nil { + if o != nil && !isNil(o.Meta) { return true } return false } -// SetMeta gets a reference to the given MetaData and assigns it to the Meta field. -func (o *AlertResponse) SetMeta(v MetaData) { +// SetMeta gets a reference to the given StatisticsResponseMeta and assigns it to the Meta field. +func (o *AlertResponse) SetMeta(v StatisticsResponseMeta) { o.Meta = &v } // GetCursors returns the Cursors field value if set, zero value otherwise. -func (o *AlertResponse) GetCursors() CursorsData { - if o == nil || o.Cursors == nil { - var ret CursorsData +func (o *AlertResponse) GetCursors() AlertResponseCursors { + if o == nil || isNil(o.Cursors) { + var ret AlertResponseCursors return ret } return *o.Cursors @@ -180,42 +181,42 @@ func (o *AlertResponse) GetCursors() CursorsData { // GetCursorsOk returns a tuple with the Cursors field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AlertResponse) GetCursorsOk() (*CursorsData, bool) { - if o == nil || o.Cursors == nil { - return nil, false +func (o *AlertResponse) GetCursorsOk() (*AlertResponseCursors, bool) { + if o == nil || isNil(o.Cursors) { + return nil, false } return o.Cursors, true } // HasCursors returns a boolean if a field has been set. func (o *AlertResponse) HasCursors() bool { - if o != nil && o.Cursors != nil { + if o != nil && !isNil(o.Cursors) { return true } return false } -// SetCursors gets a reference to the given CursorsData and assigns it to the Cursors field. -func (o *AlertResponse) SetCursors(v CursorsData) { +// SetCursors gets a reference to the given AlertResponseCursors and assigns it to the Cursors field. +func (o *AlertResponse) SetCursors(v AlertResponseCursors) { o.Cursors = &v } func (o AlertResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Data != nil { + if !isNil(o.Data) { toSerialize["Data"] = o.Data } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Meta != nil { + if !isNil(o.Meta) { toSerialize["Meta"] = o.Meta } - if o.Cursors != nil { + if !isNil(o.Cursors) { toSerialize["Cursors"] = o.Cursors } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_response_cursors.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_response_cursors.go new file mode 100644 index 00000000..2e3b4fbf --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_response_cursors.go @@ -0,0 +1,153 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// AlertResponseCursors Cursors can be used to navigate the dataset in a fixed manner +type AlertResponseCursors struct { + // Cursor for next data set + Next *string `json:"Next,omitempty"` + // Cursor for this data set (data might get updated, depending on your parameters) + Self *string `json:"Self,omitempty"` +} + +// NewAlertResponseCursors instantiates a new AlertResponseCursors object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAlertResponseCursors() *AlertResponseCursors { + this := AlertResponseCursors{} + return &this +} + +// NewAlertResponseCursorsWithDefaults instantiates a new AlertResponseCursors object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAlertResponseCursorsWithDefaults() *AlertResponseCursors { + this := AlertResponseCursors{} + return &this +} + +// GetNext returns the Next field value if set, zero value otherwise. +func (o *AlertResponseCursors) GetNext() string { + if o == nil || isNil(o.Next) { + var ret string + return ret + } + return *o.Next +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AlertResponseCursors) GetNextOk() (*string, bool) { + if o == nil || isNil(o.Next) { + return nil, false + } + return o.Next, true +} + +// HasNext returns a boolean if a field has been set. +func (o *AlertResponseCursors) HasNext() bool { + if o != nil && !isNil(o.Next) { + return true + } + + return false +} + +// SetNext gets a reference to the given string and assigns it to the Next field. +func (o *AlertResponseCursors) SetNext(v string) { + o.Next = &v +} + +// GetSelf returns the Self field value if set, zero value otherwise. +func (o *AlertResponseCursors) GetSelf() string { + if o == nil || isNil(o.Self) { + var ret string + return ret + } + return *o.Self +} + +// GetSelfOk returns a tuple with the Self field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AlertResponseCursors) GetSelfOk() (*string, bool) { + if o == nil || isNil(o.Self) { + return nil, false + } + return o.Self, true +} + +// HasSelf returns a boolean if a field has been set. +func (o *AlertResponseCursors) HasSelf() bool { + if o != nil && !isNil(o.Self) { + return true + } + + return false +} + +// SetSelf gets a reference to the given string and assigns it to the Self field. +func (o *AlertResponseCursors) SetSelf(v string) { + o.Self = &v +} + +func (o AlertResponseCursors) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Next) { + toSerialize["Next"] = o.Next + } + if !isNil(o.Self) { + toSerialize["Self"] = o.Self + } + return json.Marshal(toSerialize) +} + +type NullableAlertResponseCursors struct { + value *AlertResponseCursors + isSet bool +} + +func (v NullableAlertResponseCursors) Get() *AlertResponseCursors { + return v.value +} + +func (v *NullableAlertResponseCursors) Set(val *AlertResponseCursors) { + v.value = val + v.isSet = true +} + +func (v NullableAlertResponseCursors) IsSet() bool { + return v.isSet +} + +func (v *NullableAlertResponseCursors) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAlertResponseCursors(val *AlertResponseCursors) *NullableAlertResponseCursors { + return &NullableAlertResponseCursors{value: val, isSet: true} +} + +func (v NullableAlertResponseCursors) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAlertResponseCursors) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_type.go index ced8380f..66869d2d 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_alert_type.go @@ -25,7 +25,8 @@ const ( ALERTTYPE_REMINDER AlertType = "Reminder" ) -var allowedAlertTypeEnumValues = []AlertType{ +// All allowed values of AlertType enum +var AllowedAlertTypeEnumValues = []AlertType{ "Ok", "Error", "Reminder", @@ -38,7 +39,7 @@ func (v *AlertType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := AlertType(value) - for _, existing := range allowedAlertTypeEnumValues { + for _, existing := range AllowedAlertTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -55,13 +56,13 @@ func NewAlertTypeFromValue(v string) (*AlertType, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for AlertType: valid values are %v", v, allowedAlertTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for AlertType: valid values are %v", v, AllowedAlertTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v AlertType) IsValid() bool { - for _, existing := range allowedAlertTypeEnumValues { + for _, existing := range AllowedAlertTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_api_assertion.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_api_assertion.go index 3d7bec3b..435e44d0 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_api_assertion.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_api_assertion.go @@ -54,8 +54,8 @@ func (o *ApiAssertion) GetSource() ApiAssertionSourceType { // GetSourceOk returns a tuple with the Source field value // and a boolean to check if the value has been set. func (o *ApiAssertion) GetSourceOk() (*ApiAssertionSourceType, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Source, true } @@ -67,7 +67,7 @@ func (o *ApiAssertion) SetSource(v ApiAssertionSourceType) { // GetProperty returns the Property field value if set, zero value otherwise. func (o *ApiAssertion) GetProperty() string { - if o == nil || o.Property == nil { + if o == nil || isNil(o.Property) { var ret string return ret } @@ -77,15 +77,15 @@ func (o *ApiAssertion) GetProperty() string { // GetPropertyOk returns a tuple with the Property field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ApiAssertion) GetPropertyOk() (*string, bool) { - if o == nil || o.Property == nil { - return nil, false + if o == nil || isNil(o.Property) { + return nil, false } return o.Property, true } // HasProperty returns a boolean if a field has been set. func (o *ApiAssertion) HasProperty() bool { - if o != nil && o.Property != nil { + if o != nil && !isNil(o.Property) { return true } @@ -110,8 +110,8 @@ func (o *ApiAssertion) GetComparison() ApiComparisonType { // GetComparisonOk returns a tuple with the Comparison field value // and a boolean to check if the value has been set. func (o *ApiAssertion) GetComparisonOk() (*ApiComparisonType, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Comparison, true } @@ -123,7 +123,7 @@ func (o *ApiAssertion) SetComparison(v ApiComparisonType) { // GetTargetValue returns the TargetValue field value if set, zero value otherwise. func (o *ApiAssertion) GetTargetValue() string { - if o == nil || o.TargetValue == nil { + if o == nil || isNil(o.TargetValue) { var ret string return ret } @@ -133,15 +133,15 @@ func (o *ApiAssertion) GetTargetValue() string { // GetTargetValueOk returns a tuple with the TargetValue field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ApiAssertion) GetTargetValueOk() (*string, bool) { - if o == nil || o.TargetValue == nil { - return nil, false + if o == nil || isNil(o.TargetValue) { + return nil, false } return o.TargetValue, true } // HasTargetValue returns a boolean if a field has been set. func (o *ApiAssertion) HasTargetValue() bool { - if o != nil && o.TargetValue != nil { + if o != nil && !isNil(o.TargetValue) { return true } @@ -158,13 +158,13 @@ func (o ApiAssertion) MarshalJSON() ([]byte, error) { if true { toSerialize["Source"] = o.Source } - if o.Property != nil { + if !isNil(o.Property) { toSerialize["Property"] = o.Property } if true { toSerialize["Comparison"] = o.Comparison } - if o.TargetValue != nil { + if !isNil(o.TargetValue) { toSerialize["TargetValue"] = o.TargetValue } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_api_assertion_source_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_api_assertion_source_type.go index e63846d9..710eff46 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_api_assertion_source_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_api_assertion_source_type.go @@ -44,7 +44,8 @@ const ( APIASSERTIONSOURCETYPE_RESPONSE_HAS_EXCEPTION ApiAssertionSourceType = "ResponseHasException" ) -var allowedApiAssertionSourceTypeEnumValues = []ApiAssertionSourceType{ +// All allowed values of ApiAssertionSourceType enum +var AllowedApiAssertionSourceTypeEnumValues = []ApiAssertionSourceType{ "None", "Constant", "Variable", @@ -76,7 +77,7 @@ func (v *ApiAssertionSourceType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := ApiAssertionSourceType(value) - for _, existing := range allowedApiAssertionSourceTypeEnumValues { + for _, existing := range AllowedApiAssertionSourceTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -93,13 +94,13 @@ func NewApiAssertionSourceTypeFromValue(v string) (*ApiAssertionSourceType, erro if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for ApiAssertionSourceType: valid values are %v", v, allowedApiAssertionSourceTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for ApiAssertionSourceType: valid values are %v", v, AllowedApiAssertionSourceTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v ApiAssertionSourceType) IsValid() bool { - for _, existing := range allowedApiAssertionSourceTypeEnumValues { + for _, existing := range AllowedApiAssertionSourceTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_api_authentication_info.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_api_authentication_info.go index 059925f8..a616801e 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_api_authentication_info.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_api_authentication_info.go @@ -56,8 +56,8 @@ func (o *ApiAuthenticationInfo) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *ApiAuthenticationInfo) GetIdOk() (*string, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Id, true } @@ -80,8 +80,8 @@ func (o *ApiAuthenticationInfo) GetAuthenticationType() ApiHttpAuthenticationTyp // GetAuthenticationTypeOk returns a tuple with the AuthenticationType field value // and a boolean to check if the value has been set. func (o *ApiAuthenticationInfo) GetAuthenticationTypeOk() (*ApiHttpAuthenticationType, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.AuthenticationType, true } @@ -93,7 +93,7 @@ func (o *ApiAuthenticationInfo) SetAuthenticationType(v ApiHttpAuthenticationTyp // GetUserName returns the UserName field value if set, zero value otherwise. func (o *ApiAuthenticationInfo) GetUserName() string { - if o == nil || o.UserName == nil { + if o == nil || isNil(o.UserName) { var ret string return ret } @@ -103,15 +103,15 @@ func (o *ApiAuthenticationInfo) GetUserName() string { // GetUserNameOk returns a tuple with the UserName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ApiAuthenticationInfo) GetUserNameOk() (*string, bool) { - if o == nil || o.UserName == nil { - return nil, false + if o == nil || isNil(o.UserName) { + return nil, false } return o.UserName, true } // HasUserName returns a boolean if a field has been set. func (o *ApiAuthenticationInfo) HasUserName() bool { - if o != nil && o.UserName != nil { + if o != nil && !isNil(o.UserName) { return true } @@ -125,7 +125,7 @@ func (o *ApiAuthenticationInfo) SetUserName(v string) { // GetPassword returns the Password field value if set, zero value otherwise. func (o *ApiAuthenticationInfo) GetPassword() string { - if o == nil || o.Password == nil { + if o == nil || isNil(o.Password) { var ret string return ret } @@ -135,15 +135,15 @@ func (o *ApiAuthenticationInfo) GetPassword() string { // GetPasswordOk returns a tuple with the Password field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ApiAuthenticationInfo) GetPasswordOk() (*string, bool) { - if o == nil || o.Password == nil { - return nil, false + if o == nil || isNil(o.Password) { + return nil, false } return o.Password, true } // HasPassword returns a boolean if a field has been set. func (o *ApiAuthenticationInfo) HasPassword() bool { - if o != nil && o.Password != nil { + if o != nil && !isNil(o.Password) { return true } @@ -168,8 +168,8 @@ func (o *ApiAuthenticationInfo) GetPasswordSpecified() bool { // GetPasswordSpecifiedOk returns a tuple with the PasswordSpecified field value // and a boolean to check if the value has been set. func (o *ApiAuthenticationInfo) GetPasswordSpecifiedOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.PasswordSpecified, true } @@ -187,10 +187,10 @@ func (o ApiAuthenticationInfo) MarshalJSON() ([]byte, error) { if true { toSerialize["AuthenticationType"] = o.AuthenticationType } - if o.UserName != nil { + if !isNil(o.UserName) { toSerialize["UserName"] = o.UserName } - if o.Password != nil { + if !isNil(o.Password) { toSerialize["Password"] = o.Password } if true { diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_api_comparison_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_api_comparison_type.go index c654b606..254f99d9 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_api_comparison_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_api_comparison_type.go @@ -32,7 +32,8 @@ const ( APICOMPARISONTYPE_IS_NOT_EMPTY ApiComparisonType = "IsNotEmpty" ) -var allowedApiComparisonTypeEnumValues = []ApiComparisonType{ +// All allowed values of ApiComparisonType enum +var AllowedApiComparisonTypeEnumValues = []ApiComparisonType{ "Equal", "DoesNotEqual", "ContainsText", @@ -52,7 +53,7 @@ func (v *ApiComparisonType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := ApiComparisonType(value) - for _, existing := range allowedApiComparisonTypeEnumValues { + for _, existing := range AllowedApiComparisonTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -69,13 +70,13 @@ func NewApiComparisonTypeFromValue(v string) (*ApiComparisonType, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for ApiComparisonType: valid values are %v", v, allowedApiComparisonTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for ApiComparisonType: valid values are %v", v, AllowedApiComparisonTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v ApiComparisonType) IsValid() bool { - for _, existing := range allowedApiComparisonTypeEnumValues { + for _, existing := range AllowedApiComparisonTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_api_http_authentication_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_api_http_authentication_type.go index 109722a7..9e81c1e1 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_api_http_authentication_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_api_http_authentication_type.go @@ -26,7 +26,8 @@ const ( APIHTTPAUTHENTICATIONTYPE_DIGEST ApiHttpAuthenticationType = "Digest" ) -var allowedApiHttpAuthenticationTypeEnumValues = []ApiHttpAuthenticationType{ +// All allowed values of ApiHttpAuthenticationType enum +var AllowedApiHttpAuthenticationTypeEnumValues = []ApiHttpAuthenticationType{ "None", "Basic", "NTLM", @@ -40,7 +41,7 @@ func (v *ApiHttpAuthenticationType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := ApiHttpAuthenticationType(value) - for _, existing := range allowedApiHttpAuthenticationTypeEnumValues { + for _, existing := range AllowedApiHttpAuthenticationTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -57,13 +58,13 @@ func NewApiHttpAuthenticationTypeFromValue(v string) (*ApiHttpAuthenticationType if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for ApiHttpAuthenticationType: valid values are %v", v, allowedApiHttpAuthenticationTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for ApiHttpAuthenticationType: valid values are %v", v, AllowedApiHttpAuthenticationTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v ApiHttpAuthenticationType) IsValid() bool { - for _, existing := range allowedApiHttpAuthenticationTypeEnumValues { + for _, existing := range AllowedApiHttpAuthenticationTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_api_http_header_value.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_api_http_header_value.go index 0adc4919..3f5e9016 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_api_http_header_value.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_api_http_header_value.go @@ -39,7 +39,7 @@ func NewApiHttpHeaderValueWithDefaults() *ApiHttpHeaderValue { // GetKey returns the Key field value if set, zero value otherwise. func (o *ApiHttpHeaderValue) GetKey() string { - if o == nil || o.Key == nil { + if o == nil || isNil(o.Key) { var ret string return ret } @@ -49,15 +49,15 @@ func (o *ApiHttpHeaderValue) GetKey() string { // GetKeyOk returns a tuple with the Key field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ApiHttpHeaderValue) GetKeyOk() (*string, bool) { - if o == nil || o.Key == nil { - return nil, false + if o == nil || isNil(o.Key) { + return nil, false } return o.Key, true } // HasKey returns a boolean if a field has been set. func (o *ApiHttpHeaderValue) HasKey() bool { - if o != nil && o.Key != nil { + if o != nil && !isNil(o.Key) { return true } @@ -71,7 +71,7 @@ func (o *ApiHttpHeaderValue) SetKey(v string) { // GetValue returns the Value field value if set, zero value otherwise. func (o *ApiHttpHeaderValue) GetValue() string { - if o == nil || o.Value == nil { + if o == nil || isNil(o.Value) { var ret string return ret } @@ -81,15 +81,15 @@ func (o *ApiHttpHeaderValue) GetValue() string { // GetValueOk returns a tuple with the Value field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ApiHttpHeaderValue) GetValueOk() (*string, bool) { - if o == nil || o.Value == nil { - return nil, false + if o == nil || isNil(o.Value) { + return nil, false } return o.Value, true } // HasValue returns a boolean if a field has been set. func (o *ApiHttpHeaderValue) HasValue() bool { - if o != nil && o.Value != nil { + if o != nil && !isNil(o.Value) { return true } @@ -103,10 +103,10 @@ func (o *ApiHttpHeaderValue) SetValue(v string) { func (o ApiHttpHeaderValue) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Key != nil { + if !isNil(o.Key) { toSerialize["Key"] = o.Key } - if o.Value != nil { + if !isNil(o.Value) { toSerialize["Value"] = o.Value } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_api_variable_definition.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_api_variable_definition.go index 4c8f747a..ed1e7c3d 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_api_variable_definition.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_api_variable_definition.go @@ -19,7 +19,7 @@ type ApiVariableDefinition struct { Source ApiVariableSourceType `json:"Source"` Property *string `json:"Property,omitempty"` Name *string `json:"Name,omitempty"` - Arguments *[]ApiVariableDefinition `json:"Arguments,omitempty"` + Arguments []ApiVariableDefinition `json:"Arguments,omitempty"` } // NewApiVariableDefinition instantiates a new ApiVariableDefinition object @@ -53,8 +53,8 @@ func (o *ApiVariableDefinition) GetSource() ApiVariableSourceType { // GetSourceOk returns a tuple with the Source field value // and a boolean to check if the value has been set. func (o *ApiVariableDefinition) GetSourceOk() (*ApiVariableSourceType, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Source, true } @@ -66,7 +66,7 @@ func (o *ApiVariableDefinition) SetSource(v ApiVariableSourceType) { // GetProperty returns the Property field value if set, zero value otherwise. func (o *ApiVariableDefinition) GetProperty() string { - if o == nil || o.Property == nil { + if o == nil || isNil(o.Property) { var ret string return ret } @@ -76,15 +76,15 @@ func (o *ApiVariableDefinition) GetProperty() string { // GetPropertyOk returns a tuple with the Property field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ApiVariableDefinition) GetPropertyOk() (*string, bool) { - if o == nil || o.Property == nil { - return nil, false + if o == nil || isNil(o.Property) { + return nil, false } return o.Property, true } // HasProperty returns a boolean if a field has been set. func (o *ApiVariableDefinition) HasProperty() bool { - if o != nil && o.Property != nil { + if o != nil && !isNil(o.Property) { return true } @@ -98,7 +98,7 @@ func (o *ApiVariableDefinition) SetProperty(v string) { // GetName returns the Name field value if set, zero value otherwise. func (o *ApiVariableDefinition) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -108,15 +108,15 @@ func (o *ApiVariableDefinition) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ApiVariableDefinition) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *ApiVariableDefinition) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -130,25 +130,25 @@ func (o *ApiVariableDefinition) SetName(v string) { // GetArguments returns the Arguments field value if set, zero value otherwise. func (o *ApiVariableDefinition) GetArguments() []ApiVariableDefinition { - if o == nil || o.Arguments == nil { + if o == nil || isNil(o.Arguments) { var ret []ApiVariableDefinition return ret } - return *o.Arguments + return o.Arguments } // GetArgumentsOk returns a tuple with the Arguments field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ApiVariableDefinition) GetArgumentsOk() (*[]ApiVariableDefinition, bool) { - if o == nil || o.Arguments == nil { - return nil, false +func (o *ApiVariableDefinition) GetArgumentsOk() ([]ApiVariableDefinition, bool) { + if o == nil || isNil(o.Arguments) { + return nil, false } return o.Arguments, true } // HasArguments returns a boolean if a field has been set. func (o *ApiVariableDefinition) HasArguments() bool { - if o != nil && o.Arguments != nil { + if o != nil && !isNil(o.Arguments) { return true } @@ -157,7 +157,7 @@ func (o *ApiVariableDefinition) HasArguments() bool { // SetArguments gets a reference to the given []ApiVariableDefinition and assigns it to the Arguments field. func (o *ApiVariableDefinition) SetArguments(v []ApiVariableDefinition) { - o.Arguments = &v + o.Arguments = v } func (o ApiVariableDefinition) MarshalJSON() ([]byte, error) { @@ -165,13 +165,13 @@ func (o ApiVariableDefinition) MarshalJSON() ([]byte, error) { if true { toSerialize["Source"] = o.Source } - if o.Property != nil { + if !isNil(o.Property) { toSerialize["Property"] = o.Property } - if o.Name != nil { + if !isNil(o.Name) { toSerialize["Name"] = o.Name } - if o.Arguments != nil { + if !isNil(o.Arguments) { toSerialize["Arguments"] = o.Arguments } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_api_variable_source_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_api_variable_source_type.go index fa9e0d94..1a8ca712 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_api_variable_source_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_api_variable_source_type.go @@ -45,7 +45,8 @@ const ( APIVARIABLESOURCETYPE_EXECUTE_FUNCTION ApiVariableSourceType = "ExecuteFunction" ) -var allowedApiVariableSourceTypeEnumValues = []ApiVariableSourceType{ +// All allowed values of ApiVariableSourceType enum +var AllowedApiVariableSourceTypeEnumValues = []ApiVariableSourceType{ "None", "Constant", "Variable", @@ -78,7 +79,7 @@ func (v *ApiVariableSourceType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := ApiVariableSourceType(value) - for _, existing := range allowedApiVariableSourceTypeEnumValues { + for _, existing := range AllowedApiVariableSourceTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -95,13 +96,13 @@ func NewApiVariableSourceTypeFromValue(v string) (*ApiVariableSourceType, error) if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for ApiVariableSourceType: valid values are %v", v, allowedApiVariableSourceTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for ApiVariableSourceType: valid values are %v", v, AllowedApiVariableSourceTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v ApiVariableSourceType) IsValid() bool { - for _, existing := range allowedApiVariableSourceTypeEnumValues { + for _, existing := range AllowedApiVariableSourceTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_assertion_info.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_assertion_info.go index 023eb596..b91a64c3 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_assertion_info.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_assertion_info.go @@ -58,8 +58,8 @@ func (o *AssertionInfo) GetCompleted() bool { // GetCompletedOk returns a tuple with the Completed field value // and a boolean to check if the value has been set. func (o *AssertionInfo) GetCompletedOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Completed, true } @@ -82,8 +82,8 @@ func (o *AssertionInfo) GetPassed() bool { // GetPassedOk returns a tuple with the Passed field value // and a boolean to check if the value has been set. func (o *AssertionInfo) GetPassedOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Passed, true } @@ -95,7 +95,7 @@ func (o *AssertionInfo) SetPassed(v bool) { // GetDescription returns the Description field value if set, zero value otherwise. func (o *AssertionInfo) GetDescription() string { - if o == nil || o.Description == nil { + if o == nil || isNil(o.Description) { var ret string return ret } @@ -105,15 +105,15 @@ func (o *AssertionInfo) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AssertionInfo) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { - return nil, false + if o == nil || isNil(o.Description) { + return nil, false } return o.Description, true } // HasDescription returns a boolean if a field has been set. func (o *AssertionInfo) HasDescription() bool { - if o != nil && o.Description != nil { + if o != nil && !isNil(o.Description) { return true } @@ -127,7 +127,7 @@ func (o *AssertionInfo) SetDescription(v string) { // GetExceptionDescription returns the ExceptionDescription field value if set, zero value otherwise. func (o *AssertionInfo) GetExceptionDescription() string { - if o == nil || o.ExceptionDescription == nil { + if o == nil || isNil(o.ExceptionDescription) { var ret string return ret } @@ -137,15 +137,15 @@ func (o *AssertionInfo) GetExceptionDescription() string { // GetExceptionDescriptionOk returns a tuple with the ExceptionDescription field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AssertionInfo) GetExceptionDescriptionOk() (*string, bool) { - if o == nil || o.ExceptionDescription == nil { - return nil, false + if o == nil || isNil(o.ExceptionDescription) { + return nil, false } return o.ExceptionDescription, true } // HasExceptionDescription returns a boolean if a field has been set. func (o *AssertionInfo) HasExceptionDescription() bool { - if o != nil && o.ExceptionDescription != nil { + if o != nil && !isNil(o.ExceptionDescription) { return true } @@ -165,10 +165,10 @@ func (o AssertionInfo) MarshalJSON() ([]byte, error) { if true { toSerialize["Passed"] = o.Passed } - if o.Description != nil { + if !isNil(o.Description) { toSerialize["Description"] = o.Description } - if o.ExceptionDescription != nil { + if !isNil(o.ExceptionDescription) { toSerialize["ExceptionDescription"] = o.ExceptionDescription } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_assertion_results_info.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_assertion_results_info.go index 78350b44..f4305b85 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_assertion_results_info.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_assertion_results_info.go @@ -18,7 +18,7 @@ import ( type AssertionResultsInfo struct { TotalAssertions int32 `json:"TotalAssertions"` PassedAssertions int32 `json:"PassedAssertions"` - AssertionInfos *[]AssertionInfo `json:"AssertionInfos,omitempty"` + AssertionInfos []AssertionInfo `json:"AssertionInfos,omitempty"` } // NewAssertionResultsInfo instantiates a new AssertionResultsInfo object @@ -53,8 +53,8 @@ func (o *AssertionResultsInfo) GetTotalAssertions() int32 { // GetTotalAssertionsOk returns a tuple with the TotalAssertions field value // and a boolean to check if the value has been set. func (o *AssertionResultsInfo) GetTotalAssertionsOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.TotalAssertions, true } @@ -77,8 +77,8 @@ func (o *AssertionResultsInfo) GetPassedAssertions() int32 { // GetPassedAssertionsOk returns a tuple with the PassedAssertions field value // and a boolean to check if the value has been set. func (o *AssertionResultsInfo) GetPassedAssertionsOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.PassedAssertions, true } @@ -90,25 +90,25 @@ func (o *AssertionResultsInfo) SetPassedAssertions(v int32) { // GetAssertionInfos returns the AssertionInfos field value if set, zero value otherwise. func (o *AssertionResultsInfo) GetAssertionInfos() []AssertionInfo { - if o == nil || o.AssertionInfos == nil { + if o == nil || isNil(o.AssertionInfos) { var ret []AssertionInfo return ret } - return *o.AssertionInfos + return o.AssertionInfos } // GetAssertionInfosOk returns a tuple with the AssertionInfos field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AssertionResultsInfo) GetAssertionInfosOk() (*[]AssertionInfo, bool) { - if o == nil || o.AssertionInfos == nil { - return nil, false +func (o *AssertionResultsInfo) GetAssertionInfosOk() ([]AssertionInfo, bool) { + if o == nil || isNil(o.AssertionInfos) { + return nil, false } return o.AssertionInfos, true } // HasAssertionInfos returns a boolean if a field has been set. func (o *AssertionResultsInfo) HasAssertionInfos() bool { - if o != nil && o.AssertionInfos != nil { + if o != nil && !isNil(o.AssertionInfos) { return true } @@ -117,7 +117,7 @@ func (o *AssertionResultsInfo) HasAssertionInfos() bool { // SetAssertionInfos gets a reference to the given []AssertionInfo and assigns it to the AssertionInfos field. func (o *AssertionResultsInfo) SetAssertionInfos(v []AssertionInfo) { - o.AssertionInfos = &v + o.AssertionInfos = v } func (o AssertionResultsInfo) MarshalJSON() ([]byte, error) { @@ -128,7 +128,7 @@ func (o AssertionResultsInfo) MarshalJSON() ([]byte, error) { if true { toSerialize["PassedAssertions"] = o.PassedAssertions } - if o.AssertionInfos != nil { + if !isNil(o.AssertionInfos) { toSerialize["AssertionInfos"] = o.AssertionInfos } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_browser_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_browser_type.go index 91e81a10..e15678ed 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_browser_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_browser_type.go @@ -27,9 +27,11 @@ const ( BROWSERTYPE_PHANTOM_JS BrowserType = "PhantomJS" BROWSERTYPE_PHANTOM_JS20 BrowserType = "PhantomJS20" BROWSERTYPE_CHROME_WITH_EXTRA_METRICS BrowserType = "ChromeWithExtraMetrics" + BROWSERTYPE_EDGE BrowserType = "Edge" ) -var allowedBrowserTypeEnumValues = []BrowserType{ +// All allowed values of BrowserType enum +var AllowedBrowserTypeEnumValues = []BrowserType{ "IE", "Firefox", "Chrome", @@ -37,6 +39,7 @@ var allowedBrowserTypeEnumValues = []BrowserType{ "PhantomJS", "PhantomJS20", "ChromeWithExtraMetrics", + "Edge", } func (v *BrowserType) UnmarshalJSON(src []byte) error { @@ -46,7 +49,7 @@ func (v *BrowserType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := BrowserType(value) - for _, existing := range allowedBrowserTypeEnumValues { + for _, existing := range AllowedBrowserTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -63,13 +66,13 @@ func NewBrowserTypeFromValue(v string) (*BrowserType, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for BrowserType: valid values are %v", v, allowedBrowserTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for BrowserType: valid values are %v", v, AllowedBrowserTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v BrowserType) IsValid() bool { - for _, existing := range allowedBrowserTypeEnumValues { + for _, existing := range AllowedBrowserTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_browser_window_dimensions.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_browser_window_dimensions.go index 5a3e9328..67c6da2e 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_browser_window_dimensions.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_browser_window_dimensions.go @@ -57,8 +57,8 @@ func (o *BrowserWindowDimensions) GetIsMobile() bool { // GetIsMobileOk returns a tuple with the IsMobile field value // and a boolean to check if the value has been set. func (o *BrowserWindowDimensions) GetIsMobileOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.IsMobile, true } @@ -81,8 +81,8 @@ func (o *BrowserWindowDimensions) GetWidth() int32 { // GetWidthOk returns a tuple with the Width field value // and a boolean to check if the value has been set. func (o *BrowserWindowDimensions) GetWidthOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Width, true } @@ -105,8 +105,8 @@ func (o *BrowserWindowDimensions) GetHeight() int32 { // GetHeightOk returns a tuple with the Height field value // and a boolean to check if the value has been set. func (o *BrowserWindowDimensions) GetHeightOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Height, true } @@ -129,8 +129,8 @@ func (o *BrowserWindowDimensions) GetPixelRatio() int32 { // GetPixelRatioOk returns a tuple with the PixelRatio field value // and a boolean to check if the value has been set. func (o *BrowserWindowDimensions) GetPixelRatioOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.PixelRatio, true } @@ -142,7 +142,7 @@ func (o *BrowserWindowDimensions) SetPixelRatio(v int32) { // GetMobileDevice returns the MobileDevice field value if set, zero value otherwise. func (o *BrowserWindowDimensions) GetMobileDevice() string { - if o == nil || o.MobileDevice == nil { + if o == nil || isNil(o.MobileDevice) { var ret string return ret } @@ -152,15 +152,15 @@ func (o *BrowserWindowDimensions) GetMobileDevice() string { // GetMobileDeviceOk returns a tuple with the MobileDevice field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *BrowserWindowDimensions) GetMobileDeviceOk() (*string, bool) { - if o == nil || o.MobileDevice == nil { - return nil, false + if o == nil || isNil(o.MobileDevice) { + return nil, false } return o.MobileDevice, true } // HasMobileDevice returns a boolean if a field has been set. func (o *BrowserWindowDimensions) HasMobileDevice() bool { - if o != nil && o.MobileDevice != nil { + if o != nil && !isNil(o.MobileDevice) { return true } @@ -186,7 +186,7 @@ func (o BrowserWindowDimensions) MarshalJSON() ([]byte, error) { if true { toSerialize["PixelRatio"] = o.PixelRatio } - if o.MobileDevice != nil { + if !isNil(o.MobileDevice) { toSerialize["MobileDevice"] = o.MobileDevice } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_capability_filter_enum.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_capability_filter_enum.go index 028f1700..f08fb132 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_capability_filter_enum.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_capability_filter_enum.go @@ -21,16 +21,19 @@ type CapabilityFilterEnum string // List of CapabilityFilterEnum const ( CAPABILITYFILTERENUM_IPV6 CapabilityFilterEnum = "IPv6" - CAPABILITYFILTERENUM_NATIVE_IPV6 CapabilityFilterEnum = "NativeIPv6" CAPABILITYFILTERENUM_PRIMARY_SERVER CapabilityFilterEnum = "PrimaryServer" CAPABILITYFILTERENUM_HIGH_AVAILABILITY CapabilityFilterEnum = "HighAvailability" + CAPABILITYFILTERENUM_FIDDLER_PROXY CapabilityFilterEnum = "FiddlerProxy" + CAPABILITYFILTERENUM_FIREFOX CapabilityFilterEnum = "Firefox" ) -var allowedCapabilityFilterEnumEnumValues = []CapabilityFilterEnum{ +// All allowed values of CapabilityFilterEnum enum +var AllowedCapabilityFilterEnumEnumValues = []CapabilityFilterEnum{ "IPv6", - "NativeIPv6", "PrimaryServer", "HighAvailability", + "FiddlerProxy", + "Firefox", } func (v *CapabilityFilterEnum) UnmarshalJSON(src []byte) error { @@ -40,7 +43,7 @@ func (v *CapabilityFilterEnum) UnmarshalJSON(src []byte) error { return err } enumTypeValue := CapabilityFilterEnum(value) - for _, existing := range allowedCapabilityFilterEnumEnumValues { + for _, existing := range AllowedCapabilityFilterEnumEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -57,13 +60,13 @@ func NewCapabilityFilterEnumFromValue(v string) (*CapabilityFilterEnum, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for CapabilityFilterEnum: valid values are %v", v, allowedCapabilityFilterEnumEnumValues) + return nil, fmt.Errorf("invalid value '%v' for CapabilityFilterEnum: valid values are %v", v, AllowedCapabilityFilterEnumEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v CapabilityFilterEnum) IsValid() bool { - for _, existing := range allowedCapabilityFilterEnumEnumValues { + for _, existing := range AllowedCapabilityFilterEnumEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_certificate_archive.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_certificate_archive.go index 8ca91306..0507e09e 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_certificate_archive.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_certificate_archive.go @@ -12,7 +12,6 @@ package uptrends import ( "encoding/json" - "time" ) // CertificateArchive struct for CertificateArchive @@ -20,9 +19,9 @@ type CertificateArchive struct { // The issuer of this certificate Issuer *string `json:"Issuer,omitempty"` // The start date of this certificate - NotBefore time.Time `json:"NotBefore"` + NotBefore map[string]interface{} `json:"NotBefore"` // The certificate expiry date - NotAfter time.Time `json:"NotAfter"` + NotAfter map[string]interface{} `json:"NotAfter"` // Used to specify a new or changed password. The value will be encrypted when stored, and will not be displayed when a CertificateArchive is retrieved. Password *string `json:"Password,omitempty"` // Used to specify the certificate content as a base64 string. The value will be encrypted when stored, and will not be displayed when a CertificateArchive is retrieved. @@ -33,7 +32,7 @@ type CertificateArchive struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCertificateArchive(notBefore time.Time, notAfter time.Time) *CertificateArchive { +func NewCertificateArchive(notBefore map[string]interface{}, notAfter map[string]interface{}) *CertificateArchive { this := CertificateArchive{} this.NotBefore = notBefore this.NotAfter = notAfter @@ -50,7 +49,7 @@ func NewCertificateArchiveWithDefaults() *CertificateArchive { // GetIssuer returns the Issuer field value if set, zero value otherwise. func (o *CertificateArchive) GetIssuer() string { - if o == nil || o.Issuer == nil { + if o == nil || isNil(o.Issuer) { var ret string return ret } @@ -60,15 +59,15 @@ func (o *CertificateArchive) GetIssuer() string { // GetIssuerOk returns a tuple with the Issuer field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CertificateArchive) GetIssuerOk() (*string, bool) { - if o == nil || o.Issuer == nil { - return nil, false + if o == nil || isNil(o.Issuer) { + return nil, false } return o.Issuer, true } // HasIssuer returns a boolean if a field has been set. func (o *CertificateArchive) HasIssuer() bool { - if o != nil && o.Issuer != nil { + if o != nil && !isNil(o.Issuer) { return true } @@ -81,9 +80,9 @@ func (o *CertificateArchive) SetIssuer(v string) { } // GetNotBefore returns the NotBefore field value -func (o *CertificateArchive) GetNotBefore() time.Time { +func (o *CertificateArchive) GetNotBefore() map[string]interface{} { if o == nil { - var ret time.Time + var ret map[string]interface{} return ret } @@ -92,22 +91,22 @@ func (o *CertificateArchive) GetNotBefore() time.Time { // GetNotBeforeOk returns a tuple with the NotBefore field value // and a boolean to check if the value has been set. -func (o *CertificateArchive) GetNotBeforeOk() (*time.Time, bool) { - if o == nil { - return nil, false +func (o *CertificateArchive) GetNotBeforeOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false } - return &o.NotBefore, true + return o.NotBefore, true } // SetNotBefore sets field value -func (o *CertificateArchive) SetNotBefore(v time.Time) { +func (o *CertificateArchive) SetNotBefore(v map[string]interface{}) { o.NotBefore = v } // GetNotAfter returns the NotAfter field value -func (o *CertificateArchive) GetNotAfter() time.Time { +func (o *CertificateArchive) GetNotAfter() map[string]interface{} { if o == nil { - var ret time.Time + var ret map[string]interface{} return ret } @@ -116,21 +115,21 @@ func (o *CertificateArchive) GetNotAfter() time.Time { // GetNotAfterOk returns a tuple with the NotAfter field value // and a boolean to check if the value has been set. -func (o *CertificateArchive) GetNotAfterOk() (*time.Time, bool) { - if o == nil { - return nil, false +func (o *CertificateArchive) GetNotAfterOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false } - return &o.NotAfter, true + return o.NotAfter, true } // SetNotAfter sets field value -func (o *CertificateArchive) SetNotAfter(v time.Time) { +func (o *CertificateArchive) SetNotAfter(v map[string]interface{}) { o.NotAfter = v } // GetPassword returns the Password field value if set, zero value otherwise. func (o *CertificateArchive) GetPassword() string { - if o == nil || o.Password == nil { + if o == nil || isNil(o.Password) { var ret string return ret } @@ -140,15 +139,15 @@ func (o *CertificateArchive) GetPassword() string { // GetPasswordOk returns a tuple with the Password field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CertificateArchive) GetPasswordOk() (*string, bool) { - if o == nil || o.Password == nil { - return nil, false + if o == nil || isNil(o.Password) { + return nil, false } return o.Password, true } // HasPassword returns a boolean if a field has been set. func (o *CertificateArchive) HasPassword() bool { - if o != nil && o.Password != nil { + if o != nil && !isNil(o.Password) { return true } @@ -162,7 +161,7 @@ func (o *CertificateArchive) SetPassword(v string) { // GetArchiveData returns the ArchiveData field value if set, zero value otherwise. func (o *CertificateArchive) GetArchiveData() string { - if o == nil || o.ArchiveData == nil { + if o == nil || isNil(o.ArchiveData) { var ret string return ret } @@ -172,15 +171,15 @@ func (o *CertificateArchive) GetArchiveData() string { // GetArchiveDataOk returns a tuple with the ArchiveData field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CertificateArchive) GetArchiveDataOk() (*string, bool) { - if o == nil || o.ArchiveData == nil { - return nil, false + if o == nil || isNil(o.ArchiveData) { + return nil, false } return o.ArchiveData, true } // HasArchiveData returns a boolean if a field has been set. func (o *CertificateArchive) HasArchiveData() bool { - if o != nil && o.ArchiveData != nil { + if o != nil && !isNil(o.ArchiveData) { return true } @@ -194,7 +193,7 @@ func (o *CertificateArchive) SetArchiveData(v string) { func (o CertificateArchive) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Issuer != nil { + if !isNil(o.Issuer) { toSerialize["Issuer"] = o.Issuer } if true { @@ -203,10 +202,10 @@ func (o CertificateArchive) MarshalJSON() ([]byte, error) { if true { toSerialize["NotAfter"] = o.NotAfter } - if o.Password != nil { + if !isNil(o.Password) { toSerialize["Password"] = o.Password } - if o.ArchiveData != nil { + if !isNil(o.ArchiveData) { toSerialize["ArchiveData"] = o.ArchiveData } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoin_server_response.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoin_server_response.go index 5db843c2..732cb5d8 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoin_server_response.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoin_server_response.go @@ -16,10 +16,11 @@ import ( // CheckpoinServerResponse struct for CheckpoinServerResponse type CheckpoinServerResponse struct { - Data *CheckpointServer `json:"Data,omitempty"` - Links *LinksData `json:"Links,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` - Meta *MetaData `json:"Meta,omitempty"` + Data *CheckpoinServerResponseData `json:"Data,omitempty"` + Links *StatisticsResponseLinks `json:"Links,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + Meta *StatisticsResponseMeta `json:"Meta,omitempty"` } // NewCheckpoinServerResponse instantiates a new CheckpoinServerResponse object @@ -40,9 +41,9 @@ func NewCheckpoinServerResponseWithDefaults() *CheckpoinServerResponse { } // GetData returns the Data field value if set, zero value otherwise. -func (o *CheckpoinServerResponse) GetData() CheckpointServer { - if o == nil || o.Data == nil { - var ret CheckpointServer +func (o *CheckpoinServerResponse) GetData() CheckpoinServerResponseData { + if o == nil || isNil(o.Data) { + var ret CheckpoinServerResponseData return ret } return *o.Data @@ -50,31 +51,31 @@ func (o *CheckpoinServerResponse) GetData() CheckpointServer { // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckpoinServerResponse) GetDataOk() (*CheckpointServer, bool) { - if o == nil || o.Data == nil { - return nil, false +func (o *CheckpoinServerResponse) GetDataOk() (*CheckpoinServerResponseData, bool) { + if o == nil || isNil(o.Data) { + return nil, false } return o.Data, true } // HasData returns a boolean if a field has been set. func (o *CheckpoinServerResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && !isNil(o.Data) { return true } return false } -// SetData gets a reference to the given CheckpointServer and assigns it to the Data field. -func (o *CheckpoinServerResponse) SetData(v CheckpointServer) { +// SetData gets a reference to the given CheckpoinServerResponseData and assigns it to the Data field. +func (o *CheckpoinServerResponse) SetData(v CheckpoinServerResponseData) { o.Data = &v } // GetLinks returns the Links field value if set, zero value otherwise. -func (o *CheckpoinServerResponse) GetLinks() LinksData { - if o == nil || o.Links == nil { - var ret LinksData +func (o *CheckpoinServerResponse) GetLinks() StatisticsResponseLinks { + if o == nil || isNil(o.Links) { + var ret StatisticsResponseLinks return ret } return *o.Links @@ -82,48 +83,48 @@ func (o *CheckpoinServerResponse) GetLinks() LinksData { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckpoinServerResponse) GetLinksOk() (*LinksData, bool) { - if o == nil || o.Links == nil { - return nil, false +func (o *CheckpoinServerResponse) GetLinksOk() (*StatisticsResponseLinks, bool) { + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *CheckpoinServerResponse) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } return false } -// SetLinks gets a reference to the given LinksData and assigns it to the Links field. -func (o *CheckpoinServerResponse) SetLinks(v LinksData) { +// SetLinks gets a reference to the given StatisticsResponseLinks and assigns it to the Links field. +func (o *CheckpoinServerResponse) SetLinks(v StatisticsResponseLinks) { o.Links = &v } // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *CheckpoinServerResponse) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckpoinServerResponse) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *CheckpoinServerResponse) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *CheckpoinServerResponse) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -132,13 +133,13 @@ func (o *CheckpoinServerResponse) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *CheckpoinServerResponse) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetMeta returns the Meta field value if set, zero value otherwise. -func (o *CheckpoinServerResponse) GetMeta() MetaData { - if o == nil || o.Meta == nil { - var ret MetaData +func (o *CheckpoinServerResponse) GetMeta() StatisticsResponseMeta { + if o == nil || isNil(o.Meta) { + var ret StatisticsResponseMeta return ret } return *o.Meta @@ -146,39 +147,39 @@ func (o *CheckpoinServerResponse) GetMeta() MetaData { // GetMetaOk returns a tuple with the Meta field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckpoinServerResponse) GetMetaOk() (*MetaData, bool) { - if o == nil || o.Meta == nil { - return nil, false +func (o *CheckpoinServerResponse) GetMetaOk() (*StatisticsResponseMeta, bool) { + if o == nil || isNil(o.Meta) { + return nil, false } return o.Meta, true } // HasMeta returns a boolean if a field has been set. func (o *CheckpoinServerResponse) HasMeta() bool { - if o != nil && o.Meta != nil { + if o != nil && !isNil(o.Meta) { return true } return false } -// SetMeta gets a reference to the given MetaData and assigns it to the Meta field. -func (o *CheckpoinServerResponse) SetMeta(v MetaData) { +// SetMeta gets a reference to the given StatisticsResponseMeta and assigns it to the Meta field. +func (o *CheckpoinServerResponse) SetMeta(v StatisticsResponseMeta) { o.Meta = &v } func (o CheckpoinServerResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Data != nil { + if !isNil(o.Data) { toSerialize["Data"] = o.Data } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Meta != nil { + if !isNil(o.Meta) { toSerialize["Meta"] = o.Meta } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoin_server_response_data.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoin_server_response_data.go new file mode 100644 index 00000000..a60db25f --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoin_server_response_data.go @@ -0,0 +1,256 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// CheckpoinServerResponseData The resposne data/monitor checks +type CheckpoinServerResponseData struct { + Attributes *CheckpointServerAttributes `json:"Attributes,omitempty"` + // Identifier + Id int32 `json:"Id"` + // Object type + Type *string `json:"Type,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + // Links related to the object + Links *map[string]string `json:"Links,omitempty"` +} + +// NewCheckpoinServerResponseData instantiates a new CheckpoinServerResponseData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCheckpoinServerResponseData(id int32) *CheckpoinServerResponseData { + this := CheckpoinServerResponseData{} + this.Id = id + return &this +} + +// NewCheckpoinServerResponseDataWithDefaults instantiates a new CheckpoinServerResponseData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCheckpoinServerResponseDataWithDefaults() *CheckpoinServerResponseData { + this := CheckpoinServerResponseData{} + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *CheckpoinServerResponseData) GetAttributes() CheckpointServerAttributes { + if o == nil || isNil(o.Attributes) { + var ret CheckpointServerAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckpoinServerResponseData) GetAttributesOk() (*CheckpointServerAttributes, bool) { + if o == nil || isNil(o.Attributes) { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *CheckpoinServerResponseData) HasAttributes() bool { + if o != nil && !isNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given CheckpointServerAttributes and assigns it to the Attributes field. +func (o *CheckpoinServerResponseData) SetAttributes(v CheckpointServerAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value +func (o *CheckpoinServerResponseData) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CheckpoinServerResponseData) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CheckpoinServerResponseData) SetId(v int32) { + o.Id = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CheckpoinServerResponseData) GetType() string { + if o == nil || isNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckpoinServerResponseData) GetTypeOk() (*string, bool) { + if o == nil || isNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CheckpoinServerResponseData) HasType() bool { + if o != nil && !isNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *CheckpoinServerResponseData) SetType(v string) { + o.Type = &v +} + +// GetRelationships returns the Relationships field value if set, zero value otherwise. +func (o *CheckpoinServerResponseData) GetRelationships() []RelationObject { + if o == nil || isNil(o.Relationships) { + var ret []RelationObject + return ret + } + return o.Relationships +} + +// GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckpoinServerResponseData) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false + } + return o.Relationships, true +} + +// HasRelationships returns a boolean if a field has been set. +func (o *CheckpoinServerResponseData) HasRelationships() bool { + if o != nil && !isNil(o.Relationships) { + return true + } + + return false +} + +// SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. +func (o *CheckpoinServerResponseData) SetRelationships(v []RelationObject) { + o.Relationships = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *CheckpoinServerResponseData) GetLinks() map[string]string { + if o == nil || isNil(o.Links) { + var ret map[string]string + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckpoinServerResponseData) GetLinksOk() (*map[string]string, bool) { + if o == nil || isNil(o.Links) { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *CheckpoinServerResponseData) HasLinks() bool { + if o != nil && !isNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given map[string]string and assigns it to the Links field. +func (o *CheckpoinServerResponseData) SetLinks(v map[string]string) { + o.Links = &v +} + +func (o CheckpoinServerResponseData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Attributes) { + toSerialize["Attributes"] = o.Attributes + } + if true { + toSerialize["Id"] = o.Id + } + if !isNil(o.Type) { + toSerialize["Type"] = o.Type + } + if !isNil(o.Relationships) { + toSerialize["Relationships"] = o.Relationships + } + if !isNil(o.Links) { + toSerialize["Links"] = o.Links + } + return json.Marshal(toSerialize) +} + +type NullableCheckpoinServerResponseData struct { + value *CheckpoinServerResponseData + isSet bool +} + +func (v NullableCheckpoinServerResponseData) Get() *CheckpoinServerResponseData { + return v.value +} + +func (v *NullableCheckpoinServerResponseData) Set(val *CheckpoinServerResponseData) { + v.value = val + v.isSet = true +} + +func (v NullableCheckpoinServerResponseData) IsSet() bool { + return v.isSet +} + +func (v *NullableCheckpoinServerResponseData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCheckpoinServerResponseData(val *CheckpoinServerResponseData) *NullableCheckpoinServerResponseData { + return &NullableCheckpoinServerResponseData{value: val, isSet: true} +} + +func (v NullableCheckpoinServerResponseData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCheckpoinServerResponseData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint.go index 2c095168..958109fe 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint.go @@ -23,9 +23,9 @@ type Checkpoint struct { // The location code of the checkpoint Code *string `json:"Code,omitempty"` // The IPv4 addresses of the checkpoint - Ipv4Addresses *[]string `json:"Ipv4Addresses,omitempty"` + Ipv4Addresses []string `json:"Ipv4Addresses,omitempty"` // The IPv6 addresses of the checkpoint - Ipv6Addresses *[]Ipv6Address `json:"Ipv6Addresses,omitempty"` + Ipv6Addresses []Ipv6Address `json:"Ipv6Addresses,omitempty"` // Checkpoint is primary IsPrimaryCheckpoint bool `json:"IsPrimaryCheckpoint"` // Checkpoint supports IPv6 @@ -68,8 +68,8 @@ func (o *Checkpoint) GetCheckpointId() int32 { // GetCheckpointIdOk returns a tuple with the CheckpointId field value // and a boolean to check if the value has been set. func (o *Checkpoint) GetCheckpointIdOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.CheckpointId, true } @@ -81,7 +81,7 @@ func (o *Checkpoint) SetCheckpointId(v int32) { // GetCheckpointName returns the CheckpointName field value if set, zero value otherwise. func (o *Checkpoint) GetCheckpointName() string { - if o == nil || o.CheckpointName == nil { + if o == nil || isNil(o.CheckpointName) { var ret string return ret } @@ -91,15 +91,15 @@ func (o *Checkpoint) GetCheckpointName() string { // GetCheckpointNameOk returns a tuple with the CheckpointName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Checkpoint) GetCheckpointNameOk() (*string, bool) { - if o == nil || o.CheckpointName == nil { - return nil, false + if o == nil || isNil(o.CheckpointName) { + return nil, false } return o.CheckpointName, true } // HasCheckpointName returns a boolean if a field has been set. func (o *Checkpoint) HasCheckpointName() bool { - if o != nil && o.CheckpointName != nil { + if o != nil && !isNil(o.CheckpointName) { return true } @@ -113,7 +113,7 @@ func (o *Checkpoint) SetCheckpointName(v string) { // GetCode returns the Code field value if set, zero value otherwise. func (o *Checkpoint) GetCode() string { - if o == nil || o.Code == nil { + if o == nil || isNil(o.Code) { var ret string return ret } @@ -123,15 +123,15 @@ func (o *Checkpoint) GetCode() string { // GetCodeOk returns a tuple with the Code field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Checkpoint) GetCodeOk() (*string, bool) { - if o == nil || o.Code == nil { - return nil, false + if o == nil || isNil(o.Code) { + return nil, false } return o.Code, true } // HasCode returns a boolean if a field has been set. func (o *Checkpoint) HasCode() bool { - if o != nil && o.Code != nil { + if o != nil && !isNil(o.Code) { return true } @@ -145,25 +145,25 @@ func (o *Checkpoint) SetCode(v string) { // GetIpv4Addresses returns the Ipv4Addresses field value if set, zero value otherwise. func (o *Checkpoint) GetIpv4Addresses() []string { - if o == nil || o.Ipv4Addresses == nil { + if o == nil || isNil(o.Ipv4Addresses) { var ret []string return ret } - return *o.Ipv4Addresses + return o.Ipv4Addresses } // GetIpv4AddressesOk returns a tuple with the Ipv4Addresses field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Checkpoint) GetIpv4AddressesOk() (*[]string, bool) { - if o == nil || o.Ipv4Addresses == nil { - return nil, false +func (o *Checkpoint) GetIpv4AddressesOk() ([]string, bool) { + if o == nil || isNil(o.Ipv4Addresses) { + return nil, false } return o.Ipv4Addresses, true } // HasIpv4Addresses returns a boolean if a field has been set. func (o *Checkpoint) HasIpv4Addresses() bool { - if o != nil && o.Ipv4Addresses != nil { + if o != nil && !isNil(o.Ipv4Addresses) { return true } @@ -172,30 +172,30 @@ func (o *Checkpoint) HasIpv4Addresses() bool { // SetIpv4Addresses gets a reference to the given []string and assigns it to the Ipv4Addresses field. func (o *Checkpoint) SetIpv4Addresses(v []string) { - o.Ipv4Addresses = &v + o.Ipv4Addresses = v } // GetIpv6Addresses returns the Ipv6Addresses field value if set, zero value otherwise. func (o *Checkpoint) GetIpv6Addresses() []Ipv6Address { - if o == nil || o.Ipv6Addresses == nil { + if o == nil || isNil(o.Ipv6Addresses) { var ret []Ipv6Address return ret } - return *o.Ipv6Addresses + return o.Ipv6Addresses } // GetIpv6AddressesOk returns a tuple with the Ipv6Addresses field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Checkpoint) GetIpv6AddressesOk() (*[]Ipv6Address, bool) { - if o == nil || o.Ipv6Addresses == nil { - return nil, false +func (o *Checkpoint) GetIpv6AddressesOk() ([]Ipv6Address, bool) { + if o == nil || isNil(o.Ipv6Addresses) { + return nil, false } return o.Ipv6Addresses, true } // HasIpv6Addresses returns a boolean if a field has been set. func (o *Checkpoint) HasIpv6Addresses() bool { - if o != nil && o.Ipv6Addresses != nil { + if o != nil && !isNil(o.Ipv6Addresses) { return true } @@ -204,7 +204,7 @@ func (o *Checkpoint) HasIpv6Addresses() bool { // SetIpv6Addresses gets a reference to the given []Ipv6Address and assigns it to the Ipv6Addresses field. func (o *Checkpoint) SetIpv6Addresses(v []Ipv6Address) { - o.Ipv6Addresses = &v + o.Ipv6Addresses = v } // GetIsPrimaryCheckpoint returns the IsPrimaryCheckpoint field value @@ -220,8 +220,8 @@ func (o *Checkpoint) GetIsPrimaryCheckpoint() bool { // GetIsPrimaryCheckpointOk returns a tuple with the IsPrimaryCheckpoint field value // and a boolean to check if the value has been set. func (o *Checkpoint) GetIsPrimaryCheckpointOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.IsPrimaryCheckpoint, true } @@ -244,8 +244,8 @@ func (o *Checkpoint) GetSupportsIpv6() bool { // GetSupportsIpv6Ok returns a tuple with the SupportsIpv6 field value // and a boolean to check if the value has been set. func (o *Checkpoint) GetSupportsIpv6Ok() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.SupportsIpv6, true } @@ -268,8 +268,8 @@ func (o *Checkpoint) GetHasHighAvailability() bool { // GetHasHighAvailabilityOk returns a tuple with the HasHighAvailability field value // and a boolean to check if the value has been set. func (o *Checkpoint) GetHasHighAvailabilityOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.HasHighAvailability, true } @@ -284,16 +284,16 @@ func (o Checkpoint) MarshalJSON() ([]byte, error) { if true { toSerialize["CheckpointId"] = o.CheckpointId } - if o.CheckpointName != nil { + if !isNil(o.CheckpointName) { toSerialize["CheckpointName"] = o.CheckpointName } - if o.Code != nil { + if !isNil(o.Code) { toSerialize["Code"] = o.Code } - if o.Ipv4Addresses != nil { + if !isNil(o.Ipv4Addresses) { toSerialize["Ipv4Addresses"] = o.Ipv4Addresses } - if o.Ipv6Addresses != nil { + if !isNil(o.Ipv6Addresses) { toSerialize["Ipv6Addresses"] = o.Ipv6Addresses } if true { diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint2.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint2.go index 756ed093..ad1a6d4d 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint2.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint2.go @@ -16,10 +16,14 @@ import ( // Checkpoint2 struct for Checkpoint2 type Checkpoint2 struct { - Attributes *CheckpointAttributes `json:"Attributes,omitempty"` + Attributes *Checkpoint2Attributes `json:"Attributes,omitempty"` + // Identifier Id int32 `json:"Id"` + // Object type Type *string `json:"Type,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + // Links related to the object Links *map[string]string `json:"Links,omitempty"` } @@ -42,9 +46,9 @@ func NewCheckpoint2WithDefaults() *Checkpoint2 { } // GetAttributes returns the Attributes field value if set, zero value otherwise. -func (o *Checkpoint2) GetAttributes() CheckpointAttributes { - if o == nil || o.Attributes == nil { - var ret CheckpointAttributes +func (o *Checkpoint2) GetAttributes() Checkpoint2Attributes { + if o == nil || isNil(o.Attributes) { + var ret Checkpoint2Attributes return ret } return *o.Attributes @@ -52,24 +56,24 @@ func (o *Checkpoint2) GetAttributes() CheckpointAttributes { // GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Checkpoint2) GetAttributesOk() (*CheckpointAttributes, bool) { - if o == nil || o.Attributes == nil { - return nil, false +func (o *Checkpoint2) GetAttributesOk() (*Checkpoint2Attributes, bool) { + if o == nil || isNil(o.Attributes) { + return nil, false } return o.Attributes, true } // HasAttributes returns a boolean if a field has been set. func (o *Checkpoint2) HasAttributes() bool { - if o != nil && o.Attributes != nil { + if o != nil && !isNil(o.Attributes) { return true } return false } -// SetAttributes gets a reference to the given CheckpointAttributes and assigns it to the Attributes field. -func (o *Checkpoint2) SetAttributes(v CheckpointAttributes) { +// SetAttributes gets a reference to the given Checkpoint2Attributes and assigns it to the Attributes field. +func (o *Checkpoint2) SetAttributes(v Checkpoint2Attributes) { o.Attributes = &v } @@ -86,8 +90,8 @@ func (o *Checkpoint2) GetId() int32 { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *Checkpoint2) GetIdOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Id, true } @@ -99,7 +103,7 @@ func (o *Checkpoint2) SetId(v int32) { // GetType returns the Type field value if set, zero value otherwise. func (o *Checkpoint2) GetType() string { - if o == nil || o.Type == nil { + if o == nil || isNil(o.Type) { var ret string return ret } @@ -109,15 +113,15 @@ func (o *Checkpoint2) GetType() string { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Checkpoint2) GetTypeOk() (*string, bool) { - if o == nil || o.Type == nil { - return nil, false + if o == nil || isNil(o.Type) { + return nil, false } return o.Type, true } // HasType returns a boolean if a field has been set. func (o *Checkpoint2) HasType() bool { - if o != nil && o.Type != nil { + if o != nil && !isNil(o.Type) { return true } @@ -131,25 +135,25 @@ func (o *Checkpoint2) SetType(v string) { // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *Checkpoint2) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Checkpoint2) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *Checkpoint2) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *Checkpoint2) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -158,12 +162,12 @@ func (o *Checkpoint2) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *Checkpoint2) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetLinks returns the Links field value if set, zero value otherwise. func (o *Checkpoint2) GetLinks() map[string]string { - if o == nil || o.Links == nil { + if o == nil || isNil(o.Links) { var ret map[string]string return ret } @@ -173,15 +177,15 @@ func (o *Checkpoint2) GetLinks() map[string]string { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Checkpoint2) GetLinksOk() (*map[string]string, bool) { - if o == nil || o.Links == nil { - return nil, false + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *Checkpoint2) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } @@ -195,19 +199,19 @@ func (o *Checkpoint2) SetLinks(v map[string]string) { func (o Checkpoint2) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Attributes != nil { + if !isNil(o.Attributes) { toSerialize["Attributes"] = o.Attributes } if true { toSerialize["Id"] = o.Id } - if o.Type != nil { + if !isNil(o.Type) { toSerialize["Type"] = o.Type } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint2_attributes.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint2_attributes.go new file mode 100644 index 00000000..681811ac --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint2_attributes.go @@ -0,0 +1,317 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// Checkpoint2Attributes Object attributes +type Checkpoint2Attributes struct { + // The name of the checkpoint + CheckpointName *string `json:"CheckpointName,omitempty"` + // Location code of the checkpoint + Code *string `json:"Code,omitempty"` + // Ipv4 addresses of the checkpoint + Ipv4Addresses []string `json:"Ipv4Addresses,omitempty"` + // Ipv6 addresses of the checkpoint + IpV6Addresses []string `json:"IpV6Addresses,omitempty"` + // Checkpoint is primary + IsPrimaryCheckpoint bool `json:"IsPrimaryCheckpoint"` + // Checkpoint supports IPv6 + SupportsIpv6 bool `json:"SupportsIpv6"` + // Checkpoint has high availability + HasHighAvailability bool `json:"HasHighAvailability"` +} + +// NewCheckpoint2Attributes instantiates a new Checkpoint2Attributes object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCheckpoint2Attributes(isPrimaryCheckpoint bool, supportsIpv6 bool, hasHighAvailability bool) *Checkpoint2Attributes { + this := Checkpoint2Attributes{} + this.IsPrimaryCheckpoint = isPrimaryCheckpoint + this.SupportsIpv6 = supportsIpv6 + this.HasHighAvailability = hasHighAvailability + return &this +} + +// NewCheckpoint2AttributesWithDefaults instantiates a new Checkpoint2Attributes object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCheckpoint2AttributesWithDefaults() *Checkpoint2Attributes { + this := Checkpoint2Attributes{} + return &this +} + +// GetCheckpointName returns the CheckpointName field value if set, zero value otherwise. +func (o *Checkpoint2Attributes) GetCheckpointName() string { + if o == nil || isNil(o.CheckpointName) { + var ret string + return ret + } + return *o.CheckpointName +} + +// GetCheckpointNameOk returns a tuple with the CheckpointName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Checkpoint2Attributes) GetCheckpointNameOk() (*string, bool) { + if o == nil || isNil(o.CheckpointName) { + return nil, false + } + return o.CheckpointName, true +} + +// HasCheckpointName returns a boolean if a field has been set. +func (o *Checkpoint2Attributes) HasCheckpointName() bool { + if o != nil && !isNil(o.CheckpointName) { + return true + } + + return false +} + +// SetCheckpointName gets a reference to the given string and assigns it to the CheckpointName field. +func (o *Checkpoint2Attributes) SetCheckpointName(v string) { + o.CheckpointName = &v +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *Checkpoint2Attributes) GetCode() string { + if o == nil || isNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Checkpoint2Attributes) GetCodeOk() (*string, bool) { + if o == nil || isNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *Checkpoint2Attributes) HasCode() bool { + if o != nil && !isNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *Checkpoint2Attributes) SetCode(v string) { + o.Code = &v +} + +// GetIpv4Addresses returns the Ipv4Addresses field value if set, zero value otherwise. +func (o *Checkpoint2Attributes) GetIpv4Addresses() []string { + if o == nil || isNil(o.Ipv4Addresses) { + var ret []string + return ret + } + return o.Ipv4Addresses +} + +// GetIpv4AddressesOk returns a tuple with the Ipv4Addresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Checkpoint2Attributes) GetIpv4AddressesOk() ([]string, bool) { + if o == nil || isNil(o.Ipv4Addresses) { + return nil, false + } + return o.Ipv4Addresses, true +} + +// HasIpv4Addresses returns a boolean if a field has been set. +func (o *Checkpoint2Attributes) HasIpv4Addresses() bool { + if o != nil && !isNil(o.Ipv4Addresses) { + return true + } + + return false +} + +// SetIpv4Addresses gets a reference to the given []string and assigns it to the Ipv4Addresses field. +func (o *Checkpoint2Attributes) SetIpv4Addresses(v []string) { + o.Ipv4Addresses = v +} + +// GetIpV6Addresses returns the IpV6Addresses field value if set, zero value otherwise. +func (o *Checkpoint2Attributes) GetIpV6Addresses() []string { + if o == nil || isNil(o.IpV6Addresses) { + var ret []string + return ret + } + return o.IpV6Addresses +} + +// GetIpV6AddressesOk returns a tuple with the IpV6Addresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Checkpoint2Attributes) GetIpV6AddressesOk() ([]string, bool) { + if o == nil || isNil(o.IpV6Addresses) { + return nil, false + } + return o.IpV6Addresses, true +} + +// HasIpV6Addresses returns a boolean if a field has been set. +func (o *Checkpoint2Attributes) HasIpV6Addresses() bool { + if o != nil && !isNil(o.IpV6Addresses) { + return true + } + + return false +} + +// SetIpV6Addresses gets a reference to the given []string and assigns it to the IpV6Addresses field. +func (o *Checkpoint2Attributes) SetIpV6Addresses(v []string) { + o.IpV6Addresses = v +} + +// GetIsPrimaryCheckpoint returns the IsPrimaryCheckpoint field value +func (o *Checkpoint2Attributes) GetIsPrimaryCheckpoint() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPrimaryCheckpoint +} + +// GetIsPrimaryCheckpointOk returns a tuple with the IsPrimaryCheckpoint field value +// and a boolean to check if the value has been set. +func (o *Checkpoint2Attributes) GetIsPrimaryCheckpointOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPrimaryCheckpoint, true +} + +// SetIsPrimaryCheckpoint sets field value +func (o *Checkpoint2Attributes) SetIsPrimaryCheckpoint(v bool) { + o.IsPrimaryCheckpoint = v +} + +// GetSupportsIpv6 returns the SupportsIpv6 field value +func (o *Checkpoint2Attributes) GetSupportsIpv6() bool { + if o == nil { + var ret bool + return ret + } + + return o.SupportsIpv6 +} + +// GetSupportsIpv6Ok returns a tuple with the SupportsIpv6 field value +// and a boolean to check if the value has been set. +func (o *Checkpoint2Attributes) GetSupportsIpv6Ok() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.SupportsIpv6, true +} + +// SetSupportsIpv6 sets field value +func (o *Checkpoint2Attributes) SetSupportsIpv6(v bool) { + o.SupportsIpv6 = v +} + +// GetHasHighAvailability returns the HasHighAvailability field value +func (o *Checkpoint2Attributes) GetHasHighAvailability() bool { + if o == nil { + var ret bool + return ret + } + + return o.HasHighAvailability +} + +// GetHasHighAvailabilityOk returns a tuple with the HasHighAvailability field value +// and a boolean to check if the value has been set. +func (o *Checkpoint2Attributes) GetHasHighAvailabilityOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.HasHighAvailability, true +} + +// SetHasHighAvailability sets field value +func (o *Checkpoint2Attributes) SetHasHighAvailability(v bool) { + o.HasHighAvailability = v +} + +func (o Checkpoint2Attributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.CheckpointName) { + toSerialize["CheckpointName"] = o.CheckpointName + } + if !isNil(o.Code) { + toSerialize["Code"] = o.Code + } + if !isNil(o.Ipv4Addresses) { + toSerialize["Ipv4Addresses"] = o.Ipv4Addresses + } + if !isNil(o.IpV6Addresses) { + toSerialize["IpV6Addresses"] = o.IpV6Addresses + } + if true { + toSerialize["IsPrimaryCheckpoint"] = o.IsPrimaryCheckpoint + } + if true { + toSerialize["SupportsIpv6"] = o.SupportsIpv6 + } + if true { + toSerialize["HasHighAvailability"] = o.HasHighAvailability + } + return json.Marshal(toSerialize) +} + +type NullableCheckpoint2Attributes struct { + value *Checkpoint2Attributes + isSet bool +} + +func (v NullableCheckpoint2Attributes) Get() *Checkpoint2Attributes { + return v.value +} + +func (v *NullableCheckpoint2Attributes) Set(val *Checkpoint2Attributes) { + v.value = val + v.isSet = true +} + +func (v NullableCheckpoint2Attributes) IsSet() bool { + return v.isSet +} + +func (v *NullableCheckpoint2Attributes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCheckpoint2Attributes(val *Checkpoint2Attributes) *NullableCheckpoint2Attributes { + return &NullableCheckpoint2Attributes{value: val, isSet: true} +} + +func (v NullableCheckpoint2Attributes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCheckpoint2Attributes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_attributes.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_attributes.go index 34816fab..8bd3b09f 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_attributes.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_attributes.go @@ -21,9 +21,9 @@ type CheckpointAttributes struct { // Location code of the checkpoint Code *string `json:"Code,omitempty"` // Ipv4 addresses of the checkpoint - Ipv4Addresses *[]string `json:"Ipv4Addresses,omitempty"` + Ipv4Addresses []string `json:"Ipv4Addresses,omitempty"` // Ipv6 addresses of the checkpoint - IpV6Addresses *[]string `json:"IpV6Addresses,omitempty"` + IpV6Addresses []string `json:"IpV6Addresses,omitempty"` // Checkpoint is primary IsPrimaryCheckpoint bool `json:"IsPrimaryCheckpoint"` // Checkpoint supports IPv6 @@ -54,7 +54,7 @@ func NewCheckpointAttributesWithDefaults() *CheckpointAttributes { // GetCheckpointName returns the CheckpointName field value if set, zero value otherwise. func (o *CheckpointAttributes) GetCheckpointName() string { - if o == nil || o.CheckpointName == nil { + if o == nil || isNil(o.CheckpointName) { var ret string return ret } @@ -64,15 +64,15 @@ func (o *CheckpointAttributes) GetCheckpointName() string { // GetCheckpointNameOk returns a tuple with the CheckpointName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CheckpointAttributes) GetCheckpointNameOk() (*string, bool) { - if o == nil || o.CheckpointName == nil { - return nil, false + if o == nil || isNil(o.CheckpointName) { + return nil, false } return o.CheckpointName, true } // HasCheckpointName returns a boolean if a field has been set. func (o *CheckpointAttributes) HasCheckpointName() bool { - if o != nil && o.CheckpointName != nil { + if o != nil && !isNil(o.CheckpointName) { return true } @@ -86,7 +86,7 @@ func (o *CheckpointAttributes) SetCheckpointName(v string) { // GetCode returns the Code field value if set, zero value otherwise. func (o *CheckpointAttributes) GetCode() string { - if o == nil || o.Code == nil { + if o == nil || isNil(o.Code) { var ret string return ret } @@ -96,15 +96,15 @@ func (o *CheckpointAttributes) GetCode() string { // GetCodeOk returns a tuple with the Code field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CheckpointAttributes) GetCodeOk() (*string, bool) { - if o == nil || o.Code == nil { - return nil, false + if o == nil || isNil(o.Code) { + return nil, false } return o.Code, true } // HasCode returns a boolean if a field has been set. func (o *CheckpointAttributes) HasCode() bool { - if o != nil && o.Code != nil { + if o != nil && !isNil(o.Code) { return true } @@ -118,25 +118,25 @@ func (o *CheckpointAttributes) SetCode(v string) { // GetIpv4Addresses returns the Ipv4Addresses field value if set, zero value otherwise. func (o *CheckpointAttributes) GetIpv4Addresses() []string { - if o == nil || o.Ipv4Addresses == nil { + if o == nil || isNil(o.Ipv4Addresses) { var ret []string return ret } - return *o.Ipv4Addresses + return o.Ipv4Addresses } // GetIpv4AddressesOk returns a tuple with the Ipv4Addresses field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckpointAttributes) GetIpv4AddressesOk() (*[]string, bool) { - if o == nil || o.Ipv4Addresses == nil { - return nil, false +func (o *CheckpointAttributes) GetIpv4AddressesOk() ([]string, bool) { + if o == nil || isNil(o.Ipv4Addresses) { + return nil, false } return o.Ipv4Addresses, true } // HasIpv4Addresses returns a boolean if a field has been set. func (o *CheckpointAttributes) HasIpv4Addresses() bool { - if o != nil && o.Ipv4Addresses != nil { + if o != nil && !isNil(o.Ipv4Addresses) { return true } @@ -145,30 +145,30 @@ func (o *CheckpointAttributes) HasIpv4Addresses() bool { // SetIpv4Addresses gets a reference to the given []string and assigns it to the Ipv4Addresses field. func (o *CheckpointAttributes) SetIpv4Addresses(v []string) { - o.Ipv4Addresses = &v + o.Ipv4Addresses = v } // GetIpV6Addresses returns the IpV6Addresses field value if set, zero value otherwise. func (o *CheckpointAttributes) GetIpV6Addresses() []string { - if o == nil || o.IpV6Addresses == nil { + if o == nil || isNil(o.IpV6Addresses) { var ret []string return ret } - return *o.IpV6Addresses + return o.IpV6Addresses } // GetIpV6AddressesOk returns a tuple with the IpV6Addresses field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckpointAttributes) GetIpV6AddressesOk() (*[]string, bool) { - if o == nil || o.IpV6Addresses == nil { - return nil, false +func (o *CheckpointAttributes) GetIpV6AddressesOk() ([]string, bool) { + if o == nil || isNil(o.IpV6Addresses) { + return nil, false } return o.IpV6Addresses, true } // HasIpV6Addresses returns a boolean if a field has been set. func (o *CheckpointAttributes) HasIpV6Addresses() bool { - if o != nil && o.IpV6Addresses != nil { + if o != nil && !isNil(o.IpV6Addresses) { return true } @@ -177,7 +177,7 @@ func (o *CheckpointAttributes) HasIpV6Addresses() bool { // SetIpV6Addresses gets a reference to the given []string and assigns it to the IpV6Addresses field. func (o *CheckpointAttributes) SetIpV6Addresses(v []string) { - o.IpV6Addresses = &v + o.IpV6Addresses = v } // GetIsPrimaryCheckpoint returns the IsPrimaryCheckpoint field value @@ -193,8 +193,8 @@ func (o *CheckpointAttributes) GetIsPrimaryCheckpoint() bool { // GetIsPrimaryCheckpointOk returns a tuple with the IsPrimaryCheckpoint field value // and a boolean to check if the value has been set. func (o *CheckpointAttributes) GetIsPrimaryCheckpointOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.IsPrimaryCheckpoint, true } @@ -217,8 +217,8 @@ func (o *CheckpointAttributes) GetSupportsIpv6() bool { // GetSupportsIpv6Ok returns a tuple with the SupportsIpv6 field value // and a boolean to check if the value has been set. func (o *CheckpointAttributes) GetSupportsIpv6Ok() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.SupportsIpv6, true } @@ -241,8 +241,8 @@ func (o *CheckpointAttributes) GetHasHighAvailability() bool { // GetHasHighAvailabilityOk returns a tuple with the HasHighAvailability field value // and a boolean to check if the value has been set. func (o *CheckpointAttributes) GetHasHighAvailabilityOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.HasHighAvailability, true } @@ -254,16 +254,16 @@ func (o *CheckpointAttributes) SetHasHighAvailability(v bool) { func (o CheckpointAttributes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.CheckpointName != nil { + if !isNil(o.CheckpointName) { toSerialize["CheckpointName"] = o.CheckpointName } - if o.Code != nil { + if !isNil(o.Code) { toSerialize["Code"] = o.Code } - if o.Ipv4Addresses != nil { + if !isNil(o.Ipv4Addresses) { toSerialize["Ipv4Addresses"] = o.Ipv4Addresses } - if o.IpV6Addresses != nil { + if !isNil(o.IpV6Addresses) { toSerialize["IpV6Addresses"] = o.IpV6Addresses } if true { diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_list_response.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_list_response.go index 019dee6f..ede1d8bd 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_list_response.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_list_response.go @@ -16,10 +16,12 @@ import ( // CheckpointListResponse struct for CheckpointListResponse type CheckpointListResponse struct { - Data *[]Checkpoint2 `json:"Data,omitempty"` - Links *LinksData `json:"Links,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` - Meta *MetaData `json:"Meta,omitempty"` + // The resposne data/monitor checks + Data []Checkpoint2 `json:"Data,omitempty"` + Links *StatisticsResponseLinks `json:"Links,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + Meta *StatisticsResponseMeta `json:"Meta,omitempty"` } // NewCheckpointListResponse instantiates a new CheckpointListResponse object @@ -41,25 +43,25 @@ func NewCheckpointListResponseWithDefaults() *CheckpointListResponse { // GetData returns the Data field value if set, zero value otherwise. func (o *CheckpointListResponse) GetData() []Checkpoint2 { - if o == nil || o.Data == nil { + if o == nil || isNil(o.Data) { var ret []Checkpoint2 return ret } - return *o.Data + return o.Data } // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckpointListResponse) GetDataOk() (*[]Checkpoint2, bool) { - if o == nil || o.Data == nil { - return nil, false +func (o *CheckpointListResponse) GetDataOk() ([]Checkpoint2, bool) { + if o == nil || isNil(o.Data) { + return nil, false } return o.Data, true } // HasData returns a boolean if a field has been set. func (o *CheckpointListResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && !isNil(o.Data) { return true } @@ -68,13 +70,13 @@ func (o *CheckpointListResponse) HasData() bool { // SetData gets a reference to the given []Checkpoint2 and assigns it to the Data field. func (o *CheckpointListResponse) SetData(v []Checkpoint2) { - o.Data = &v + o.Data = v } // GetLinks returns the Links field value if set, zero value otherwise. -func (o *CheckpointListResponse) GetLinks() LinksData { - if o == nil || o.Links == nil { - var ret LinksData +func (o *CheckpointListResponse) GetLinks() StatisticsResponseLinks { + if o == nil || isNil(o.Links) { + var ret StatisticsResponseLinks return ret } return *o.Links @@ -82,48 +84,48 @@ func (o *CheckpointListResponse) GetLinks() LinksData { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckpointListResponse) GetLinksOk() (*LinksData, bool) { - if o == nil || o.Links == nil { - return nil, false +func (o *CheckpointListResponse) GetLinksOk() (*StatisticsResponseLinks, bool) { + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *CheckpointListResponse) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } return false } -// SetLinks gets a reference to the given LinksData and assigns it to the Links field. -func (o *CheckpointListResponse) SetLinks(v LinksData) { +// SetLinks gets a reference to the given StatisticsResponseLinks and assigns it to the Links field. +func (o *CheckpointListResponse) SetLinks(v StatisticsResponseLinks) { o.Links = &v } // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *CheckpointListResponse) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckpointListResponse) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *CheckpointListResponse) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *CheckpointListResponse) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -132,13 +134,13 @@ func (o *CheckpointListResponse) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *CheckpointListResponse) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetMeta returns the Meta field value if set, zero value otherwise. -func (o *CheckpointListResponse) GetMeta() MetaData { - if o == nil || o.Meta == nil { - var ret MetaData +func (o *CheckpointListResponse) GetMeta() StatisticsResponseMeta { + if o == nil || isNil(o.Meta) { + var ret StatisticsResponseMeta return ret } return *o.Meta @@ -146,39 +148,39 @@ func (o *CheckpointListResponse) GetMeta() MetaData { // GetMetaOk returns a tuple with the Meta field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckpointListResponse) GetMetaOk() (*MetaData, bool) { - if o == nil || o.Meta == nil { - return nil, false +func (o *CheckpointListResponse) GetMetaOk() (*StatisticsResponseMeta, bool) { + if o == nil || isNil(o.Meta) { + return nil, false } return o.Meta, true } // HasMeta returns a boolean if a field has been set. func (o *CheckpointListResponse) HasMeta() bool { - if o != nil && o.Meta != nil { + if o != nil && !isNil(o.Meta) { return true } return false } -// SetMeta gets a reference to the given MetaData and assigns it to the Meta field. -func (o *CheckpointListResponse) SetMeta(v MetaData) { +// SetMeta gets a reference to the given StatisticsResponseMeta and assigns it to the Meta field. +func (o *CheckpointListResponse) SetMeta(v StatisticsResponseMeta) { o.Meta = &v } func (o CheckpointListResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Data != nil { + if !isNil(o.Data) { toSerialize["Data"] = o.Data } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Meta != nil { + if !isNil(o.Meta) { toSerialize["Meta"] = o.Meta } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_region.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_region.go index 64cd3861..84ed80a1 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_region.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_region.go @@ -18,7 +18,7 @@ import ( type CheckpointRegion struct { Id int32 `json:"Id"` Name *string `json:"Name,omitempty"` - ChildRegions *[]int32 `json:"ChildRegions,omitempty"` + ChildRegions []int32 `json:"ChildRegions,omitempty"` } // NewCheckpointRegion instantiates a new CheckpointRegion object @@ -52,8 +52,8 @@ func (o *CheckpointRegion) GetId() int32 { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *CheckpointRegion) GetIdOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Id, true } @@ -65,7 +65,7 @@ func (o *CheckpointRegion) SetId(v int32) { // GetName returns the Name field value if set, zero value otherwise. func (o *CheckpointRegion) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -75,15 +75,15 @@ func (o *CheckpointRegion) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CheckpointRegion) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *CheckpointRegion) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -97,25 +97,25 @@ func (o *CheckpointRegion) SetName(v string) { // GetChildRegions returns the ChildRegions field value if set, zero value otherwise. func (o *CheckpointRegion) GetChildRegions() []int32 { - if o == nil || o.ChildRegions == nil { + if o == nil || isNil(o.ChildRegions) { var ret []int32 return ret } - return *o.ChildRegions + return o.ChildRegions } // GetChildRegionsOk returns a tuple with the ChildRegions field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckpointRegion) GetChildRegionsOk() (*[]int32, bool) { - if o == nil || o.ChildRegions == nil { - return nil, false +func (o *CheckpointRegion) GetChildRegionsOk() ([]int32, bool) { + if o == nil || isNil(o.ChildRegions) { + return nil, false } return o.ChildRegions, true } // HasChildRegions returns a boolean if a field has been set. func (o *CheckpointRegion) HasChildRegions() bool { - if o != nil && o.ChildRegions != nil { + if o != nil && !isNil(o.ChildRegions) { return true } @@ -124,7 +124,7 @@ func (o *CheckpointRegion) HasChildRegions() bool { // SetChildRegions gets a reference to the given []int32 and assigns it to the ChildRegions field. func (o *CheckpointRegion) SetChildRegions(v []int32) { - o.ChildRegions = &v + o.ChildRegions = v } func (o CheckpointRegion) MarshalJSON() ([]byte, error) { @@ -132,10 +132,10 @@ func (o CheckpointRegion) MarshalJSON() ([]byte, error) { if true { toSerialize["Id"] = o.Id } - if o.Name != nil { + if !isNil(o.Name) { toSerialize["Name"] = o.Name } - if o.ChildRegions != nil { + if !isNil(o.ChildRegions) { toSerialize["ChildRegions"] = o.ChildRegions } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_response.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_response.go index 7bf56467..9e4390e1 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_response.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_response.go @@ -16,10 +16,11 @@ import ( // CheckpointResponse struct for CheckpointResponse type CheckpointResponse struct { - Data *Checkpoint2 `json:"Data,omitempty"` - Links *LinksData `json:"Links,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` - Meta *MetaData `json:"Meta,omitempty"` + Data *CheckpointResponseData `json:"Data,omitempty"` + Links *StatisticsResponseLinks `json:"Links,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + Meta *StatisticsResponseMeta `json:"Meta,omitempty"` } // NewCheckpointResponse instantiates a new CheckpointResponse object @@ -40,9 +41,9 @@ func NewCheckpointResponseWithDefaults() *CheckpointResponse { } // GetData returns the Data field value if set, zero value otherwise. -func (o *CheckpointResponse) GetData() Checkpoint2 { - if o == nil || o.Data == nil { - var ret Checkpoint2 +func (o *CheckpointResponse) GetData() CheckpointResponseData { + if o == nil || isNil(o.Data) { + var ret CheckpointResponseData return ret } return *o.Data @@ -50,31 +51,31 @@ func (o *CheckpointResponse) GetData() Checkpoint2 { // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckpointResponse) GetDataOk() (*Checkpoint2, bool) { - if o == nil || o.Data == nil { - return nil, false +func (o *CheckpointResponse) GetDataOk() (*CheckpointResponseData, bool) { + if o == nil || isNil(o.Data) { + return nil, false } return o.Data, true } // HasData returns a boolean if a field has been set. func (o *CheckpointResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && !isNil(o.Data) { return true } return false } -// SetData gets a reference to the given Checkpoint2 and assigns it to the Data field. -func (o *CheckpointResponse) SetData(v Checkpoint2) { +// SetData gets a reference to the given CheckpointResponseData and assigns it to the Data field. +func (o *CheckpointResponse) SetData(v CheckpointResponseData) { o.Data = &v } // GetLinks returns the Links field value if set, zero value otherwise. -func (o *CheckpointResponse) GetLinks() LinksData { - if o == nil || o.Links == nil { - var ret LinksData +func (o *CheckpointResponse) GetLinks() StatisticsResponseLinks { + if o == nil || isNil(o.Links) { + var ret StatisticsResponseLinks return ret } return *o.Links @@ -82,48 +83,48 @@ func (o *CheckpointResponse) GetLinks() LinksData { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckpointResponse) GetLinksOk() (*LinksData, bool) { - if o == nil || o.Links == nil { - return nil, false +func (o *CheckpointResponse) GetLinksOk() (*StatisticsResponseLinks, bool) { + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *CheckpointResponse) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } return false } -// SetLinks gets a reference to the given LinksData and assigns it to the Links field. -func (o *CheckpointResponse) SetLinks(v LinksData) { +// SetLinks gets a reference to the given StatisticsResponseLinks and assigns it to the Links field. +func (o *CheckpointResponse) SetLinks(v StatisticsResponseLinks) { o.Links = &v } // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *CheckpointResponse) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckpointResponse) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *CheckpointResponse) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *CheckpointResponse) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -132,13 +133,13 @@ func (o *CheckpointResponse) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *CheckpointResponse) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetMeta returns the Meta field value if set, zero value otherwise. -func (o *CheckpointResponse) GetMeta() MetaData { - if o == nil || o.Meta == nil { - var ret MetaData +func (o *CheckpointResponse) GetMeta() StatisticsResponseMeta { + if o == nil || isNil(o.Meta) { + var ret StatisticsResponseMeta return ret } return *o.Meta @@ -146,39 +147,39 @@ func (o *CheckpointResponse) GetMeta() MetaData { // GetMetaOk returns a tuple with the Meta field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckpointResponse) GetMetaOk() (*MetaData, bool) { - if o == nil || o.Meta == nil { - return nil, false +func (o *CheckpointResponse) GetMetaOk() (*StatisticsResponseMeta, bool) { + if o == nil || isNil(o.Meta) { + return nil, false } return o.Meta, true } // HasMeta returns a boolean if a field has been set. func (o *CheckpointResponse) HasMeta() bool { - if o != nil && o.Meta != nil { + if o != nil && !isNil(o.Meta) { return true } return false } -// SetMeta gets a reference to the given MetaData and assigns it to the Meta field. -func (o *CheckpointResponse) SetMeta(v MetaData) { +// SetMeta gets a reference to the given StatisticsResponseMeta and assigns it to the Meta field. +func (o *CheckpointResponse) SetMeta(v StatisticsResponseMeta) { o.Meta = &v } func (o CheckpointResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Data != nil { + if !isNil(o.Data) { toSerialize["Data"] = o.Data } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Meta != nil { + if !isNil(o.Meta) { toSerialize["Meta"] = o.Meta } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_response_data.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_response_data.go new file mode 100644 index 00000000..4591cd3e --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_response_data.go @@ -0,0 +1,256 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// CheckpointResponseData The resposne data/monitor checks +type CheckpointResponseData struct { + Attributes *Checkpoint2Attributes `json:"Attributes,omitempty"` + // Identifier + Id int32 `json:"Id"` + // Object type + Type *string `json:"Type,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + // Links related to the object + Links *map[string]string `json:"Links,omitempty"` +} + +// NewCheckpointResponseData instantiates a new CheckpointResponseData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCheckpointResponseData(id int32) *CheckpointResponseData { + this := CheckpointResponseData{} + this.Id = id + return &this +} + +// NewCheckpointResponseDataWithDefaults instantiates a new CheckpointResponseData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCheckpointResponseDataWithDefaults() *CheckpointResponseData { + this := CheckpointResponseData{} + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *CheckpointResponseData) GetAttributes() Checkpoint2Attributes { + if o == nil || isNil(o.Attributes) { + var ret Checkpoint2Attributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckpointResponseData) GetAttributesOk() (*Checkpoint2Attributes, bool) { + if o == nil || isNil(o.Attributes) { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *CheckpointResponseData) HasAttributes() bool { + if o != nil && !isNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given Checkpoint2Attributes and assigns it to the Attributes field. +func (o *CheckpointResponseData) SetAttributes(v Checkpoint2Attributes) { + o.Attributes = &v +} + +// GetId returns the Id field value +func (o *CheckpointResponseData) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CheckpointResponseData) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CheckpointResponseData) SetId(v int32) { + o.Id = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CheckpointResponseData) GetType() string { + if o == nil || isNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckpointResponseData) GetTypeOk() (*string, bool) { + if o == nil || isNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CheckpointResponseData) HasType() bool { + if o != nil && !isNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *CheckpointResponseData) SetType(v string) { + o.Type = &v +} + +// GetRelationships returns the Relationships field value if set, zero value otherwise. +func (o *CheckpointResponseData) GetRelationships() []RelationObject { + if o == nil || isNil(o.Relationships) { + var ret []RelationObject + return ret + } + return o.Relationships +} + +// GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckpointResponseData) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false + } + return o.Relationships, true +} + +// HasRelationships returns a boolean if a field has been set. +func (o *CheckpointResponseData) HasRelationships() bool { + if o != nil && !isNil(o.Relationships) { + return true + } + + return false +} + +// SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. +func (o *CheckpointResponseData) SetRelationships(v []RelationObject) { + o.Relationships = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *CheckpointResponseData) GetLinks() map[string]string { + if o == nil || isNil(o.Links) { + var ret map[string]string + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckpointResponseData) GetLinksOk() (*map[string]string, bool) { + if o == nil || isNil(o.Links) { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *CheckpointResponseData) HasLinks() bool { + if o != nil && !isNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given map[string]string and assigns it to the Links field. +func (o *CheckpointResponseData) SetLinks(v map[string]string) { + o.Links = &v +} + +func (o CheckpointResponseData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Attributes) { + toSerialize["Attributes"] = o.Attributes + } + if true { + toSerialize["Id"] = o.Id + } + if !isNil(o.Type) { + toSerialize["Type"] = o.Type + } + if !isNil(o.Relationships) { + toSerialize["Relationships"] = o.Relationships + } + if !isNil(o.Links) { + toSerialize["Links"] = o.Links + } + return json.Marshal(toSerialize) +} + +type NullableCheckpointResponseData struct { + value *CheckpointResponseData + isSet bool +} + +func (v NullableCheckpointResponseData) Get() *CheckpointResponseData { + return v.value +} + +func (v *NullableCheckpointResponseData) Set(val *CheckpointResponseData) { + v.value = val + v.isSet = true +} + +func (v NullableCheckpointResponseData) IsSet() bool { + return v.isSet +} + +func (v *NullableCheckpointResponseData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCheckpointResponseData(val *CheckpointResponseData) *NullableCheckpointResponseData { + return &NullableCheckpointResponseData{value: val, isSet: true} +} + +func (v NullableCheckpointResponseData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCheckpointResponseData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_server.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_server.go index b15ba77b..f34bea13 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_server.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_server.go @@ -17,9 +17,13 @@ import ( // CheckpointServer struct for CheckpointServer type CheckpointServer struct { Attributes *CheckpointServerAttributes `json:"Attributes,omitempty"` + // Identifier Id int32 `json:"Id"` + // Object type Type *string `json:"Type,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + // Links related to the object Links *map[string]string `json:"Links,omitempty"` } @@ -43,7 +47,7 @@ func NewCheckpointServerWithDefaults() *CheckpointServer { // GetAttributes returns the Attributes field value if set, zero value otherwise. func (o *CheckpointServer) GetAttributes() CheckpointServerAttributes { - if o == nil || o.Attributes == nil { + if o == nil || isNil(o.Attributes) { var ret CheckpointServerAttributes return ret } @@ -53,15 +57,15 @@ func (o *CheckpointServer) GetAttributes() CheckpointServerAttributes { // GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CheckpointServer) GetAttributesOk() (*CheckpointServerAttributes, bool) { - if o == nil || o.Attributes == nil { - return nil, false + if o == nil || isNil(o.Attributes) { + return nil, false } return o.Attributes, true } // HasAttributes returns a boolean if a field has been set. func (o *CheckpointServer) HasAttributes() bool { - if o != nil && o.Attributes != nil { + if o != nil && !isNil(o.Attributes) { return true } @@ -86,8 +90,8 @@ func (o *CheckpointServer) GetId() int32 { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *CheckpointServer) GetIdOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Id, true } @@ -99,7 +103,7 @@ func (o *CheckpointServer) SetId(v int32) { // GetType returns the Type field value if set, zero value otherwise. func (o *CheckpointServer) GetType() string { - if o == nil || o.Type == nil { + if o == nil || isNil(o.Type) { var ret string return ret } @@ -109,15 +113,15 @@ func (o *CheckpointServer) GetType() string { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CheckpointServer) GetTypeOk() (*string, bool) { - if o == nil || o.Type == nil { - return nil, false + if o == nil || isNil(o.Type) { + return nil, false } return o.Type, true } // HasType returns a boolean if a field has been set. func (o *CheckpointServer) HasType() bool { - if o != nil && o.Type != nil { + if o != nil && !isNil(o.Type) { return true } @@ -131,25 +135,25 @@ func (o *CheckpointServer) SetType(v string) { // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *CheckpointServer) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckpointServer) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *CheckpointServer) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *CheckpointServer) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -158,12 +162,12 @@ func (o *CheckpointServer) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *CheckpointServer) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetLinks returns the Links field value if set, zero value otherwise. func (o *CheckpointServer) GetLinks() map[string]string { - if o == nil || o.Links == nil { + if o == nil || isNil(o.Links) { var ret map[string]string return ret } @@ -173,15 +177,15 @@ func (o *CheckpointServer) GetLinks() map[string]string { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CheckpointServer) GetLinksOk() (*map[string]string, bool) { - if o == nil || o.Links == nil { - return nil, false + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *CheckpointServer) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } @@ -195,19 +199,19 @@ func (o *CheckpointServer) SetLinks(v map[string]string) { func (o CheckpointServer) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Attributes != nil { + if !isNil(o.Attributes) { toSerialize["Attributes"] = o.Attributes } if true { toSerialize["Id"] = o.Id } - if o.Type != nil { + if !isNil(o.Type) { toSerialize["Type"] = o.Type } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_server_attributes.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_server_attributes.go index c761dd58..e1328b40 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_server_attributes.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoint_server_attributes.go @@ -14,14 +14,14 @@ import ( "encoding/json" ) -// CheckpointServerAttributes Checkpoint server attributes +// CheckpointServerAttributes Object attributes type CheckpointServerAttributes struct { // The ipv4 address Ip4Address *string `json:"Ip4Address,omitempty"` // The ipv6 address IpV6Address *string `json:"IpV6Address,omitempty"` // List of server's capabilities - Capabilities *[]CapabilityFilterEnum `json:"Capabilities,omitempty"` + Capabilities []CapabilityFilterEnum `json:"Capabilities,omitempty"` } // NewCheckpointServerAttributes instantiates a new CheckpointServerAttributes object @@ -43,7 +43,7 @@ func NewCheckpointServerAttributesWithDefaults() *CheckpointServerAttributes { // GetIp4Address returns the Ip4Address field value if set, zero value otherwise. func (o *CheckpointServerAttributes) GetIp4Address() string { - if o == nil || o.Ip4Address == nil { + if o == nil || isNil(o.Ip4Address) { var ret string return ret } @@ -53,15 +53,15 @@ func (o *CheckpointServerAttributes) GetIp4Address() string { // GetIp4AddressOk returns a tuple with the Ip4Address field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CheckpointServerAttributes) GetIp4AddressOk() (*string, bool) { - if o == nil || o.Ip4Address == nil { - return nil, false + if o == nil || isNil(o.Ip4Address) { + return nil, false } return o.Ip4Address, true } // HasIp4Address returns a boolean if a field has been set. func (o *CheckpointServerAttributes) HasIp4Address() bool { - if o != nil && o.Ip4Address != nil { + if o != nil && !isNil(o.Ip4Address) { return true } @@ -75,7 +75,7 @@ func (o *CheckpointServerAttributes) SetIp4Address(v string) { // GetIpV6Address returns the IpV6Address field value if set, zero value otherwise. func (o *CheckpointServerAttributes) GetIpV6Address() string { - if o == nil || o.IpV6Address == nil { + if o == nil || isNil(o.IpV6Address) { var ret string return ret } @@ -85,15 +85,15 @@ func (o *CheckpointServerAttributes) GetIpV6Address() string { // GetIpV6AddressOk returns a tuple with the IpV6Address field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CheckpointServerAttributes) GetIpV6AddressOk() (*string, bool) { - if o == nil || o.IpV6Address == nil { - return nil, false + if o == nil || isNil(o.IpV6Address) { + return nil, false } return o.IpV6Address, true } // HasIpV6Address returns a boolean if a field has been set. func (o *CheckpointServerAttributes) HasIpV6Address() bool { - if o != nil && o.IpV6Address != nil { + if o != nil && !isNil(o.IpV6Address) { return true } @@ -107,25 +107,25 @@ func (o *CheckpointServerAttributes) SetIpV6Address(v string) { // GetCapabilities returns the Capabilities field value if set, zero value otherwise. func (o *CheckpointServerAttributes) GetCapabilities() []CapabilityFilterEnum { - if o == nil || o.Capabilities == nil { + if o == nil || isNil(o.Capabilities) { var ret []CapabilityFilterEnum return ret } - return *o.Capabilities + return o.Capabilities } // GetCapabilitiesOk returns a tuple with the Capabilities field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckpointServerAttributes) GetCapabilitiesOk() (*[]CapabilityFilterEnum, bool) { - if o == nil || o.Capabilities == nil { - return nil, false +func (o *CheckpointServerAttributes) GetCapabilitiesOk() ([]CapabilityFilterEnum, bool) { + if o == nil || isNil(o.Capabilities) { + return nil, false } return o.Capabilities, true } // HasCapabilities returns a boolean if a field has been set. func (o *CheckpointServerAttributes) HasCapabilities() bool { - if o != nil && o.Capabilities != nil { + if o != nil && !isNil(o.Capabilities) { return true } @@ -134,18 +134,18 @@ func (o *CheckpointServerAttributes) HasCapabilities() bool { // SetCapabilities gets a reference to the given []CapabilityFilterEnum and assigns it to the Capabilities field. func (o *CheckpointServerAttributes) SetCapabilities(v []CapabilityFilterEnum) { - o.Capabilities = &v + o.Capabilities = v } func (o CheckpointServerAttributes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Ip4Address != nil { + if !isNil(o.Ip4Address) { toSerialize["Ip4Address"] = o.Ip4Address } - if o.IpV6Address != nil { + if !isNil(o.IpV6Address) { toSerialize["IpV6Address"] = o.IpV6Address } - if o.Capabilities != nil { + if !isNil(o.Capabilities) { toSerialize["Capabilities"] = o.Capabilities } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoints_health.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoints_health.go new file mode 100644 index 00000000..4465a4d5 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_checkpoints_health.go @@ -0,0 +1,146 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// CheckpointsHealth CheckpointsHealth +type CheckpointsHealth struct { + // The number of healthy servers + HealthyServers int32 `json:"HealthyServers"` + // The health of each server + Servers []ServerHealth `json:"Servers,omitempty"` +} + +// NewCheckpointsHealth instantiates a new CheckpointsHealth object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCheckpointsHealth(healthyServers int32) *CheckpointsHealth { + this := CheckpointsHealth{} + this.HealthyServers = healthyServers + return &this +} + +// NewCheckpointsHealthWithDefaults instantiates a new CheckpointsHealth object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCheckpointsHealthWithDefaults() *CheckpointsHealth { + this := CheckpointsHealth{} + return &this +} + +// GetHealthyServers returns the HealthyServers field value +func (o *CheckpointsHealth) GetHealthyServers() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.HealthyServers +} + +// GetHealthyServersOk returns a tuple with the HealthyServers field value +// and a boolean to check if the value has been set. +func (o *CheckpointsHealth) GetHealthyServersOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.HealthyServers, true +} + +// SetHealthyServers sets field value +func (o *CheckpointsHealth) SetHealthyServers(v int32) { + o.HealthyServers = v +} + +// GetServers returns the Servers field value if set, zero value otherwise. +func (o *CheckpointsHealth) GetServers() []ServerHealth { + if o == nil || isNil(o.Servers) { + var ret []ServerHealth + return ret + } + return o.Servers +} + +// GetServersOk returns a tuple with the Servers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckpointsHealth) GetServersOk() ([]ServerHealth, bool) { + if o == nil || isNil(o.Servers) { + return nil, false + } + return o.Servers, true +} + +// HasServers returns a boolean if a field has been set. +func (o *CheckpointsHealth) HasServers() bool { + if o != nil && !isNil(o.Servers) { + return true + } + + return false +} + +// SetServers gets a reference to the given []ServerHealth and assigns it to the Servers field. +func (o *CheckpointsHealth) SetServers(v []ServerHealth) { + o.Servers = v +} + +func (o CheckpointsHealth) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["HealthyServers"] = o.HealthyServers + } + if !isNil(o.Servers) { + toSerialize["Servers"] = o.Servers + } + return json.Marshal(toSerialize) +} + +type NullableCheckpointsHealth struct { + value *CheckpointsHealth + isSet bool +} + +func (v NullableCheckpointsHealth) Get() *CheckpointsHealth { + return v.value +} + +func (v *NullableCheckpointsHealth) Set(val *CheckpointsHealth) { + v.value = val + v.isSet = true +} + +func (v NullableCheckpointsHealth) IsSet() bool { + return v.isSet +} + +func (v *NullableCheckpointsHealth) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCheckpointsHealth(val *CheckpointsHealth) *NullableCheckpointsHealth { + return &NullableCheckpointsHealth{value: val, isSet: true} +} + +func (v NullableCheckpointsHealth) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCheckpointsHealth) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_cursors_data.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_cursors_data.go index d90b4f0e..0157d713 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_cursors_data.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_cursors_data.go @@ -41,7 +41,7 @@ func NewCursorsDataWithDefaults() *CursorsData { // GetNext returns the Next field value if set, zero value otherwise. func (o *CursorsData) GetNext() string { - if o == nil || o.Next == nil { + if o == nil || isNil(o.Next) { var ret string return ret } @@ -51,15 +51,15 @@ func (o *CursorsData) GetNext() string { // GetNextOk returns a tuple with the Next field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CursorsData) GetNextOk() (*string, bool) { - if o == nil || o.Next == nil { - return nil, false + if o == nil || isNil(o.Next) { + return nil, false } return o.Next, true } // HasNext returns a boolean if a field has been set. func (o *CursorsData) HasNext() bool { - if o != nil && o.Next != nil { + if o != nil && !isNil(o.Next) { return true } @@ -73,7 +73,7 @@ func (o *CursorsData) SetNext(v string) { // GetSelf returns the Self field value if set, zero value otherwise. func (o *CursorsData) GetSelf() string { - if o == nil || o.Self == nil { + if o == nil || isNil(o.Self) { var ret string return ret } @@ -83,15 +83,15 @@ func (o *CursorsData) GetSelf() string { // GetSelfOk returns a tuple with the Self field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CursorsData) GetSelfOk() (*string, bool) { - if o == nil || o.Self == nil { - return nil, false + if o == nil || isNil(o.Self) { + return nil, false } return o.Self, true } // HasSelf returns a boolean if a field has been set. func (o *CursorsData) HasSelf() bool { - if o != nil && o.Self != nil { + if o != nil && !isNil(o.Self) { return true } @@ -105,10 +105,10 @@ func (o *CursorsData) SetSelf(v string) { func (o CursorsData) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Next != nil { + if !isNil(o.Next) { toSerialize["Next"] = o.Next } - if o.Self != nil { + if !isNil(o.Self) { toSerialize["Self"] = o.Self } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_custom_field.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_custom_field.go index 03978ded..1b6acefc 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_custom_field.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_custom_field.go @@ -39,7 +39,7 @@ func NewCustomFieldWithDefaults() *CustomField { // GetName returns the Name field value if set, zero value otherwise. func (o *CustomField) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -49,15 +49,15 @@ func (o *CustomField) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomField) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *CustomField) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -71,7 +71,7 @@ func (o *CustomField) SetName(v string) { // GetValue returns the Value field value if set, zero value otherwise. func (o *CustomField) GetValue() string { - if o == nil || o.Value == nil { + if o == nil || isNil(o.Value) { var ret string return ret } @@ -81,15 +81,15 @@ func (o *CustomField) GetValue() string { // GetValueOk returns a tuple with the Value field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomField) GetValueOk() (*string, bool) { - if o == nil || o.Value == nil { - return nil, false + if o == nil || isNil(o.Value) { + return nil, false } return o.Value, true } // HasValue returns a boolean if a field has been set. func (o *CustomField) HasValue() bool { - if o != nil && o.Value != nil { + if o != nil && !isNil(o.Value) { return true } @@ -103,10 +103,10 @@ func (o *CustomField) SetValue(v string) { func (o CustomField) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !isNil(o.Name) { toSerialize["Name"] = o.Name } - if o.Value != nil { + if !isNil(o.Value) { toSerialize["Value"] = o.Value } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_custom_metric.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_custom_metric.go index 6c0ee6a0..1ca46b90 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_custom_metric.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_custom_metric.go @@ -39,7 +39,7 @@ func NewCustomMetricWithDefaults() *CustomMetric { // GetName returns the Name field value if set, zero value otherwise. func (o *CustomMetric) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -49,15 +49,15 @@ func (o *CustomMetric) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomMetric) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *CustomMetric) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -71,7 +71,7 @@ func (o *CustomMetric) SetName(v string) { // GetVariableName returns the VariableName field value if set, zero value otherwise. func (o *CustomMetric) GetVariableName() string { - if o == nil || o.VariableName == nil { + if o == nil || isNil(o.VariableName) { var ret string return ret } @@ -81,15 +81,15 @@ func (o *CustomMetric) GetVariableName() string { // GetVariableNameOk returns a tuple with the VariableName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomMetric) GetVariableNameOk() (*string, bool) { - if o == nil || o.VariableName == nil { - return nil, false + if o == nil || isNil(o.VariableName) { + return nil, false } return o.VariableName, true } // HasVariableName returns a boolean if a field has been set. func (o *CustomMetric) HasVariableName() bool { - if o != nil && o.VariableName != nil { + if o != nil && !isNil(o.VariableName) { return true } @@ -103,10 +103,10 @@ func (o *CustomMetric) SetVariableName(v string) { func (o CustomMetric) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !isNil(o.Name) { toSerialize["Name"] = o.Name } - if o.VariableName != nil { + if !isNil(o.VariableName) { toSerialize["VariableName"] = o.VariableName } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_customization_info.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_customization_info.go index 00639b99..ba1f67a1 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_customization_info.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_customization_info.go @@ -21,6 +21,7 @@ type CustomizationInfo struct { TextColor *string `json:"TextColor,omitempty"` TitleText *string `json:"TitleText,omitempty"` FooterText *string `json:"FooterText,omitempty"` + MonitorNameOverrideFieldName *string `json:"MonitorNameOverrideFieldName,omitempty"` SortColumnsNewToOld bool `json:"SortColumnsNewToOld"` SortRowsProperty SortOrderEnum `json:"SortRowsProperty"` CommentTitle *string `json:"CommentTitle,omitempty"` @@ -48,7 +49,7 @@ func NewCustomizationInfoWithDefaults() *CustomizationInfo { // GetMainColor returns the MainColor field value if set, zero value otherwise. func (o *CustomizationInfo) GetMainColor() string { - if o == nil || o.MainColor == nil { + if o == nil || isNil(o.MainColor) { var ret string return ret } @@ -58,15 +59,15 @@ func (o *CustomizationInfo) GetMainColor() string { // GetMainColorOk returns a tuple with the MainColor field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomizationInfo) GetMainColorOk() (*string, bool) { - if o == nil || o.MainColor == nil { - return nil, false + if o == nil || isNil(o.MainColor) { + return nil, false } return o.MainColor, true } // HasMainColor returns a boolean if a field has been set. func (o *CustomizationInfo) HasMainColor() bool { - if o != nil && o.MainColor != nil { + if o != nil && !isNil(o.MainColor) { return true } @@ -80,7 +81,7 @@ func (o *CustomizationInfo) SetMainColor(v string) { // GetBackgroundColor returns the BackgroundColor field value if set, zero value otherwise. func (o *CustomizationInfo) GetBackgroundColor() string { - if o == nil || o.BackgroundColor == nil { + if o == nil || isNil(o.BackgroundColor) { var ret string return ret } @@ -90,15 +91,15 @@ func (o *CustomizationInfo) GetBackgroundColor() string { // GetBackgroundColorOk returns a tuple with the BackgroundColor field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomizationInfo) GetBackgroundColorOk() (*string, bool) { - if o == nil || o.BackgroundColor == nil { - return nil, false + if o == nil || isNil(o.BackgroundColor) { + return nil, false } return o.BackgroundColor, true } // HasBackgroundColor returns a boolean if a field has been set. func (o *CustomizationInfo) HasBackgroundColor() bool { - if o != nil && o.BackgroundColor != nil { + if o != nil && !isNil(o.BackgroundColor) { return true } @@ -112,7 +113,7 @@ func (o *CustomizationInfo) SetBackgroundColor(v string) { // GetTextColor returns the TextColor field value if set, zero value otherwise. func (o *CustomizationInfo) GetTextColor() string { - if o == nil || o.TextColor == nil { + if o == nil || isNil(o.TextColor) { var ret string return ret } @@ -122,15 +123,15 @@ func (o *CustomizationInfo) GetTextColor() string { // GetTextColorOk returns a tuple with the TextColor field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomizationInfo) GetTextColorOk() (*string, bool) { - if o == nil || o.TextColor == nil { - return nil, false + if o == nil || isNil(o.TextColor) { + return nil, false } return o.TextColor, true } // HasTextColor returns a boolean if a field has been set. func (o *CustomizationInfo) HasTextColor() bool { - if o != nil && o.TextColor != nil { + if o != nil && !isNil(o.TextColor) { return true } @@ -144,7 +145,7 @@ func (o *CustomizationInfo) SetTextColor(v string) { // GetTitleText returns the TitleText field value if set, zero value otherwise. func (o *CustomizationInfo) GetTitleText() string { - if o == nil || o.TitleText == nil { + if o == nil || isNil(o.TitleText) { var ret string return ret } @@ -154,15 +155,15 @@ func (o *CustomizationInfo) GetTitleText() string { // GetTitleTextOk returns a tuple with the TitleText field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomizationInfo) GetTitleTextOk() (*string, bool) { - if o == nil || o.TitleText == nil { - return nil, false + if o == nil || isNil(o.TitleText) { + return nil, false } return o.TitleText, true } // HasTitleText returns a boolean if a field has been set. func (o *CustomizationInfo) HasTitleText() bool { - if o != nil && o.TitleText != nil { + if o != nil && !isNil(o.TitleText) { return true } @@ -176,7 +177,7 @@ func (o *CustomizationInfo) SetTitleText(v string) { // GetFooterText returns the FooterText field value if set, zero value otherwise. func (o *CustomizationInfo) GetFooterText() string { - if o == nil || o.FooterText == nil { + if o == nil || isNil(o.FooterText) { var ret string return ret } @@ -186,15 +187,15 @@ func (o *CustomizationInfo) GetFooterText() string { // GetFooterTextOk returns a tuple with the FooterText field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomizationInfo) GetFooterTextOk() (*string, bool) { - if o == nil || o.FooterText == nil { - return nil, false + if o == nil || isNil(o.FooterText) { + return nil, false } return o.FooterText, true } // HasFooterText returns a boolean if a field has been set. func (o *CustomizationInfo) HasFooterText() bool { - if o != nil && o.FooterText != nil { + if o != nil && !isNil(o.FooterText) { return true } @@ -206,6 +207,38 @@ func (o *CustomizationInfo) SetFooterText(v string) { o.FooterText = &v } +// GetMonitorNameOverrideFieldName returns the MonitorNameOverrideFieldName field value if set, zero value otherwise. +func (o *CustomizationInfo) GetMonitorNameOverrideFieldName() string { + if o == nil || isNil(o.MonitorNameOverrideFieldName) { + var ret string + return ret + } + return *o.MonitorNameOverrideFieldName +} + +// GetMonitorNameOverrideFieldNameOk returns a tuple with the MonitorNameOverrideFieldName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomizationInfo) GetMonitorNameOverrideFieldNameOk() (*string, bool) { + if o == nil || isNil(o.MonitorNameOverrideFieldName) { + return nil, false + } + return o.MonitorNameOverrideFieldName, true +} + +// HasMonitorNameOverrideFieldName returns a boolean if a field has been set. +func (o *CustomizationInfo) HasMonitorNameOverrideFieldName() bool { + if o != nil && !isNil(o.MonitorNameOverrideFieldName) { + return true + } + + return false +} + +// SetMonitorNameOverrideFieldName gets a reference to the given string and assigns it to the MonitorNameOverrideFieldName field. +func (o *CustomizationInfo) SetMonitorNameOverrideFieldName(v string) { + o.MonitorNameOverrideFieldName = &v +} + // GetSortColumnsNewToOld returns the SortColumnsNewToOld field value func (o *CustomizationInfo) GetSortColumnsNewToOld() bool { if o == nil { @@ -219,8 +252,8 @@ func (o *CustomizationInfo) GetSortColumnsNewToOld() bool { // GetSortColumnsNewToOldOk returns a tuple with the SortColumnsNewToOld field value // and a boolean to check if the value has been set. func (o *CustomizationInfo) GetSortColumnsNewToOldOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.SortColumnsNewToOld, true } @@ -243,8 +276,8 @@ func (o *CustomizationInfo) GetSortRowsProperty() SortOrderEnum { // GetSortRowsPropertyOk returns a tuple with the SortRowsProperty field value // and a boolean to check if the value has been set. func (o *CustomizationInfo) GetSortRowsPropertyOk() (*SortOrderEnum, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.SortRowsProperty, true } @@ -256,7 +289,7 @@ func (o *CustomizationInfo) SetSortRowsProperty(v SortOrderEnum) { // GetCommentTitle returns the CommentTitle field value if set, zero value otherwise. func (o *CustomizationInfo) GetCommentTitle() string { - if o == nil || o.CommentTitle == nil { + if o == nil || isNil(o.CommentTitle) { var ret string return ret } @@ -266,15 +299,15 @@ func (o *CustomizationInfo) GetCommentTitle() string { // GetCommentTitleOk returns a tuple with the CommentTitle field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomizationInfo) GetCommentTitleOk() (*string, bool) { - if o == nil || o.CommentTitle == nil { - return nil, false + if o == nil || isNil(o.CommentTitle) { + return nil, false } return o.CommentTitle, true } // HasCommentTitle returns a boolean if a field has been set. func (o *CustomizationInfo) HasCommentTitle() bool { - if o != nil && o.CommentTitle != nil { + if o != nil && !isNil(o.CommentTitle) { return true } @@ -288,7 +321,7 @@ func (o *CustomizationInfo) SetCommentTitle(v string) { // GetCommentText returns the CommentText field value if set, zero value otherwise. func (o *CustomizationInfo) GetCommentText() string { - if o == nil || o.CommentText == nil { + if o == nil || isNil(o.CommentText) { var ret string return ret } @@ -298,15 +331,15 @@ func (o *CustomizationInfo) GetCommentText() string { // GetCommentTextOk returns a tuple with the CommentText field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomizationInfo) GetCommentTextOk() (*string, bool) { - if o == nil || o.CommentText == nil { - return nil, false + if o == nil || isNil(o.CommentText) { + return nil, false } return o.CommentText, true } // HasCommentText returns a boolean if a field has been set. func (o *CustomizationInfo) HasCommentText() bool { - if o != nil && o.CommentText != nil { + if o != nil && !isNil(o.CommentText) { return true } @@ -320,31 +353,34 @@ func (o *CustomizationInfo) SetCommentText(v string) { func (o CustomizationInfo) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.MainColor != nil { + if !isNil(o.MainColor) { toSerialize["MainColor"] = o.MainColor } - if o.BackgroundColor != nil { + if !isNil(o.BackgroundColor) { toSerialize["BackgroundColor"] = o.BackgroundColor } - if o.TextColor != nil { + if !isNil(o.TextColor) { toSerialize["TextColor"] = o.TextColor } - if o.TitleText != nil { + if !isNil(o.TitleText) { toSerialize["TitleText"] = o.TitleText } - if o.FooterText != nil { + if !isNil(o.FooterText) { toSerialize["FooterText"] = o.FooterText } + if !isNil(o.MonitorNameOverrideFieldName) { + toSerialize["MonitorNameOverrideFieldName"] = o.MonitorNameOverrideFieldName + } if true { toSerialize["SortColumnsNewToOld"] = o.SortColumnsNewToOld } if true { toSerialize["SortRowsProperty"] = o.SortRowsProperty } - if o.CommentTitle != nil { + if !isNil(o.CommentTitle) { toSerialize["CommentTitle"] = o.CommentTitle } - if o.CommentText != nil { + if !isNil(o.CommentText) { toSerialize["CommentText"] = o.CommentText } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_dashboard.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_dashboard.go index 40b1c522..281852ac 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_dashboard.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_dashboard.go @@ -41,7 +41,7 @@ func NewDashboardWithDefaults() *Dashboard { // GetDashboardGuid returns the DashboardGuid field value if set, zero value otherwise. func (o *Dashboard) GetDashboardGuid() string { - if o == nil || o.DashboardGuid == nil { + if o == nil || isNil(o.DashboardGuid) { var ret string return ret } @@ -51,15 +51,15 @@ func (o *Dashboard) GetDashboardGuid() string { // GetDashboardGuidOk returns a tuple with the DashboardGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Dashboard) GetDashboardGuidOk() (*string, bool) { - if o == nil || o.DashboardGuid == nil { - return nil, false + if o == nil || isNil(o.DashboardGuid) { + return nil, false } return o.DashboardGuid, true } // HasDashboardGuid returns a boolean if a field has been set. func (o *Dashboard) HasDashboardGuid() bool { - if o != nil && o.DashboardGuid != nil { + if o != nil && !isNil(o.DashboardGuid) { return true } @@ -73,7 +73,7 @@ func (o *Dashboard) SetDashboardGuid(v string) { // GetName returns the Name field value if set, zero value otherwise. func (o *Dashboard) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -83,15 +83,15 @@ func (o *Dashboard) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Dashboard) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *Dashboard) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -105,7 +105,7 @@ func (o *Dashboard) SetName(v string) { // GetDashboardFilter returns the DashboardFilter field value if set, zero value otherwise. func (o *Dashboard) GetDashboardFilter() DashboardFilter { - if o == nil || o.DashboardFilter == nil { + if o == nil || isNil(o.DashboardFilter) { var ret DashboardFilter return ret } @@ -115,15 +115,15 @@ func (o *Dashboard) GetDashboardFilter() DashboardFilter { // GetDashboardFilterOk returns a tuple with the DashboardFilter field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Dashboard) GetDashboardFilterOk() (*DashboardFilter, bool) { - if o == nil || o.DashboardFilter == nil { - return nil, false + if o == nil || isNil(o.DashboardFilter) { + return nil, false } return o.DashboardFilter, true } // HasDashboardFilter returns a boolean if a field has been set. func (o *Dashboard) HasDashboardFilter() bool { - if o != nil && o.DashboardFilter != nil { + if o != nil && !isNil(o.DashboardFilter) { return true } @@ -137,7 +137,7 @@ func (o *Dashboard) SetDashboardFilter(v DashboardFilter) { // GetAutoRefresh returns the AutoRefresh field value if set, zero value otherwise. func (o *Dashboard) GetAutoRefresh() bool { - if o == nil || o.AutoRefresh == nil { + if o == nil || isNil(o.AutoRefresh) { var ret bool return ret } @@ -147,15 +147,15 @@ func (o *Dashboard) GetAutoRefresh() bool { // GetAutoRefreshOk returns a tuple with the AutoRefresh field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Dashboard) GetAutoRefreshOk() (*bool, bool) { - if o == nil || o.AutoRefresh == nil { - return nil, false + if o == nil || isNil(o.AutoRefresh) { + return nil, false } return o.AutoRefresh, true } // HasAutoRefresh returns a boolean if a field has been set. func (o *Dashboard) HasAutoRefresh() bool { - if o != nil && o.AutoRefresh != nil { + if o != nil && !isNil(o.AutoRefresh) { return true } @@ -169,16 +169,16 @@ func (o *Dashboard) SetAutoRefresh(v bool) { func (o Dashboard) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.DashboardGuid != nil { + if !isNil(o.DashboardGuid) { toSerialize["DashboardGuid"] = o.DashboardGuid } - if o.Name != nil { + if !isNil(o.Name) { toSerialize["Name"] = o.Name } - if o.DashboardFilter != nil { + if !isNil(o.DashboardFilter) { toSerialize["DashboardFilter"] = o.DashboardFilter } - if o.AutoRefresh != nil { + if !isNil(o.AutoRefresh) { toSerialize["AutoRefresh"] = o.AutoRefresh } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_dashboard_filter.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_dashboard_filter.go index 3faabb02..59edc091 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_dashboard_filter.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_dashboard_filter.go @@ -17,9 +17,9 @@ import ( // DashboardFilter struct for DashboardFilter type DashboardFilter struct { SelectedPeriod *SelectedPeriod `json:"SelectedPeriod,omitempty"` - Monitors *[]string `json:"Monitors,omitempty"` - MonitorGroups *[]string `json:"MonitorGroups,omitempty"` - Checkpoints *[]int32 `json:"Checkpoints,omitempty"` + Monitors []string `json:"Monitors,omitempty"` + MonitorGroups []string `json:"MonitorGroups,omitempty"` + Checkpoints []int32 `json:"Checkpoints,omitempty"` } // NewDashboardFilter instantiates a new DashboardFilter object @@ -41,7 +41,7 @@ func NewDashboardFilterWithDefaults() *DashboardFilter { // GetSelectedPeriod returns the SelectedPeriod field value if set, zero value otherwise. func (o *DashboardFilter) GetSelectedPeriod() SelectedPeriod { - if o == nil || o.SelectedPeriod == nil { + if o == nil || isNil(o.SelectedPeriod) { var ret SelectedPeriod return ret } @@ -51,15 +51,15 @@ func (o *DashboardFilter) GetSelectedPeriod() SelectedPeriod { // GetSelectedPeriodOk returns a tuple with the SelectedPeriod field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DashboardFilter) GetSelectedPeriodOk() (*SelectedPeriod, bool) { - if o == nil || o.SelectedPeriod == nil { - return nil, false + if o == nil || isNil(o.SelectedPeriod) { + return nil, false } return o.SelectedPeriod, true } // HasSelectedPeriod returns a boolean if a field has been set. func (o *DashboardFilter) HasSelectedPeriod() bool { - if o != nil && o.SelectedPeriod != nil { + if o != nil && !isNil(o.SelectedPeriod) { return true } @@ -73,25 +73,25 @@ func (o *DashboardFilter) SetSelectedPeriod(v SelectedPeriod) { // GetMonitors returns the Monitors field value if set, zero value otherwise. func (o *DashboardFilter) GetMonitors() []string { - if o == nil || o.Monitors == nil { + if o == nil || isNil(o.Monitors) { var ret []string return ret } - return *o.Monitors + return o.Monitors } // GetMonitorsOk returns a tuple with the Monitors field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DashboardFilter) GetMonitorsOk() (*[]string, bool) { - if o == nil || o.Monitors == nil { - return nil, false +func (o *DashboardFilter) GetMonitorsOk() ([]string, bool) { + if o == nil || isNil(o.Monitors) { + return nil, false } return o.Monitors, true } // HasMonitors returns a boolean if a field has been set. func (o *DashboardFilter) HasMonitors() bool { - if o != nil && o.Monitors != nil { + if o != nil && !isNil(o.Monitors) { return true } @@ -100,30 +100,30 @@ func (o *DashboardFilter) HasMonitors() bool { // SetMonitors gets a reference to the given []string and assigns it to the Monitors field. func (o *DashboardFilter) SetMonitors(v []string) { - o.Monitors = &v + o.Monitors = v } // GetMonitorGroups returns the MonitorGroups field value if set, zero value otherwise. func (o *DashboardFilter) GetMonitorGroups() []string { - if o == nil || o.MonitorGroups == nil { + if o == nil || isNil(o.MonitorGroups) { var ret []string return ret } - return *o.MonitorGroups + return o.MonitorGroups } // GetMonitorGroupsOk returns a tuple with the MonitorGroups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DashboardFilter) GetMonitorGroupsOk() (*[]string, bool) { - if o == nil || o.MonitorGroups == nil { - return nil, false +func (o *DashboardFilter) GetMonitorGroupsOk() ([]string, bool) { + if o == nil || isNil(o.MonitorGroups) { + return nil, false } return o.MonitorGroups, true } // HasMonitorGroups returns a boolean if a field has been set. func (o *DashboardFilter) HasMonitorGroups() bool { - if o != nil && o.MonitorGroups != nil { + if o != nil && !isNil(o.MonitorGroups) { return true } @@ -132,30 +132,30 @@ func (o *DashboardFilter) HasMonitorGroups() bool { // SetMonitorGroups gets a reference to the given []string and assigns it to the MonitorGroups field. func (o *DashboardFilter) SetMonitorGroups(v []string) { - o.MonitorGroups = &v + o.MonitorGroups = v } // GetCheckpoints returns the Checkpoints field value if set, zero value otherwise. func (o *DashboardFilter) GetCheckpoints() []int32 { - if o == nil || o.Checkpoints == nil { + if o == nil || isNil(o.Checkpoints) { var ret []int32 return ret } - return *o.Checkpoints + return o.Checkpoints } // GetCheckpointsOk returns a tuple with the Checkpoints field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DashboardFilter) GetCheckpointsOk() (*[]int32, bool) { - if o == nil || o.Checkpoints == nil { - return nil, false +func (o *DashboardFilter) GetCheckpointsOk() ([]int32, bool) { + if o == nil || isNil(o.Checkpoints) { + return nil, false } return o.Checkpoints, true } // HasCheckpoints returns a boolean if a field has been set. func (o *DashboardFilter) HasCheckpoints() bool { - if o != nil && o.Checkpoints != nil { + if o != nil && !isNil(o.Checkpoints) { return true } @@ -164,21 +164,21 @@ func (o *DashboardFilter) HasCheckpoints() bool { // SetCheckpoints gets a reference to the given []int32 and assigns it to the Checkpoints field. func (o *DashboardFilter) SetCheckpoints(v []int32) { - o.Checkpoints = &v + o.Checkpoints = v } func (o DashboardFilter) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.SelectedPeriod != nil { + if !isNil(o.SelectedPeriod) { toSerialize["SelectedPeriod"] = o.SelectedPeriod } - if o.Monitors != nil { + if !isNil(o.Monitors) { toSerialize["Monitors"] = o.Monitors } - if o.MonitorGroups != nil { + if !isNil(o.MonitorGroups) { toSerialize["MonitorGroups"] = o.MonitorGroups } - if o.Checkpoints != nil { + if !isNil(o.Checkpoints) { toSerialize["Checkpoints"] = o.Checkpoints } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_date_time_pattern_match.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_date_time_pattern_match.go index 3a9ccc25..92e12a08 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_date_time_pattern_match.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_date_time_pattern_match.go @@ -52,8 +52,8 @@ func (o *DateTimePatternMatch) GetOffsetUTC() int32 { // GetOffsetUTCOk returns a tuple with the OffsetUTC field value // and a boolean to check if the value has been set. func (o *DateTimePatternMatch) GetOffsetUTCOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.OffsetUTC, true } @@ -76,8 +76,8 @@ func (o *DateTimePatternMatch) GetMaxDifference() int32 { // GetMaxDifferenceOk returns a tuple with the MaxDifference field value // and a boolean to check if the value has been set. func (o *DateTimePatternMatch) GetMaxDifferenceOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.MaxDifference, true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_day_of_week.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_day_of_week.go index f17410e4..1fbf2456 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_day_of_week.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_day_of_week.go @@ -29,7 +29,8 @@ const ( DAYOFWEEK_SATURDAY DayOfWeek = "Saturday" ) -var allowedDayOfWeekEnumValues = []DayOfWeek{ +// All allowed values of DayOfWeek enum +var AllowedDayOfWeekEnumValues = []DayOfWeek{ "Sunday", "Monday", "Tuesday", @@ -46,7 +47,7 @@ func (v *DayOfWeek) UnmarshalJSON(src []byte) error { return err } enumTypeValue := DayOfWeek(value) - for _, existing := range allowedDayOfWeekEnumValues { + for _, existing := range AllowedDayOfWeekEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -63,13 +64,13 @@ func NewDayOfWeekFromValue(v string) (*DayOfWeek, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for DayOfWeek: valid values are %v", v, allowedDayOfWeekEnumValues) + return nil, fmt.Errorf("invalid value '%v' for DayOfWeek: valid values are %v", v, AllowedDayOfWeekEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v DayOfWeek) IsValid() bool { - for _, existing := range allowedDayOfWeekEnumValues { + for _, existing := range AllowedDayOfWeekEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_dns_bypass.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_dns_bypass.go new file mode 100644 index 00000000..ee863f36 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_dns_bypass.go @@ -0,0 +1,151 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// DnsBypass struct for DnsBypass +type DnsBypass struct { + Source *string `json:"Source,omitempty"` + Target *string `json:"Target,omitempty"` +} + +// NewDnsBypass instantiates a new DnsBypass object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDnsBypass() *DnsBypass { + this := DnsBypass{} + return &this +} + +// NewDnsBypassWithDefaults instantiates a new DnsBypass object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDnsBypassWithDefaults() *DnsBypass { + this := DnsBypass{} + return &this +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *DnsBypass) GetSource() string { + if o == nil || isNil(o.Source) { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DnsBypass) GetSourceOk() (*string, bool) { + if o == nil || isNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *DnsBypass) HasSource() bool { + if o != nil && !isNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *DnsBypass) SetSource(v string) { + o.Source = &v +} + +// GetTarget returns the Target field value if set, zero value otherwise. +func (o *DnsBypass) GetTarget() string { + if o == nil || isNil(o.Target) { + var ret string + return ret + } + return *o.Target +} + +// GetTargetOk returns a tuple with the Target field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DnsBypass) GetTargetOk() (*string, bool) { + if o == nil || isNil(o.Target) { + return nil, false + } + return o.Target, true +} + +// HasTarget returns a boolean if a field has been set. +func (o *DnsBypass) HasTarget() bool { + if o != nil && !isNil(o.Target) { + return true + } + + return false +} + +// SetTarget gets a reference to the given string and assigns it to the Target field. +func (o *DnsBypass) SetTarget(v string) { + o.Target = &v +} + +func (o DnsBypass) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Source) { + toSerialize["Source"] = o.Source + } + if !isNil(o.Target) { + toSerialize["Target"] = o.Target + } + return json.Marshal(toSerialize) +} + +type NullableDnsBypass struct { + value *DnsBypass + isSet bool +} + +func (v NullableDnsBypass) Get() *DnsBypass { + return v.value +} + +func (v *NullableDnsBypass) Set(val *DnsBypass) { + v.value = val + v.isSet = true +} + +func (v NullableDnsBypass) IsSet() bool { + return v.isSet +} + +func (v *NullableDnsBypass) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDnsBypass(val *DnsBypass) *NullableDnsBypass { + return &NullableDnsBypass{value: val, isSet: true} +} + +func (v NullableDnsBypass) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDnsBypass) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_dns_query.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_dns_query.go index b795b7a6..4e6401eb 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_dns_query.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_dns_query.go @@ -31,7 +31,8 @@ const ( DNSQUERY_SRV_RECORD DnsQuery = "SrvRecord" ) -var allowedDnsQueryEnumValues = []DnsQuery{ +// All allowed values of DnsQuery enum +var AllowedDnsQueryEnumValues = []DnsQuery{ "ARecord", "CnameRecord", "MxRecord", @@ -50,7 +51,7 @@ func (v *DnsQuery) UnmarshalJSON(src []byte) error { return err } enumTypeValue := DnsQuery(value) - for _, existing := range allowedDnsQueryEnumValues { + for _, existing := range AllowedDnsQueryEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -67,13 +68,13 @@ func NewDnsQueryFromValue(v string) (*DnsQuery, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for DnsQuery: valid values are %v", v, allowedDnsQueryEnumValues) + return nil, fmt.Errorf("invalid value '%v' for DnsQuery: valid values are %v", v, AllowedDnsQueryEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v DnsQuery) IsValid() bool { - for _, existing := range allowedDnsQueryEnumValues { + for _, existing := range AllowedDnsQueryEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_engine_hash_algorithm.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_engine_hash_algorithm.go new file mode 100644 index 00000000..65be07af --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_engine_hash_algorithm.go @@ -0,0 +1,121 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" + "fmt" +) + +// EngineHashAlgorithm +type EngineHashAlgorithm string + +// List of EngineHashAlgorithm +const ( + ENGINEHASHALGORITHM_MD5 EngineHashAlgorithm = "MD5" + ENGINEHASHALGORITHM_SHA1 EngineHashAlgorithm = "SHA1" + ENGINEHASHALGORITHM_SHA256 EngineHashAlgorithm = "SHA256" + ENGINEHASHALGORITHM_SHA512 EngineHashAlgorithm = "SHA512" + ENGINEHASHALGORITHM_HMACSHA1 EngineHashAlgorithm = "HMACSHA1" + ENGINEHASHALGORITHM_HMACSHA256 EngineHashAlgorithm = "HMACSHA256" + ENGINEHASHALGORITHM_HMACSHA512 EngineHashAlgorithm = "HMACSHA512" +) + +// All allowed values of EngineHashAlgorithm enum +var AllowedEngineHashAlgorithmEnumValues = []EngineHashAlgorithm{ + "MD5", + "SHA1", + "SHA256", + "SHA512", + "HMACSHA1", + "HMACSHA256", + "HMACSHA512", +} + +func (v *EngineHashAlgorithm) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EngineHashAlgorithm(value) + for _, existing := range AllowedEngineHashAlgorithmEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EngineHashAlgorithm", value) +} + +// NewEngineHashAlgorithmFromValue returns a pointer to a valid EngineHashAlgorithm +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEngineHashAlgorithmFromValue(v string) (*EngineHashAlgorithm, error) { + ev := EngineHashAlgorithm(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EngineHashAlgorithm: valid values are %v", v, AllowedEngineHashAlgorithmEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EngineHashAlgorithm) IsValid() bool { + for _, existing := range AllowedEngineHashAlgorithmEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EngineHashAlgorithm value +func (v EngineHashAlgorithm) Ptr() *EngineHashAlgorithm { + return &v +} + +type NullableEngineHashAlgorithm struct { + value *EngineHashAlgorithm + isSet bool +} + +func (v NullableEngineHashAlgorithm) Get() *EngineHashAlgorithm { + return v.value +} + +func (v *NullableEngineHashAlgorithm) Set(val *EngineHashAlgorithm) { + v.value = val + v.isSet = true +} + +func (v NullableEngineHashAlgorithm) IsSet() bool { + return v.isSet +} + +func (v *NullableEngineHashAlgorithm) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEngineHashAlgorithm(val *EngineHashAlgorithm) *NullableEngineHashAlgorithm { + return &NullableEngineHashAlgorithm{value: val, isSet: true} +} + +func (v NullableEngineHashAlgorithm) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEngineHashAlgorithm) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_error_condition.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_error_condition.go new file mode 100644 index 00000000..7ba5ee74 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_error_condition.go @@ -0,0 +1,294 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// ErrorCondition struct for ErrorCondition +type ErrorCondition struct { + // Error condition type + ErrorConditionType ErrorConditionType `json:"ErrorConditionType"` + // The value of this error conditions (not used in all types) + Value *string `json:"Value,omitempty"` + // The percentage of this error conditions (not used in all types) + Percentage *string `json:"Percentage,omitempty"` + // The level of this error conditions (not used in all types) + Level *ErrorConditionConsoleLevel `json:"Level,omitempty"` + // The match type of this error conditions (not used in all types) + MatchType *ErrorConditionMatchType `json:"MatchType,omitempty"` + // The effect of this error conditions (not used in all types) + Effect *ErrorConditionEffect `json:"Effect,omitempty"` +} + +// NewErrorCondition instantiates a new ErrorCondition object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewErrorCondition(errorConditionType ErrorConditionType) *ErrorCondition { + this := ErrorCondition{} + this.ErrorConditionType = errorConditionType + return &this +} + +// NewErrorConditionWithDefaults instantiates a new ErrorCondition object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorConditionWithDefaults() *ErrorCondition { + this := ErrorCondition{} + return &this +} + +// GetErrorConditionType returns the ErrorConditionType field value +func (o *ErrorCondition) GetErrorConditionType() ErrorConditionType { + if o == nil { + var ret ErrorConditionType + return ret + } + + return o.ErrorConditionType +} + +// GetErrorConditionTypeOk returns a tuple with the ErrorConditionType field value +// and a boolean to check if the value has been set. +func (o *ErrorCondition) GetErrorConditionTypeOk() (*ErrorConditionType, bool) { + if o == nil { + return nil, false + } + return &o.ErrorConditionType, true +} + +// SetErrorConditionType sets field value +func (o *ErrorCondition) SetErrorConditionType(v ErrorConditionType) { + o.ErrorConditionType = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *ErrorCondition) GetValue() string { + if o == nil || isNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorCondition) GetValueOk() (*string, bool) { + if o == nil || isNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *ErrorCondition) HasValue() bool { + if o != nil && !isNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *ErrorCondition) SetValue(v string) { + o.Value = &v +} + +// GetPercentage returns the Percentage field value if set, zero value otherwise. +func (o *ErrorCondition) GetPercentage() string { + if o == nil || isNil(o.Percentage) { + var ret string + return ret + } + return *o.Percentage +} + +// GetPercentageOk returns a tuple with the Percentage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorCondition) GetPercentageOk() (*string, bool) { + if o == nil || isNil(o.Percentage) { + return nil, false + } + return o.Percentage, true +} + +// HasPercentage returns a boolean if a field has been set. +func (o *ErrorCondition) HasPercentage() bool { + if o != nil && !isNil(o.Percentage) { + return true + } + + return false +} + +// SetPercentage gets a reference to the given string and assigns it to the Percentage field. +func (o *ErrorCondition) SetPercentage(v string) { + o.Percentage = &v +} + +// GetLevel returns the Level field value if set, zero value otherwise. +func (o *ErrorCondition) GetLevel() ErrorConditionConsoleLevel { + if o == nil || isNil(o.Level) { + var ret ErrorConditionConsoleLevel + return ret + } + return *o.Level +} + +// GetLevelOk returns a tuple with the Level field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorCondition) GetLevelOk() (*ErrorConditionConsoleLevel, bool) { + if o == nil || isNil(o.Level) { + return nil, false + } + return o.Level, true +} + +// HasLevel returns a boolean if a field has been set. +func (o *ErrorCondition) HasLevel() bool { + if o != nil && !isNil(o.Level) { + return true + } + + return false +} + +// SetLevel gets a reference to the given ErrorConditionConsoleLevel and assigns it to the Level field. +func (o *ErrorCondition) SetLevel(v ErrorConditionConsoleLevel) { + o.Level = &v +} + +// GetMatchType returns the MatchType field value if set, zero value otherwise. +func (o *ErrorCondition) GetMatchType() ErrorConditionMatchType { + if o == nil || isNil(o.MatchType) { + var ret ErrorConditionMatchType + return ret + } + return *o.MatchType +} + +// GetMatchTypeOk returns a tuple with the MatchType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorCondition) GetMatchTypeOk() (*ErrorConditionMatchType, bool) { + if o == nil || isNil(o.MatchType) { + return nil, false + } + return o.MatchType, true +} + +// HasMatchType returns a boolean if a field has been set. +func (o *ErrorCondition) HasMatchType() bool { + if o != nil && !isNil(o.MatchType) { + return true + } + + return false +} + +// SetMatchType gets a reference to the given ErrorConditionMatchType and assigns it to the MatchType field. +func (o *ErrorCondition) SetMatchType(v ErrorConditionMatchType) { + o.MatchType = &v +} + +// GetEffect returns the Effect field value if set, zero value otherwise. +func (o *ErrorCondition) GetEffect() ErrorConditionEffect { + if o == nil || isNil(o.Effect) { + var ret ErrorConditionEffect + return ret + } + return *o.Effect +} + +// GetEffectOk returns a tuple with the Effect field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorCondition) GetEffectOk() (*ErrorConditionEffect, bool) { + if o == nil || isNil(o.Effect) { + return nil, false + } + return o.Effect, true +} + +// HasEffect returns a boolean if a field has been set. +func (o *ErrorCondition) HasEffect() bool { + if o != nil && !isNil(o.Effect) { + return true + } + + return false +} + +// SetEffect gets a reference to the given ErrorConditionEffect and assigns it to the Effect field. +func (o *ErrorCondition) SetEffect(v ErrorConditionEffect) { + o.Effect = &v +} + +func (o ErrorCondition) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["ErrorConditionType"] = o.ErrorConditionType + } + if !isNil(o.Value) { + toSerialize["Value"] = o.Value + } + if !isNil(o.Percentage) { + toSerialize["Percentage"] = o.Percentage + } + if !isNil(o.Level) { + toSerialize["Level"] = o.Level + } + if !isNil(o.MatchType) { + toSerialize["MatchType"] = o.MatchType + } + if !isNil(o.Effect) { + toSerialize["Effect"] = o.Effect + } + return json.Marshal(toSerialize) +} + +type NullableErrorCondition struct { + value *ErrorCondition + isSet bool +} + +func (v NullableErrorCondition) Get() *ErrorCondition { + return v.value +} + +func (v *NullableErrorCondition) Set(val *ErrorCondition) { + v.value = val + v.isSet = true +} + +func (v NullableErrorCondition) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorCondition) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorCondition(val *ErrorCondition) *NullableErrorCondition { + return &NullableErrorCondition{value: val, isSet: true} +} + +func (v NullableErrorCondition) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorCondition) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_error_condition_console_level.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_error_condition_console_level.go new file mode 100644 index 00000000..1c14aef6 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_error_condition_console_level.go @@ -0,0 +1,113 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" + "fmt" +) + +// ErrorConditionConsoleLevel +type ErrorConditionConsoleLevel string + +// List of ErrorConditionConsoleLevel +const ( + ERRORCONDITIONCONSOLELEVEL_INFO ErrorConditionConsoleLevel = "Info" + ERRORCONDITIONCONSOLELEVEL_WARNING ErrorConditionConsoleLevel = "Warning" + ERRORCONDITIONCONSOLELEVEL_SEVERE ErrorConditionConsoleLevel = "Severe" +) + +// All allowed values of ErrorConditionConsoleLevel enum +var AllowedErrorConditionConsoleLevelEnumValues = []ErrorConditionConsoleLevel{ + "Info", + "Warning", + "Severe", +} + +func (v *ErrorConditionConsoleLevel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ErrorConditionConsoleLevel(value) + for _, existing := range AllowedErrorConditionConsoleLevelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ErrorConditionConsoleLevel", value) +} + +// NewErrorConditionConsoleLevelFromValue returns a pointer to a valid ErrorConditionConsoleLevel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewErrorConditionConsoleLevelFromValue(v string) (*ErrorConditionConsoleLevel, error) { + ev := ErrorConditionConsoleLevel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ErrorConditionConsoleLevel: valid values are %v", v, AllowedErrorConditionConsoleLevelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ErrorConditionConsoleLevel) IsValid() bool { + for _, existing := range AllowedErrorConditionConsoleLevelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ErrorConditionConsoleLevel value +func (v ErrorConditionConsoleLevel) Ptr() *ErrorConditionConsoleLevel { + return &v +} + +type NullableErrorConditionConsoleLevel struct { + value *ErrorConditionConsoleLevel + isSet bool +} + +func (v NullableErrorConditionConsoleLevel) Get() *ErrorConditionConsoleLevel { + return v.value +} + +func (v *NullableErrorConditionConsoleLevel) Set(val *ErrorConditionConsoleLevel) { + v.value = val + v.isSet = true +} + +func (v NullableErrorConditionConsoleLevel) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorConditionConsoleLevel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorConditionConsoleLevel(val *ErrorConditionConsoleLevel) *NullableErrorConditionConsoleLevel { + return &NullableErrorConditionConsoleLevel{value: val, isSet: true} +} + +func (v NullableErrorConditionConsoleLevel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorConditionConsoleLevel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_error_condition_effect.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_error_condition_effect.go new file mode 100644 index 00000000..bbc11c55 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_error_condition_effect.go @@ -0,0 +1,111 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" + "fmt" +) + +// ErrorConditionEffect +type ErrorConditionEffect string + +// List of ErrorConditionEffect +const ( + ERRORCONDITIONEFFECT_INDICATE ErrorConditionEffect = "Indicate" + ERRORCONDITIONEFFECT_ERROR ErrorConditionEffect = "Error" +) + +// All allowed values of ErrorConditionEffect enum +var AllowedErrorConditionEffectEnumValues = []ErrorConditionEffect{ + "Indicate", + "Error", +} + +func (v *ErrorConditionEffect) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ErrorConditionEffect(value) + for _, existing := range AllowedErrorConditionEffectEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ErrorConditionEffect", value) +} + +// NewErrorConditionEffectFromValue returns a pointer to a valid ErrorConditionEffect +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewErrorConditionEffectFromValue(v string) (*ErrorConditionEffect, error) { + ev := ErrorConditionEffect(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ErrorConditionEffect: valid values are %v", v, AllowedErrorConditionEffectEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ErrorConditionEffect) IsValid() bool { + for _, existing := range AllowedErrorConditionEffectEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ErrorConditionEffect value +func (v ErrorConditionEffect) Ptr() *ErrorConditionEffect { + return &v +} + +type NullableErrorConditionEffect struct { + value *ErrorConditionEffect + isSet bool +} + +func (v NullableErrorConditionEffect) Get() *ErrorConditionEffect { + return v.value +} + +func (v *NullableErrorConditionEffect) Set(val *ErrorConditionEffect) { + v.value = val + v.isSet = true +} + +func (v NullableErrorConditionEffect) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorConditionEffect) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorConditionEffect(val *ErrorConditionEffect) *NullableErrorConditionEffect { + return &NullableErrorConditionEffect{value: val, isSet: true} +} + +func (v NullableErrorConditionEffect) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorConditionEffect) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_error_condition_match_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_error_condition_match_type.go new file mode 100644 index 00000000..d2cce9d6 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_error_condition_match_type.go @@ -0,0 +1,115 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" + "fmt" +) + +// ErrorConditionMatchType +type ErrorConditionMatchType string + +// List of ErrorConditionMatchType +const ( + ERRORCONDITIONMATCHTYPE_POSITIVE ErrorConditionMatchType = "Positive" + ERRORCONDITIONMATCHTYPE_NEGATIVE ErrorConditionMatchType = "Negative" + ERRORCONDITIONMATCHTYPE_POSITIVE_REGEX ErrorConditionMatchType = "PositiveRegex" + ERRORCONDITIONMATCHTYPE_NEGATIVE_REGEX ErrorConditionMatchType = "NegativeRegex" +) + +// All allowed values of ErrorConditionMatchType enum +var AllowedErrorConditionMatchTypeEnumValues = []ErrorConditionMatchType{ + "Positive", + "Negative", + "PositiveRegex", + "NegativeRegex", +} + +func (v *ErrorConditionMatchType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ErrorConditionMatchType(value) + for _, existing := range AllowedErrorConditionMatchTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ErrorConditionMatchType", value) +} + +// NewErrorConditionMatchTypeFromValue returns a pointer to a valid ErrorConditionMatchType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewErrorConditionMatchTypeFromValue(v string) (*ErrorConditionMatchType, error) { + ev := ErrorConditionMatchType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ErrorConditionMatchType: valid values are %v", v, AllowedErrorConditionMatchTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ErrorConditionMatchType) IsValid() bool { + for _, existing := range AllowedErrorConditionMatchTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ErrorConditionMatchType value +func (v ErrorConditionMatchType) Ptr() *ErrorConditionMatchType { + return &v +} + +type NullableErrorConditionMatchType struct { + value *ErrorConditionMatchType + isSet bool +} + +func (v NullableErrorConditionMatchType) Get() *ErrorConditionMatchType { + return v.value +} + +func (v *NullableErrorConditionMatchType) Set(val *ErrorConditionMatchType) { + v.value = val + v.isSet = true +} + +func (v NullableErrorConditionMatchType) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorConditionMatchType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorConditionMatchType(val *ErrorConditionMatchType) *NullableErrorConditionMatchType { + return &NullableErrorConditionMatchType{value: val, isSet: true} +} + +func (v NullableErrorConditionMatchType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorConditionMatchType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_error_condition_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_error_condition_type.go new file mode 100644 index 00000000..9641abbc --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_error_condition_type.go @@ -0,0 +1,147 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" + "fmt" +) + +// ErrorConditionType +type ErrorConditionType string + +// List of ErrorConditionType +const ( + ERRORCONDITIONTYPE_LOAD_TIME_LIMIT1 ErrorConditionType = "LoadTimeLimit1" + ERRORCONDITIONTYPE_LOAD_TIME_LIMIT2 ErrorConditionType = "LoadTimeLimit2" + ERRORCONDITIONTYPE_TOTAL_MIN_BYTES ErrorConditionType = "TotalMinBytes" + ERRORCONDITIONTYPE_TOTAL_MAX_BYTES ErrorConditionType = "TotalMaxBytes" + ERRORCONDITIONTYPE_CONTENT_MATCH ErrorConditionType = "ContentMatch" + ERRORCONDITIONTYPE_CONSOLE_CONTENT_MATCH ErrorConditionType = "ConsoleContentMatch" + ERRORCONDITIONTYPE_CONSOLE_LEVEL ErrorConditionType = "ConsoleLevel" + ERRORCONDITIONTYPE_HTTP_STATUS ErrorConditionType = "HttpStatus" + ERRORCONDITIONTYPE_PAGE_ELEMENT_MAX_SIZE_WITH_PERCENTAGE ErrorConditionType = "PageElementMaxSizeWithPercentage" + ERRORCONDITIONTYPE_PAGE_ELEMENT_FAILED_WITH_PERCENTAGE ErrorConditionType = "PageElementFailedWithPercentage" + ERRORCONDITIONTYPE_TIME_TO_FIRST_BYTE_MAXIMUM ErrorConditionType = "TimeToFirstByteMaximum" + ERRORCONDITIONTYPE_REQUEST_START_MAXIMUM ErrorConditionType = "RequestStartMaximum" + ERRORCONDITIONTYPE_DOM_COMPLETE_MAXIMUM ErrorConditionType = "DomCompleteMaximum" + ERRORCONDITIONTYPE_DOM_INTERACTIVE_MAXIMUM ErrorConditionType = "DomInteractiveMaximum" + ERRORCONDITIONTYPE_USE_RECOMMENDED_CORE_WEB_VITALS ErrorConditionType = "UseRecommendedCoreWebVitals" + ERRORCONDITIONTYPE_FIRST_CONTENTFUL_PAINT_MAXIMUM ErrorConditionType = "FirstContentfulPaintMaximum" + ERRORCONDITIONTYPE_LARGEST_CONTENTFUL_PAINT_MAXIMUM ErrorConditionType = "LargestContentfulPaintMaximum" + ERRORCONDITIONTYPE_TIME_TO_INTERACTIVE_MAXIMUM ErrorConditionType = "TimeToInteractiveMaximum" + ERRORCONDITIONTYPE_CUMULATIVE_LAYOUT_SHIFT_MAXIMUM ErrorConditionType = "CumulativeLayoutShiftMaximum" + ERRORCONDITIONTYPE_TOTAL_BLOCKING_TIME_MAXIMUM ErrorConditionType = "TotalBlockingTimeMaximum" +) + +// All allowed values of ErrorConditionType enum +var AllowedErrorConditionTypeEnumValues = []ErrorConditionType{ + "LoadTimeLimit1", + "LoadTimeLimit2", + "TotalMinBytes", + "TotalMaxBytes", + "ContentMatch", + "ConsoleContentMatch", + "ConsoleLevel", + "HttpStatus", + "PageElementMaxSizeWithPercentage", + "PageElementFailedWithPercentage", + "TimeToFirstByteMaximum", + "RequestStartMaximum", + "DomCompleteMaximum", + "DomInteractiveMaximum", + "UseRecommendedCoreWebVitals", + "FirstContentfulPaintMaximum", + "LargestContentfulPaintMaximum", + "TimeToInteractiveMaximum", + "CumulativeLayoutShiftMaximum", + "TotalBlockingTimeMaximum", +} + +func (v *ErrorConditionType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ErrorConditionType(value) + for _, existing := range AllowedErrorConditionTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ErrorConditionType", value) +} + +// NewErrorConditionTypeFromValue returns a pointer to a valid ErrorConditionType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewErrorConditionTypeFromValue(v string) (*ErrorConditionType, error) { + ev := ErrorConditionType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ErrorConditionType: valid values are %v", v, AllowedErrorConditionTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ErrorConditionType) IsValid() bool { + for _, existing := range AllowedErrorConditionTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ErrorConditionType value +func (v ErrorConditionType) Ptr() *ErrorConditionType { + return &v +} + +type NullableErrorConditionType struct { + value *ErrorConditionType + isSet bool +} + +func (v NullableErrorConditionType) Get() *ErrorConditionType { + return v.value +} + +func (v *NullableErrorConditionType) Set(val *ErrorConditionType) { + v.value = val + v.isSet = true +} + +func (v NullableErrorConditionType) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorConditionType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorConditionType(val *ErrorConditionType) *NullableErrorConditionType { + return &NullableErrorConditionType{value: val, isSet: true} +} + +func (v NullableErrorConditionType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorConditionType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_error_level.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_error_level.go index 77257310..8d452e13 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_error_level.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_error_level.go @@ -25,7 +25,8 @@ const ( ERRORLEVEL_CONFIRMED ErrorLevel = "Confirmed" ) -var allowedErrorLevelEnumValues = []ErrorLevel{ +// All allowed values of ErrorLevel enum +var AllowedErrorLevelEnumValues = []ErrorLevel{ "NoError", "Unconfirmed", "Confirmed", @@ -38,7 +39,7 @@ func (v *ErrorLevel) UnmarshalJSON(src []byte) error { return err } enumTypeValue := ErrorLevel(value) - for _, existing := range allowedErrorLevelEnumValues { + for _, existing := range AllowedErrorLevelEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -55,13 +56,13 @@ func NewErrorLevelFromValue(v string) (*ErrorLevel, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for ErrorLevel: valid values are %v", v, allowedErrorLevelEnumValues) + return nil, fmt.Errorf("invalid value '%v' for ErrorLevel: valid values are %v", v, AllowedErrorLevelEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v ErrorLevel) IsValid() bool { - for _, existing := range allowedErrorLevelEnumValues { + for _, existing := range AllowedErrorLevelEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_error_level_filter.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_error_level_filter.go index 88eeb621..cda23de2 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_error_level_filter.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_error_level_filter.go @@ -25,7 +25,8 @@ const ( ERRORLEVELFILTER_CONFIRMED ErrorLevelFilter = "Confirmed" ) -var allowedErrorLevelFilterEnumValues = []ErrorLevelFilter{ +// All allowed values of ErrorLevelFilter enum +var AllowedErrorLevelFilterEnumValues = []ErrorLevelFilter{ "NoError", "Unconfirmed", "Confirmed", @@ -38,7 +39,7 @@ func (v *ErrorLevelFilter) UnmarshalJSON(src []byte) error { return err } enumTypeValue := ErrorLevelFilter(value) - for _, existing := range allowedErrorLevelFilterEnumValues { + for _, existing := range AllowedErrorLevelFilterEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -55,13 +56,13 @@ func NewErrorLevelFilterFromValue(v string) (*ErrorLevelFilter, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for ErrorLevelFilter: valid values are %v", v, allowedErrorLevelFilterEnumValues) + return nil, fmt.Errorf("invalid value '%v' for ErrorLevelFilter: valid values are %v", v, AllowedErrorLevelFilterEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v ErrorLevelFilter) IsValid() bool { - for _, existing := range allowedErrorLevelFilterEnumValues { + for _, existing := range AllowedErrorLevelFilterEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_escalation_level.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_escalation_level.go index e28a1cb0..71e3617e 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_escalation_level.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_escalation_level.go @@ -48,7 +48,7 @@ func NewEscalationLevelWithDefaults() *EscalationLevel { // GetEscalationMode returns the EscalationMode field value if set, zero value otherwise. func (o *EscalationLevel) GetEscalationMode() EscalationMode { - if o == nil || o.EscalationMode == nil { + if o == nil || isNil(o.EscalationMode) { var ret EscalationMode return ret } @@ -58,15 +58,15 @@ func (o *EscalationLevel) GetEscalationMode() EscalationMode { // GetEscalationModeOk returns a tuple with the EscalationMode field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EscalationLevel) GetEscalationModeOk() (*EscalationMode, bool) { - if o == nil || o.EscalationMode == nil { - return nil, false + if o == nil || isNil(o.EscalationMode) { + return nil, false } return o.EscalationMode, true } // HasEscalationMode returns a boolean if a field has been set. func (o *EscalationLevel) HasEscalationMode() bool { - if o != nil && o.EscalationMode != nil { + if o != nil && !isNil(o.EscalationMode) { return true } @@ -80,7 +80,7 @@ func (o *EscalationLevel) SetEscalationMode(v EscalationMode) { // GetId returns the Id field value if set, zero value otherwise. func (o *EscalationLevel) GetId() int32 { - if o == nil || o.Id == nil { + if o == nil || isNil(o.Id) { var ret int32 return ret } @@ -90,15 +90,15 @@ func (o *EscalationLevel) GetId() int32 { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EscalationLevel) GetIdOk() (*int32, bool) { - if o == nil || o.Id == nil { - return nil, false + if o == nil || isNil(o.Id) { + return nil, false } return o.Id, true } // HasId returns a boolean if a field has been set. func (o *EscalationLevel) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !isNil(o.Id) { return true } @@ -112,7 +112,7 @@ func (o *EscalationLevel) SetId(v int32) { // GetThresholdErrorCount returns the ThresholdErrorCount field value if set, zero value otherwise. func (o *EscalationLevel) GetThresholdErrorCount() int32 { - if o == nil || o.ThresholdErrorCount == nil { + if o == nil || isNil(o.ThresholdErrorCount) { var ret int32 return ret } @@ -122,15 +122,15 @@ func (o *EscalationLevel) GetThresholdErrorCount() int32 { // GetThresholdErrorCountOk returns a tuple with the ThresholdErrorCount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EscalationLevel) GetThresholdErrorCountOk() (*int32, bool) { - if o == nil || o.ThresholdErrorCount == nil { - return nil, false + if o == nil || isNil(o.ThresholdErrorCount) { + return nil, false } return o.ThresholdErrorCount, true } // HasThresholdErrorCount returns a boolean if a field has been set. func (o *EscalationLevel) HasThresholdErrorCount() bool { - if o != nil && o.ThresholdErrorCount != nil { + if o != nil && !isNil(o.ThresholdErrorCount) { return true } @@ -144,7 +144,7 @@ func (o *EscalationLevel) SetThresholdErrorCount(v int32) { // GetThresholdMinutes returns the ThresholdMinutes field value if set, zero value otherwise. func (o *EscalationLevel) GetThresholdMinutes() int32 { - if o == nil || o.ThresholdMinutes == nil { + if o == nil || isNil(o.ThresholdMinutes) { var ret int32 return ret } @@ -154,15 +154,15 @@ func (o *EscalationLevel) GetThresholdMinutes() int32 { // GetThresholdMinutesOk returns a tuple with the ThresholdMinutes field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EscalationLevel) GetThresholdMinutesOk() (*int32, bool) { - if o == nil || o.ThresholdMinutes == nil { - return nil, false + if o == nil || isNil(o.ThresholdMinutes) { + return nil, false } return o.ThresholdMinutes, true } // HasThresholdMinutes returns a boolean if a field has been set. func (o *EscalationLevel) HasThresholdMinutes() bool { - if o != nil && o.ThresholdMinutes != nil { + if o != nil && !isNil(o.ThresholdMinutes) { return true } @@ -176,7 +176,7 @@ func (o *EscalationLevel) SetThresholdMinutes(v int32) { // GetIsActive returns the IsActive field value if set, zero value otherwise. func (o *EscalationLevel) GetIsActive() bool { - if o == nil || o.IsActive == nil { + if o == nil || isNil(o.IsActive) { var ret bool return ret } @@ -186,15 +186,15 @@ func (o *EscalationLevel) GetIsActive() bool { // GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EscalationLevel) GetIsActiveOk() (*bool, bool) { - if o == nil || o.IsActive == nil { - return nil, false + if o == nil || isNil(o.IsActive) { + return nil, false } return o.IsActive, true } // HasIsActive returns a boolean if a field has been set. func (o *EscalationLevel) HasIsActive() bool { - if o != nil && o.IsActive != nil { + if o != nil && !isNil(o.IsActive) { return true } @@ -208,7 +208,7 @@ func (o *EscalationLevel) SetIsActive(v bool) { // GetMessage returns the Message field value if set, zero value otherwise. func (o *EscalationLevel) GetMessage() string { - if o == nil || o.Message == nil { + if o == nil || isNil(o.Message) { var ret string return ret } @@ -218,15 +218,15 @@ func (o *EscalationLevel) GetMessage() string { // GetMessageOk returns a tuple with the Message field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EscalationLevel) GetMessageOk() (*string, bool) { - if o == nil || o.Message == nil { - return nil, false + if o == nil || isNil(o.Message) { + return nil, false } return o.Message, true } // HasMessage returns a boolean if a field has been set. func (o *EscalationLevel) HasMessage() bool { - if o != nil && o.Message != nil { + if o != nil && !isNil(o.Message) { return true } @@ -240,7 +240,7 @@ func (o *EscalationLevel) SetMessage(v string) { // GetNumberOfReminders returns the NumberOfReminders field value if set, zero value otherwise. func (o *EscalationLevel) GetNumberOfReminders() int32 { - if o == nil || o.NumberOfReminders == nil { + if o == nil || isNil(o.NumberOfReminders) { var ret int32 return ret } @@ -250,15 +250,15 @@ func (o *EscalationLevel) GetNumberOfReminders() int32 { // GetNumberOfRemindersOk returns a tuple with the NumberOfReminders field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EscalationLevel) GetNumberOfRemindersOk() (*int32, bool) { - if o == nil || o.NumberOfReminders == nil { - return nil, false + if o == nil || isNil(o.NumberOfReminders) { + return nil, false } return o.NumberOfReminders, true } // HasNumberOfReminders returns a boolean if a field has been set. func (o *EscalationLevel) HasNumberOfReminders() bool { - if o != nil && o.NumberOfReminders != nil { + if o != nil && !isNil(o.NumberOfReminders) { return true } @@ -272,7 +272,7 @@ func (o *EscalationLevel) SetNumberOfReminders(v int32) { // GetReminderDelay returns the ReminderDelay field value if set, zero value otherwise. func (o *EscalationLevel) GetReminderDelay() int32 { - if o == nil || o.ReminderDelay == nil { + if o == nil || isNil(o.ReminderDelay) { var ret int32 return ret } @@ -282,15 +282,15 @@ func (o *EscalationLevel) GetReminderDelay() int32 { // GetReminderDelayOk returns a tuple with the ReminderDelay field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EscalationLevel) GetReminderDelayOk() (*int32, bool) { - if o == nil || o.ReminderDelay == nil { - return nil, false + if o == nil || isNil(o.ReminderDelay) { + return nil, false } return o.ReminderDelay, true } // HasReminderDelay returns a boolean if a field has been set. func (o *EscalationLevel) HasReminderDelay() bool { - if o != nil && o.ReminderDelay != nil { + if o != nil && !isNil(o.ReminderDelay) { return true } @@ -304,7 +304,7 @@ func (o *EscalationLevel) SetReminderDelay(v int32) { // GetIncludeTraceRoute returns the IncludeTraceRoute field value if set, zero value otherwise. func (o *EscalationLevel) GetIncludeTraceRoute() bool { - if o == nil || o.IncludeTraceRoute == nil { + if o == nil || isNil(o.IncludeTraceRoute) { var ret bool return ret } @@ -314,15 +314,15 @@ func (o *EscalationLevel) GetIncludeTraceRoute() bool { // GetIncludeTraceRouteOk returns a tuple with the IncludeTraceRoute field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EscalationLevel) GetIncludeTraceRouteOk() (*bool, bool) { - if o == nil || o.IncludeTraceRoute == nil { - return nil, false + if o == nil || isNil(o.IncludeTraceRoute) { + return nil, false } return o.IncludeTraceRoute, true } // HasIncludeTraceRoute returns a boolean if a field has been set. func (o *EscalationLevel) HasIncludeTraceRoute() bool { - if o != nil && o.IncludeTraceRoute != nil { + if o != nil && !isNil(o.IncludeTraceRoute) { return true } @@ -336,7 +336,7 @@ func (o *EscalationLevel) SetIncludeTraceRoute(v bool) { // GetHash returns the Hash field value if set, zero value otherwise. func (o *EscalationLevel) GetHash() string { - if o == nil || o.Hash == nil { + if o == nil || isNil(o.Hash) { var ret string return ret } @@ -346,15 +346,15 @@ func (o *EscalationLevel) GetHash() string { // GetHashOk returns a tuple with the Hash field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EscalationLevel) GetHashOk() (*string, bool) { - if o == nil || o.Hash == nil { - return nil, false + if o == nil || isNil(o.Hash) { + return nil, false } return o.Hash, true } // HasHash returns a boolean if a field has been set. func (o *EscalationLevel) HasHash() bool { - if o != nil && o.Hash != nil { + if o != nil && !isNil(o.Hash) { return true } @@ -368,34 +368,34 @@ func (o *EscalationLevel) SetHash(v string) { func (o EscalationLevel) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.EscalationMode != nil { + if !isNil(o.EscalationMode) { toSerialize["EscalationMode"] = o.EscalationMode } - if o.Id != nil { + if !isNil(o.Id) { toSerialize["Id"] = o.Id } - if o.ThresholdErrorCount != nil { + if !isNil(o.ThresholdErrorCount) { toSerialize["ThresholdErrorCount"] = o.ThresholdErrorCount } - if o.ThresholdMinutes != nil { + if !isNil(o.ThresholdMinutes) { toSerialize["ThresholdMinutes"] = o.ThresholdMinutes } - if o.IsActive != nil { + if !isNil(o.IsActive) { toSerialize["IsActive"] = o.IsActive } - if o.Message != nil { + if !isNil(o.Message) { toSerialize["Message"] = o.Message } - if o.NumberOfReminders != nil { + if !isNil(o.NumberOfReminders) { toSerialize["NumberOfReminders"] = o.NumberOfReminders } - if o.ReminderDelay != nil { + if !isNil(o.ReminderDelay) { toSerialize["ReminderDelay"] = o.ReminderDelay } - if o.IncludeTraceRoute != nil { + if !isNil(o.IncludeTraceRoute) { toSerialize["IncludeTraceRoute"] = o.IncludeTraceRoute } - if o.Hash != nil { + if !isNil(o.Hash) { toSerialize["Hash"] = o.Hash } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_escalation_level_integration.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_escalation_level_integration.go index c130c164..addb7bd7 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_escalation_level_integration.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_escalation_level_integration.go @@ -19,11 +19,11 @@ type EscalationLevelIntegration struct { // The unique key of this Integration. IntegrationGuid *string `json:"IntegrationGuid,omitempty"` // Extra email addresses - ExtraEmailAddresses *[]string `json:"ExtraEmailAddresses,omitempty"` + ExtraEmailAddresses []string `json:"ExtraEmailAddresses,omitempty"` // Specified Extra EmailAddresses For Patch request ExtraEmailAddressesSpecified *bool `json:"ExtraEmailAddressesSpecified,omitempty"` // StatusHub Service Mapping - StatusHubServiceList *[]IntegrationServiceMap `json:"StatusHubServiceList,omitempty"` + StatusHubServiceList []IntegrationServiceMap `json:"StatusHubServiceList,omitempty"` // Specified StatusHubServiceList For Patch request StatusHubServiceListSpecified *bool `json:"StatusHubServiceListSpecified,omitempty"` // Indicates whether this Integration is active. @@ -50,7 +50,7 @@ func NewEscalationLevelIntegrationWithDefaults() *EscalationLevelIntegration { // GetIntegrationGuid returns the IntegrationGuid field value if set, zero value otherwise. func (o *EscalationLevelIntegration) GetIntegrationGuid() string { - if o == nil || o.IntegrationGuid == nil { + if o == nil || isNil(o.IntegrationGuid) { var ret string return ret } @@ -60,15 +60,15 @@ func (o *EscalationLevelIntegration) GetIntegrationGuid() string { // GetIntegrationGuidOk returns a tuple with the IntegrationGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EscalationLevelIntegration) GetIntegrationGuidOk() (*string, bool) { - if o == nil || o.IntegrationGuid == nil { - return nil, false + if o == nil || isNil(o.IntegrationGuid) { + return nil, false } return o.IntegrationGuid, true } // HasIntegrationGuid returns a boolean if a field has been set. func (o *EscalationLevelIntegration) HasIntegrationGuid() bool { - if o != nil && o.IntegrationGuid != nil { + if o != nil && !isNil(o.IntegrationGuid) { return true } @@ -82,25 +82,25 @@ func (o *EscalationLevelIntegration) SetIntegrationGuid(v string) { // GetExtraEmailAddresses returns the ExtraEmailAddresses field value if set, zero value otherwise. func (o *EscalationLevelIntegration) GetExtraEmailAddresses() []string { - if o == nil || o.ExtraEmailAddresses == nil { + if o == nil || isNil(o.ExtraEmailAddresses) { var ret []string return ret } - return *o.ExtraEmailAddresses + return o.ExtraEmailAddresses } // GetExtraEmailAddressesOk returns a tuple with the ExtraEmailAddresses field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *EscalationLevelIntegration) GetExtraEmailAddressesOk() (*[]string, bool) { - if o == nil || o.ExtraEmailAddresses == nil { - return nil, false +func (o *EscalationLevelIntegration) GetExtraEmailAddressesOk() ([]string, bool) { + if o == nil || isNil(o.ExtraEmailAddresses) { + return nil, false } return o.ExtraEmailAddresses, true } // HasExtraEmailAddresses returns a boolean if a field has been set. func (o *EscalationLevelIntegration) HasExtraEmailAddresses() bool { - if o != nil && o.ExtraEmailAddresses != nil { + if o != nil && !isNil(o.ExtraEmailAddresses) { return true } @@ -109,12 +109,12 @@ func (o *EscalationLevelIntegration) HasExtraEmailAddresses() bool { // SetExtraEmailAddresses gets a reference to the given []string and assigns it to the ExtraEmailAddresses field. func (o *EscalationLevelIntegration) SetExtraEmailAddresses(v []string) { - o.ExtraEmailAddresses = &v + o.ExtraEmailAddresses = v } // GetExtraEmailAddressesSpecified returns the ExtraEmailAddressesSpecified field value if set, zero value otherwise. func (o *EscalationLevelIntegration) GetExtraEmailAddressesSpecified() bool { - if o == nil || o.ExtraEmailAddressesSpecified == nil { + if o == nil || isNil(o.ExtraEmailAddressesSpecified) { var ret bool return ret } @@ -124,15 +124,15 @@ func (o *EscalationLevelIntegration) GetExtraEmailAddressesSpecified() bool { // GetExtraEmailAddressesSpecifiedOk returns a tuple with the ExtraEmailAddressesSpecified field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EscalationLevelIntegration) GetExtraEmailAddressesSpecifiedOk() (*bool, bool) { - if o == nil || o.ExtraEmailAddressesSpecified == nil { - return nil, false + if o == nil || isNil(o.ExtraEmailAddressesSpecified) { + return nil, false } return o.ExtraEmailAddressesSpecified, true } // HasExtraEmailAddressesSpecified returns a boolean if a field has been set. func (o *EscalationLevelIntegration) HasExtraEmailAddressesSpecified() bool { - if o != nil && o.ExtraEmailAddressesSpecified != nil { + if o != nil && !isNil(o.ExtraEmailAddressesSpecified) { return true } @@ -146,25 +146,25 @@ func (o *EscalationLevelIntegration) SetExtraEmailAddressesSpecified(v bool) { // GetStatusHubServiceList returns the StatusHubServiceList field value if set, zero value otherwise. func (o *EscalationLevelIntegration) GetStatusHubServiceList() []IntegrationServiceMap { - if o == nil || o.StatusHubServiceList == nil { + if o == nil || isNil(o.StatusHubServiceList) { var ret []IntegrationServiceMap return ret } - return *o.StatusHubServiceList + return o.StatusHubServiceList } // GetStatusHubServiceListOk returns a tuple with the StatusHubServiceList field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *EscalationLevelIntegration) GetStatusHubServiceListOk() (*[]IntegrationServiceMap, bool) { - if o == nil || o.StatusHubServiceList == nil { - return nil, false +func (o *EscalationLevelIntegration) GetStatusHubServiceListOk() ([]IntegrationServiceMap, bool) { + if o == nil || isNil(o.StatusHubServiceList) { + return nil, false } return o.StatusHubServiceList, true } // HasStatusHubServiceList returns a boolean if a field has been set. func (o *EscalationLevelIntegration) HasStatusHubServiceList() bool { - if o != nil && o.StatusHubServiceList != nil { + if o != nil && !isNil(o.StatusHubServiceList) { return true } @@ -173,12 +173,12 @@ func (o *EscalationLevelIntegration) HasStatusHubServiceList() bool { // SetStatusHubServiceList gets a reference to the given []IntegrationServiceMap and assigns it to the StatusHubServiceList field. func (o *EscalationLevelIntegration) SetStatusHubServiceList(v []IntegrationServiceMap) { - o.StatusHubServiceList = &v + o.StatusHubServiceList = v } // GetStatusHubServiceListSpecified returns the StatusHubServiceListSpecified field value if set, zero value otherwise. func (o *EscalationLevelIntegration) GetStatusHubServiceListSpecified() bool { - if o == nil || o.StatusHubServiceListSpecified == nil { + if o == nil || isNil(o.StatusHubServiceListSpecified) { var ret bool return ret } @@ -188,15 +188,15 @@ func (o *EscalationLevelIntegration) GetStatusHubServiceListSpecified() bool { // GetStatusHubServiceListSpecifiedOk returns a tuple with the StatusHubServiceListSpecified field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EscalationLevelIntegration) GetStatusHubServiceListSpecifiedOk() (*bool, bool) { - if o == nil || o.StatusHubServiceListSpecified == nil { - return nil, false + if o == nil || isNil(o.StatusHubServiceListSpecified) { + return nil, false } return o.StatusHubServiceListSpecified, true } // HasStatusHubServiceListSpecified returns a boolean if a field has been set. func (o *EscalationLevelIntegration) HasStatusHubServiceListSpecified() bool { - if o != nil && o.StatusHubServiceListSpecified != nil { + if o != nil && !isNil(o.StatusHubServiceListSpecified) { return true } @@ -210,7 +210,7 @@ func (o *EscalationLevelIntegration) SetStatusHubServiceListSpecified(v bool) { // GetIsActive returns the IsActive field value if set, zero value otherwise. func (o *EscalationLevelIntegration) GetIsActive() bool { - if o == nil || o.IsActive == nil { + if o == nil || isNil(o.IsActive) { var ret bool return ret } @@ -220,15 +220,15 @@ func (o *EscalationLevelIntegration) GetIsActive() bool { // GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EscalationLevelIntegration) GetIsActiveOk() (*bool, bool) { - if o == nil || o.IsActive == nil { - return nil, false + if o == nil || isNil(o.IsActive) { + return nil, false } return o.IsActive, true } // HasIsActive returns a boolean if a field has been set. func (o *EscalationLevelIntegration) HasIsActive() bool { - if o != nil && o.IsActive != nil { + if o != nil && !isNil(o.IsActive) { return true } @@ -242,7 +242,7 @@ func (o *EscalationLevelIntegration) SetIsActive(v bool) { // GetHash returns the Hash field value if set, zero value otherwise. func (o *EscalationLevelIntegration) GetHash() string { - if o == nil || o.Hash == nil { + if o == nil || isNil(o.Hash) { var ret string return ret } @@ -252,15 +252,15 @@ func (o *EscalationLevelIntegration) GetHash() string { // GetHashOk returns a tuple with the Hash field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EscalationLevelIntegration) GetHashOk() (*string, bool) { - if o == nil || o.Hash == nil { - return nil, false + if o == nil || isNil(o.Hash) { + return nil, false } return o.Hash, true } // HasHash returns a boolean if a field has been set. func (o *EscalationLevelIntegration) HasHash() bool { - if o != nil && o.Hash != nil { + if o != nil && !isNil(o.Hash) { return true } @@ -274,25 +274,25 @@ func (o *EscalationLevelIntegration) SetHash(v string) { func (o EscalationLevelIntegration) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.IntegrationGuid != nil { + if !isNil(o.IntegrationGuid) { toSerialize["IntegrationGuid"] = o.IntegrationGuid } - if o.ExtraEmailAddresses != nil { + if !isNil(o.ExtraEmailAddresses) { toSerialize["ExtraEmailAddresses"] = o.ExtraEmailAddresses } - if o.ExtraEmailAddressesSpecified != nil { + if !isNil(o.ExtraEmailAddressesSpecified) { toSerialize["ExtraEmailAddressesSpecified"] = o.ExtraEmailAddressesSpecified } - if o.StatusHubServiceList != nil { + if !isNil(o.StatusHubServiceList) { toSerialize["StatusHubServiceList"] = o.StatusHubServiceList } - if o.StatusHubServiceListSpecified != nil { + if !isNil(o.StatusHubServiceListSpecified) { toSerialize["StatusHubServiceListSpecified"] = o.StatusHubServiceListSpecified } - if o.IsActive != nil { + if !isNil(o.IsActive) { toSerialize["IsActive"] = o.IsActive } - if o.Hash != nil { + if !isNil(o.Hash) { toSerialize["Hash"] = o.Hash } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_escalation_mode.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_escalation_mode.go index 8f34bd09..92b340a1 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_escalation_mode.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_escalation_mode.go @@ -24,7 +24,8 @@ const ( ESCALATIONMODE_ALERT_ON_ERROR_DURATION EscalationMode = "AlertOnErrorDuration" ) -var allowedEscalationModeEnumValues = []EscalationMode{ +// All allowed values of EscalationMode enum +var AllowedEscalationModeEnumValues = []EscalationMode{ "AlertOnErrorCount", "AlertOnErrorDuration", } @@ -36,7 +37,7 @@ func (v *EscalationMode) UnmarshalJSON(src []byte) error { return err } enumTypeValue := EscalationMode(value) - for _, existing := range allowedEscalationModeEnumValues { + for _, existing := range AllowedEscalationModeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -53,13 +54,13 @@ func NewEscalationModeFromValue(v string) (*EscalationMode, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for EscalationMode: valid values are %v", v, allowedEscalationModeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for EscalationMode: valid values are %v", v, AllowedEscalationModeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v EscalationMode) IsValid() bool { - for _, existing := range allowedEscalationModeEnumValues { + for _, existing := range AllowedEscalationModeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_exclusion_period.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_exclusion_period.go index 079632fe..392da0c0 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_exclusion_period.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_exclusion_period.go @@ -12,15 +12,14 @@ package uptrends import ( "encoding/json" - "time" ) // ExclusionPeriod struct for ExclusionPeriod type ExclusionPeriod struct { ExclusionPeriodId *int32 `json:"ExclusionPeriodId,omitempty"` Description *string `json:"Description,omitempty"` - From *time.Time `json:"From,omitempty"` - Until *time.Time `json:"Until,omitempty"` + From map[string]interface{} `json:"From,omitempty"` + Until map[string]interface{} `json:"Until,omitempty"` Hash *string `json:"Hash,omitempty"` } @@ -43,7 +42,7 @@ func NewExclusionPeriodWithDefaults() *ExclusionPeriod { // GetExclusionPeriodId returns the ExclusionPeriodId field value if set, zero value otherwise. func (o *ExclusionPeriod) GetExclusionPeriodId() int32 { - if o == nil || o.ExclusionPeriodId == nil { + if o == nil || isNil(o.ExclusionPeriodId) { var ret int32 return ret } @@ -53,15 +52,15 @@ func (o *ExclusionPeriod) GetExclusionPeriodId() int32 { // GetExclusionPeriodIdOk returns a tuple with the ExclusionPeriodId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ExclusionPeriod) GetExclusionPeriodIdOk() (*int32, bool) { - if o == nil || o.ExclusionPeriodId == nil { - return nil, false + if o == nil || isNil(o.ExclusionPeriodId) { + return nil, false } return o.ExclusionPeriodId, true } // HasExclusionPeriodId returns a boolean if a field has been set. func (o *ExclusionPeriod) HasExclusionPeriodId() bool { - if o != nil && o.ExclusionPeriodId != nil { + if o != nil && !isNil(o.ExclusionPeriodId) { return true } @@ -75,7 +74,7 @@ func (o *ExclusionPeriod) SetExclusionPeriodId(v int32) { // GetDescription returns the Description field value if set, zero value otherwise. func (o *ExclusionPeriod) GetDescription() string { - if o == nil || o.Description == nil { + if o == nil || isNil(o.Description) { var ret string return ret } @@ -85,15 +84,15 @@ func (o *ExclusionPeriod) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ExclusionPeriod) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { - return nil, false + if o == nil || isNil(o.Description) { + return nil, false } return o.Description, true } // HasDescription returns a boolean if a field has been set. func (o *ExclusionPeriod) HasDescription() bool { - if o != nil && o.Description != nil { + if o != nil && !isNil(o.Description) { return true } @@ -106,72 +105,72 @@ func (o *ExclusionPeriod) SetDescription(v string) { } // GetFrom returns the From field value if set, zero value otherwise. -func (o *ExclusionPeriod) GetFrom() time.Time { - if o == nil || o.From == nil { - var ret time.Time +func (o *ExclusionPeriod) GetFrom() map[string]interface{} { + if o == nil || isNil(o.From) { + var ret map[string]interface{} return ret } - return *o.From + return o.From } // GetFromOk returns a tuple with the From field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ExclusionPeriod) GetFromOk() (*time.Time, bool) { - if o == nil || o.From == nil { - return nil, false +func (o *ExclusionPeriod) GetFromOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.From) { + return map[string]interface{}{}, false } return o.From, true } // HasFrom returns a boolean if a field has been set. func (o *ExclusionPeriod) HasFrom() bool { - if o != nil && o.From != nil { + if o != nil && !isNil(o.From) { return true } return false } -// SetFrom gets a reference to the given time.Time and assigns it to the From field. -func (o *ExclusionPeriod) SetFrom(v time.Time) { - o.From = &v +// SetFrom gets a reference to the given map[string]interface{} and assigns it to the From field. +func (o *ExclusionPeriod) SetFrom(v map[string]interface{}) { + o.From = v } // GetUntil returns the Until field value if set, zero value otherwise. -func (o *ExclusionPeriod) GetUntil() time.Time { - if o == nil || o.Until == nil { - var ret time.Time +func (o *ExclusionPeriod) GetUntil() map[string]interface{} { + if o == nil || isNil(o.Until) { + var ret map[string]interface{} return ret } - return *o.Until + return o.Until } // GetUntilOk returns a tuple with the Until field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ExclusionPeriod) GetUntilOk() (*time.Time, bool) { - if o == nil || o.Until == nil { - return nil, false +func (o *ExclusionPeriod) GetUntilOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.Until) { + return map[string]interface{}{}, false } return o.Until, true } // HasUntil returns a boolean if a field has been set. func (o *ExclusionPeriod) HasUntil() bool { - if o != nil && o.Until != nil { + if o != nil && !isNil(o.Until) { return true } return false } -// SetUntil gets a reference to the given time.Time and assigns it to the Until field. -func (o *ExclusionPeriod) SetUntil(v time.Time) { - o.Until = &v +// SetUntil gets a reference to the given map[string]interface{} and assigns it to the Until field. +func (o *ExclusionPeriod) SetUntil(v map[string]interface{}) { + o.Until = v } // GetHash returns the Hash field value if set, zero value otherwise. func (o *ExclusionPeriod) GetHash() string { - if o == nil || o.Hash == nil { + if o == nil || isNil(o.Hash) { var ret string return ret } @@ -181,15 +180,15 @@ func (o *ExclusionPeriod) GetHash() string { // GetHashOk returns a tuple with the Hash field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ExclusionPeriod) GetHashOk() (*string, bool) { - if o == nil || o.Hash == nil { - return nil, false + if o == nil || isNil(o.Hash) { + return nil, false } return o.Hash, true } // HasHash returns a boolean if a field has been set. func (o *ExclusionPeriod) HasHash() bool { - if o != nil && o.Hash != nil { + if o != nil && !isNil(o.Hash) { return true } @@ -203,19 +202,19 @@ func (o *ExclusionPeriod) SetHash(v string) { func (o ExclusionPeriod) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.ExclusionPeriodId != nil { + if !isNil(o.ExclusionPeriodId) { toSerialize["ExclusionPeriodId"] = o.ExclusionPeriodId } - if o.Description != nil { + if !isNil(o.Description) { toSerialize["Description"] = o.Description } - if o.From != nil { + if !isNil(o.From) { toSerialize["From"] = o.From } - if o.Until != nil { + if !isNil(o.Until) { toSerialize["Until"] = o.Until } - if o.Hash != nil { + if !isNil(o.Hash) { toSerialize["Hash"] = o.Hash } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_file_info.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_file_info.go index f8cd7e97..51642a0e 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_file_info.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_file_info.go @@ -43,7 +43,7 @@ func NewFileInfoWithDefaults() *FileInfo { // GetData returns the Data field value if set, zero value otherwise. func (o *FileInfo) GetData() string { - if o == nil || o.Data == nil { + if o == nil || isNil(o.Data) { var ret string return ret } @@ -53,15 +53,15 @@ func (o *FileInfo) GetData() string { // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FileInfo) GetDataOk() (*string, bool) { - if o == nil || o.Data == nil { - return nil, false + if o == nil || isNil(o.Data) { + return nil, false } return o.Data, true } // HasData returns a boolean if a field has been set. func (o *FileInfo) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && !isNil(o.Data) { return true } @@ -75,7 +75,7 @@ func (o *FileInfo) SetData(v string) { // GetName returns the Name field value if set, zero value otherwise. func (o *FileInfo) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -85,15 +85,15 @@ func (o *FileInfo) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FileInfo) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *FileInfo) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -118,8 +118,8 @@ func (o *FileInfo) GetSize() int32 { // GetSizeOk returns a tuple with the Size field value // and a boolean to check if the value has been set. func (o *FileInfo) GetSizeOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Size, true } @@ -131,10 +131,10 @@ func (o *FileInfo) SetSize(v int32) { func (o FileInfo) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Data != nil { + if !isNil(o.Data) { toSerialize["Data"] = o.Data } - if o.Name != nil { + if !isNil(o.Name) { toSerialize["Name"] = o.Name } if true { diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_hash_algorithm.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_hash_algorithm.go new file mode 100644 index 00000000..19a652de --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_hash_algorithm.go @@ -0,0 +1,113 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" + "fmt" +) + +// HashAlgorithm +type HashAlgorithm string + +// List of HashAlgorithm +const ( + HASHALGORITHM_SHA256 HashAlgorithm = "SHA256" + HASHALGORITHM_SHA512 HashAlgorithm = "SHA512" + HASHALGORITHM_SHA1 HashAlgorithm = "SHA1" +) + +// All allowed values of HashAlgorithm enum +var AllowedHashAlgorithmEnumValues = []HashAlgorithm{ + "SHA256", + "SHA512", + "SHA1", +} + +func (v *HashAlgorithm) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := HashAlgorithm(value) + for _, existing := range AllowedHashAlgorithmEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid HashAlgorithm", value) +} + +// NewHashAlgorithmFromValue returns a pointer to a valid HashAlgorithm +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewHashAlgorithmFromValue(v string) (*HashAlgorithm, error) { + ev := HashAlgorithm(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for HashAlgorithm: valid values are %v", v, AllowedHashAlgorithmEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v HashAlgorithm) IsValid() bool { + for _, existing := range AllowedHashAlgorithmEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to HashAlgorithm value +func (v HashAlgorithm) Ptr() *HashAlgorithm { + return &v +} + +type NullableHashAlgorithm struct { + value *HashAlgorithm + isSet bool +} + +func (v NullableHashAlgorithm) Get() *HashAlgorithm { + return v.value +} + +func (v *NullableHashAlgorithm) Set(val *HashAlgorithm) { + v.value = val + v.isSet = true +} + +func (v NullableHashAlgorithm) IsSet() bool { + return v.isSet +} + +func (v *NullableHashAlgorithm) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHashAlgorithm(val *HashAlgorithm) *NullableHashAlgorithm { + return &NullableHashAlgorithm{value: val, isSet: true} +} + +func (v NullableHashAlgorithm) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHashAlgorithm) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_http_attributes.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_attributes.go index beb5b0aa..800660c1 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_http_attributes.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_attributes.go @@ -20,6 +20,8 @@ type HttpAttributes struct { ResponseBody *string `json:"ResponseBody,omitempty"` // The HTTP response headers retrieved from the target ResponseHeaders *string `json:"ResponseHeaders,omitempty"` + // The URL of the HTTP Check. + Url *string `json:"Url,omitempty"` } // NewHttpAttributes instantiates a new HttpAttributes object @@ -41,7 +43,7 @@ func NewHttpAttributesWithDefaults() *HttpAttributes { // GetResponseBody returns the ResponseBody field value if set, zero value otherwise. func (o *HttpAttributes) GetResponseBody() string { - if o == nil || o.ResponseBody == nil { + if o == nil || isNil(o.ResponseBody) { var ret string return ret } @@ -51,15 +53,15 @@ func (o *HttpAttributes) GetResponseBody() string { // GetResponseBodyOk returns a tuple with the ResponseBody field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HttpAttributes) GetResponseBodyOk() (*string, bool) { - if o == nil || o.ResponseBody == nil { - return nil, false + if o == nil || isNil(o.ResponseBody) { + return nil, false } return o.ResponseBody, true } // HasResponseBody returns a boolean if a field has been set. func (o *HttpAttributes) HasResponseBody() bool { - if o != nil && o.ResponseBody != nil { + if o != nil && !isNil(o.ResponseBody) { return true } @@ -73,7 +75,7 @@ func (o *HttpAttributes) SetResponseBody(v string) { // GetResponseHeaders returns the ResponseHeaders field value if set, zero value otherwise. func (o *HttpAttributes) GetResponseHeaders() string { - if o == nil || o.ResponseHeaders == nil { + if o == nil || isNil(o.ResponseHeaders) { var ret string return ret } @@ -83,15 +85,15 @@ func (o *HttpAttributes) GetResponseHeaders() string { // GetResponseHeadersOk returns a tuple with the ResponseHeaders field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HttpAttributes) GetResponseHeadersOk() (*string, bool) { - if o == nil || o.ResponseHeaders == nil { - return nil, false + if o == nil || isNil(o.ResponseHeaders) { + return nil, false } return o.ResponseHeaders, true } // HasResponseHeaders returns a boolean if a field has been set. func (o *HttpAttributes) HasResponseHeaders() bool { - if o != nil && o.ResponseHeaders != nil { + if o != nil && !isNil(o.ResponseHeaders) { return true } @@ -103,14 +105,49 @@ func (o *HttpAttributes) SetResponseHeaders(v string) { o.ResponseHeaders = &v } +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *HttpAttributes) GetUrl() string { + if o == nil || isNil(o.Url) { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpAttributes) GetUrlOk() (*string, bool) { + if o == nil || isNil(o.Url) { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *HttpAttributes) HasUrl() bool { + if o != nil && !isNil(o.Url) { + return true + } + + return false +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *HttpAttributes) SetUrl(v string) { + o.Url = &v +} + func (o HttpAttributes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.ResponseBody != nil { + if !isNil(o.ResponseBody) { toSerialize["ResponseBody"] = o.ResponseBody } - if o.ResponseHeaders != nil { + if !isNil(o.ResponseHeaders) { toSerialize["ResponseHeaders"] = o.ResponseHeaders } + if !isNil(o.Url) { + toSerialize["Url"] = o.Url + } return json.Marshal(toSerialize) } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_http_check_details.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_check_details.go index 5446d935..ebac8104 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_http_check_details.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_check_details.go @@ -16,10 +16,14 @@ import ( // HttpCheckDetails struct for HttpCheckDetails type HttpCheckDetails struct { - Attributes *HttpAttributes `json:"Attributes,omitempty"` + Attributes *HttpCheckDetailsAttributes `json:"Attributes,omitempty"` + // Identifier Id int64 `json:"Id"` + // Object type Type *string `json:"Type,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + // Links related to the object Links *map[string]string `json:"Links,omitempty"` } @@ -42,9 +46,9 @@ func NewHttpCheckDetailsWithDefaults() *HttpCheckDetails { } // GetAttributes returns the Attributes field value if set, zero value otherwise. -func (o *HttpCheckDetails) GetAttributes() HttpAttributes { - if o == nil || o.Attributes == nil { - var ret HttpAttributes +func (o *HttpCheckDetails) GetAttributes() HttpCheckDetailsAttributes { + if o == nil || isNil(o.Attributes) { + var ret HttpCheckDetailsAttributes return ret } return *o.Attributes @@ -52,24 +56,24 @@ func (o *HttpCheckDetails) GetAttributes() HttpAttributes { // GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *HttpCheckDetails) GetAttributesOk() (*HttpAttributes, bool) { - if o == nil || o.Attributes == nil { - return nil, false +func (o *HttpCheckDetails) GetAttributesOk() (*HttpCheckDetailsAttributes, bool) { + if o == nil || isNil(o.Attributes) { + return nil, false } return o.Attributes, true } // HasAttributes returns a boolean if a field has been set. func (o *HttpCheckDetails) HasAttributes() bool { - if o != nil && o.Attributes != nil { + if o != nil && !isNil(o.Attributes) { return true } return false } -// SetAttributes gets a reference to the given HttpAttributes and assigns it to the Attributes field. -func (o *HttpCheckDetails) SetAttributes(v HttpAttributes) { +// SetAttributes gets a reference to the given HttpCheckDetailsAttributes and assigns it to the Attributes field. +func (o *HttpCheckDetails) SetAttributes(v HttpCheckDetailsAttributes) { o.Attributes = &v } @@ -86,8 +90,8 @@ func (o *HttpCheckDetails) GetId() int64 { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *HttpCheckDetails) GetIdOk() (*int64, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Id, true } @@ -99,7 +103,7 @@ func (o *HttpCheckDetails) SetId(v int64) { // GetType returns the Type field value if set, zero value otherwise. func (o *HttpCheckDetails) GetType() string { - if o == nil || o.Type == nil { + if o == nil || isNil(o.Type) { var ret string return ret } @@ -109,15 +113,15 @@ func (o *HttpCheckDetails) GetType() string { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HttpCheckDetails) GetTypeOk() (*string, bool) { - if o == nil || o.Type == nil { - return nil, false + if o == nil || isNil(o.Type) { + return nil, false } return o.Type, true } // HasType returns a boolean if a field has been set. func (o *HttpCheckDetails) HasType() bool { - if o != nil && o.Type != nil { + if o != nil && !isNil(o.Type) { return true } @@ -131,25 +135,25 @@ func (o *HttpCheckDetails) SetType(v string) { // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *HttpCheckDetails) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *HttpCheckDetails) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *HttpCheckDetails) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *HttpCheckDetails) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -158,12 +162,12 @@ func (o *HttpCheckDetails) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *HttpCheckDetails) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetLinks returns the Links field value if set, zero value otherwise. func (o *HttpCheckDetails) GetLinks() map[string]string { - if o == nil || o.Links == nil { + if o == nil || isNil(o.Links) { var ret map[string]string return ret } @@ -173,15 +177,15 @@ func (o *HttpCheckDetails) GetLinks() map[string]string { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HttpCheckDetails) GetLinksOk() (*map[string]string, bool) { - if o == nil || o.Links == nil { - return nil, false + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *HttpCheckDetails) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } @@ -195,19 +199,19 @@ func (o *HttpCheckDetails) SetLinks(v map[string]string) { func (o HttpCheckDetails) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Attributes != nil { + if !isNil(o.Attributes) { toSerialize["Attributes"] = o.Attributes } if true { toSerialize["Id"] = o.Id } - if o.Type != nil { + if !isNil(o.Type) { toSerialize["Type"] = o.Type } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_http_check_details_attributes.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_check_details_attributes.go new file mode 100644 index 00000000..d5f98957 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_check_details_attributes.go @@ -0,0 +1,190 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// HttpCheckDetailsAttributes Object attributes +type HttpCheckDetailsAttributes struct { + // The HTML code retrieved from the target + ResponseBody *string `json:"ResponseBody,omitempty"` + // The HTTP response headers retrieved from the target + ResponseHeaders *string `json:"ResponseHeaders,omitempty"` + // The URL of the HTTP Check. + Url *string `json:"Url,omitempty"` +} + +// NewHttpCheckDetailsAttributes instantiates a new HttpCheckDetailsAttributes object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHttpCheckDetailsAttributes() *HttpCheckDetailsAttributes { + this := HttpCheckDetailsAttributes{} + return &this +} + +// NewHttpCheckDetailsAttributesWithDefaults instantiates a new HttpCheckDetailsAttributes object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHttpCheckDetailsAttributesWithDefaults() *HttpCheckDetailsAttributes { + this := HttpCheckDetailsAttributes{} + return &this +} + +// GetResponseBody returns the ResponseBody field value if set, zero value otherwise. +func (o *HttpCheckDetailsAttributes) GetResponseBody() string { + if o == nil || isNil(o.ResponseBody) { + var ret string + return ret + } + return *o.ResponseBody +} + +// GetResponseBodyOk returns a tuple with the ResponseBody field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpCheckDetailsAttributes) GetResponseBodyOk() (*string, bool) { + if o == nil || isNil(o.ResponseBody) { + return nil, false + } + return o.ResponseBody, true +} + +// HasResponseBody returns a boolean if a field has been set. +func (o *HttpCheckDetailsAttributes) HasResponseBody() bool { + if o != nil && !isNil(o.ResponseBody) { + return true + } + + return false +} + +// SetResponseBody gets a reference to the given string and assigns it to the ResponseBody field. +func (o *HttpCheckDetailsAttributes) SetResponseBody(v string) { + o.ResponseBody = &v +} + +// GetResponseHeaders returns the ResponseHeaders field value if set, zero value otherwise. +func (o *HttpCheckDetailsAttributes) GetResponseHeaders() string { + if o == nil || isNil(o.ResponseHeaders) { + var ret string + return ret + } + return *o.ResponseHeaders +} + +// GetResponseHeadersOk returns a tuple with the ResponseHeaders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpCheckDetailsAttributes) GetResponseHeadersOk() (*string, bool) { + if o == nil || isNil(o.ResponseHeaders) { + return nil, false + } + return o.ResponseHeaders, true +} + +// HasResponseHeaders returns a boolean if a field has been set. +func (o *HttpCheckDetailsAttributes) HasResponseHeaders() bool { + if o != nil && !isNil(o.ResponseHeaders) { + return true + } + + return false +} + +// SetResponseHeaders gets a reference to the given string and assigns it to the ResponseHeaders field. +func (o *HttpCheckDetailsAttributes) SetResponseHeaders(v string) { + o.ResponseHeaders = &v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *HttpCheckDetailsAttributes) GetUrl() string { + if o == nil || isNil(o.Url) { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpCheckDetailsAttributes) GetUrlOk() (*string, bool) { + if o == nil || isNil(o.Url) { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *HttpCheckDetailsAttributes) HasUrl() bool { + if o != nil && !isNil(o.Url) { + return true + } + + return false +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *HttpCheckDetailsAttributes) SetUrl(v string) { + o.Url = &v +} + +func (o HttpCheckDetailsAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.ResponseBody) { + toSerialize["ResponseBody"] = o.ResponseBody + } + if !isNil(o.ResponseHeaders) { + toSerialize["ResponseHeaders"] = o.ResponseHeaders + } + if !isNil(o.Url) { + toSerialize["Url"] = o.Url + } + return json.Marshal(toSerialize) +} + +type NullableHttpCheckDetailsAttributes struct { + value *HttpCheckDetailsAttributes + isSet bool +} + +func (v NullableHttpCheckDetailsAttributes) Get() *HttpCheckDetailsAttributes { + return v.value +} + +func (v *NullableHttpCheckDetailsAttributes) Set(val *HttpCheckDetailsAttributes) { + v.value = val + v.isSet = true +} + +func (v NullableHttpCheckDetailsAttributes) IsSet() bool { + return v.isSet +} + +func (v *NullableHttpCheckDetailsAttributes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHttpCheckDetailsAttributes(val *HttpCheckDetailsAttributes) *NullableHttpCheckDetailsAttributes { + return &NullableHttpCheckDetailsAttributes{value: val, isSet: true} +} + +func (v NullableHttpCheckDetailsAttributes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHttpCheckDetailsAttributes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_http_details_response.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_details_response.go index 95632b82..7df4a16b 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_http_details_response.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_details_response.go @@ -16,10 +16,11 @@ import ( // HttpDetailsResponse struct for HttpDetailsResponse type HttpDetailsResponse struct { - Data *HttpCheckDetails `json:"Data,omitempty"` - Links *LinksData `json:"Links,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` - Meta *MetaData `json:"Meta,omitempty"` + Data *HttpDetailsResponseData `json:"Data,omitempty"` + Links *StatisticsResponseLinks `json:"Links,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + Meta *StatisticsResponseMeta `json:"Meta,omitempty"` } // NewHttpDetailsResponse instantiates a new HttpDetailsResponse object @@ -40,9 +41,9 @@ func NewHttpDetailsResponseWithDefaults() *HttpDetailsResponse { } // GetData returns the Data field value if set, zero value otherwise. -func (o *HttpDetailsResponse) GetData() HttpCheckDetails { - if o == nil || o.Data == nil { - var ret HttpCheckDetails +func (o *HttpDetailsResponse) GetData() HttpDetailsResponseData { + if o == nil || isNil(o.Data) { + var ret HttpDetailsResponseData return ret } return *o.Data @@ -50,31 +51,31 @@ func (o *HttpDetailsResponse) GetData() HttpCheckDetails { // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *HttpDetailsResponse) GetDataOk() (*HttpCheckDetails, bool) { - if o == nil || o.Data == nil { - return nil, false +func (o *HttpDetailsResponse) GetDataOk() (*HttpDetailsResponseData, bool) { + if o == nil || isNil(o.Data) { + return nil, false } return o.Data, true } // HasData returns a boolean if a field has been set. func (o *HttpDetailsResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && !isNil(o.Data) { return true } return false } -// SetData gets a reference to the given HttpCheckDetails and assigns it to the Data field. -func (o *HttpDetailsResponse) SetData(v HttpCheckDetails) { +// SetData gets a reference to the given HttpDetailsResponseData and assigns it to the Data field. +func (o *HttpDetailsResponse) SetData(v HttpDetailsResponseData) { o.Data = &v } // GetLinks returns the Links field value if set, zero value otherwise. -func (o *HttpDetailsResponse) GetLinks() LinksData { - if o == nil || o.Links == nil { - var ret LinksData +func (o *HttpDetailsResponse) GetLinks() StatisticsResponseLinks { + if o == nil || isNil(o.Links) { + var ret StatisticsResponseLinks return ret } return *o.Links @@ -82,48 +83,48 @@ func (o *HttpDetailsResponse) GetLinks() LinksData { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *HttpDetailsResponse) GetLinksOk() (*LinksData, bool) { - if o == nil || o.Links == nil { - return nil, false +func (o *HttpDetailsResponse) GetLinksOk() (*StatisticsResponseLinks, bool) { + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *HttpDetailsResponse) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } return false } -// SetLinks gets a reference to the given LinksData and assigns it to the Links field. -func (o *HttpDetailsResponse) SetLinks(v LinksData) { +// SetLinks gets a reference to the given StatisticsResponseLinks and assigns it to the Links field. +func (o *HttpDetailsResponse) SetLinks(v StatisticsResponseLinks) { o.Links = &v } // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *HttpDetailsResponse) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *HttpDetailsResponse) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *HttpDetailsResponse) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *HttpDetailsResponse) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -132,13 +133,13 @@ func (o *HttpDetailsResponse) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *HttpDetailsResponse) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetMeta returns the Meta field value if set, zero value otherwise. -func (o *HttpDetailsResponse) GetMeta() MetaData { - if o == nil || o.Meta == nil { - var ret MetaData +func (o *HttpDetailsResponse) GetMeta() StatisticsResponseMeta { + if o == nil || isNil(o.Meta) { + var ret StatisticsResponseMeta return ret } return *o.Meta @@ -146,39 +147,39 @@ func (o *HttpDetailsResponse) GetMeta() MetaData { // GetMetaOk returns a tuple with the Meta field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *HttpDetailsResponse) GetMetaOk() (*MetaData, bool) { - if o == nil || o.Meta == nil { - return nil, false +func (o *HttpDetailsResponse) GetMetaOk() (*StatisticsResponseMeta, bool) { + if o == nil || isNil(o.Meta) { + return nil, false } return o.Meta, true } // HasMeta returns a boolean if a field has been set. func (o *HttpDetailsResponse) HasMeta() bool { - if o != nil && o.Meta != nil { + if o != nil && !isNil(o.Meta) { return true } return false } -// SetMeta gets a reference to the given MetaData and assigns it to the Meta field. -func (o *HttpDetailsResponse) SetMeta(v MetaData) { +// SetMeta gets a reference to the given StatisticsResponseMeta and assigns it to the Meta field. +func (o *HttpDetailsResponse) SetMeta(v StatisticsResponseMeta) { o.Meta = &v } func (o HttpDetailsResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Data != nil { + if !isNil(o.Data) { toSerialize["Data"] = o.Data } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Meta != nil { + if !isNil(o.Meta) { toSerialize["Meta"] = o.Meta } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_http_details_response_data.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_details_response_data.go new file mode 100644 index 00000000..135ce00a --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_details_response_data.go @@ -0,0 +1,256 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// HttpDetailsResponseData The resposne data/monitor checks +type HttpDetailsResponseData struct { + Attributes *HttpCheckDetailsAttributes `json:"Attributes,omitempty"` + // Identifier + Id int64 `json:"Id"` + // Object type + Type *string `json:"Type,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + // Links related to the object + Links *map[string]string `json:"Links,omitempty"` +} + +// NewHttpDetailsResponseData instantiates a new HttpDetailsResponseData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHttpDetailsResponseData(id int64) *HttpDetailsResponseData { + this := HttpDetailsResponseData{} + this.Id = id + return &this +} + +// NewHttpDetailsResponseDataWithDefaults instantiates a new HttpDetailsResponseData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHttpDetailsResponseDataWithDefaults() *HttpDetailsResponseData { + this := HttpDetailsResponseData{} + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *HttpDetailsResponseData) GetAttributes() HttpCheckDetailsAttributes { + if o == nil || isNil(o.Attributes) { + var ret HttpCheckDetailsAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpDetailsResponseData) GetAttributesOk() (*HttpCheckDetailsAttributes, bool) { + if o == nil || isNil(o.Attributes) { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *HttpDetailsResponseData) HasAttributes() bool { + if o != nil && !isNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given HttpCheckDetailsAttributes and assigns it to the Attributes field. +func (o *HttpDetailsResponseData) SetAttributes(v HttpCheckDetailsAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value +func (o *HttpDetailsResponseData) GetId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *HttpDetailsResponseData) GetIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *HttpDetailsResponseData) SetId(v int64) { + o.Id = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *HttpDetailsResponseData) GetType() string { + if o == nil || isNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpDetailsResponseData) GetTypeOk() (*string, bool) { + if o == nil || isNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *HttpDetailsResponseData) HasType() bool { + if o != nil && !isNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *HttpDetailsResponseData) SetType(v string) { + o.Type = &v +} + +// GetRelationships returns the Relationships field value if set, zero value otherwise. +func (o *HttpDetailsResponseData) GetRelationships() []RelationObject { + if o == nil || isNil(o.Relationships) { + var ret []RelationObject + return ret + } + return o.Relationships +} + +// GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpDetailsResponseData) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false + } + return o.Relationships, true +} + +// HasRelationships returns a boolean if a field has been set. +func (o *HttpDetailsResponseData) HasRelationships() bool { + if o != nil && !isNil(o.Relationships) { + return true + } + + return false +} + +// SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. +func (o *HttpDetailsResponseData) SetRelationships(v []RelationObject) { + o.Relationships = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *HttpDetailsResponseData) GetLinks() map[string]string { + if o == nil || isNil(o.Links) { + var ret map[string]string + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpDetailsResponseData) GetLinksOk() (*map[string]string, bool) { + if o == nil || isNil(o.Links) { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *HttpDetailsResponseData) HasLinks() bool { + if o != nil && !isNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given map[string]string and assigns it to the Links field. +func (o *HttpDetailsResponseData) SetLinks(v map[string]string) { + o.Links = &v +} + +func (o HttpDetailsResponseData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Attributes) { + toSerialize["Attributes"] = o.Attributes + } + if true { + toSerialize["Id"] = o.Id + } + if !isNil(o.Type) { + toSerialize["Type"] = o.Type + } + if !isNil(o.Relationships) { + toSerialize["Relationships"] = o.Relationships + } + if !isNil(o.Links) { + toSerialize["Links"] = o.Links + } + return json.Marshal(toSerialize) +} + +type NullableHttpDetailsResponseData struct { + value *HttpDetailsResponseData + isSet bool +} + +func (v NullableHttpDetailsResponseData) Get() *HttpDetailsResponseData { + return v.value +} + +func (v *NullableHttpDetailsResponseData) Set(val *HttpDetailsResponseData) { + v.value = val + v.isSet = true +} + +func (v NullableHttpDetailsResponseData) IsSet() bool { + return v.isSet +} + +func (v *NullableHttpDetailsResponseData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHttpDetailsResponseData(val *HttpDetailsResponseData) *NullableHttpDetailsResponseData { + return &NullableHttpDetailsResponseData{value: val, isSet: true} +} + +func (v NullableHttpDetailsResponseData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHttpDetailsResponseData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_attributes.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_attributes.go index a5511a5c..79d94b64 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_attributes.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_attributes.go @@ -17,9 +17,8 @@ import ( // HttpEngineAttributes HttpEngineAttributes describes the attributes of a Multi-step Api monitor check type HttpEngineAttributes struct { // The results of the steps - StepResults *[]HttpEngineStep `json:"StepResults,omitempty"` - // Timing info - TimingInfo *StepTimingInfo `json:"TimingInfo,omitempty"` + StepResults []HttpEngineStep `json:"StepResults,omitempty"` + TimingInfo *HttpEngineAttributesTimingInfo `json:"TimingInfo,omitempty"` // Number of total steps TotalSteps int32 `json:"TotalSteps"` // Number of passed/succeed tests @@ -47,25 +46,25 @@ func NewHttpEngineAttributesWithDefaults() *HttpEngineAttributes { // GetStepResults returns the StepResults field value if set, zero value otherwise. func (o *HttpEngineAttributes) GetStepResults() []HttpEngineStep { - if o == nil || o.StepResults == nil { + if o == nil || isNil(o.StepResults) { var ret []HttpEngineStep return ret } - return *o.StepResults + return o.StepResults } // GetStepResultsOk returns a tuple with the StepResults field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *HttpEngineAttributes) GetStepResultsOk() (*[]HttpEngineStep, bool) { - if o == nil || o.StepResults == nil { - return nil, false +func (o *HttpEngineAttributes) GetStepResultsOk() ([]HttpEngineStep, bool) { + if o == nil || isNil(o.StepResults) { + return nil, false } return o.StepResults, true } // HasStepResults returns a boolean if a field has been set. func (o *HttpEngineAttributes) HasStepResults() bool { - if o != nil && o.StepResults != nil { + if o != nil && !isNil(o.StepResults) { return true } @@ -74,13 +73,13 @@ func (o *HttpEngineAttributes) HasStepResults() bool { // SetStepResults gets a reference to the given []HttpEngineStep and assigns it to the StepResults field. func (o *HttpEngineAttributes) SetStepResults(v []HttpEngineStep) { - o.StepResults = &v + o.StepResults = v } // GetTimingInfo returns the TimingInfo field value if set, zero value otherwise. -func (o *HttpEngineAttributes) GetTimingInfo() StepTimingInfo { - if o == nil || o.TimingInfo == nil { - var ret StepTimingInfo +func (o *HttpEngineAttributes) GetTimingInfo() HttpEngineAttributesTimingInfo { + if o == nil || isNil(o.TimingInfo) { + var ret HttpEngineAttributesTimingInfo return ret } return *o.TimingInfo @@ -88,24 +87,24 @@ func (o *HttpEngineAttributes) GetTimingInfo() StepTimingInfo { // GetTimingInfoOk returns a tuple with the TimingInfo field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *HttpEngineAttributes) GetTimingInfoOk() (*StepTimingInfo, bool) { - if o == nil || o.TimingInfo == nil { - return nil, false +func (o *HttpEngineAttributes) GetTimingInfoOk() (*HttpEngineAttributesTimingInfo, bool) { + if o == nil || isNil(o.TimingInfo) { + return nil, false } return o.TimingInfo, true } // HasTimingInfo returns a boolean if a field has been set. func (o *HttpEngineAttributes) HasTimingInfo() bool { - if o != nil && o.TimingInfo != nil { + if o != nil && !isNil(o.TimingInfo) { return true } return false } -// SetTimingInfo gets a reference to the given StepTimingInfo and assigns it to the TimingInfo field. -func (o *HttpEngineAttributes) SetTimingInfo(v StepTimingInfo) { +// SetTimingInfo gets a reference to the given HttpEngineAttributesTimingInfo and assigns it to the TimingInfo field. +func (o *HttpEngineAttributes) SetTimingInfo(v HttpEngineAttributesTimingInfo) { o.TimingInfo = &v } @@ -122,8 +121,8 @@ func (o *HttpEngineAttributes) GetTotalSteps() int32 { // GetTotalStepsOk returns a tuple with the TotalSteps field value // and a boolean to check if the value has been set. func (o *HttpEngineAttributes) GetTotalStepsOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.TotalSteps, true } @@ -146,8 +145,8 @@ func (o *HttpEngineAttributes) GetPassedSteps() int32 { // GetPassedStepsOk returns a tuple with the PassedSteps field value // and a boolean to check if the value has been set. func (o *HttpEngineAttributes) GetPassedStepsOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.PassedSteps, true } @@ -159,10 +158,10 @@ func (o *HttpEngineAttributes) SetPassedSteps(v int32) { func (o HttpEngineAttributes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.StepResults != nil { + if !isNil(o.StepResults) { toSerialize["StepResults"] = o.StepResults } - if o.TimingInfo != nil { + if !isNil(o.TimingInfo) { toSerialize["TimingInfo"] = o.TimingInfo } if true { diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_attributes_timing_info.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_attributes_timing_info.go new file mode 100644 index 00000000..5cb00f07 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_attributes_timing_info.go @@ -0,0 +1,297 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// HttpEngineAttributesTimingInfo Timing info +type HttpEngineAttributesTimingInfo struct { + Description *string `json:"Description,omitempty"` + StartUtc map[string]interface{} `json:"StartUtc"` + EndUtc map[string]interface{} `json:"EndUtc"` + ElapsedMilliseconds int64 `json:"ElapsedMilliseconds"` + DelayMilliseconds int64 `json:"DelayMilliseconds"` + SubTimingInfos []StepTimingInfo `json:"SubTimingInfos,omitempty"` + // If true, this TimingInfo should be counted as part of the sum of its siblings. If false, the TimingInfo should be discarded (e.g. for PreDelays we don't want to count). + IsValid bool `json:"IsValid"` +} + +// NewHttpEngineAttributesTimingInfo instantiates a new HttpEngineAttributesTimingInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHttpEngineAttributesTimingInfo(startUtc map[string]interface{}, endUtc map[string]interface{}, elapsedMilliseconds int64, delayMilliseconds int64, isValid bool) *HttpEngineAttributesTimingInfo { + this := HttpEngineAttributesTimingInfo{} + this.StartUtc = startUtc + this.EndUtc = endUtc + this.ElapsedMilliseconds = elapsedMilliseconds + this.DelayMilliseconds = delayMilliseconds + this.IsValid = isValid + return &this +} + +// NewHttpEngineAttributesTimingInfoWithDefaults instantiates a new HttpEngineAttributesTimingInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHttpEngineAttributesTimingInfoWithDefaults() *HttpEngineAttributesTimingInfo { + this := HttpEngineAttributesTimingInfo{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *HttpEngineAttributesTimingInfo) GetDescription() string { + if o == nil || isNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpEngineAttributesTimingInfo) GetDescriptionOk() (*string, bool) { + if o == nil || isNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *HttpEngineAttributesTimingInfo) HasDescription() bool { + if o != nil && !isNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *HttpEngineAttributesTimingInfo) SetDescription(v string) { + o.Description = &v +} + +// GetStartUtc returns the StartUtc field value +func (o *HttpEngineAttributesTimingInfo) GetStartUtc() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.StartUtc +} + +// GetStartUtcOk returns a tuple with the StartUtc field value +// and a boolean to check if the value has been set. +func (o *HttpEngineAttributesTimingInfo) GetStartUtcOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.StartUtc, true +} + +// SetStartUtc sets field value +func (o *HttpEngineAttributesTimingInfo) SetStartUtc(v map[string]interface{}) { + o.StartUtc = v +} + +// GetEndUtc returns the EndUtc field value +func (o *HttpEngineAttributesTimingInfo) GetEndUtc() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.EndUtc +} + +// GetEndUtcOk returns a tuple with the EndUtc field value +// and a boolean to check if the value has been set. +func (o *HttpEngineAttributesTimingInfo) GetEndUtcOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.EndUtc, true +} + +// SetEndUtc sets field value +func (o *HttpEngineAttributesTimingInfo) SetEndUtc(v map[string]interface{}) { + o.EndUtc = v +} + +// GetElapsedMilliseconds returns the ElapsedMilliseconds field value +func (o *HttpEngineAttributesTimingInfo) GetElapsedMilliseconds() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ElapsedMilliseconds +} + +// GetElapsedMillisecondsOk returns a tuple with the ElapsedMilliseconds field value +// and a boolean to check if the value has been set. +func (o *HttpEngineAttributesTimingInfo) GetElapsedMillisecondsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ElapsedMilliseconds, true +} + +// SetElapsedMilliseconds sets field value +func (o *HttpEngineAttributesTimingInfo) SetElapsedMilliseconds(v int64) { + o.ElapsedMilliseconds = v +} + +// GetDelayMilliseconds returns the DelayMilliseconds field value +func (o *HttpEngineAttributesTimingInfo) GetDelayMilliseconds() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DelayMilliseconds +} + +// GetDelayMillisecondsOk returns a tuple with the DelayMilliseconds field value +// and a boolean to check if the value has been set. +func (o *HttpEngineAttributesTimingInfo) GetDelayMillisecondsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DelayMilliseconds, true +} + +// SetDelayMilliseconds sets field value +func (o *HttpEngineAttributesTimingInfo) SetDelayMilliseconds(v int64) { + o.DelayMilliseconds = v +} + +// GetSubTimingInfos returns the SubTimingInfos field value if set, zero value otherwise. +func (o *HttpEngineAttributesTimingInfo) GetSubTimingInfos() []StepTimingInfo { + if o == nil || isNil(o.SubTimingInfos) { + var ret []StepTimingInfo + return ret + } + return o.SubTimingInfos +} + +// GetSubTimingInfosOk returns a tuple with the SubTimingInfos field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpEngineAttributesTimingInfo) GetSubTimingInfosOk() ([]StepTimingInfo, bool) { + if o == nil || isNil(o.SubTimingInfos) { + return nil, false + } + return o.SubTimingInfos, true +} + +// HasSubTimingInfos returns a boolean if a field has been set. +func (o *HttpEngineAttributesTimingInfo) HasSubTimingInfos() bool { + if o != nil && !isNil(o.SubTimingInfos) { + return true + } + + return false +} + +// SetSubTimingInfos gets a reference to the given []StepTimingInfo and assigns it to the SubTimingInfos field. +func (o *HttpEngineAttributesTimingInfo) SetSubTimingInfos(v []StepTimingInfo) { + o.SubTimingInfos = v +} + +// GetIsValid returns the IsValid field value +func (o *HttpEngineAttributesTimingInfo) GetIsValid() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsValid +} + +// GetIsValidOk returns a tuple with the IsValid field value +// and a boolean to check if the value has been set. +func (o *HttpEngineAttributesTimingInfo) GetIsValidOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsValid, true +} + +// SetIsValid sets field value +func (o *HttpEngineAttributesTimingInfo) SetIsValid(v bool) { + o.IsValid = v +} + +func (o HttpEngineAttributesTimingInfo) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Description) { + toSerialize["Description"] = o.Description + } + if true { + toSerialize["StartUtc"] = o.StartUtc + } + if true { + toSerialize["EndUtc"] = o.EndUtc + } + if true { + toSerialize["ElapsedMilliseconds"] = o.ElapsedMilliseconds + } + if true { + toSerialize["DelayMilliseconds"] = o.DelayMilliseconds + } + if !isNil(o.SubTimingInfos) { + toSerialize["SubTimingInfos"] = o.SubTimingInfos + } + if true { + toSerialize["IsValid"] = o.IsValid + } + return json.Marshal(toSerialize) +} + +type NullableHttpEngineAttributesTimingInfo struct { + value *HttpEngineAttributesTimingInfo + isSet bool +} + +func (v NullableHttpEngineAttributesTimingInfo) Get() *HttpEngineAttributesTimingInfo { + return v.value +} + +func (v *NullableHttpEngineAttributesTimingInfo) Set(val *HttpEngineAttributesTimingInfo) { + v.value = val + v.isSet = true +} + +func (v NullableHttpEngineAttributesTimingInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableHttpEngineAttributesTimingInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHttpEngineAttributesTimingInfo(val *HttpEngineAttributesTimingInfo) *NullableHttpEngineAttributesTimingInfo { + return &NullableHttpEngineAttributesTimingInfo{value: val, isSet: true} +} + +func (v NullableHttpEngineAttributesTimingInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHttpEngineAttributesTimingInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_check_details.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_check_details.go index 705e58b7..6b61e4fb 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_check_details.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_check_details.go @@ -16,10 +16,14 @@ import ( // HttpEngineCheckDetails struct for HttpEngineCheckDetails type HttpEngineCheckDetails struct { - Attributes *HttpEngineAttributes `json:"Attributes,omitempty"` + Attributes *HttpEngineCheckDetailsAttributes `json:"Attributes,omitempty"` + // Identifier Id int64 `json:"Id"` + // Object type Type *string `json:"Type,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + // Links related to the object Links *map[string]string `json:"Links,omitempty"` } @@ -42,9 +46,9 @@ func NewHttpEngineCheckDetailsWithDefaults() *HttpEngineCheckDetails { } // GetAttributes returns the Attributes field value if set, zero value otherwise. -func (o *HttpEngineCheckDetails) GetAttributes() HttpEngineAttributes { - if o == nil || o.Attributes == nil { - var ret HttpEngineAttributes +func (o *HttpEngineCheckDetails) GetAttributes() HttpEngineCheckDetailsAttributes { + if o == nil || isNil(o.Attributes) { + var ret HttpEngineCheckDetailsAttributes return ret } return *o.Attributes @@ -52,24 +56,24 @@ func (o *HttpEngineCheckDetails) GetAttributes() HttpEngineAttributes { // GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *HttpEngineCheckDetails) GetAttributesOk() (*HttpEngineAttributes, bool) { - if o == nil || o.Attributes == nil { - return nil, false +func (o *HttpEngineCheckDetails) GetAttributesOk() (*HttpEngineCheckDetailsAttributes, bool) { + if o == nil || isNil(o.Attributes) { + return nil, false } return o.Attributes, true } // HasAttributes returns a boolean if a field has been set. func (o *HttpEngineCheckDetails) HasAttributes() bool { - if o != nil && o.Attributes != nil { + if o != nil && !isNil(o.Attributes) { return true } return false } -// SetAttributes gets a reference to the given HttpEngineAttributes and assigns it to the Attributes field. -func (o *HttpEngineCheckDetails) SetAttributes(v HttpEngineAttributes) { +// SetAttributes gets a reference to the given HttpEngineCheckDetailsAttributes and assigns it to the Attributes field. +func (o *HttpEngineCheckDetails) SetAttributes(v HttpEngineCheckDetailsAttributes) { o.Attributes = &v } @@ -86,8 +90,8 @@ func (o *HttpEngineCheckDetails) GetId() int64 { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *HttpEngineCheckDetails) GetIdOk() (*int64, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Id, true } @@ -99,7 +103,7 @@ func (o *HttpEngineCheckDetails) SetId(v int64) { // GetType returns the Type field value if set, zero value otherwise. func (o *HttpEngineCheckDetails) GetType() string { - if o == nil || o.Type == nil { + if o == nil || isNil(o.Type) { var ret string return ret } @@ -109,15 +113,15 @@ func (o *HttpEngineCheckDetails) GetType() string { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HttpEngineCheckDetails) GetTypeOk() (*string, bool) { - if o == nil || o.Type == nil { - return nil, false + if o == nil || isNil(o.Type) { + return nil, false } return o.Type, true } // HasType returns a boolean if a field has been set. func (o *HttpEngineCheckDetails) HasType() bool { - if o != nil && o.Type != nil { + if o != nil && !isNil(o.Type) { return true } @@ -131,25 +135,25 @@ func (o *HttpEngineCheckDetails) SetType(v string) { // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *HttpEngineCheckDetails) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *HttpEngineCheckDetails) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *HttpEngineCheckDetails) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *HttpEngineCheckDetails) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -158,12 +162,12 @@ func (o *HttpEngineCheckDetails) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *HttpEngineCheckDetails) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetLinks returns the Links field value if set, zero value otherwise. func (o *HttpEngineCheckDetails) GetLinks() map[string]string { - if o == nil || o.Links == nil { + if o == nil || isNil(o.Links) { var ret map[string]string return ret } @@ -173,15 +177,15 @@ func (o *HttpEngineCheckDetails) GetLinks() map[string]string { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HttpEngineCheckDetails) GetLinksOk() (*map[string]string, bool) { - if o == nil || o.Links == nil { - return nil, false + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *HttpEngineCheckDetails) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } @@ -195,19 +199,19 @@ func (o *HttpEngineCheckDetails) SetLinks(v map[string]string) { func (o HttpEngineCheckDetails) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Attributes != nil { + if !isNil(o.Attributes) { toSerialize["Attributes"] = o.Attributes } if true { toSerialize["Id"] = o.Id } - if o.Type != nil { + if !isNil(o.Type) { toSerialize["Type"] = o.Type } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_check_details_attributes.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_check_details_attributes.go new file mode 100644 index 00000000..c2c396d0 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_check_details_attributes.go @@ -0,0 +1,212 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// HttpEngineCheckDetailsAttributes Object attributes +type HttpEngineCheckDetailsAttributes struct { + // The results of the steps + StepResults []HttpEngineStep `json:"StepResults,omitempty"` + TimingInfo *HttpEngineAttributesTimingInfo `json:"TimingInfo,omitempty"` + // Number of total steps + TotalSteps int32 `json:"TotalSteps"` + // Number of passed/succeed tests + PassedSteps int32 `json:"PassedSteps"` +} + +// NewHttpEngineCheckDetailsAttributes instantiates a new HttpEngineCheckDetailsAttributes object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHttpEngineCheckDetailsAttributes(totalSteps int32, passedSteps int32) *HttpEngineCheckDetailsAttributes { + this := HttpEngineCheckDetailsAttributes{} + this.TotalSteps = totalSteps + this.PassedSteps = passedSteps + return &this +} + +// NewHttpEngineCheckDetailsAttributesWithDefaults instantiates a new HttpEngineCheckDetailsAttributes object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHttpEngineCheckDetailsAttributesWithDefaults() *HttpEngineCheckDetailsAttributes { + this := HttpEngineCheckDetailsAttributes{} + return &this +} + +// GetStepResults returns the StepResults field value if set, zero value otherwise. +func (o *HttpEngineCheckDetailsAttributes) GetStepResults() []HttpEngineStep { + if o == nil || isNil(o.StepResults) { + var ret []HttpEngineStep + return ret + } + return o.StepResults +} + +// GetStepResultsOk returns a tuple with the StepResults field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpEngineCheckDetailsAttributes) GetStepResultsOk() ([]HttpEngineStep, bool) { + if o == nil || isNil(o.StepResults) { + return nil, false + } + return o.StepResults, true +} + +// HasStepResults returns a boolean if a field has been set. +func (o *HttpEngineCheckDetailsAttributes) HasStepResults() bool { + if o != nil && !isNil(o.StepResults) { + return true + } + + return false +} + +// SetStepResults gets a reference to the given []HttpEngineStep and assigns it to the StepResults field. +func (o *HttpEngineCheckDetailsAttributes) SetStepResults(v []HttpEngineStep) { + o.StepResults = v +} + +// GetTimingInfo returns the TimingInfo field value if set, zero value otherwise. +func (o *HttpEngineCheckDetailsAttributes) GetTimingInfo() HttpEngineAttributesTimingInfo { + if o == nil || isNil(o.TimingInfo) { + var ret HttpEngineAttributesTimingInfo + return ret + } + return *o.TimingInfo +} + +// GetTimingInfoOk returns a tuple with the TimingInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpEngineCheckDetailsAttributes) GetTimingInfoOk() (*HttpEngineAttributesTimingInfo, bool) { + if o == nil || isNil(o.TimingInfo) { + return nil, false + } + return o.TimingInfo, true +} + +// HasTimingInfo returns a boolean if a field has been set. +func (o *HttpEngineCheckDetailsAttributes) HasTimingInfo() bool { + if o != nil && !isNil(o.TimingInfo) { + return true + } + + return false +} + +// SetTimingInfo gets a reference to the given HttpEngineAttributesTimingInfo and assigns it to the TimingInfo field. +func (o *HttpEngineCheckDetailsAttributes) SetTimingInfo(v HttpEngineAttributesTimingInfo) { + o.TimingInfo = &v +} + +// GetTotalSteps returns the TotalSteps field value +func (o *HttpEngineCheckDetailsAttributes) GetTotalSteps() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.TotalSteps +} + +// GetTotalStepsOk returns a tuple with the TotalSteps field value +// and a boolean to check if the value has been set. +func (o *HttpEngineCheckDetailsAttributes) GetTotalStepsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TotalSteps, true +} + +// SetTotalSteps sets field value +func (o *HttpEngineCheckDetailsAttributes) SetTotalSteps(v int32) { + o.TotalSteps = v +} + +// GetPassedSteps returns the PassedSteps field value +func (o *HttpEngineCheckDetailsAttributes) GetPassedSteps() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PassedSteps +} + +// GetPassedStepsOk returns a tuple with the PassedSteps field value +// and a boolean to check if the value has been set. +func (o *HttpEngineCheckDetailsAttributes) GetPassedStepsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PassedSteps, true +} + +// SetPassedSteps sets field value +func (o *HttpEngineCheckDetailsAttributes) SetPassedSteps(v int32) { + o.PassedSteps = v +} + +func (o HttpEngineCheckDetailsAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.StepResults) { + toSerialize["StepResults"] = o.StepResults + } + if !isNil(o.TimingInfo) { + toSerialize["TimingInfo"] = o.TimingInfo + } + if true { + toSerialize["TotalSteps"] = o.TotalSteps + } + if true { + toSerialize["PassedSteps"] = o.PassedSteps + } + return json.Marshal(toSerialize) +} + +type NullableHttpEngineCheckDetailsAttributes struct { + value *HttpEngineCheckDetailsAttributes + isSet bool +} + +func (v NullableHttpEngineCheckDetailsAttributes) Get() *HttpEngineCheckDetailsAttributes { + return v.value +} + +func (v *NullableHttpEngineCheckDetailsAttributes) Set(val *HttpEngineCheckDetailsAttributes) { + v.value = val + v.isSet = true +} + +func (v NullableHttpEngineCheckDetailsAttributes) IsSet() bool { + return v.isSet +} + +func (v *NullableHttpEngineCheckDetailsAttributes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHttpEngineCheckDetailsAttributes(val *HttpEngineCheckDetailsAttributes) *NullableHttpEngineCheckDetailsAttributes { + return &NullableHttpEngineCheckDetailsAttributes{value: val, isSet: true} +} + +func (v NullableHttpEngineCheckDetailsAttributes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHttpEngineCheckDetailsAttributes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_step.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_step.go index 72836aa5..c7e58424 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_step.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_step.go @@ -14,7 +14,7 @@ import ( "encoding/json" ) -// HttpEngineStep HttpEngineStep descriobes the results of a step in a Multi-step Api monitor +// HttpEngineStep HttpEngineStep describes the results of a step in a Multi-step Api monitor type HttpEngineStep struct { // The name of the step StepName *string `json:"StepName,omitempty"` @@ -30,8 +30,7 @@ type HttpEngineStep struct { ResponseCompleted bool `json:"ResponseCompleted"` // Was this step executed? StepExecuted bool `json:"StepExecuted"` - // Results of the assertions in this step - AssertionResultsInfo *AssertionResultsInfo `json:"AssertionResultsInfo,omitempty"` + AssertionResultsInfo *HttpEngineStepAssertionResultsInfo `json:"AssertionResultsInfo,omitempty"` // Number of milliseconds it took for this step to succeed TotalTime int64 `json:"TotalTime"` // Response headers @@ -42,6 +41,8 @@ type HttpEngineStep struct { RequestHeaders *string `json:"RequestHeaders,omitempty"` // Request body send RequestBody *string `json:"RequestBody,omitempty"` + // Resolved IP address + ResolvedIpAddress *string `json:"ResolvedIpAddress,omitempty"` } // NewHttpEngineStep instantiates a new HttpEngineStep object @@ -66,7 +67,7 @@ func NewHttpEngineStepWithDefaults() *HttpEngineStep { // GetStepName returns the StepName field value if set, zero value otherwise. func (o *HttpEngineStep) GetStepName() string { - if o == nil || o.StepName == nil { + if o == nil || isNil(o.StepName) { var ret string return ret } @@ -76,15 +77,15 @@ func (o *HttpEngineStep) GetStepName() string { // GetStepNameOk returns a tuple with the StepName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HttpEngineStep) GetStepNameOk() (*string, bool) { - if o == nil || o.StepName == nil { - return nil, false + if o == nil || isNil(o.StepName) { + return nil, false } return o.StepName, true } // HasStepName returns a boolean if a field has been set. func (o *HttpEngineStep) HasStepName() bool { - if o != nil && o.StepName != nil { + if o != nil && !isNil(o.StepName) { return true } @@ -98,7 +99,7 @@ func (o *HttpEngineStep) SetStepName(v string) { // GetUrl returns the Url field value if set, zero value otherwise. func (o *HttpEngineStep) GetUrl() string { - if o == nil || o.Url == nil { + if o == nil || isNil(o.Url) { var ret string return ret } @@ -108,15 +109,15 @@ func (o *HttpEngineStep) GetUrl() string { // GetUrlOk returns a tuple with the Url field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HttpEngineStep) GetUrlOk() (*string, bool) { - if o == nil || o.Url == nil { - return nil, false + if o == nil || isNil(o.Url) { + return nil, false } return o.Url, true } // HasUrl returns a boolean if a field has been set. func (o *HttpEngineStep) HasUrl() bool { - if o != nil && o.Url != nil { + if o != nil && !isNil(o.Url) { return true } @@ -130,7 +131,7 @@ func (o *HttpEngineStep) SetUrl(v string) { // GetHttpStatusCode returns the HttpStatusCode field value if set, zero value otherwise. func (o *HttpEngineStep) GetHttpStatusCode() string { - if o == nil || o.HttpStatusCode == nil { + if o == nil || isNil(o.HttpStatusCode) { var ret string return ret } @@ -140,15 +141,15 @@ func (o *HttpEngineStep) GetHttpStatusCode() string { // GetHttpStatusCodeOk returns a tuple with the HttpStatusCode field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HttpEngineStep) GetHttpStatusCodeOk() (*string, bool) { - if o == nil || o.HttpStatusCode == nil { - return nil, false + if o == nil || isNil(o.HttpStatusCode) { + return nil, false } return o.HttpStatusCode, true } // HasHttpStatusCode returns a boolean if a field has been set. func (o *HttpEngineStep) HasHttpStatusCode() bool { - if o != nil && o.HttpStatusCode != nil { + if o != nil && !isNil(o.HttpStatusCode) { return true } @@ -162,7 +163,7 @@ func (o *HttpEngineStep) SetHttpStatusCode(v string) { // GetHttpMethod returns the HttpMethod field value if set, zero value otherwise. func (o *HttpEngineStep) GetHttpMethod() string { - if o == nil || o.HttpMethod == nil { + if o == nil || isNil(o.HttpMethod) { var ret string return ret } @@ -172,15 +173,15 @@ func (o *HttpEngineStep) GetHttpMethod() string { // GetHttpMethodOk returns a tuple with the HttpMethod field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HttpEngineStep) GetHttpMethodOk() (*string, bool) { - if o == nil || o.HttpMethod == nil { - return nil, false + if o == nil || isNil(o.HttpMethod) { + return nil, false } return o.HttpMethod, true } // HasHttpMethod returns a boolean if a field has been set. func (o *HttpEngineStep) HasHttpMethod() bool { - if o != nil && o.HttpMethod != nil { + if o != nil && !isNil(o.HttpMethod) { return true } @@ -194,7 +195,7 @@ func (o *HttpEngineStep) SetHttpMethod(v string) { // GetHttpStatusDescription returns the HttpStatusDescription field value if set, zero value otherwise. func (o *HttpEngineStep) GetHttpStatusDescription() string { - if o == nil || o.HttpStatusDescription == nil { + if o == nil || isNil(o.HttpStatusDescription) { var ret string return ret } @@ -204,15 +205,15 @@ func (o *HttpEngineStep) GetHttpStatusDescription() string { // GetHttpStatusDescriptionOk returns a tuple with the HttpStatusDescription field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HttpEngineStep) GetHttpStatusDescriptionOk() (*string, bool) { - if o == nil || o.HttpStatusDescription == nil { - return nil, false + if o == nil || isNil(o.HttpStatusDescription) { + return nil, false } return o.HttpStatusDescription, true } // HasHttpStatusDescription returns a boolean if a field has been set. func (o *HttpEngineStep) HasHttpStatusDescription() bool { - if o != nil && o.HttpStatusDescription != nil { + if o != nil && !isNil(o.HttpStatusDescription) { return true } @@ -237,8 +238,8 @@ func (o *HttpEngineStep) GetResponseCompleted() bool { // GetResponseCompletedOk returns a tuple with the ResponseCompleted field value // and a boolean to check if the value has been set. func (o *HttpEngineStep) GetResponseCompletedOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.ResponseCompleted, true } @@ -261,8 +262,8 @@ func (o *HttpEngineStep) GetStepExecuted() bool { // GetStepExecutedOk returns a tuple with the StepExecuted field value // and a boolean to check if the value has been set. func (o *HttpEngineStep) GetStepExecutedOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.StepExecuted, true } @@ -273,9 +274,9 @@ func (o *HttpEngineStep) SetStepExecuted(v bool) { } // GetAssertionResultsInfo returns the AssertionResultsInfo field value if set, zero value otherwise. -func (o *HttpEngineStep) GetAssertionResultsInfo() AssertionResultsInfo { - if o == nil || o.AssertionResultsInfo == nil { - var ret AssertionResultsInfo +func (o *HttpEngineStep) GetAssertionResultsInfo() HttpEngineStepAssertionResultsInfo { + if o == nil || isNil(o.AssertionResultsInfo) { + var ret HttpEngineStepAssertionResultsInfo return ret } return *o.AssertionResultsInfo @@ -283,24 +284,24 @@ func (o *HttpEngineStep) GetAssertionResultsInfo() AssertionResultsInfo { // GetAssertionResultsInfoOk returns a tuple with the AssertionResultsInfo field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *HttpEngineStep) GetAssertionResultsInfoOk() (*AssertionResultsInfo, bool) { - if o == nil || o.AssertionResultsInfo == nil { - return nil, false +func (o *HttpEngineStep) GetAssertionResultsInfoOk() (*HttpEngineStepAssertionResultsInfo, bool) { + if o == nil || isNil(o.AssertionResultsInfo) { + return nil, false } return o.AssertionResultsInfo, true } // HasAssertionResultsInfo returns a boolean if a field has been set. func (o *HttpEngineStep) HasAssertionResultsInfo() bool { - if o != nil && o.AssertionResultsInfo != nil { + if o != nil && !isNil(o.AssertionResultsInfo) { return true } return false } -// SetAssertionResultsInfo gets a reference to the given AssertionResultsInfo and assigns it to the AssertionResultsInfo field. -func (o *HttpEngineStep) SetAssertionResultsInfo(v AssertionResultsInfo) { +// SetAssertionResultsInfo gets a reference to the given HttpEngineStepAssertionResultsInfo and assigns it to the AssertionResultsInfo field. +func (o *HttpEngineStep) SetAssertionResultsInfo(v HttpEngineStepAssertionResultsInfo) { o.AssertionResultsInfo = &v } @@ -317,8 +318,8 @@ func (o *HttpEngineStep) GetTotalTime() int64 { // GetTotalTimeOk returns a tuple with the TotalTime field value // and a boolean to check if the value has been set. func (o *HttpEngineStep) GetTotalTimeOk() (*int64, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.TotalTime, true } @@ -330,7 +331,7 @@ func (o *HttpEngineStep) SetTotalTime(v int64) { // GetResponseHeaders returns the ResponseHeaders field value if set, zero value otherwise. func (o *HttpEngineStep) GetResponseHeaders() string { - if o == nil || o.ResponseHeaders == nil { + if o == nil || isNil(o.ResponseHeaders) { var ret string return ret } @@ -340,15 +341,15 @@ func (o *HttpEngineStep) GetResponseHeaders() string { // GetResponseHeadersOk returns a tuple with the ResponseHeaders field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HttpEngineStep) GetResponseHeadersOk() (*string, bool) { - if o == nil || o.ResponseHeaders == nil { - return nil, false + if o == nil || isNil(o.ResponseHeaders) { + return nil, false } return o.ResponseHeaders, true } // HasResponseHeaders returns a boolean if a field has been set. func (o *HttpEngineStep) HasResponseHeaders() bool { - if o != nil && o.ResponseHeaders != nil { + if o != nil && !isNil(o.ResponseHeaders) { return true } @@ -362,7 +363,7 @@ func (o *HttpEngineStep) SetResponseHeaders(v string) { // GetResponseBody returns the ResponseBody field value if set, zero value otherwise. func (o *HttpEngineStep) GetResponseBody() string { - if o == nil || o.ResponseBody == nil { + if o == nil || isNil(o.ResponseBody) { var ret string return ret } @@ -372,15 +373,15 @@ func (o *HttpEngineStep) GetResponseBody() string { // GetResponseBodyOk returns a tuple with the ResponseBody field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HttpEngineStep) GetResponseBodyOk() (*string, bool) { - if o == nil || o.ResponseBody == nil { - return nil, false + if o == nil || isNil(o.ResponseBody) { + return nil, false } return o.ResponseBody, true } // HasResponseBody returns a boolean if a field has been set. func (o *HttpEngineStep) HasResponseBody() bool { - if o != nil && o.ResponseBody != nil { + if o != nil && !isNil(o.ResponseBody) { return true } @@ -394,7 +395,7 @@ func (o *HttpEngineStep) SetResponseBody(v string) { // GetRequestHeaders returns the RequestHeaders field value if set, zero value otherwise. func (o *HttpEngineStep) GetRequestHeaders() string { - if o == nil || o.RequestHeaders == nil { + if o == nil || isNil(o.RequestHeaders) { var ret string return ret } @@ -404,15 +405,15 @@ func (o *HttpEngineStep) GetRequestHeaders() string { // GetRequestHeadersOk returns a tuple with the RequestHeaders field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HttpEngineStep) GetRequestHeadersOk() (*string, bool) { - if o == nil || o.RequestHeaders == nil { - return nil, false + if o == nil || isNil(o.RequestHeaders) { + return nil, false } return o.RequestHeaders, true } // HasRequestHeaders returns a boolean if a field has been set. func (o *HttpEngineStep) HasRequestHeaders() bool { - if o != nil && o.RequestHeaders != nil { + if o != nil && !isNil(o.RequestHeaders) { return true } @@ -426,7 +427,7 @@ func (o *HttpEngineStep) SetRequestHeaders(v string) { // GetRequestBody returns the RequestBody field value if set, zero value otherwise. func (o *HttpEngineStep) GetRequestBody() string { - if o == nil || o.RequestBody == nil { + if o == nil || isNil(o.RequestBody) { var ret string return ret } @@ -436,15 +437,15 @@ func (o *HttpEngineStep) GetRequestBody() string { // GetRequestBodyOk returns a tuple with the RequestBody field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HttpEngineStep) GetRequestBodyOk() (*string, bool) { - if o == nil || o.RequestBody == nil { - return nil, false + if o == nil || isNil(o.RequestBody) { + return nil, false } return o.RequestBody, true } // HasRequestBody returns a boolean if a field has been set. func (o *HttpEngineStep) HasRequestBody() bool { - if o != nil && o.RequestBody != nil { + if o != nil && !isNil(o.RequestBody) { return true } @@ -456,21 +457,53 @@ func (o *HttpEngineStep) SetRequestBody(v string) { o.RequestBody = &v } +// GetResolvedIpAddress returns the ResolvedIpAddress field value if set, zero value otherwise. +func (o *HttpEngineStep) GetResolvedIpAddress() string { + if o == nil || isNil(o.ResolvedIpAddress) { + var ret string + return ret + } + return *o.ResolvedIpAddress +} + +// GetResolvedIpAddressOk returns a tuple with the ResolvedIpAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpEngineStep) GetResolvedIpAddressOk() (*string, bool) { + if o == nil || isNil(o.ResolvedIpAddress) { + return nil, false + } + return o.ResolvedIpAddress, true +} + +// HasResolvedIpAddress returns a boolean if a field has been set. +func (o *HttpEngineStep) HasResolvedIpAddress() bool { + if o != nil && !isNil(o.ResolvedIpAddress) { + return true + } + + return false +} + +// SetResolvedIpAddress gets a reference to the given string and assigns it to the ResolvedIpAddress field. +func (o *HttpEngineStep) SetResolvedIpAddress(v string) { + o.ResolvedIpAddress = &v +} + func (o HttpEngineStep) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.StepName != nil { + if !isNil(o.StepName) { toSerialize["StepName"] = o.StepName } - if o.Url != nil { + if !isNil(o.Url) { toSerialize["Url"] = o.Url } - if o.HttpStatusCode != nil { + if !isNil(o.HttpStatusCode) { toSerialize["HttpStatusCode"] = o.HttpStatusCode } - if o.HttpMethod != nil { + if !isNil(o.HttpMethod) { toSerialize["HttpMethod"] = o.HttpMethod } - if o.HttpStatusDescription != nil { + if !isNil(o.HttpStatusDescription) { toSerialize["HttpStatusDescription"] = o.HttpStatusDescription } if true { @@ -479,24 +512,27 @@ func (o HttpEngineStep) MarshalJSON() ([]byte, error) { if true { toSerialize["StepExecuted"] = o.StepExecuted } - if o.AssertionResultsInfo != nil { + if !isNil(o.AssertionResultsInfo) { toSerialize["AssertionResultsInfo"] = o.AssertionResultsInfo } if true { toSerialize["TotalTime"] = o.TotalTime } - if o.ResponseHeaders != nil { + if !isNil(o.ResponseHeaders) { toSerialize["ResponseHeaders"] = o.ResponseHeaders } - if o.ResponseBody != nil { + if !isNil(o.ResponseBody) { toSerialize["ResponseBody"] = o.ResponseBody } - if o.RequestHeaders != nil { + if !isNil(o.RequestHeaders) { toSerialize["RequestHeaders"] = o.RequestHeaders } - if o.RequestBody != nil { + if !isNil(o.RequestBody) { toSerialize["RequestBody"] = o.RequestBody } + if !isNil(o.ResolvedIpAddress) { + toSerialize["ResolvedIpAddress"] = o.ResolvedIpAddress + } return json.Marshal(toSerialize) } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_step_assertion_results_info.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_step_assertion_results_info.go new file mode 100644 index 00000000..f1821548 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_engine_step_assertion_results_info.go @@ -0,0 +1,173 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// HttpEngineStepAssertionResultsInfo Results of the assertions in this step +type HttpEngineStepAssertionResultsInfo struct { + TotalAssertions int32 `json:"TotalAssertions"` + PassedAssertions int32 `json:"PassedAssertions"` + AssertionInfos []AssertionInfo `json:"AssertionInfos,omitempty"` +} + +// NewHttpEngineStepAssertionResultsInfo instantiates a new HttpEngineStepAssertionResultsInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHttpEngineStepAssertionResultsInfo(totalAssertions int32, passedAssertions int32) *HttpEngineStepAssertionResultsInfo { + this := HttpEngineStepAssertionResultsInfo{} + this.TotalAssertions = totalAssertions + this.PassedAssertions = passedAssertions + return &this +} + +// NewHttpEngineStepAssertionResultsInfoWithDefaults instantiates a new HttpEngineStepAssertionResultsInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHttpEngineStepAssertionResultsInfoWithDefaults() *HttpEngineStepAssertionResultsInfo { + this := HttpEngineStepAssertionResultsInfo{} + return &this +} + +// GetTotalAssertions returns the TotalAssertions field value +func (o *HttpEngineStepAssertionResultsInfo) GetTotalAssertions() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.TotalAssertions +} + +// GetTotalAssertionsOk returns a tuple with the TotalAssertions field value +// and a boolean to check if the value has been set. +func (o *HttpEngineStepAssertionResultsInfo) GetTotalAssertionsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TotalAssertions, true +} + +// SetTotalAssertions sets field value +func (o *HttpEngineStepAssertionResultsInfo) SetTotalAssertions(v int32) { + o.TotalAssertions = v +} + +// GetPassedAssertions returns the PassedAssertions field value +func (o *HttpEngineStepAssertionResultsInfo) GetPassedAssertions() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PassedAssertions +} + +// GetPassedAssertionsOk returns a tuple with the PassedAssertions field value +// and a boolean to check if the value has been set. +func (o *HttpEngineStepAssertionResultsInfo) GetPassedAssertionsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PassedAssertions, true +} + +// SetPassedAssertions sets field value +func (o *HttpEngineStepAssertionResultsInfo) SetPassedAssertions(v int32) { + o.PassedAssertions = v +} + +// GetAssertionInfos returns the AssertionInfos field value if set, zero value otherwise. +func (o *HttpEngineStepAssertionResultsInfo) GetAssertionInfos() []AssertionInfo { + if o == nil || isNil(o.AssertionInfos) { + var ret []AssertionInfo + return ret + } + return o.AssertionInfos +} + +// GetAssertionInfosOk returns a tuple with the AssertionInfos field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpEngineStepAssertionResultsInfo) GetAssertionInfosOk() ([]AssertionInfo, bool) { + if o == nil || isNil(o.AssertionInfos) { + return nil, false + } + return o.AssertionInfos, true +} + +// HasAssertionInfos returns a boolean if a field has been set. +func (o *HttpEngineStepAssertionResultsInfo) HasAssertionInfos() bool { + if o != nil && !isNil(o.AssertionInfos) { + return true + } + + return false +} + +// SetAssertionInfos gets a reference to the given []AssertionInfo and assigns it to the AssertionInfos field. +func (o *HttpEngineStepAssertionResultsInfo) SetAssertionInfos(v []AssertionInfo) { + o.AssertionInfos = v +} + +func (o HttpEngineStepAssertionResultsInfo) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["TotalAssertions"] = o.TotalAssertions + } + if true { + toSerialize["PassedAssertions"] = o.PassedAssertions + } + if !isNil(o.AssertionInfos) { + toSerialize["AssertionInfos"] = o.AssertionInfos + } + return json.Marshal(toSerialize) +} + +type NullableHttpEngineStepAssertionResultsInfo struct { + value *HttpEngineStepAssertionResultsInfo + isSet bool +} + +func (v NullableHttpEngineStepAssertionResultsInfo) Get() *HttpEngineStepAssertionResultsInfo { + return v.value +} + +func (v *NullableHttpEngineStepAssertionResultsInfo) Set(val *HttpEngineStepAssertionResultsInfo) { + v.value = val + v.isSet = true +} + +func (v NullableHttpEngineStepAssertionResultsInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableHttpEngineStepAssertionResultsInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHttpEngineStepAssertionResultsInfo(val *HttpEngineStepAssertionResultsInfo) *NullableHttpEngineStepAssertionResultsInfo { + return &NullableHttpEngineStepAssertionResultsInfo{value: val, isSet: true} +} + +func (v NullableHttpEngineStepAssertionResultsInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHttpEngineStepAssertionResultsInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_http_method.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_method.go index 471a8ad5..eb5f1010 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_http_method.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_method.go @@ -24,7 +24,8 @@ const ( HTTPMETHOD_POST HttpMethod = "Post" ) -var allowedHttpMethodEnumValues = []HttpMethod{ +// All allowed values of HttpMethod enum +var AllowedHttpMethodEnumValues = []HttpMethod{ "Get", "Post", } @@ -36,7 +37,7 @@ func (v *HttpMethod) UnmarshalJSON(src []byte) error { return err } enumTypeValue := HttpMethod(value) - for _, existing := range allowedHttpMethodEnumValues { + for _, existing := range AllowedHttpMethodEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -53,13 +54,13 @@ func NewHttpMethodFromValue(v string) (*HttpMethod, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for HttpMethod: valid values are %v", v, allowedHttpMethodEnumValues) + return nil, fmt.Errorf("invalid value '%v' for HttpMethod: valid values are %v", v, AllowedHttpMethodEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v HttpMethod) IsValid() bool { - for _, existing := range allowedHttpMethodEnumValues { + for _, existing := range AllowedHttpMethodEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_http_methods.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_methods.go new file mode 100644 index 00000000..b9d32151 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_http_methods.go @@ -0,0 +1,119 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" + "fmt" +) + +// HttpMethods +type HttpMethods string + +// List of HttpMethods +const ( + HTTPMETHODS_GET HttpMethods = "GET" + HTTPMETHODS_POST HttpMethods = "POST" + HTTPMETHODS_PUT HttpMethods = "PUT" + HTTPMETHODS_PATCH HttpMethods = "PATCH" + HTTPMETHODS_DELETE HttpMethods = "DELETE" + HTTPMETHODS_HEAD HttpMethods = "HEAD" +) + +// All allowed values of HttpMethods enum +var AllowedHttpMethodsEnumValues = []HttpMethods{ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "HEAD", +} + +func (v *HttpMethods) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := HttpMethods(value) + for _, existing := range AllowedHttpMethodsEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid HttpMethods", value) +} + +// NewHttpMethodsFromValue returns a pointer to a valid HttpMethods +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewHttpMethodsFromValue(v string) (*HttpMethods, error) { + ev := HttpMethods(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for HttpMethods: valid values are %v", v, AllowedHttpMethodsEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v HttpMethods) IsValid() bool { + for _, existing := range AllowedHttpMethodsEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to HttpMethods value +func (v HttpMethods) Ptr() *HttpMethods { + return &v +} + +type NullableHttpMethods struct { + value *HttpMethods + isSet bool +} + +func (v NullableHttpMethods) Get() *HttpMethods { + return v.value +} + +func (v *NullableHttpMethods) Set(val *HttpMethods) { + v.value = val + v.isSet = true +} + +func (v NullableHttpMethods) IsSet() bool { + return v.isSet +} + +func (v *NullableHttpMethods) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHttpMethods(val *HttpMethods) *NullableHttpMethods { + return &NullableHttpMethods{value: val, isSet: true} +} + +func (v NullableHttpMethods) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHttpMethods) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_integration.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_integration.go index 174126fe..18951d5d 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_integration.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_integration.go @@ -25,9 +25,9 @@ type Integration struct { // Extra emailadresses for this integration (if type == email) ExtraEmailAddresses *string `json:"ExtraEmailAddresses,omitempty"` // All statushubs for this integration (if type == statushub) - StatusHubServiceList *[]IntegrationServiceMap `json:"StatusHubServiceList,omitempty"` + StatusHubServiceList []IntegrationServiceMap `json:"StatusHubServiceList,omitempty"` // All integrations services. - IntegrationServices *[]string `json:"IntegrationServices,omitempty"` + IntegrationServices []string `json:"IntegrationServices,omitempty"` Hash *string `json:"Hash,omitempty"` } @@ -63,8 +63,8 @@ func (o *Integration) GetIntegrationGuid() string { // GetIntegrationGuidOk returns a tuple with the IntegrationGuid field value // and a boolean to check if the value has been set. func (o *Integration) GetIntegrationGuidOk() (*string, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.IntegrationGuid, true } @@ -76,7 +76,7 @@ func (o *Integration) SetIntegrationGuid(v string) { // GetName returns the Name field value if set, zero value otherwise. func (o *Integration) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -86,15 +86,15 @@ func (o *Integration) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Integration) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *Integration) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -119,8 +119,8 @@ func (o *Integration) GetType() IntegrationTypeEnum { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *Integration) GetTypeOk() (*IntegrationTypeEnum, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Type, true } @@ -132,7 +132,7 @@ func (o *Integration) SetType(v IntegrationTypeEnum) { // GetExtraEmailAddresses returns the ExtraEmailAddresses field value if set, zero value otherwise. func (o *Integration) GetExtraEmailAddresses() string { - if o == nil || o.ExtraEmailAddresses == nil { + if o == nil || isNil(o.ExtraEmailAddresses) { var ret string return ret } @@ -142,15 +142,15 @@ func (o *Integration) GetExtraEmailAddresses() string { // GetExtraEmailAddressesOk returns a tuple with the ExtraEmailAddresses field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Integration) GetExtraEmailAddressesOk() (*string, bool) { - if o == nil || o.ExtraEmailAddresses == nil { - return nil, false + if o == nil || isNil(o.ExtraEmailAddresses) { + return nil, false } return o.ExtraEmailAddresses, true } // HasExtraEmailAddresses returns a boolean if a field has been set. func (o *Integration) HasExtraEmailAddresses() bool { - if o != nil && o.ExtraEmailAddresses != nil { + if o != nil && !isNil(o.ExtraEmailAddresses) { return true } @@ -164,25 +164,25 @@ func (o *Integration) SetExtraEmailAddresses(v string) { // GetStatusHubServiceList returns the StatusHubServiceList field value if set, zero value otherwise. func (o *Integration) GetStatusHubServiceList() []IntegrationServiceMap { - if o == nil || o.StatusHubServiceList == nil { + if o == nil || isNil(o.StatusHubServiceList) { var ret []IntegrationServiceMap return ret } - return *o.StatusHubServiceList + return o.StatusHubServiceList } // GetStatusHubServiceListOk returns a tuple with the StatusHubServiceList field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Integration) GetStatusHubServiceListOk() (*[]IntegrationServiceMap, bool) { - if o == nil || o.StatusHubServiceList == nil { - return nil, false +func (o *Integration) GetStatusHubServiceListOk() ([]IntegrationServiceMap, bool) { + if o == nil || isNil(o.StatusHubServiceList) { + return nil, false } return o.StatusHubServiceList, true } // HasStatusHubServiceList returns a boolean if a field has been set. func (o *Integration) HasStatusHubServiceList() bool { - if o != nil && o.StatusHubServiceList != nil { + if o != nil && !isNil(o.StatusHubServiceList) { return true } @@ -191,30 +191,30 @@ func (o *Integration) HasStatusHubServiceList() bool { // SetStatusHubServiceList gets a reference to the given []IntegrationServiceMap and assigns it to the StatusHubServiceList field. func (o *Integration) SetStatusHubServiceList(v []IntegrationServiceMap) { - o.StatusHubServiceList = &v + o.StatusHubServiceList = v } // GetIntegrationServices returns the IntegrationServices field value if set, zero value otherwise. func (o *Integration) GetIntegrationServices() []string { - if o == nil || o.IntegrationServices == nil { + if o == nil || isNil(o.IntegrationServices) { var ret []string return ret } - return *o.IntegrationServices + return o.IntegrationServices } // GetIntegrationServicesOk returns a tuple with the IntegrationServices field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Integration) GetIntegrationServicesOk() (*[]string, bool) { - if o == nil || o.IntegrationServices == nil { - return nil, false +func (o *Integration) GetIntegrationServicesOk() ([]string, bool) { + if o == nil || isNil(o.IntegrationServices) { + return nil, false } return o.IntegrationServices, true } // HasIntegrationServices returns a boolean if a field has been set. func (o *Integration) HasIntegrationServices() bool { - if o != nil && o.IntegrationServices != nil { + if o != nil && !isNil(o.IntegrationServices) { return true } @@ -223,12 +223,12 @@ func (o *Integration) HasIntegrationServices() bool { // SetIntegrationServices gets a reference to the given []string and assigns it to the IntegrationServices field. func (o *Integration) SetIntegrationServices(v []string) { - o.IntegrationServices = &v + o.IntegrationServices = v } // GetHash returns the Hash field value if set, zero value otherwise. func (o *Integration) GetHash() string { - if o == nil || o.Hash == nil { + if o == nil || isNil(o.Hash) { var ret string return ret } @@ -238,15 +238,15 @@ func (o *Integration) GetHash() string { // GetHashOk returns a tuple with the Hash field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Integration) GetHashOk() (*string, bool) { - if o == nil || o.Hash == nil { - return nil, false + if o == nil || isNil(o.Hash) { + return nil, false } return o.Hash, true } // HasHash returns a boolean if a field has been set. func (o *Integration) HasHash() bool { - if o != nil && o.Hash != nil { + if o != nil && !isNil(o.Hash) { return true } @@ -263,22 +263,22 @@ func (o Integration) MarshalJSON() ([]byte, error) { if true { toSerialize["IntegrationGuid"] = o.IntegrationGuid } - if o.Name != nil { + if !isNil(o.Name) { toSerialize["Name"] = o.Name } if true { toSerialize["Type"] = o.Type } - if o.ExtraEmailAddresses != nil { + if !isNil(o.ExtraEmailAddresses) { toSerialize["ExtraEmailAddresses"] = o.ExtraEmailAddresses } - if o.StatusHubServiceList != nil { + if !isNil(o.StatusHubServiceList) { toSerialize["StatusHubServiceList"] = o.StatusHubServiceList } - if o.IntegrationServices != nil { + if !isNil(o.IntegrationServices) { toSerialize["IntegrationServices"] = o.IntegrationServices } - if o.Hash != nil { + if !isNil(o.Hash) { toSerialize["Hash"] = o.Hash } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_integration_authorization.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_integration_authorization.go new file mode 100644 index 00000000..c59b3583 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_integration_authorization.go @@ -0,0 +1,220 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// IntegrationAuthorization Alert definition authorization +type IntegrationAuthorization struct { + // The unique ID of this authorization + AuthorizationId *string `json:"AuthorizationId,omitempty"` + // The authorization type + AuthorizationType IntegrationAuthorizationType `json:"AuthorizationType"` + // The GUID of the operator (NULL if this authorization is for an operator group) + OperatorGuid *string `json:"OperatorGuid,omitempty"` + // The GUID of the operator group (NULL if this authorization is for an operator) + OperatorGroupGuid *string `json:"OperatorGroupGuid,omitempty"` +} + +// NewIntegrationAuthorization instantiates a new IntegrationAuthorization object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIntegrationAuthorization(authorizationType IntegrationAuthorizationType) *IntegrationAuthorization { + this := IntegrationAuthorization{} + this.AuthorizationType = authorizationType + return &this +} + +// NewIntegrationAuthorizationWithDefaults instantiates a new IntegrationAuthorization object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIntegrationAuthorizationWithDefaults() *IntegrationAuthorization { + this := IntegrationAuthorization{} + return &this +} + +// GetAuthorizationId returns the AuthorizationId field value if set, zero value otherwise. +func (o *IntegrationAuthorization) GetAuthorizationId() string { + if o == nil || isNil(o.AuthorizationId) { + var ret string + return ret + } + return *o.AuthorizationId +} + +// GetAuthorizationIdOk returns a tuple with the AuthorizationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IntegrationAuthorization) GetAuthorizationIdOk() (*string, bool) { + if o == nil || isNil(o.AuthorizationId) { + return nil, false + } + return o.AuthorizationId, true +} + +// HasAuthorizationId returns a boolean if a field has been set. +func (o *IntegrationAuthorization) HasAuthorizationId() bool { + if o != nil && !isNil(o.AuthorizationId) { + return true + } + + return false +} + +// SetAuthorizationId gets a reference to the given string and assigns it to the AuthorizationId field. +func (o *IntegrationAuthorization) SetAuthorizationId(v string) { + o.AuthorizationId = &v +} + +// GetAuthorizationType returns the AuthorizationType field value +func (o *IntegrationAuthorization) GetAuthorizationType() IntegrationAuthorizationType { + if o == nil { + var ret IntegrationAuthorizationType + return ret + } + + return o.AuthorizationType +} + +// GetAuthorizationTypeOk returns a tuple with the AuthorizationType field value +// and a boolean to check if the value has been set. +func (o *IntegrationAuthorization) GetAuthorizationTypeOk() (*IntegrationAuthorizationType, bool) { + if o == nil { + return nil, false + } + return &o.AuthorizationType, true +} + +// SetAuthorizationType sets field value +func (o *IntegrationAuthorization) SetAuthorizationType(v IntegrationAuthorizationType) { + o.AuthorizationType = v +} + +// GetOperatorGuid returns the OperatorGuid field value if set, zero value otherwise. +func (o *IntegrationAuthorization) GetOperatorGuid() string { + if o == nil || isNil(o.OperatorGuid) { + var ret string + return ret + } + return *o.OperatorGuid +} + +// GetOperatorGuidOk returns a tuple with the OperatorGuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IntegrationAuthorization) GetOperatorGuidOk() (*string, bool) { + if o == nil || isNil(o.OperatorGuid) { + return nil, false + } + return o.OperatorGuid, true +} + +// HasOperatorGuid returns a boolean if a field has been set. +func (o *IntegrationAuthorization) HasOperatorGuid() bool { + if o != nil && !isNil(o.OperatorGuid) { + return true + } + + return false +} + +// SetOperatorGuid gets a reference to the given string and assigns it to the OperatorGuid field. +func (o *IntegrationAuthorization) SetOperatorGuid(v string) { + o.OperatorGuid = &v +} + +// GetOperatorGroupGuid returns the OperatorGroupGuid field value if set, zero value otherwise. +func (o *IntegrationAuthorization) GetOperatorGroupGuid() string { + if o == nil || isNil(o.OperatorGroupGuid) { + var ret string + return ret + } + return *o.OperatorGroupGuid +} + +// GetOperatorGroupGuidOk returns a tuple with the OperatorGroupGuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IntegrationAuthorization) GetOperatorGroupGuidOk() (*string, bool) { + if o == nil || isNil(o.OperatorGroupGuid) { + return nil, false + } + return o.OperatorGroupGuid, true +} + +// HasOperatorGroupGuid returns a boolean if a field has been set. +func (o *IntegrationAuthorization) HasOperatorGroupGuid() bool { + if o != nil && !isNil(o.OperatorGroupGuid) { + return true + } + + return false +} + +// SetOperatorGroupGuid gets a reference to the given string and assigns it to the OperatorGroupGuid field. +func (o *IntegrationAuthorization) SetOperatorGroupGuid(v string) { + o.OperatorGroupGuid = &v +} + +func (o IntegrationAuthorization) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.AuthorizationId) { + toSerialize["AuthorizationId"] = o.AuthorizationId + } + if true { + toSerialize["AuthorizationType"] = o.AuthorizationType + } + if !isNil(o.OperatorGuid) { + toSerialize["OperatorGuid"] = o.OperatorGuid + } + if !isNil(o.OperatorGroupGuid) { + toSerialize["OperatorGroupGuid"] = o.OperatorGroupGuid + } + return json.Marshal(toSerialize) +} + +type NullableIntegrationAuthorization struct { + value *IntegrationAuthorization + isSet bool +} + +func (v NullableIntegrationAuthorization) Get() *IntegrationAuthorization { + return v.value +} + +func (v *NullableIntegrationAuthorization) Set(val *IntegrationAuthorization) { + v.value = val + v.isSet = true +} + +func (v NullableIntegrationAuthorization) IsSet() bool { + return v.isSet +} + +func (v *NullableIntegrationAuthorization) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIntegrationAuthorization(val *IntegrationAuthorization) *NullableIntegrationAuthorization { + return &NullableIntegrationAuthorization{value: val, isSet: true} +} + +func (v NullableIntegrationAuthorization) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIntegrationAuthorization) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_integration_authorization_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_integration_authorization_type.go new file mode 100644 index 00000000..e56bca0f --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_integration_authorization_type.go @@ -0,0 +1,111 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" + "fmt" +) + +// IntegrationAuthorizationType +type IntegrationAuthorizationType string + +// List of IntegrationAuthorizationType +const ( + INTEGRATIONAUTHORIZATIONTYPE_USE_INTEGRATION IntegrationAuthorizationType = "UseIntegration" + INTEGRATIONAUTHORIZATIONTYPE_EDIT_INTEGRATION IntegrationAuthorizationType = "EditIntegration" +) + +// All allowed values of IntegrationAuthorizationType enum +var AllowedIntegrationAuthorizationTypeEnumValues = []IntegrationAuthorizationType{ + "UseIntegration", + "EditIntegration", +} + +func (v *IntegrationAuthorizationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IntegrationAuthorizationType(value) + for _, existing := range AllowedIntegrationAuthorizationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IntegrationAuthorizationType", value) +} + +// NewIntegrationAuthorizationTypeFromValue returns a pointer to a valid IntegrationAuthorizationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIntegrationAuthorizationTypeFromValue(v string) (*IntegrationAuthorizationType, error) { + ev := IntegrationAuthorizationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IntegrationAuthorizationType: valid values are %v", v, AllowedIntegrationAuthorizationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IntegrationAuthorizationType) IsValid() bool { + for _, existing := range AllowedIntegrationAuthorizationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IntegrationAuthorizationType value +func (v IntegrationAuthorizationType) Ptr() *IntegrationAuthorizationType { + return &v +} + +type NullableIntegrationAuthorizationType struct { + value *IntegrationAuthorizationType + isSet bool +} + +func (v NullableIntegrationAuthorizationType) Get() *IntegrationAuthorizationType { + return v.value +} + +func (v *NullableIntegrationAuthorizationType) Set(val *IntegrationAuthorizationType) { + v.value = val + v.isSet = true +} + +func (v NullableIntegrationAuthorizationType) IsSet() bool { + return v.isSet +} + +func (v *NullableIntegrationAuthorizationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIntegrationAuthorizationType(val *IntegrationAuthorizationType) *NullableIntegrationAuthorizationType { + return &NullableIntegrationAuthorizationType{value: val, isSet: true} +} + +func (v NullableIntegrationAuthorizationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIntegrationAuthorizationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_integration_service_map.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_integration_service_map.go index 7a105f36..348e19c8 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_integration_service_map.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_integration_service_map.go @@ -52,8 +52,8 @@ func (o *IntegrationServiceMap) GetMonitorGuid() string { // GetMonitorGuidOk returns a tuple with the MonitorGuid field value // and a boolean to check if the value has been set. func (o *IntegrationServiceMap) GetMonitorGuidOk() (*string, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.MonitorGuid, true } @@ -76,8 +76,8 @@ func (o *IntegrationServiceMap) GetIntegrationServiceGuid() string { // GetIntegrationServiceGuidOk returns a tuple with the IntegrationServiceGuid field value // and a boolean to check if the value has been set. func (o *IntegrationServiceMap) GetIntegrationServiceGuidOk() (*string, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.IntegrationServiceGuid, true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_integration_type_enum.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_integration_type_enum.go index 4f69649f..75d9dd66 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_integration_type_enum.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_integration_type_enum.go @@ -29,7 +29,8 @@ const ( INTEGRATIONTYPEENUM_GENERIC_WEBHOOK IntegrationTypeEnum = "GenericWebhook" ) -var allowedIntegrationTypeEnumEnumValues = []IntegrationTypeEnum{ +// All allowed values of IntegrationTypeEnum enum +var AllowedIntegrationTypeEnumEnumValues = []IntegrationTypeEnum{ "Slack", "PagerDuty", "Sms", @@ -46,7 +47,7 @@ func (v *IntegrationTypeEnum) UnmarshalJSON(src []byte) error { return err } enumTypeValue := IntegrationTypeEnum(value) - for _, existing := range allowedIntegrationTypeEnumEnumValues { + for _, existing := range AllowedIntegrationTypeEnumEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -63,13 +64,13 @@ func NewIntegrationTypeEnumFromValue(v string) (*IntegrationTypeEnum, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for IntegrationTypeEnum: valid values are %v", v, allowedIntegrationTypeEnumEnumValues) + return nil, fmt.Errorf("invalid value '%v' for IntegrationTypeEnum: valid values are %v", v, AllowedIntegrationTypeEnumEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v IntegrationTypeEnum) IsValid() bool { - for _, existing := range allowedIntegrationTypeEnumEnumValues { + for _, existing := range AllowedIntegrationTypeEnumEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_ip_version.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_ip_version.go index bedbaa30..9876ff24 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_ip_version.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_ip_version.go @@ -24,7 +24,8 @@ const ( IPVERSION_IP_V6 IpVersion = "IpV6" ) -var allowedIpVersionEnumValues = []IpVersion{ +// All allowed values of IpVersion enum +var AllowedIpVersionEnumValues = []IpVersion{ "IpV4", "IpV6", } @@ -36,7 +37,7 @@ func (v *IpVersion) UnmarshalJSON(src []byte) error { return err } enumTypeValue := IpVersion(value) - for _, existing := range allowedIpVersionEnumValues { + for _, existing := range AllowedIpVersionEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -53,13 +54,13 @@ func NewIpVersionFromValue(v string) (*IpVersion, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for IpVersion: valid values are %v", v, allowedIpVersionEnumValues) + return nil, fmt.Errorf("invalid value '%v' for IpVersion: valid values are %v", v, AllowedIpVersionEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v IpVersion) IsValid() bool { - for _, existing := range allowedIpVersionEnumValues { + for _, existing := range AllowedIpVersionEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_ipv6_address.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_ipv6_address.go index f5d39ef8..638ea279 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_ipv6_address.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_ipv6_address.go @@ -18,17 +18,14 @@ import ( type Ipv6Address struct { // The IPv6 address IpAddress *string `json:"IpAddress,omitempty"` - // This indicates whether this is a native IPv6 address - IsNative bool `json:"IsNative"` } // NewIpv6Address instantiates a new Ipv6Address object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewIpv6Address(isNative bool) *Ipv6Address { +func NewIpv6Address() *Ipv6Address { this := Ipv6Address{} - this.IsNative = isNative return &this } @@ -42,7 +39,7 @@ func NewIpv6AddressWithDefaults() *Ipv6Address { // GetIpAddress returns the IpAddress field value if set, zero value otherwise. func (o *Ipv6Address) GetIpAddress() string { - if o == nil || o.IpAddress == nil { + if o == nil || isNil(o.IpAddress) { var ret string return ret } @@ -52,15 +49,15 @@ func (o *Ipv6Address) GetIpAddress() string { // GetIpAddressOk returns a tuple with the IpAddress field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Ipv6Address) GetIpAddressOk() (*string, bool) { - if o == nil || o.IpAddress == nil { - return nil, false + if o == nil || isNil(o.IpAddress) { + return nil, false } return o.IpAddress, true } // HasIpAddress returns a boolean if a field has been set. func (o *Ipv6Address) HasIpAddress() bool { - if o != nil && o.IpAddress != nil { + if o != nil && !isNil(o.IpAddress) { return true } @@ -72,38 +69,11 @@ func (o *Ipv6Address) SetIpAddress(v string) { o.IpAddress = &v } -// GetIsNative returns the IsNative field value -func (o *Ipv6Address) GetIsNative() bool { - if o == nil { - var ret bool - return ret - } - - return o.IsNative -} - -// GetIsNativeOk returns a tuple with the IsNative field value -// and a boolean to check if the value has been set. -func (o *Ipv6Address) GetIsNativeOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.IsNative, true -} - -// SetIsNative sets field value -func (o *Ipv6Address) SetIsNative(v bool) { - o.IsNative = v -} - func (o Ipv6Address) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.IpAddress != nil { + if !isNil(o.IpAddress) { toSerialize["IpAddress"] = o.IpAddress } - if true { - toSerialize["IsNative"] = o.IsNative - } return json.Marshal(toSerialize) } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_jwt_algorithm.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_jwt_algorithm.go index 909dffbc..d064f1a6 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_jwt_algorithm.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_jwt_algorithm.go @@ -25,7 +25,8 @@ const ( JWTALGORITHM_HS512 JwtAlgorithm = "HS512" ) -var allowedJwtAlgorithmEnumValues = []JwtAlgorithm{ +// All allowed values of JwtAlgorithm enum +var AllowedJwtAlgorithmEnumValues = []JwtAlgorithm{ "HS256", "HS384", "HS512", @@ -38,7 +39,7 @@ func (v *JwtAlgorithm) UnmarshalJSON(src []byte) error { return err } enumTypeValue := JwtAlgorithm(value) - for _, existing := range allowedJwtAlgorithmEnumValues { + for _, existing := range AllowedJwtAlgorithmEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -55,13 +56,13 @@ func NewJwtAlgorithmFromValue(v string) (*JwtAlgorithm, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for JwtAlgorithm: valid values are %v", v, allowedJwtAlgorithmEnumValues) + return nil, fmt.Errorf("invalid value '%v' for JwtAlgorithm: valid values are %v", v, AllowedJwtAlgorithmEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v JwtAlgorithm) IsValid() bool { - for _, existing := range allowedJwtAlgorithmEnumValues { + for _, existing := range AllowedJwtAlgorithmEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_last_error_level.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_last_error_level.go index 183f411d..44b84a5a 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_last_error_level.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_last_error_level.go @@ -27,7 +27,8 @@ const ( LASTERRORLEVEL_INCONCLUSIVE LastErrorLevel = "Inconclusive" ) -var allowedLastErrorLevelEnumValues = []LastErrorLevel{ +// All allowed values of LastErrorLevel enum +var AllowedLastErrorLevelEnumValues = []LastErrorLevel{ "NoError", "Unconfirmed", "Confirmed", @@ -42,7 +43,7 @@ func (v *LastErrorLevel) UnmarshalJSON(src []byte) error { return err } enumTypeValue := LastErrorLevel(value) - for _, existing := range allowedLastErrorLevelEnumValues { + for _, existing := range AllowedLastErrorLevelEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -59,13 +60,13 @@ func NewLastErrorLevelFromValue(v string) (*LastErrorLevel, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for LastErrorLevel: valid values are %v", v, allowedLastErrorLevelEnumValues) + return nil, fmt.Errorf("invalid value '%v' for LastErrorLevel: valid values are %v", v, AllowedLastErrorLevelEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v LastErrorLevel) IsValid() bool { - for _, existing := range allowedLastErrorLevelEnumValues { + for _, existing := range AllowedLastErrorLevelEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_links_data.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_links_data.go index 91fd9be2..9e18fba1 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_links_data.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_links_data.go @@ -41,7 +41,7 @@ func NewLinksDataWithDefaults() *LinksData { // GetNext returns the Next field value if set, zero value otherwise. func (o *LinksData) GetNext() string { - if o == nil || o.Next == nil { + if o == nil || isNil(o.Next) { var ret string return ret } @@ -51,15 +51,15 @@ func (o *LinksData) GetNext() string { // GetNextOk returns a tuple with the Next field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *LinksData) GetNextOk() (*string, bool) { - if o == nil || o.Next == nil { - return nil, false + if o == nil || isNil(o.Next) { + return nil, false } return o.Next, true } // HasNext returns a boolean if a field has been set. func (o *LinksData) HasNext() bool { - if o != nil && o.Next != nil { + if o != nil && !isNil(o.Next) { return true } @@ -73,7 +73,7 @@ func (o *LinksData) SetNext(v string) { // GetSelf returns the Self field value if set, zero value otherwise. func (o *LinksData) GetSelf() string { - if o == nil || o.Self == nil { + if o == nil || isNil(o.Self) { var ret string return ret } @@ -83,15 +83,15 @@ func (o *LinksData) GetSelf() string { // GetSelfOk returns a tuple with the Self field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *LinksData) GetSelfOk() (*string, bool) { - if o == nil || o.Self == nil { - return nil, false + if o == nil || isNil(o.Self) { + return nil, false } return o.Self, true } // HasSelf returns a boolean if a field has been set. func (o *LinksData) HasSelf() bool { - if o != nil && o.Self != nil { + if o != nil && !isNil(o.Self) { return true } @@ -105,10 +105,10 @@ func (o *LinksData) SetSelf(v string) { func (o LinksData) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Next != nil { + if !isNil(o.Next) { toSerialize["Next"] = o.Next } - if o.Self != nil { + if !isNil(o.Self) { toSerialize["Self"] = o.Self } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_list_string_response.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_list_string_response.go index 4cbebe87..db4ea2c0 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_list_string_response.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_list_string_response.go @@ -16,10 +16,12 @@ import ( // ListStringResponse struct for ListStringResponse type ListStringResponse struct { - Data *[]string `json:"Data,omitempty"` - Links *LinksData `json:"Links,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` - Meta *MetaData `json:"Meta,omitempty"` + // The resposne data/monitor checks + Data []string `json:"Data,omitempty"` + Links *StatisticsResponseLinks `json:"Links,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + Meta *StatisticsResponseMeta `json:"Meta,omitempty"` } // NewListStringResponse instantiates a new ListStringResponse object @@ -41,25 +43,25 @@ func NewListStringResponseWithDefaults() *ListStringResponse { // GetData returns the Data field value if set, zero value otherwise. func (o *ListStringResponse) GetData() []string { - if o == nil || o.Data == nil { + if o == nil || isNil(o.Data) { var ret []string return ret } - return *o.Data + return o.Data } // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListStringResponse) GetDataOk() (*[]string, bool) { - if o == nil || o.Data == nil { - return nil, false +func (o *ListStringResponse) GetDataOk() ([]string, bool) { + if o == nil || isNil(o.Data) { + return nil, false } return o.Data, true } // HasData returns a boolean if a field has been set. func (o *ListStringResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && !isNil(o.Data) { return true } @@ -68,13 +70,13 @@ func (o *ListStringResponse) HasData() bool { // SetData gets a reference to the given []string and assigns it to the Data field. func (o *ListStringResponse) SetData(v []string) { - o.Data = &v + o.Data = v } // GetLinks returns the Links field value if set, zero value otherwise. -func (o *ListStringResponse) GetLinks() LinksData { - if o == nil || o.Links == nil { - var ret LinksData +func (o *ListStringResponse) GetLinks() StatisticsResponseLinks { + if o == nil || isNil(o.Links) { + var ret StatisticsResponseLinks return ret } return *o.Links @@ -82,48 +84,48 @@ func (o *ListStringResponse) GetLinks() LinksData { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListStringResponse) GetLinksOk() (*LinksData, bool) { - if o == nil || o.Links == nil { - return nil, false +func (o *ListStringResponse) GetLinksOk() (*StatisticsResponseLinks, bool) { + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *ListStringResponse) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } return false } -// SetLinks gets a reference to the given LinksData and assigns it to the Links field. -func (o *ListStringResponse) SetLinks(v LinksData) { +// SetLinks gets a reference to the given StatisticsResponseLinks and assigns it to the Links field. +func (o *ListStringResponse) SetLinks(v StatisticsResponseLinks) { o.Links = &v } // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *ListStringResponse) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListStringResponse) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *ListStringResponse) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *ListStringResponse) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -132,13 +134,13 @@ func (o *ListStringResponse) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *ListStringResponse) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetMeta returns the Meta field value if set, zero value otherwise. -func (o *ListStringResponse) GetMeta() MetaData { - if o == nil || o.Meta == nil { - var ret MetaData +func (o *ListStringResponse) GetMeta() StatisticsResponseMeta { + if o == nil || isNil(o.Meta) { + var ret StatisticsResponseMeta return ret } return *o.Meta @@ -146,39 +148,39 @@ func (o *ListStringResponse) GetMeta() MetaData { // GetMetaOk returns a tuple with the Meta field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListStringResponse) GetMetaOk() (*MetaData, bool) { - if o == nil || o.Meta == nil { - return nil, false +func (o *ListStringResponse) GetMetaOk() (*StatisticsResponseMeta, bool) { + if o == nil || isNil(o.Meta) { + return nil, false } return o.Meta, true } // HasMeta returns a boolean if a field has been set. func (o *ListStringResponse) HasMeta() bool { - if o != nil && o.Meta != nil { + if o != nil && !isNil(o.Meta) { return true } return false } -// SetMeta gets a reference to the given MetaData and assigns it to the Meta field. -func (o *ListStringResponse) SetMeta(v MetaData) { +// SetMeta gets a reference to the given StatisticsResponseMeta and assigns it to the Meta field. +func (o *ListStringResponse) SetMeta(v StatisticsResponseMeta) { o.Meta = &v } func (o ListStringResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Data != nil { + if !isNil(o.Data) { toSerialize["Data"] = o.Data } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Meta != nil { + if !isNil(o.Meta) { toSerialize["Meta"] = o.Meta } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_maintenance_period.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_maintenance_period.go index a09ce6e2..d8e89524 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_maintenance_period.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_maintenance_period.go @@ -12,7 +12,6 @@ package uptrends import ( "encoding/json" - "time" ) // MaintenancePeriod struct for MaintenancePeriod @@ -22,9 +21,9 @@ type MaintenancePeriod struct { // The schedule mode (one time, daily, weekly, monthly) ScheduleMode ScheduleMode `json:"ScheduleMode"` // The start date/time for this schedule (for one-time schedules only) - StartDateTime *time.Time `json:"StartDateTime,omitempty"` + StartDateTime map[string]interface{} `json:"StartDateTime,omitempty"` // The end date/time for this maintenance period (for one-time maintenance periods only) - EndDateTime *time.Time `json:"EndDateTime,omitempty"` + EndDateTime map[string]interface{} `json:"EndDateTime,omitempty"` // The weekday for this maintenance period (for weekly maintenance periods only) WeekDay *DayOfWeek `json:"WeekDay,omitempty"` // the month day for this maintenance period (for montly maintenance periods only) @@ -72,8 +71,8 @@ func (o *MaintenancePeriod) GetId() int32 { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *MaintenancePeriod) GetIdOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Id, true } @@ -96,8 +95,8 @@ func (o *MaintenancePeriod) GetScheduleMode() ScheduleMode { // GetScheduleModeOk returns a tuple with the ScheduleMode field value // and a boolean to check if the value has been set. func (o *MaintenancePeriod) GetScheduleModeOk() (*ScheduleMode, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.ScheduleMode, true } @@ -108,72 +107,72 @@ func (o *MaintenancePeriod) SetScheduleMode(v ScheduleMode) { } // GetStartDateTime returns the StartDateTime field value if set, zero value otherwise. -func (o *MaintenancePeriod) GetStartDateTime() time.Time { - if o == nil || o.StartDateTime == nil { - var ret time.Time +func (o *MaintenancePeriod) GetStartDateTime() map[string]interface{} { + if o == nil || isNil(o.StartDateTime) { + var ret map[string]interface{} return ret } - return *o.StartDateTime + return o.StartDateTime } // GetStartDateTimeOk returns a tuple with the StartDateTime field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MaintenancePeriod) GetStartDateTimeOk() (*time.Time, bool) { - if o == nil || o.StartDateTime == nil { - return nil, false +func (o *MaintenancePeriod) GetStartDateTimeOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.StartDateTime) { + return map[string]interface{}{}, false } return o.StartDateTime, true } // HasStartDateTime returns a boolean if a field has been set. func (o *MaintenancePeriod) HasStartDateTime() bool { - if o != nil && o.StartDateTime != nil { + if o != nil && !isNil(o.StartDateTime) { return true } return false } -// SetStartDateTime gets a reference to the given time.Time and assigns it to the StartDateTime field. -func (o *MaintenancePeriod) SetStartDateTime(v time.Time) { - o.StartDateTime = &v +// SetStartDateTime gets a reference to the given map[string]interface{} and assigns it to the StartDateTime field. +func (o *MaintenancePeriod) SetStartDateTime(v map[string]interface{}) { + o.StartDateTime = v } // GetEndDateTime returns the EndDateTime field value if set, zero value otherwise. -func (o *MaintenancePeriod) GetEndDateTime() time.Time { - if o == nil || o.EndDateTime == nil { - var ret time.Time +func (o *MaintenancePeriod) GetEndDateTime() map[string]interface{} { + if o == nil || isNil(o.EndDateTime) { + var ret map[string]interface{} return ret } - return *o.EndDateTime + return o.EndDateTime } // GetEndDateTimeOk returns a tuple with the EndDateTime field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MaintenancePeriod) GetEndDateTimeOk() (*time.Time, bool) { - if o == nil || o.EndDateTime == nil { - return nil, false +func (o *MaintenancePeriod) GetEndDateTimeOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.EndDateTime) { + return map[string]interface{}{}, false } return o.EndDateTime, true } // HasEndDateTime returns a boolean if a field has been set. func (o *MaintenancePeriod) HasEndDateTime() bool { - if o != nil && o.EndDateTime != nil { + if o != nil && !isNil(o.EndDateTime) { return true } return false } -// SetEndDateTime gets a reference to the given time.Time and assigns it to the EndDateTime field. -func (o *MaintenancePeriod) SetEndDateTime(v time.Time) { - o.EndDateTime = &v +// SetEndDateTime gets a reference to the given map[string]interface{} and assigns it to the EndDateTime field. +func (o *MaintenancePeriod) SetEndDateTime(v map[string]interface{}) { + o.EndDateTime = v } // GetWeekDay returns the WeekDay field value if set, zero value otherwise. func (o *MaintenancePeriod) GetWeekDay() DayOfWeek { - if o == nil || o.WeekDay == nil { + if o == nil || isNil(o.WeekDay) { var ret DayOfWeek return ret } @@ -183,15 +182,15 @@ func (o *MaintenancePeriod) GetWeekDay() DayOfWeek { // GetWeekDayOk returns a tuple with the WeekDay field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MaintenancePeriod) GetWeekDayOk() (*DayOfWeek, bool) { - if o == nil || o.WeekDay == nil { - return nil, false + if o == nil || isNil(o.WeekDay) { + return nil, false } return o.WeekDay, true } // HasWeekDay returns a boolean if a field has been set. func (o *MaintenancePeriod) HasWeekDay() bool { - if o != nil && o.WeekDay != nil { + if o != nil && !isNil(o.WeekDay) { return true } @@ -205,7 +204,7 @@ func (o *MaintenancePeriod) SetWeekDay(v DayOfWeek) { // GetMonthDay returns the MonthDay field value if set, zero value otherwise. func (o *MaintenancePeriod) GetMonthDay() int32 { - if o == nil || o.MonthDay == nil { + if o == nil || isNil(o.MonthDay) { var ret int32 return ret } @@ -215,15 +214,15 @@ func (o *MaintenancePeriod) GetMonthDay() int32 { // GetMonthDayOk returns a tuple with the MonthDay field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MaintenancePeriod) GetMonthDayOk() (*int32, bool) { - if o == nil || o.MonthDay == nil { - return nil, false + if o == nil || isNil(o.MonthDay) { + return nil, false } return o.MonthDay, true } // HasMonthDay returns a boolean if a field has been set. func (o *MaintenancePeriod) HasMonthDay() bool { - if o != nil && o.MonthDay != nil { + if o != nil && !isNil(o.MonthDay) { return true } @@ -237,7 +236,7 @@ func (o *MaintenancePeriod) SetMonthDay(v int32) { // GetStartTime returns the StartTime field value if set, zero value otherwise. func (o *MaintenancePeriod) GetStartTime() string { - if o == nil || o.StartTime == nil { + if o == nil || isNil(o.StartTime) { var ret string return ret } @@ -247,15 +246,15 @@ func (o *MaintenancePeriod) GetStartTime() string { // GetStartTimeOk returns a tuple with the StartTime field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MaintenancePeriod) GetStartTimeOk() (*string, bool) { - if o == nil || o.StartTime == nil { - return nil, false + if o == nil || isNil(o.StartTime) { + return nil, false } return o.StartTime, true } // HasStartTime returns a boolean if a field has been set. func (o *MaintenancePeriod) HasStartTime() bool { - if o != nil && o.StartTime != nil { + if o != nil && !isNil(o.StartTime) { return true } @@ -269,7 +268,7 @@ func (o *MaintenancePeriod) SetStartTime(v string) { // GetEndTime returns the EndTime field value if set, zero value otherwise. func (o *MaintenancePeriod) GetEndTime() string { - if o == nil || o.EndTime == nil { + if o == nil || isNil(o.EndTime) { var ret string return ret } @@ -279,15 +278,15 @@ func (o *MaintenancePeriod) GetEndTime() string { // GetEndTimeOk returns a tuple with the EndTime field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MaintenancePeriod) GetEndTimeOk() (*string, bool) { - if o == nil || o.EndTime == nil { - return nil, false + if o == nil || isNil(o.EndTime) { + return nil, false } return o.EndTime, true } // HasEndTime returns a boolean if a field has been set. func (o *MaintenancePeriod) HasEndTime() bool { - if o != nil && o.EndTime != nil { + if o != nil && !isNil(o.EndTime) { return true } @@ -312,8 +311,8 @@ func (o *MaintenancePeriod) GetMaintenanceType() MaintenanceTypes { // GetMaintenanceTypeOk returns a tuple with the MaintenanceType field value // and a boolean to check if the value has been set. func (o *MaintenancePeriod) GetMaintenanceTypeOk() (*MaintenanceTypes, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.MaintenanceType, true } @@ -325,7 +324,7 @@ func (o *MaintenancePeriod) SetMaintenanceType(v MaintenanceTypes) { // GetDescription returns the Description field value if set, zero value otherwise. func (o *MaintenancePeriod) GetDescription() string { - if o == nil || o.Description == nil { + if o == nil || isNil(o.Description) { var ret string return ret } @@ -335,15 +334,15 @@ func (o *MaintenancePeriod) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MaintenancePeriod) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { - return nil, false + if o == nil || isNil(o.Description) { + return nil, false } return o.Description, true } // HasDescription returns a boolean if a field has been set. func (o *MaintenancePeriod) HasDescription() bool { - if o != nil && o.Description != nil { + if o != nil && !isNil(o.Description) { return true } @@ -363,28 +362,28 @@ func (o MaintenancePeriod) MarshalJSON() ([]byte, error) { if true { toSerialize["ScheduleMode"] = o.ScheduleMode } - if o.StartDateTime != nil { + if !isNil(o.StartDateTime) { toSerialize["StartDateTime"] = o.StartDateTime } - if o.EndDateTime != nil { + if !isNil(o.EndDateTime) { toSerialize["EndDateTime"] = o.EndDateTime } - if o.WeekDay != nil { + if !isNil(o.WeekDay) { toSerialize["WeekDay"] = o.WeekDay } - if o.MonthDay != nil { + if !isNil(o.MonthDay) { toSerialize["MonthDay"] = o.MonthDay } - if o.StartTime != nil { + if !isNil(o.StartTime) { toSerialize["StartTime"] = o.StartTime } - if o.EndTime != nil { + if !isNil(o.EndTime) { toSerialize["EndTime"] = o.EndTime } if true { toSerialize["MaintenanceType"] = o.MaintenanceType } - if o.Description != nil { + if !isNil(o.Description) { toSerialize["Description"] = o.Description } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_maintenance_types.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_maintenance_types.go index 6aac5239..0e599ccb 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_maintenance_types.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_maintenance_types.go @@ -24,7 +24,8 @@ const ( MAINTENANCETYPES_DISABLE_NOTIFICATIONS MaintenanceTypes = "DisableNotifications" ) -var allowedMaintenanceTypesEnumValues = []MaintenanceTypes{ +// All allowed values of MaintenanceTypes enum +var AllowedMaintenanceTypesEnumValues = []MaintenanceTypes{ "DisableMonitoring", "DisableNotifications", } @@ -36,7 +37,7 @@ func (v *MaintenanceTypes) UnmarshalJSON(src []byte) error { return err } enumTypeValue := MaintenanceTypes(value) - for _, existing := range allowedMaintenanceTypesEnumValues { + for _, existing := range AllowedMaintenanceTypesEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -53,13 +54,13 @@ func NewMaintenanceTypesFromValue(v string) (*MaintenanceTypes, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for MaintenanceTypes: valid values are %v", v, allowedMaintenanceTypesEnumValues) + return nil, fmt.Errorf("invalid value '%v' for MaintenanceTypes: valid values are %v", v, AllowedMaintenanceTypesEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v MaintenanceTypes) IsValid() bool { - for _, existing := range allowedMaintenanceTypesEnumValues { + for _, existing := range AllowedMaintenanceTypesEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_message_info.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_message_info.go index 07321e92..2585e7f5 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_message_info.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_message_info.go @@ -38,7 +38,7 @@ func NewMessageInfoWithDefaults() *MessageInfo { // GetMessage returns the Message field value if set, zero value otherwise. func (o *MessageInfo) GetMessage() string { - if o == nil || o.Message == nil { + if o == nil || isNil(o.Message) { var ret string return ret } @@ -48,15 +48,15 @@ func (o *MessageInfo) GetMessage() string { // GetMessageOk returns a tuple with the Message field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MessageInfo) GetMessageOk() (*string, bool) { - if o == nil || o.Message == nil { - return nil, false + if o == nil || isNil(o.Message) { + return nil, false } return o.Message, true } // HasMessage returns a boolean if a field has been set. func (o *MessageInfo) HasMessage() bool { - if o != nil && o.Message != nil { + if o != nil && !isNil(o.Message) { return true } @@ -70,7 +70,7 @@ func (o *MessageInfo) SetMessage(v string) { func (o MessageInfo) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Message != nil { + if !isNil(o.Message) { toSerialize["Message"] = o.Message } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_message_list.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_message_list.go index 6652bf8b..4325c065 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_message_list.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_message_list.go @@ -16,7 +16,7 @@ import ( // MessageList struct for MessageList type MessageList struct { - Messages *[]MessageInfo `json:"Messages,omitempty"` + Messages []MessageInfo `json:"Messages,omitempty"` } // NewMessageList instantiates a new MessageList object @@ -38,25 +38,25 @@ func NewMessageListWithDefaults() *MessageList { // GetMessages returns the Messages field value if set, zero value otherwise. func (o *MessageList) GetMessages() []MessageInfo { - if o == nil || o.Messages == nil { + if o == nil || isNil(o.Messages) { var ret []MessageInfo return ret } - return *o.Messages + return o.Messages } // GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MessageList) GetMessagesOk() (*[]MessageInfo, bool) { - if o == nil || o.Messages == nil { - return nil, false +func (o *MessageList) GetMessagesOk() ([]MessageInfo, bool) { + if o == nil || isNil(o.Messages) { + return nil, false } return o.Messages, true } // HasMessages returns a boolean if a field has been set. func (o *MessageList) HasMessages() bool { - if o != nil && o.Messages != nil { + if o != nil && !isNil(o.Messages) { return true } @@ -65,12 +65,12 @@ func (o *MessageList) HasMessages() bool { // SetMessages gets a reference to the given []MessageInfo and assigns it to the Messages field. func (o *MessageList) SetMessages(v []MessageInfo) { - o.Messages = &v + o.Messages = v } func (o MessageList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Messages != nil { + if !isNil(o.Messages) { toSerialize["Messages"] = o.Messages } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_meta_data.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_meta_data.go index 28ab1832..4e84397a 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_meta_data.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_meta_data.go @@ -12,12 +12,11 @@ package uptrends import ( "encoding/json" - "time" ) // MetaData struct for MetaData type MetaData struct { - Timestamp *time.Time `json:"Timestamp,omitempty"` + Timestamp map[string]interface{} `json:"Timestamp,omitempty"` Period *PeriodMetaData `json:"Period,omitempty"` } @@ -39,40 +38,40 @@ func NewMetaDataWithDefaults() *MetaData { } // GetTimestamp returns the Timestamp field value if set, zero value otherwise. -func (o *MetaData) GetTimestamp() time.Time { - if o == nil || o.Timestamp == nil { - var ret time.Time +func (o *MetaData) GetTimestamp() map[string]interface{} { + if o == nil || isNil(o.Timestamp) { + var ret map[string]interface{} return ret } - return *o.Timestamp + return o.Timestamp } // GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MetaData) GetTimestampOk() (*time.Time, bool) { - if o == nil || o.Timestamp == nil { - return nil, false +func (o *MetaData) GetTimestampOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.Timestamp) { + return map[string]interface{}{}, false } return o.Timestamp, true } // HasTimestamp returns a boolean if a field has been set. func (o *MetaData) HasTimestamp() bool { - if o != nil && o.Timestamp != nil { + if o != nil && !isNil(o.Timestamp) { return true } return false } -// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. -func (o *MetaData) SetTimestamp(v time.Time) { - o.Timestamp = &v +// SetTimestamp gets a reference to the given map[string]interface{} and assigns it to the Timestamp field. +func (o *MetaData) SetTimestamp(v map[string]interface{}) { + o.Timestamp = v } // GetPeriod returns the Period field value if set, zero value otherwise. func (o *MetaData) GetPeriod() PeriodMetaData { - if o == nil || o.Period == nil { + if o == nil || isNil(o.Period) { var ret PeriodMetaData return ret } @@ -82,15 +81,15 @@ func (o *MetaData) GetPeriod() PeriodMetaData { // GetPeriodOk returns a tuple with the Period field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MetaData) GetPeriodOk() (*PeriodMetaData, bool) { - if o == nil || o.Period == nil { - return nil, false + if o == nil || isNil(o.Period) { + return nil, false } return o.Period, true } // HasPeriod returns a boolean if a field has been set. func (o *MetaData) HasPeriod() bool { - if o != nil && o.Period != nil { + if o != nil && !isNil(o.Period) { return true } @@ -104,10 +103,10 @@ func (o *MetaData) SetPeriod(v PeriodMetaData) { func (o MetaData) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Timestamp != nil { + if !isNil(o.Timestamp) { toSerialize["Timestamp"] = o.Timestamp } - if o.Period != nil { + if !isNil(o.Period) { toSerialize["Period"] = o.Period } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor.go index 437c21a8..086625c4 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor.go @@ -16,51 +16,49 @@ import ( // Monitor struct for Monitor type Monitor struct { - // The unique key of this monitor. - MonitorGuid *string `json:"MonitorGuid,omitempty"` // The name of this monitor. Name *string `json:"Name,omitempty"` - MonitorType *MonitorType `json:"MonitorType,omitempty"` // Indicates whether this monitor is actively running according to the monitoring interval. IsActive *bool `json:"IsActive,omitempty"` - CustomFields *[]CustomField `json:"CustomFields,omitempty"` - // Indicates the interval in seconds - CheckInterval *int32 `json:"CheckInterval,omitempty"` - MonitorMode *MonitorMode `json:"MonitorMode,omitempty"` + // The unique key of this monitor. + MonitorGuid *string `json:"MonitorGuid,omitempty"` // Hash corresponding with this monitor. Hash *string `json:"Hash,omitempty"` - LoadTimeLimit1 *int32 `json:"LoadTimeLimit1,omitempty"` - LoadTimeLimit2 *int32 `json:"LoadTimeLimit2,omitempty"` - Url *string `json:"Url,omitempty"` - Port *int32 `json:"Port,omitempty"` - NetworkAddress *string `json:"NetworkAddress,omitempty"` // Indicates whether this monitor should generate alerts. GenerateAlert *bool `json:"GenerateAlert,omitempty"` // Indicates whether this monitor is locked. IsLocked *bool `json:"IsLocked,omitempty"` + // Indicates the interval in seconds + CheckInterval *int32 `json:"CheckInterval,omitempty"` Credits *int32 `json:"Credits,omitempty"` - PredefinedVariables *[]PredefinedVariable `json:"PredefinedVariables,omitempty"` - MsaSteps *[]MsaStep `json:"MsaSteps,omitempty"` - UserDefinedFunctions *[]UserDefinedFunction `json:"UserDefinedFunctions,omitempty"` - CustomMetrics *[]CustomMetric `json:"CustomMetrics,omitempty"` + MonitorMode *MonitorMode `json:"MonitorMode,omitempty"` + PredefinedVariables []PredefinedVariable `json:"PredefinedVariables,omitempty"` + MsaSteps []MsaStep `json:"MsaSteps,omitempty"` + UserDefinedFunctions []UserDefinedFunction `json:"UserDefinedFunctions,omitempty"` + CustomMetrics []CustomMetric `json:"CustomMetrics,omitempty"` + CustomFields []CustomField `json:"CustomFields,omitempty"` SelectedCheckpoints *SelectedCheckpoints `json:"SelectedCheckpoints,omitempty"` UsePrimaryCheckpointsOnly *bool `json:"UsePrimaryCheckpointsOnly,omitempty"` SelfServiceTransactionScript *string `json:"SelfServiceTransactionScript,omitempty"` + MonitorType *MonitorType `json:"MonitorType,omitempty"` Notes *string `json:"Notes,omitempty"` AlertOnLoadTimeLimit1 *bool `json:"AlertOnLoadTimeLimit1,omitempty"` + MultiStepApiTransactionScript *string `json:"MultiStepApiTransactionScript,omitempty"` + LoadTimeLimit1 *int32 `json:"LoadTimeLimit1,omitempty"` AlertOnLoadTimeLimit2 *bool `json:"AlertOnLoadTimeLimit2,omitempty"` + LoadTimeLimit2 *int32 `json:"LoadTimeLimit2,omitempty"` BlockGoogleAnalytics *bool `json:"BlockGoogleAnalytics,omitempty"` BlockUptrendsRum *bool `json:"BlockUptrendsRum,omitempty"` - BlockUrls *[]string `json:"BlockUrls,omitempty"` - RequestHeaders *[]RequestHeader `json:"RequestHeaders,omitempty"` + BlockUrls []string `json:"BlockUrls,omitempty"` + RequestHeaders []RequestHeader `json:"RequestHeaders,omitempty"` UserAgent *string `json:"UserAgent,omitempty"` Username *string `json:"Username,omitempty"` Password *string `json:"Password,omitempty"` NameForPhoneAlerts *string `json:"NameForPhoneAlerts,omitempty"` AuthenticationType *ApiHttpAuthenticationType `json:"AuthenticationType,omitempty"` ThrottlingOptions *ThrottlingOptions `json:"ThrottlingOptions,omitempty"` - // Only valid for Transaction monitors: the data structure that specifies the transaction steps (and sub steps) to execute. - TransactionStepDefinition *TransactionStepDefinition `json:"TransactionStepDefinition,omitempty"` + DnsBypasses []DnsBypass `json:"DnsBypasses,omitempty"` + TransactionStepDefinition *MonitorTransactionStepDefinition `json:"TransactionStepDefinition,omitempty"` CertificateName *string `json:"CertificateName,omitempty"` CertificateOrganization *string `json:"CertificateOrganization,omitempty"` CertificateOrganizationalUnit *string `json:"CertificateOrganizationalUnit,omitempty"` @@ -84,11 +82,12 @@ type Monitor struct { DnsQuery *DnsQuery `json:"DnsQuery,omitempty"` DnsExpectedResult *string `json:"DnsExpectedResult,omitempty"` DnsTestValue *string `json:"DnsTestValue,omitempty"` + Port *int32 `json:"Port,omitempty"` IpVersion *IpVersion `json:"IpVersion,omitempty"` - NativeIPv6Only *bool `json:"NativeIPv6Only,omitempty"` AlertOnMinimumBytes *bool `json:"AlertOnMinimumBytes,omitempty"` MinimumBytes *int32 `json:"MinimumBytes,omitempty"` DatabaseName *string `json:"DatabaseName,omitempty"` + NetworkAddress *string `json:"NetworkAddress,omitempty"` ImapSecureConnection *bool `json:"ImapSecureConnection,omitempty"` SftpAction *SftpAction `json:"SftpAction,omitempty"` SftpActionPath *string `json:"SftpActionPath,omitempty"` @@ -97,12 +96,14 @@ type Monitor struct { ExpectedHttpStatusCodeSpecified *bool `json:"ExpectedHttpStatusCodeSpecified,omitempty"` TlsVersion *TlsVersion `json:"TlsVersion,omitempty"` RequestBody *string `json:"RequestBody,omitempty"` - MatchPatterns *[]PatternMatch `json:"MatchPatterns,omitempty"` + MatchPatterns []PatternMatch `json:"MatchPatterns,omitempty"` + Url *string `json:"Url,omitempty"` BrowserType *BrowserType `json:"BrowserType,omitempty"` BrowserWindowDimensions *BrowserWindowDimensions `json:"BrowserWindowDimensions,omitempty"` UseConcurrentMonitoring *bool `json:"UseConcurrentMonitoring,omitempty"` ConcurrentUnconfirmedErrorThreshold *int32 `json:"ConcurrentUnconfirmedErrorThreshold,omitempty"` ConcurrentConfirmedErrorThreshold *int32 `json:"ConcurrentConfirmedErrorThreshold,omitempty"` + ErrorConditions []ErrorCondition `json:"ErrorConditions,omitempty"` } // NewMonitor instantiates a new Monitor object @@ -130,41 +131,9 @@ func NewMonitorWithDefaults() *Monitor { return &this } -// GetMonitorGuid returns the MonitorGuid field value if set, zero value otherwise. -func (o *Monitor) GetMonitorGuid() string { - if o == nil || o.MonitorGuid == nil { - var ret string - return ret - } - return *o.MonitorGuid -} - -// GetMonitorGuidOk returns a tuple with the MonitorGuid field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Monitor) GetMonitorGuidOk() (*string, bool) { - if o == nil || o.MonitorGuid == nil { - return nil, false - } - return o.MonitorGuid, true -} - -// HasMonitorGuid returns a boolean if a field has been set. -func (o *Monitor) HasMonitorGuid() bool { - if o != nil && o.MonitorGuid != nil { - return true - } - - return false -} - -// SetMonitorGuid gets a reference to the given string and assigns it to the MonitorGuid field. -func (o *Monitor) SetMonitorGuid(v string) { - o.MonitorGuid = &v -} - // GetName returns the Name field value if set, zero value otherwise. func (o *Monitor) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -174,15 +143,15 @@ func (o *Monitor) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *Monitor) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -194,41 +163,9 @@ func (o *Monitor) SetName(v string) { o.Name = &v } -// GetMonitorType returns the MonitorType field value if set, zero value otherwise. -func (o *Monitor) GetMonitorType() MonitorType { - if o == nil || o.MonitorType == nil { - var ret MonitorType - return ret - } - return *o.MonitorType -} - -// GetMonitorTypeOk returns a tuple with the MonitorType field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Monitor) GetMonitorTypeOk() (*MonitorType, bool) { - if o == nil || o.MonitorType == nil { - return nil, false - } - return o.MonitorType, true -} - -// HasMonitorType returns a boolean if a field has been set. -func (o *Monitor) HasMonitorType() bool { - if o != nil && o.MonitorType != nil { - return true - } - - return false -} - -// SetMonitorType gets a reference to the given MonitorType and assigns it to the MonitorType field. -func (o *Monitor) SetMonitorType(v MonitorType) { - o.MonitorType = &v -} - // GetIsActive returns the IsActive field value if set, zero value otherwise. func (o *Monitor) GetIsActive() bool { - if o == nil || o.IsActive == nil { + if o == nil || isNil(o.IsActive) { var ret bool return ret } @@ -238,15 +175,15 @@ func (o *Monitor) GetIsActive() bool { // GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetIsActiveOk() (*bool, bool) { - if o == nil || o.IsActive == nil { - return nil, false + if o == nil || isNil(o.IsActive) { + return nil, false } return o.IsActive, true } // HasIsActive returns a boolean if a field has been set. func (o *Monitor) HasIsActive() bool { - if o != nil && o.IsActive != nil { + if o != nil && !isNil(o.IsActive) { return true } @@ -258,105 +195,41 @@ func (o *Monitor) SetIsActive(v bool) { o.IsActive = &v } -// GetCustomFields returns the CustomFields field value if set, zero value otherwise. -func (o *Monitor) GetCustomFields() []CustomField { - if o == nil || o.CustomFields == nil { - var ret []CustomField - return ret - } - return *o.CustomFields -} - -// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Monitor) GetCustomFieldsOk() (*[]CustomField, bool) { - if o == nil || o.CustomFields == nil { - return nil, false - } - return o.CustomFields, true -} - -// HasCustomFields returns a boolean if a field has been set. -func (o *Monitor) HasCustomFields() bool { - if o != nil && o.CustomFields != nil { - return true - } - - return false -} - -// SetCustomFields gets a reference to the given []CustomField and assigns it to the CustomFields field. -func (o *Monitor) SetCustomFields(v []CustomField) { - o.CustomFields = &v -} - -// GetCheckInterval returns the CheckInterval field value if set, zero value otherwise. -func (o *Monitor) GetCheckInterval() int32 { - if o == nil || o.CheckInterval == nil { - var ret int32 - return ret - } - return *o.CheckInterval -} - -// GetCheckIntervalOk returns a tuple with the CheckInterval field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Monitor) GetCheckIntervalOk() (*int32, bool) { - if o == nil || o.CheckInterval == nil { - return nil, false - } - return o.CheckInterval, true -} - -// HasCheckInterval returns a boolean if a field has been set. -func (o *Monitor) HasCheckInterval() bool { - if o != nil && o.CheckInterval != nil { - return true - } - - return false -} - -// SetCheckInterval gets a reference to the given int32 and assigns it to the CheckInterval field. -func (o *Monitor) SetCheckInterval(v int32) { - o.CheckInterval = &v -} - -// GetMonitorMode returns the MonitorMode field value if set, zero value otherwise. -func (o *Monitor) GetMonitorMode() MonitorMode { - if o == nil || o.MonitorMode == nil { - var ret MonitorMode +// GetMonitorGuid returns the MonitorGuid field value if set, zero value otherwise. +func (o *Monitor) GetMonitorGuid() string { + if o == nil || isNil(o.MonitorGuid) { + var ret string return ret } - return *o.MonitorMode + return *o.MonitorGuid } -// GetMonitorModeOk returns a tuple with the MonitorMode field value if set, nil otherwise +// GetMonitorGuidOk returns a tuple with the MonitorGuid field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Monitor) GetMonitorModeOk() (*MonitorMode, bool) { - if o == nil || o.MonitorMode == nil { - return nil, false +func (o *Monitor) GetMonitorGuidOk() (*string, bool) { + if o == nil || isNil(o.MonitorGuid) { + return nil, false } - return o.MonitorMode, true + return o.MonitorGuid, true } -// HasMonitorMode returns a boolean if a field has been set. -func (o *Monitor) HasMonitorMode() bool { - if o != nil && o.MonitorMode != nil { +// HasMonitorGuid returns a boolean if a field has been set. +func (o *Monitor) HasMonitorGuid() bool { + if o != nil && !isNil(o.MonitorGuid) { return true } return false } -// SetMonitorMode gets a reference to the given MonitorMode and assigns it to the MonitorMode field. -func (o *Monitor) SetMonitorMode(v MonitorMode) { - o.MonitorMode = &v +// SetMonitorGuid gets a reference to the given string and assigns it to the MonitorGuid field. +func (o *Monitor) SetMonitorGuid(v string) { + o.MonitorGuid = &v } // GetHash returns the Hash field value if set, zero value otherwise. func (o *Monitor) GetHash() string { - if o == nil || o.Hash == nil { + if o == nil || isNil(o.Hash) { var ret string return ret } @@ -366,15 +239,15 @@ func (o *Monitor) GetHash() string { // GetHashOk returns a tuple with the Hash field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetHashOk() (*string, bool) { - if o == nil || o.Hash == nil { - return nil, false + if o == nil || isNil(o.Hash) { + return nil, false } return o.Hash, true } // HasHash returns a boolean if a field has been set. func (o *Monitor) HasHash() bool { - if o != nil && o.Hash != nil { + if o != nil && !isNil(o.Hash) { return true } @@ -386,169 +259,9 @@ func (o *Monitor) SetHash(v string) { o.Hash = &v } -// GetLoadTimeLimit1 returns the LoadTimeLimit1 field value if set, zero value otherwise. -func (o *Monitor) GetLoadTimeLimit1() int32 { - if o == nil || o.LoadTimeLimit1 == nil { - var ret int32 - return ret - } - return *o.LoadTimeLimit1 -} - -// GetLoadTimeLimit1Ok returns a tuple with the LoadTimeLimit1 field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Monitor) GetLoadTimeLimit1Ok() (*int32, bool) { - if o == nil || o.LoadTimeLimit1 == nil { - return nil, false - } - return o.LoadTimeLimit1, true -} - -// HasLoadTimeLimit1 returns a boolean if a field has been set. -func (o *Monitor) HasLoadTimeLimit1() bool { - if o != nil && o.LoadTimeLimit1 != nil { - return true - } - - return false -} - -// SetLoadTimeLimit1 gets a reference to the given int32 and assigns it to the LoadTimeLimit1 field. -func (o *Monitor) SetLoadTimeLimit1(v int32) { - o.LoadTimeLimit1 = &v -} - -// GetLoadTimeLimit2 returns the LoadTimeLimit2 field value if set, zero value otherwise. -func (o *Monitor) GetLoadTimeLimit2() int32 { - if o == nil || o.LoadTimeLimit2 == nil { - var ret int32 - return ret - } - return *o.LoadTimeLimit2 -} - -// GetLoadTimeLimit2Ok returns a tuple with the LoadTimeLimit2 field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Monitor) GetLoadTimeLimit2Ok() (*int32, bool) { - if o == nil || o.LoadTimeLimit2 == nil { - return nil, false - } - return o.LoadTimeLimit2, true -} - -// HasLoadTimeLimit2 returns a boolean if a field has been set. -func (o *Monitor) HasLoadTimeLimit2() bool { - if o != nil && o.LoadTimeLimit2 != nil { - return true - } - - return false -} - -// SetLoadTimeLimit2 gets a reference to the given int32 and assigns it to the LoadTimeLimit2 field. -func (o *Monitor) SetLoadTimeLimit2(v int32) { - o.LoadTimeLimit2 = &v -} - -// GetUrl returns the Url field value if set, zero value otherwise. -func (o *Monitor) GetUrl() string { - if o == nil || o.Url == nil { - var ret string - return ret - } - return *o.Url -} - -// GetUrlOk returns a tuple with the Url field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Monitor) GetUrlOk() (*string, bool) { - if o == nil || o.Url == nil { - return nil, false - } - return o.Url, true -} - -// HasUrl returns a boolean if a field has been set. -func (o *Monitor) HasUrl() bool { - if o != nil && o.Url != nil { - return true - } - - return false -} - -// SetUrl gets a reference to the given string and assigns it to the Url field. -func (o *Monitor) SetUrl(v string) { - o.Url = &v -} - -// GetPort returns the Port field value if set, zero value otherwise. -func (o *Monitor) GetPort() int32 { - if o == nil || o.Port == nil { - var ret int32 - return ret - } - return *o.Port -} - -// GetPortOk returns a tuple with the Port field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Monitor) GetPortOk() (*int32, bool) { - if o == nil || o.Port == nil { - return nil, false - } - return o.Port, true -} - -// HasPort returns a boolean if a field has been set. -func (o *Monitor) HasPort() bool { - if o != nil && o.Port != nil { - return true - } - - return false -} - -// SetPort gets a reference to the given int32 and assigns it to the Port field. -func (o *Monitor) SetPort(v int32) { - o.Port = &v -} - -// GetNetworkAddress returns the NetworkAddress field value if set, zero value otherwise. -func (o *Monitor) GetNetworkAddress() string { - if o == nil || o.NetworkAddress == nil { - var ret string - return ret - } - return *o.NetworkAddress -} - -// GetNetworkAddressOk returns a tuple with the NetworkAddress field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Monitor) GetNetworkAddressOk() (*string, bool) { - if o == nil || o.NetworkAddress == nil { - return nil, false - } - return o.NetworkAddress, true -} - -// HasNetworkAddress returns a boolean if a field has been set. -func (o *Monitor) HasNetworkAddress() bool { - if o != nil && o.NetworkAddress != nil { - return true - } - - return false -} - -// SetNetworkAddress gets a reference to the given string and assigns it to the NetworkAddress field. -func (o *Monitor) SetNetworkAddress(v string) { - o.NetworkAddress = &v -} - // GetGenerateAlert returns the GenerateAlert field value if set, zero value otherwise. func (o *Monitor) GetGenerateAlert() bool { - if o == nil || o.GenerateAlert == nil { + if o == nil || isNil(o.GenerateAlert) { var ret bool return ret } @@ -558,15 +271,15 @@ func (o *Monitor) GetGenerateAlert() bool { // GetGenerateAlertOk returns a tuple with the GenerateAlert field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetGenerateAlertOk() (*bool, bool) { - if o == nil || o.GenerateAlert == nil { - return nil, false + if o == nil || isNil(o.GenerateAlert) { + return nil, false } return o.GenerateAlert, true } // HasGenerateAlert returns a boolean if a field has been set. func (o *Monitor) HasGenerateAlert() bool { - if o != nil && o.GenerateAlert != nil { + if o != nil && !isNil(o.GenerateAlert) { return true } @@ -580,7 +293,7 @@ func (o *Monitor) SetGenerateAlert(v bool) { // GetIsLocked returns the IsLocked field value if set, zero value otherwise. func (o *Monitor) GetIsLocked() bool { - if o == nil || o.IsLocked == nil { + if o == nil || isNil(o.IsLocked) { var ret bool return ret } @@ -590,15 +303,15 @@ func (o *Monitor) GetIsLocked() bool { // GetIsLockedOk returns a tuple with the IsLocked field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetIsLockedOk() (*bool, bool) { - if o == nil || o.IsLocked == nil { - return nil, false + if o == nil || isNil(o.IsLocked) { + return nil, false } return o.IsLocked, true } // HasIsLocked returns a boolean if a field has been set. func (o *Monitor) HasIsLocked() bool { - if o != nil && o.IsLocked != nil { + if o != nil && !isNil(o.IsLocked) { return true } @@ -610,9 +323,41 @@ func (o *Monitor) SetIsLocked(v bool) { o.IsLocked = &v } +// GetCheckInterval returns the CheckInterval field value if set, zero value otherwise. +func (o *Monitor) GetCheckInterval() int32 { + if o == nil || isNil(o.CheckInterval) { + var ret int32 + return ret + } + return *o.CheckInterval +} + +// GetCheckIntervalOk returns a tuple with the CheckInterval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Monitor) GetCheckIntervalOk() (*int32, bool) { + if o == nil || isNil(o.CheckInterval) { + return nil, false + } + return o.CheckInterval, true +} + +// HasCheckInterval returns a boolean if a field has been set. +func (o *Monitor) HasCheckInterval() bool { + if o != nil && !isNil(o.CheckInterval) { + return true + } + + return false +} + +// SetCheckInterval gets a reference to the given int32 and assigns it to the CheckInterval field. +func (o *Monitor) SetCheckInterval(v int32) { + o.CheckInterval = &v +} + // GetCredits returns the Credits field value if set, zero value otherwise. func (o *Monitor) GetCredits() int32 { - if o == nil || o.Credits == nil { + if o == nil || isNil(o.Credits) { var ret int32 return ret } @@ -622,15 +367,15 @@ func (o *Monitor) GetCredits() int32 { // GetCreditsOk returns a tuple with the Credits field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetCreditsOk() (*int32, bool) { - if o == nil || o.Credits == nil { - return nil, false + if o == nil || isNil(o.Credits) { + return nil, false } return o.Credits, true } // HasCredits returns a boolean if a field has been set. func (o *Monitor) HasCredits() bool { - if o != nil && o.Credits != nil { + if o != nil && !isNil(o.Credits) { return true } @@ -642,27 +387,59 @@ func (o *Monitor) SetCredits(v int32) { o.Credits = &v } +// GetMonitorMode returns the MonitorMode field value if set, zero value otherwise. +func (o *Monitor) GetMonitorMode() MonitorMode { + if o == nil || isNil(o.MonitorMode) { + var ret MonitorMode + return ret + } + return *o.MonitorMode +} + +// GetMonitorModeOk returns a tuple with the MonitorMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Monitor) GetMonitorModeOk() (*MonitorMode, bool) { + if o == nil || isNil(o.MonitorMode) { + return nil, false + } + return o.MonitorMode, true +} + +// HasMonitorMode returns a boolean if a field has been set. +func (o *Monitor) HasMonitorMode() bool { + if o != nil && !isNil(o.MonitorMode) { + return true + } + + return false +} + +// SetMonitorMode gets a reference to the given MonitorMode and assigns it to the MonitorMode field. +func (o *Monitor) SetMonitorMode(v MonitorMode) { + o.MonitorMode = &v +} + // GetPredefinedVariables returns the PredefinedVariables field value if set, zero value otherwise. func (o *Monitor) GetPredefinedVariables() []PredefinedVariable { - if o == nil || o.PredefinedVariables == nil { + if o == nil || isNil(o.PredefinedVariables) { var ret []PredefinedVariable return ret } - return *o.PredefinedVariables + return o.PredefinedVariables } // GetPredefinedVariablesOk returns a tuple with the PredefinedVariables field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Monitor) GetPredefinedVariablesOk() (*[]PredefinedVariable, bool) { - if o == nil || o.PredefinedVariables == nil { - return nil, false +func (o *Monitor) GetPredefinedVariablesOk() ([]PredefinedVariable, bool) { + if o == nil || isNil(o.PredefinedVariables) { + return nil, false } return o.PredefinedVariables, true } // HasPredefinedVariables returns a boolean if a field has been set. func (o *Monitor) HasPredefinedVariables() bool { - if o != nil && o.PredefinedVariables != nil { + if o != nil && !isNil(o.PredefinedVariables) { return true } @@ -671,30 +448,30 @@ func (o *Monitor) HasPredefinedVariables() bool { // SetPredefinedVariables gets a reference to the given []PredefinedVariable and assigns it to the PredefinedVariables field. func (o *Monitor) SetPredefinedVariables(v []PredefinedVariable) { - o.PredefinedVariables = &v + o.PredefinedVariables = v } // GetMsaSteps returns the MsaSteps field value if set, zero value otherwise. func (o *Monitor) GetMsaSteps() []MsaStep { - if o == nil || o.MsaSteps == nil { + if o == nil || isNil(o.MsaSteps) { var ret []MsaStep return ret } - return *o.MsaSteps + return o.MsaSteps } // GetMsaStepsOk returns a tuple with the MsaSteps field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Monitor) GetMsaStepsOk() (*[]MsaStep, bool) { - if o == nil || o.MsaSteps == nil { - return nil, false +func (o *Monitor) GetMsaStepsOk() ([]MsaStep, bool) { + if o == nil || isNil(o.MsaSteps) { + return nil, false } return o.MsaSteps, true } // HasMsaSteps returns a boolean if a field has been set. func (o *Monitor) HasMsaSteps() bool { - if o != nil && o.MsaSteps != nil { + if o != nil && !isNil(o.MsaSteps) { return true } @@ -703,30 +480,30 @@ func (o *Monitor) HasMsaSteps() bool { // SetMsaSteps gets a reference to the given []MsaStep and assigns it to the MsaSteps field. func (o *Monitor) SetMsaSteps(v []MsaStep) { - o.MsaSteps = &v + o.MsaSteps = v } // GetUserDefinedFunctions returns the UserDefinedFunctions field value if set, zero value otherwise. func (o *Monitor) GetUserDefinedFunctions() []UserDefinedFunction { - if o == nil || o.UserDefinedFunctions == nil { + if o == nil || isNil(o.UserDefinedFunctions) { var ret []UserDefinedFunction return ret } - return *o.UserDefinedFunctions + return o.UserDefinedFunctions } // GetUserDefinedFunctionsOk returns a tuple with the UserDefinedFunctions field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Monitor) GetUserDefinedFunctionsOk() (*[]UserDefinedFunction, bool) { - if o == nil || o.UserDefinedFunctions == nil { - return nil, false +func (o *Monitor) GetUserDefinedFunctionsOk() ([]UserDefinedFunction, bool) { + if o == nil || isNil(o.UserDefinedFunctions) { + return nil, false } return o.UserDefinedFunctions, true } // HasUserDefinedFunctions returns a boolean if a field has been set. func (o *Monitor) HasUserDefinedFunctions() bool { - if o != nil && o.UserDefinedFunctions != nil { + if o != nil && !isNil(o.UserDefinedFunctions) { return true } @@ -735,30 +512,30 @@ func (o *Monitor) HasUserDefinedFunctions() bool { // SetUserDefinedFunctions gets a reference to the given []UserDefinedFunction and assigns it to the UserDefinedFunctions field. func (o *Monitor) SetUserDefinedFunctions(v []UserDefinedFunction) { - o.UserDefinedFunctions = &v + o.UserDefinedFunctions = v } // GetCustomMetrics returns the CustomMetrics field value if set, zero value otherwise. func (o *Monitor) GetCustomMetrics() []CustomMetric { - if o == nil || o.CustomMetrics == nil { + if o == nil || isNil(o.CustomMetrics) { var ret []CustomMetric return ret } - return *o.CustomMetrics + return o.CustomMetrics } // GetCustomMetricsOk returns a tuple with the CustomMetrics field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Monitor) GetCustomMetricsOk() (*[]CustomMetric, bool) { - if o == nil || o.CustomMetrics == nil { - return nil, false +func (o *Monitor) GetCustomMetricsOk() ([]CustomMetric, bool) { + if o == nil || isNil(o.CustomMetrics) { + return nil, false } return o.CustomMetrics, true } // HasCustomMetrics returns a boolean if a field has been set. func (o *Monitor) HasCustomMetrics() bool { - if o != nil && o.CustomMetrics != nil { + if o != nil && !isNil(o.CustomMetrics) { return true } @@ -767,12 +544,44 @@ func (o *Monitor) HasCustomMetrics() bool { // SetCustomMetrics gets a reference to the given []CustomMetric and assigns it to the CustomMetrics field. func (o *Monitor) SetCustomMetrics(v []CustomMetric) { - o.CustomMetrics = &v + o.CustomMetrics = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Monitor) GetCustomFields() []CustomField { + if o == nil || isNil(o.CustomFields) { + var ret []CustomField + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Monitor) GetCustomFieldsOk() ([]CustomField, bool) { + if o == nil || isNil(o.CustomFields) { + return nil, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Monitor) HasCustomFields() bool { + if o != nil && !isNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given []CustomField and assigns it to the CustomFields field. +func (o *Monitor) SetCustomFields(v []CustomField) { + o.CustomFields = v } // GetSelectedCheckpoints returns the SelectedCheckpoints field value if set, zero value otherwise. func (o *Monitor) GetSelectedCheckpoints() SelectedCheckpoints { - if o == nil || o.SelectedCheckpoints == nil { + if o == nil || isNil(o.SelectedCheckpoints) { var ret SelectedCheckpoints return ret } @@ -782,15 +591,15 @@ func (o *Monitor) GetSelectedCheckpoints() SelectedCheckpoints { // GetSelectedCheckpointsOk returns a tuple with the SelectedCheckpoints field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetSelectedCheckpointsOk() (*SelectedCheckpoints, bool) { - if o == nil || o.SelectedCheckpoints == nil { - return nil, false + if o == nil || isNil(o.SelectedCheckpoints) { + return nil, false } return o.SelectedCheckpoints, true } // HasSelectedCheckpoints returns a boolean if a field has been set. func (o *Monitor) HasSelectedCheckpoints() bool { - if o != nil && o.SelectedCheckpoints != nil { + if o != nil && !isNil(o.SelectedCheckpoints) { return true } @@ -804,7 +613,7 @@ func (o *Monitor) SetSelectedCheckpoints(v SelectedCheckpoints) { // GetUsePrimaryCheckpointsOnly returns the UsePrimaryCheckpointsOnly field value if set, zero value otherwise. func (o *Monitor) GetUsePrimaryCheckpointsOnly() bool { - if o == nil || o.UsePrimaryCheckpointsOnly == nil { + if o == nil || isNil(o.UsePrimaryCheckpointsOnly) { var ret bool return ret } @@ -814,15 +623,15 @@ func (o *Monitor) GetUsePrimaryCheckpointsOnly() bool { // GetUsePrimaryCheckpointsOnlyOk returns a tuple with the UsePrimaryCheckpointsOnly field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetUsePrimaryCheckpointsOnlyOk() (*bool, bool) { - if o == nil || o.UsePrimaryCheckpointsOnly == nil { - return nil, false + if o == nil || isNil(o.UsePrimaryCheckpointsOnly) { + return nil, false } return o.UsePrimaryCheckpointsOnly, true } // HasUsePrimaryCheckpointsOnly returns a boolean if a field has been set. func (o *Monitor) HasUsePrimaryCheckpointsOnly() bool { - if o != nil && o.UsePrimaryCheckpointsOnly != nil { + if o != nil && !isNil(o.UsePrimaryCheckpointsOnly) { return true } @@ -836,39 +645,71 @@ func (o *Monitor) SetUsePrimaryCheckpointsOnly(v bool) { // GetSelfServiceTransactionScript returns the SelfServiceTransactionScript field value if set, zero value otherwise. func (o *Monitor) GetSelfServiceTransactionScript() string { - if o == nil || o.SelfServiceTransactionScript == nil { + if o == nil || isNil(o.SelfServiceTransactionScript) { var ret string return ret } return *o.SelfServiceTransactionScript } -// GetSelfServiceTransactionScriptOk returns a tuple with the SelfServiceTransactionScript field value if set, nil otherwise +// GetSelfServiceTransactionScriptOk returns a tuple with the SelfServiceTransactionScript field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Monitor) GetSelfServiceTransactionScriptOk() (*string, bool) { + if o == nil || isNil(o.SelfServiceTransactionScript) { + return nil, false + } + return o.SelfServiceTransactionScript, true +} + +// HasSelfServiceTransactionScript returns a boolean if a field has been set. +func (o *Monitor) HasSelfServiceTransactionScript() bool { + if o != nil && !isNil(o.SelfServiceTransactionScript) { + return true + } + + return false +} + +// SetSelfServiceTransactionScript gets a reference to the given string and assigns it to the SelfServiceTransactionScript field. +func (o *Monitor) SetSelfServiceTransactionScript(v string) { + o.SelfServiceTransactionScript = &v +} + +// GetMonitorType returns the MonitorType field value if set, zero value otherwise. +func (o *Monitor) GetMonitorType() MonitorType { + if o == nil || isNil(o.MonitorType) { + var ret MonitorType + return ret + } + return *o.MonitorType +} + +// GetMonitorTypeOk returns a tuple with the MonitorType field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Monitor) GetSelfServiceTransactionScriptOk() (*string, bool) { - if o == nil || o.SelfServiceTransactionScript == nil { - return nil, false +func (o *Monitor) GetMonitorTypeOk() (*MonitorType, bool) { + if o == nil || isNil(o.MonitorType) { + return nil, false } - return o.SelfServiceTransactionScript, true + return o.MonitorType, true } -// HasSelfServiceTransactionScript returns a boolean if a field has been set. -func (o *Monitor) HasSelfServiceTransactionScript() bool { - if o != nil && o.SelfServiceTransactionScript != nil { +// HasMonitorType returns a boolean if a field has been set. +func (o *Monitor) HasMonitorType() bool { + if o != nil && !isNil(o.MonitorType) { return true } return false } -// SetSelfServiceTransactionScript gets a reference to the given string and assigns it to the SelfServiceTransactionScript field. -func (o *Monitor) SetSelfServiceTransactionScript(v string) { - o.SelfServiceTransactionScript = &v +// SetMonitorType gets a reference to the given MonitorType and assigns it to the MonitorType field. +func (o *Monitor) SetMonitorType(v MonitorType) { + o.MonitorType = &v } // GetNotes returns the Notes field value if set, zero value otherwise. func (o *Monitor) GetNotes() string { - if o == nil || o.Notes == nil { + if o == nil || isNil(o.Notes) { var ret string return ret } @@ -878,15 +719,15 @@ func (o *Monitor) GetNotes() string { // GetNotesOk returns a tuple with the Notes field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetNotesOk() (*string, bool) { - if o == nil || o.Notes == nil { - return nil, false + if o == nil || isNil(o.Notes) { + return nil, false } return o.Notes, true } // HasNotes returns a boolean if a field has been set. func (o *Monitor) HasNotes() bool { - if o != nil && o.Notes != nil { + if o != nil && !isNil(o.Notes) { return true } @@ -900,7 +741,7 @@ func (o *Monitor) SetNotes(v string) { // GetAlertOnLoadTimeLimit1 returns the AlertOnLoadTimeLimit1 field value if set, zero value otherwise. func (o *Monitor) GetAlertOnLoadTimeLimit1() bool { - if o == nil || o.AlertOnLoadTimeLimit1 == nil { + if o == nil || isNil(o.AlertOnLoadTimeLimit1) { var ret bool return ret } @@ -910,15 +751,15 @@ func (o *Monitor) GetAlertOnLoadTimeLimit1() bool { // GetAlertOnLoadTimeLimit1Ok returns a tuple with the AlertOnLoadTimeLimit1 field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetAlertOnLoadTimeLimit1Ok() (*bool, bool) { - if o == nil || o.AlertOnLoadTimeLimit1 == nil { - return nil, false + if o == nil || isNil(o.AlertOnLoadTimeLimit1) { + return nil, false } return o.AlertOnLoadTimeLimit1, true } // HasAlertOnLoadTimeLimit1 returns a boolean if a field has been set. func (o *Monitor) HasAlertOnLoadTimeLimit1() bool { - if o != nil && o.AlertOnLoadTimeLimit1 != nil { + if o != nil && !isNil(o.AlertOnLoadTimeLimit1) { return true } @@ -930,9 +771,73 @@ func (o *Monitor) SetAlertOnLoadTimeLimit1(v bool) { o.AlertOnLoadTimeLimit1 = &v } +// GetMultiStepApiTransactionScript returns the MultiStepApiTransactionScript field value if set, zero value otherwise. +func (o *Monitor) GetMultiStepApiTransactionScript() string { + if o == nil || isNil(o.MultiStepApiTransactionScript) { + var ret string + return ret + } + return *o.MultiStepApiTransactionScript +} + +// GetMultiStepApiTransactionScriptOk returns a tuple with the MultiStepApiTransactionScript field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Monitor) GetMultiStepApiTransactionScriptOk() (*string, bool) { + if o == nil || isNil(o.MultiStepApiTransactionScript) { + return nil, false + } + return o.MultiStepApiTransactionScript, true +} + +// HasMultiStepApiTransactionScript returns a boolean if a field has been set. +func (o *Monitor) HasMultiStepApiTransactionScript() bool { + if o != nil && !isNil(o.MultiStepApiTransactionScript) { + return true + } + + return false +} + +// SetMultiStepApiTransactionScript gets a reference to the given string and assigns it to the MultiStepApiTransactionScript field. +func (o *Monitor) SetMultiStepApiTransactionScript(v string) { + o.MultiStepApiTransactionScript = &v +} + +// GetLoadTimeLimit1 returns the LoadTimeLimit1 field value if set, zero value otherwise. +func (o *Monitor) GetLoadTimeLimit1() int32 { + if o == nil || isNil(o.LoadTimeLimit1) { + var ret int32 + return ret + } + return *o.LoadTimeLimit1 +} + +// GetLoadTimeLimit1Ok returns a tuple with the LoadTimeLimit1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Monitor) GetLoadTimeLimit1Ok() (*int32, bool) { + if o == nil || isNil(o.LoadTimeLimit1) { + return nil, false + } + return o.LoadTimeLimit1, true +} + +// HasLoadTimeLimit1 returns a boolean if a field has been set. +func (o *Monitor) HasLoadTimeLimit1() bool { + if o != nil && !isNil(o.LoadTimeLimit1) { + return true + } + + return false +} + +// SetLoadTimeLimit1 gets a reference to the given int32 and assigns it to the LoadTimeLimit1 field. +func (o *Monitor) SetLoadTimeLimit1(v int32) { + o.LoadTimeLimit1 = &v +} + // GetAlertOnLoadTimeLimit2 returns the AlertOnLoadTimeLimit2 field value if set, zero value otherwise. func (o *Monitor) GetAlertOnLoadTimeLimit2() bool { - if o == nil || o.AlertOnLoadTimeLimit2 == nil { + if o == nil || isNil(o.AlertOnLoadTimeLimit2) { var ret bool return ret } @@ -942,15 +847,15 @@ func (o *Monitor) GetAlertOnLoadTimeLimit2() bool { // GetAlertOnLoadTimeLimit2Ok returns a tuple with the AlertOnLoadTimeLimit2 field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetAlertOnLoadTimeLimit2Ok() (*bool, bool) { - if o == nil || o.AlertOnLoadTimeLimit2 == nil { - return nil, false + if o == nil || isNil(o.AlertOnLoadTimeLimit2) { + return nil, false } return o.AlertOnLoadTimeLimit2, true } // HasAlertOnLoadTimeLimit2 returns a boolean if a field has been set. func (o *Monitor) HasAlertOnLoadTimeLimit2() bool { - if o != nil && o.AlertOnLoadTimeLimit2 != nil { + if o != nil && !isNil(o.AlertOnLoadTimeLimit2) { return true } @@ -962,9 +867,41 @@ func (o *Monitor) SetAlertOnLoadTimeLimit2(v bool) { o.AlertOnLoadTimeLimit2 = &v } +// GetLoadTimeLimit2 returns the LoadTimeLimit2 field value if set, zero value otherwise. +func (o *Monitor) GetLoadTimeLimit2() int32 { + if o == nil || isNil(o.LoadTimeLimit2) { + var ret int32 + return ret + } + return *o.LoadTimeLimit2 +} + +// GetLoadTimeLimit2Ok returns a tuple with the LoadTimeLimit2 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Monitor) GetLoadTimeLimit2Ok() (*int32, bool) { + if o == nil || isNil(o.LoadTimeLimit2) { + return nil, false + } + return o.LoadTimeLimit2, true +} + +// HasLoadTimeLimit2 returns a boolean if a field has been set. +func (o *Monitor) HasLoadTimeLimit2() bool { + if o != nil && !isNil(o.LoadTimeLimit2) { + return true + } + + return false +} + +// SetLoadTimeLimit2 gets a reference to the given int32 and assigns it to the LoadTimeLimit2 field. +func (o *Monitor) SetLoadTimeLimit2(v int32) { + o.LoadTimeLimit2 = &v +} + // GetBlockGoogleAnalytics returns the BlockGoogleAnalytics field value if set, zero value otherwise. func (o *Monitor) GetBlockGoogleAnalytics() bool { - if o == nil || o.BlockGoogleAnalytics == nil { + if o == nil || isNil(o.BlockGoogleAnalytics) { var ret bool return ret } @@ -974,15 +911,15 @@ func (o *Monitor) GetBlockGoogleAnalytics() bool { // GetBlockGoogleAnalyticsOk returns a tuple with the BlockGoogleAnalytics field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetBlockGoogleAnalyticsOk() (*bool, bool) { - if o == nil || o.BlockGoogleAnalytics == nil { - return nil, false + if o == nil || isNil(o.BlockGoogleAnalytics) { + return nil, false } return o.BlockGoogleAnalytics, true } // HasBlockGoogleAnalytics returns a boolean if a field has been set. func (o *Monitor) HasBlockGoogleAnalytics() bool { - if o != nil && o.BlockGoogleAnalytics != nil { + if o != nil && !isNil(o.BlockGoogleAnalytics) { return true } @@ -996,7 +933,7 @@ func (o *Monitor) SetBlockGoogleAnalytics(v bool) { // GetBlockUptrendsRum returns the BlockUptrendsRum field value if set, zero value otherwise. func (o *Monitor) GetBlockUptrendsRum() bool { - if o == nil || o.BlockUptrendsRum == nil { + if o == nil || isNil(o.BlockUptrendsRum) { var ret bool return ret } @@ -1006,15 +943,15 @@ func (o *Monitor) GetBlockUptrendsRum() bool { // GetBlockUptrendsRumOk returns a tuple with the BlockUptrendsRum field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetBlockUptrendsRumOk() (*bool, bool) { - if o == nil || o.BlockUptrendsRum == nil { - return nil, false + if o == nil || isNil(o.BlockUptrendsRum) { + return nil, false } return o.BlockUptrendsRum, true } // HasBlockUptrendsRum returns a boolean if a field has been set. func (o *Monitor) HasBlockUptrendsRum() bool { - if o != nil && o.BlockUptrendsRum != nil { + if o != nil && !isNil(o.BlockUptrendsRum) { return true } @@ -1028,25 +965,25 @@ func (o *Monitor) SetBlockUptrendsRum(v bool) { // GetBlockUrls returns the BlockUrls field value if set, zero value otherwise. func (o *Monitor) GetBlockUrls() []string { - if o == nil || o.BlockUrls == nil { + if o == nil || isNil(o.BlockUrls) { var ret []string return ret } - return *o.BlockUrls + return o.BlockUrls } // GetBlockUrlsOk returns a tuple with the BlockUrls field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Monitor) GetBlockUrlsOk() (*[]string, bool) { - if o == nil || o.BlockUrls == nil { - return nil, false +func (o *Monitor) GetBlockUrlsOk() ([]string, bool) { + if o == nil || isNil(o.BlockUrls) { + return nil, false } return o.BlockUrls, true } // HasBlockUrls returns a boolean if a field has been set. func (o *Monitor) HasBlockUrls() bool { - if o != nil && o.BlockUrls != nil { + if o != nil && !isNil(o.BlockUrls) { return true } @@ -1055,30 +992,30 @@ func (o *Monitor) HasBlockUrls() bool { // SetBlockUrls gets a reference to the given []string and assigns it to the BlockUrls field. func (o *Monitor) SetBlockUrls(v []string) { - o.BlockUrls = &v + o.BlockUrls = v } // GetRequestHeaders returns the RequestHeaders field value if set, zero value otherwise. func (o *Monitor) GetRequestHeaders() []RequestHeader { - if o == nil || o.RequestHeaders == nil { + if o == nil || isNil(o.RequestHeaders) { var ret []RequestHeader return ret } - return *o.RequestHeaders + return o.RequestHeaders } // GetRequestHeadersOk returns a tuple with the RequestHeaders field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Monitor) GetRequestHeadersOk() (*[]RequestHeader, bool) { - if o == nil || o.RequestHeaders == nil { - return nil, false +func (o *Monitor) GetRequestHeadersOk() ([]RequestHeader, bool) { + if o == nil || isNil(o.RequestHeaders) { + return nil, false } return o.RequestHeaders, true } // HasRequestHeaders returns a boolean if a field has been set. func (o *Monitor) HasRequestHeaders() bool { - if o != nil && o.RequestHeaders != nil { + if o != nil && !isNil(o.RequestHeaders) { return true } @@ -1087,12 +1024,12 @@ func (o *Monitor) HasRequestHeaders() bool { // SetRequestHeaders gets a reference to the given []RequestHeader and assigns it to the RequestHeaders field. func (o *Monitor) SetRequestHeaders(v []RequestHeader) { - o.RequestHeaders = &v + o.RequestHeaders = v } // GetUserAgent returns the UserAgent field value if set, zero value otherwise. func (o *Monitor) GetUserAgent() string { - if o == nil || o.UserAgent == nil { + if o == nil || isNil(o.UserAgent) { var ret string return ret } @@ -1102,15 +1039,15 @@ func (o *Monitor) GetUserAgent() string { // GetUserAgentOk returns a tuple with the UserAgent field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetUserAgentOk() (*string, bool) { - if o == nil || o.UserAgent == nil { - return nil, false + if o == nil || isNil(o.UserAgent) { + return nil, false } return o.UserAgent, true } // HasUserAgent returns a boolean if a field has been set. func (o *Monitor) HasUserAgent() bool { - if o != nil && o.UserAgent != nil { + if o != nil && !isNil(o.UserAgent) { return true } @@ -1124,7 +1061,7 @@ func (o *Monitor) SetUserAgent(v string) { // GetUsername returns the Username field value if set, zero value otherwise. func (o *Monitor) GetUsername() string { - if o == nil || o.Username == nil { + if o == nil || isNil(o.Username) { var ret string return ret } @@ -1134,15 +1071,15 @@ func (o *Monitor) GetUsername() string { // GetUsernameOk returns a tuple with the Username field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetUsernameOk() (*string, bool) { - if o == nil || o.Username == nil { - return nil, false + if o == nil || isNil(o.Username) { + return nil, false } return o.Username, true } // HasUsername returns a boolean if a field has been set. func (o *Monitor) HasUsername() bool { - if o != nil && o.Username != nil { + if o != nil && !isNil(o.Username) { return true } @@ -1156,7 +1093,7 @@ func (o *Monitor) SetUsername(v string) { // GetPassword returns the Password field value if set, zero value otherwise. func (o *Monitor) GetPassword() string { - if o == nil || o.Password == nil { + if o == nil || isNil(o.Password) { var ret string return ret } @@ -1166,15 +1103,15 @@ func (o *Monitor) GetPassword() string { // GetPasswordOk returns a tuple with the Password field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetPasswordOk() (*string, bool) { - if o == nil || o.Password == nil { - return nil, false + if o == nil || isNil(o.Password) { + return nil, false } return o.Password, true } // HasPassword returns a boolean if a field has been set. func (o *Monitor) HasPassword() bool { - if o != nil && o.Password != nil { + if o != nil && !isNil(o.Password) { return true } @@ -1188,7 +1125,7 @@ func (o *Monitor) SetPassword(v string) { // GetNameForPhoneAlerts returns the NameForPhoneAlerts field value if set, zero value otherwise. func (o *Monitor) GetNameForPhoneAlerts() string { - if o == nil || o.NameForPhoneAlerts == nil { + if o == nil || isNil(o.NameForPhoneAlerts) { var ret string return ret } @@ -1198,15 +1135,15 @@ func (o *Monitor) GetNameForPhoneAlerts() string { // GetNameForPhoneAlertsOk returns a tuple with the NameForPhoneAlerts field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetNameForPhoneAlertsOk() (*string, bool) { - if o == nil || o.NameForPhoneAlerts == nil { - return nil, false + if o == nil || isNil(o.NameForPhoneAlerts) { + return nil, false } return o.NameForPhoneAlerts, true } // HasNameForPhoneAlerts returns a boolean if a field has been set. func (o *Monitor) HasNameForPhoneAlerts() bool { - if o != nil && o.NameForPhoneAlerts != nil { + if o != nil && !isNil(o.NameForPhoneAlerts) { return true } @@ -1220,7 +1157,7 @@ func (o *Monitor) SetNameForPhoneAlerts(v string) { // GetAuthenticationType returns the AuthenticationType field value if set, zero value otherwise. func (o *Monitor) GetAuthenticationType() ApiHttpAuthenticationType { - if o == nil || o.AuthenticationType == nil { + if o == nil || isNil(o.AuthenticationType) { var ret ApiHttpAuthenticationType return ret } @@ -1230,15 +1167,15 @@ func (o *Monitor) GetAuthenticationType() ApiHttpAuthenticationType { // GetAuthenticationTypeOk returns a tuple with the AuthenticationType field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetAuthenticationTypeOk() (*ApiHttpAuthenticationType, bool) { - if o == nil || o.AuthenticationType == nil { - return nil, false + if o == nil || isNil(o.AuthenticationType) { + return nil, false } return o.AuthenticationType, true } // HasAuthenticationType returns a boolean if a field has been set. func (o *Monitor) HasAuthenticationType() bool { - if o != nil && o.AuthenticationType != nil { + if o != nil && !isNil(o.AuthenticationType) { return true } @@ -1252,7 +1189,7 @@ func (o *Monitor) SetAuthenticationType(v ApiHttpAuthenticationType) { // GetThrottlingOptions returns the ThrottlingOptions field value if set, zero value otherwise. func (o *Monitor) GetThrottlingOptions() ThrottlingOptions { - if o == nil || o.ThrottlingOptions == nil { + if o == nil || isNil(o.ThrottlingOptions) { var ret ThrottlingOptions return ret } @@ -1262,15 +1199,15 @@ func (o *Monitor) GetThrottlingOptions() ThrottlingOptions { // GetThrottlingOptionsOk returns a tuple with the ThrottlingOptions field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetThrottlingOptionsOk() (*ThrottlingOptions, bool) { - if o == nil || o.ThrottlingOptions == nil { - return nil, false + if o == nil || isNil(o.ThrottlingOptions) { + return nil, false } return o.ThrottlingOptions, true } // HasThrottlingOptions returns a boolean if a field has been set. func (o *Monitor) HasThrottlingOptions() bool { - if o != nil && o.ThrottlingOptions != nil { + if o != nil && !isNil(o.ThrottlingOptions) { return true } @@ -1282,10 +1219,42 @@ func (o *Monitor) SetThrottlingOptions(v ThrottlingOptions) { o.ThrottlingOptions = &v } +// GetDnsBypasses returns the DnsBypasses field value if set, zero value otherwise. +func (o *Monitor) GetDnsBypasses() []DnsBypass { + if o == nil || isNil(o.DnsBypasses) { + var ret []DnsBypass + return ret + } + return o.DnsBypasses +} + +// GetDnsBypassesOk returns a tuple with the DnsBypasses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Monitor) GetDnsBypassesOk() ([]DnsBypass, bool) { + if o == nil || isNil(o.DnsBypasses) { + return nil, false + } + return o.DnsBypasses, true +} + +// HasDnsBypasses returns a boolean if a field has been set. +func (o *Monitor) HasDnsBypasses() bool { + if o != nil && !isNil(o.DnsBypasses) { + return true + } + + return false +} + +// SetDnsBypasses gets a reference to the given []DnsBypass and assigns it to the DnsBypasses field. +func (o *Monitor) SetDnsBypasses(v []DnsBypass) { + o.DnsBypasses = v +} + // GetTransactionStepDefinition returns the TransactionStepDefinition field value if set, zero value otherwise. -func (o *Monitor) GetTransactionStepDefinition() TransactionStepDefinition { - if o == nil || o.TransactionStepDefinition == nil { - var ret TransactionStepDefinition +func (o *Monitor) GetTransactionStepDefinition() MonitorTransactionStepDefinition { + if o == nil || isNil(o.TransactionStepDefinition) { + var ret MonitorTransactionStepDefinition return ret } return *o.TransactionStepDefinition @@ -1293,30 +1262,30 @@ func (o *Monitor) GetTransactionStepDefinition() TransactionStepDefinition { // GetTransactionStepDefinitionOk returns a tuple with the TransactionStepDefinition field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Monitor) GetTransactionStepDefinitionOk() (*TransactionStepDefinition, bool) { - if o == nil || o.TransactionStepDefinition == nil { - return nil, false +func (o *Monitor) GetTransactionStepDefinitionOk() (*MonitorTransactionStepDefinition, bool) { + if o == nil || isNil(o.TransactionStepDefinition) { + return nil, false } return o.TransactionStepDefinition, true } // HasTransactionStepDefinition returns a boolean if a field has been set. func (o *Monitor) HasTransactionStepDefinition() bool { - if o != nil && o.TransactionStepDefinition != nil { + if o != nil && !isNil(o.TransactionStepDefinition) { return true } return false } -// SetTransactionStepDefinition gets a reference to the given TransactionStepDefinition and assigns it to the TransactionStepDefinition field. -func (o *Monitor) SetTransactionStepDefinition(v TransactionStepDefinition) { +// SetTransactionStepDefinition gets a reference to the given MonitorTransactionStepDefinition and assigns it to the TransactionStepDefinition field. +func (o *Monitor) SetTransactionStepDefinition(v MonitorTransactionStepDefinition) { o.TransactionStepDefinition = &v } // GetCertificateName returns the CertificateName field value if set, zero value otherwise. func (o *Monitor) GetCertificateName() string { - if o == nil || o.CertificateName == nil { + if o == nil || isNil(o.CertificateName) { var ret string return ret } @@ -1326,15 +1295,15 @@ func (o *Monitor) GetCertificateName() string { // GetCertificateNameOk returns a tuple with the CertificateName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetCertificateNameOk() (*string, bool) { - if o == nil || o.CertificateName == nil { - return nil, false + if o == nil || isNil(o.CertificateName) { + return nil, false } return o.CertificateName, true } // HasCertificateName returns a boolean if a field has been set. func (o *Monitor) HasCertificateName() bool { - if o != nil && o.CertificateName != nil { + if o != nil && !isNil(o.CertificateName) { return true } @@ -1348,7 +1317,7 @@ func (o *Monitor) SetCertificateName(v string) { // GetCertificateOrganization returns the CertificateOrganization field value if set, zero value otherwise. func (o *Monitor) GetCertificateOrganization() string { - if o == nil || o.CertificateOrganization == nil { + if o == nil || isNil(o.CertificateOrganization) { var ret string return ret } @@ -1358,15 +1327,15 @@ func (o *Monitor) GetCertificateOrganization() string { // GetCertificateOrganizationOk returns a tuple with the CertificateOrganization field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetCertificateOrganizationOk() (*string, bool) { - if o == nil || o.CertificateOrganization == nil { - return nil, false + if o == nil || isNil(o.CertificateOrganization) { + return nil, false } return o.CertificateOrganization, true } // HasCertificateOrganization returns a boolean if a field has been set. func (o *Monitor) HasCertificateOrganization() bool { - if o != nil && o.CertificateOrganization != nil { + if o != nil && !isNil(o.CertificateOrganization) { return true } @@ -1380,7 +1349,7 @@ func (o *Monitor) SetCertificateOrganization(v string) { // GetCertificateOrganizationalUnit returns the CertificateOrganizationalUnit field value if set, zero value otherwise. func (o *Monitor) GetCertificateOrganizationalUnit() string { - if o == nil || o.CertificateOrganizationalUnit == nil { + if o == nil || isNil(o.CertificateOrganizationalUnit) { var ret string return ret } @@ -1390,15 +1359,15 @@ func (o *Monitor) GetCertificateOrganizationalUnit() string { // GetCertificateOrganizationalUnitOk returns a tuple with the CertificateOrganizationalUnit field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetCertificateOrganizationalUnitOk() (*string, bool) { - if o == nil || o.CertificateOrganizationalUnit == nil { - return nil, false + if o == nil || isNil(o.CertificateOrganizationalUnit) { + return nil, false } return o.CertificateOrganizationalUnit, true } // HasCertificateOrganizationalUnit returns a boolean if a field has been set. func (o *Monitor) HasCertificateOrganizationalUnit() bool { - if o != nil && o.CertificateOrganizationalUnit != nil { + if o != nil && !isNil(o.CertificateOrganizationalUnit) { return true } @@ -1412,7 +1381,7 @@ func (o *Monitor) SetCertificateOrganizationalUnit(v string) { // GetCertificateSerialNumber returns the CertificateSerialNumber field value if set, zero value otherwise. func (o *Monitor) GetCertificateSerialNumber() string { - if o == nil || o.CertificateSerialNumber == nil { + if o == nil || isNil(o.CertificateSerialNumber) { var ret string return ret } @@ -1422,15 +1391,15 @@ func (o *Monitor) GetCertificateSerialNumber() string { // GetCertificateSerialNumberOk returns a tuple with the CertificateSerialNumber field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetCertificateSerialNumberOk() (*string, bool) { - if o == nil || o.CertificateSerialNumber == nil { - return nil, false + if o == nil || isNil(o.CertificateSerialNumber) { + return nil, false } return o.CertificateSerialNumber, true } // HasCertificateSerialNumber returns a boolean if a field has been set. func (o *Monitor) HasCertificateSerialNumber() bool { - if o != nil && o.CertificateSerialNumber != nil { + if o != nil && !isNil(o.CertificateSerialNumber) { return true } @@ -1444,7 +1413,7 @@ func (o *Monitor) SetCertificateSerialNumber(v string) { // GetCertificateFingerprint returns the CertificateFingerprint field value if set, zero value otherwise. func (o *Monitor) GetCertificateFingerprint() string { - if o == nil || o.CertificateFingerprint == nil { + if o == nil || isNil(o.CertificateFingerprint) { var ret string return ret } @@ -1454,15 +1423,15 @@ func (o *Monitor) GetCertificateFingerprint() string { // GetCertificateFingerprintOk returns a tuple with the CertificateFingerprint field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetCertificateFingerprintOk() (*string, bool) { - if o == nil || o.CertificateFingerprint == nil { - return nil, false + if o == nil || isNil(o.CertificateFingerprint) { + return nil, false } return o.CertificateFingerprint, true } // HasCertificateFingerprint returns a boolean if a field has been set. func (o *Monitor) HasCertificateFingerprint() bool { - if o != nil && o.CertificateFingerprint != nil { + if o != nil && !isNil(o.CertificateFingerprint) { return true } @@ -1476,7 +1445,7 @@ func (o *Monitor) SetCertificateFingerprint(v string) { // GetCertificateIssuerName returns the CertificateIssuerName field value if set, zero value otherwise. func (o *Monitor) GetCertificateIssuerName() string { - if o == nil || o.CertificateIssuerName == nil { + if o == nil || isNil(o.CertificateIssuerName) { var ret string return ret } @@ -1486,15 +1455,15 @@ func (o *Monitor) GetCertificateIssuerName() string { // GetCertificateIssuerNameOk returns a tuple with the CertificateIssuerName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetCertificateIssuerNameOk() (*string, bool) { - if o == nil || o.CertificateIssuerName == nil { - return nil, false + if o == nil || isNil(o.CertificateIssuerName) { + return nil, false } return o.CertificateIssuerName, true } // HasCertificateIssuerName returns a boolean if a field has been set. func (o *Monitor) HasCertificateIssuerName() bool { - if o != nil && o.CertificateIssuerName != nil { + if o != nil && !isNil(o.CertificateIssuerName) { return true } @@ -1508,7 +1477,7 @@ func (o *Monitor) SetCertificateIssuerName(v string) { // GetCertificateIssuerCompanyName returns the CertificateIssuerCompanyName field value if set, zero value otherwise. func (o *Monitor) GetCertificateIssuerCompanyName() string { - if o == nil || o.CertificateIssuerCompanyName == nil { + if o == nil || isNil(o.CertificateIssuerCompanyName) { var ret string return ret } @@ -1518,15 +1487,15 @@ func (o *Monitor) GetCertificateIssuerCompanyName() string { // GetCertificateIssuerCompanyNameOk returns a tuple with the CertificateIssuerCompanyName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetCertificateIssuerCompanyNameOk() (*string, bool) { - if o == nil || o.CertificateIssuerCompanyName == nil { - return nil, false + if o == nil || isNil(o.CertificateIssuerCompanyName) { + return nil, false } return o.CertificateIssuerCompanyName, true } // HasCertificateIssuerCompanyName returns a boolean if a field has been set. func (o *Monitor) HasCertificateIssuerCompanyName() bool { - if o != nil && o.CertificateIssuerCompanyName != nil { + if o != nil && !isNil(o.CertificateIssuerCompanyName) { return true } @@ -1540,7 +1509,7 @@ func (o *Monitor) SetCertificateIssuerCompanyName(v string) { // GetCertificateIssuerOrganizationalUnit returns the CertificateIssuerOrganizationalUnit field value if set, zero value otherwise. func (o *Monitor) GetCertificateIssuerOrganizationalUnit() string { - if o == nil || o.CertificateIssuerOrganizationalUnit == nil { + if o == nil || isNil(o.CertificateIssuerOrganizationalUnit) { var ret string return ret } @@ -1550,15 +1519,15 @@ func (o *Monitor) GetCertificateIssuerOrganizationalUnit() string { // GetCertificateIssuerOrganizationalUnitOk returns a tuple with the CertificateIssuerOrganizationalUnit field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetCertificateIssuerOrganizationalUnitOk() (*string, bool) { - if o == nil || o.CertificateIssuerOrganizationalUnit == nil { - return nil, false + if o == nil || isNil(o.CertificateIssuerOrganizationalUnit) { + return nil, false } return o.CertificateIssuerOrganizationalUnit, true } // HasCertificateIssuerOrganizationalUnit returns a boolean if a field has been set. func (o *Monitor) HasCertificateIssuerOrganizationalUnit() bool { - if o != nil && o.CertificateIssuerOrganizationalUnit != nil { + if o != nil && !isNil(o.CertificateIssuerOrganizationalUnit) { return true } @@ -1572,7 +1541,7 @@ func (o *Monitor) SetCertificateIssuerOrganizationalUnit(v string) { // GetCertificateExpirationWarningDays returns the CertificateExpirationWarningDays field value if set, zero value otherwise. func (o *Monitor) GetCertificateExpirationWarningDays() int32 { - if o == nil || o.CertificateExpirationWarningDays == nil { + if o == nil || isNil(o.CertificateExpirationWarningDays) { var ret int32 return ret } @@ -1582,15 +1551,15 @@ func (o *Monitor) GetCertificateExpirationWarningDays() int32 { // GetCertificateExpirationWarningDaysOk returns a tuple with the CertificateExpirationWarningDays field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetCertificateExpirationWarningDaysOk() (*int32, bool) { - if o == nil || o.CertificateExpirationWarningDays == nil { - return nil, false + if o == nil || isNil(o.CertificateExpirationWarningDays) { + return nil, false } return o.CertificateExpirationWarningDays, true } // HasCertificateExpirationWarningDays returns a boolean if a field has been set. func (o *Monitor) HasCertificateExpirationWarningDays() bool { - if o != nil && o.CertificateExpirationWarningDays != nil { + if o != nil && !isNil(o.CertificateExpirationWarningDays) { return true } @@ -1604,7 +1573,7 @@ func (o *Monitor) SetCertificateExpirationWarningDays(v int32) { // GetCheckCertificateErrors returns the CheckCertificateErrors field value if set, zero value otherwise. func (o *Monitor) GetCheckCertificateErrors() bool { - if o == nil || o.CheckCertificateErrors == nil { + if o == nil || isNil(o.CheckCertificateErrors) { var ret bool return ret } @@ -1614,15 +1583,15 @@ func (o *Monitor) GetCheckCertificateErrors() bool { // GetCheckCertificateErrorsOk returns a tuple with the CheckCertificateErrors field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetCheckCertificateErrorsOk() (*bool, bool) { - if o == nil || o.CheckCertificateErrors == nil { - return nil, false + if o == nil || isNil(o.CheckCertificateErrors) { + return nil, false } return o.CheckCertificateErrors, true } // HasCheckCertificateErrors returns a boolean if a field has been set. func (o *Monitor) HasCheckCertificateErrors() bool { - if o != nil && o.CheckCertificateErrors != nil { + if o != nil && !isNil(o.CheckCertificateErrors) { return true } @@ -1636,7 +1605,7 @@ func (o *Monitor) SetCheckCertificateErrors(v bool) { // GetAlertOnMaximumBytes returns the AlertOnMaximumBytes field value if set, zero value otherwise. func (o *Monitor) GetAlertOnMaximumBytes() bool { - if o == nil || o.AlertOnMaximumBytes == nil { + if o == nil || isNil(o.AlertOnMaximumBytes) { var ret bool return ret } @@ -1646,15 +1615,15 @@ func (o *Monitor) GetAlertOnMaximumBytes() bool { // GetAlertOnMaximumBytesOk returns a tuple with the AlertOnMaximumBytes field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetAlertOnMaximumBytesOk() (*bool, bool) { - if o == nil || o.AlertOnMaximumBytes == nil { - return nil, false + if o == nil || isNil(o.AlertOnMaximumBytes) { + return nil, false } return o.AlertOnMaximumBytes, true } // HasAlertOnMaximumBytes returns a boolean if a field has been set. func (o *Monitor) HasAlertOnMaximumBytes() bool { - if o != nil && o.AlertOnMaximumBytes != nil { + if o != nil && !isNil(o.AlertOnMaximumBytes) { return true } @@ -1668,7 +1637,7 @@ func (o *Monitor) SetAlertOnMaximumBytes(v bool) { // GetMaximumBytes returns the MaximumBytes field value if set, zero value otherwise. func (o *Monitor) GetMaximumBytes() int32 { - if o == nil || o.MaximumBytes == nil { + if o == nil || isNil(o.MaximumBytes) { var ret int32 return ret } @@ -1678,15 +1647,15 @@ func (o *Monitor) GetMaximumBytes() int32 { // GetMaximumBytesOk returns a tuple with the MaximumBytes field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetMaximumBytesOk() (*int32, bool) { - if o == nil || o.MaximumBytes == nil { - return nil, false + if o == nil || isNil(o.MaximumBytes) { + return nil, false } return o.MaximumBytes, true } // HasMaximumBytes returns a boolean if a field has been set. func (o *Monitor) HasMaximumBytes() bool { - if o != nil && o.MaximumBytes != nil { + if o != nil && !isNil(o.MaximumBytes) { return true } @@ -1700,7 +1669,7 @@ func (o *Monitor) SetMaximumBytes(v int32) { // GetAlertOnMaximumSize returns the AlertOnMaximumSize field value if set, zero value otherwise. func (o *Monitor) GetAlertOnMaximumSize() bool { - if o == nil || o.AlertOnMaximumSize == nil { + if o == nil || isNil(o.AlertOnMaximumSize) { var ret bool return ret } @@ -1710,15 +1679,15 @@ func (o *Monitor) GetAlertOnMaximumSize() bool { // GetAlertOnMaximumSizeOk returns a tuple with the AlertOnMaximumSize field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetAlertOnMaximumSizeOk() (*bool, bool) { - if o == nil || o.AlertOnMaximumSize == nil { - return nil, false + if o == nil || isNil(o.AlertOnMaximumSize) { + return nil, false } return o.AlertOnMaximumSize, true } // HasAlertOnMaximumSize returns a boolean if a field has been set. func (o *Monitor) HasAlertOnMaximumSize() bool { - if o != nil && o.AlertOnMaximumSize != nil { + if o != nil && !isNil(o.AlertOnMaximumSize) { return true } @@ -1732,7 +1701,7 @@ func (o *Monitor) SetAlertOnMaximumSize(v bool) { // GetElementMaximumSize returns the ElementMaximumSize field value if set, zero value otherwise. func (o *Monitor) GetElementMaximumSize() int32 { - if o == nil || o.ElementMaximumSize == nil { + if o == nil || isNil(o.ElementMaximumSize) { var ret int32 return ret } @@ -1742,15 +1711,15 @@ func (o *Monitor) GetElementMaximumSize() int32 { // GetElementMaximumSizeOk returns a tuple with the ElementMaximumSize field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetElementMaximumSizeOk() (*int32, bool) { - if o == nil || o.ElementMaximumSize == nil { - return nil, false + if o == nil || isNil(o.ElementMaximumSize) { + return nil, false } return o.ElementMaximumSize, true } // HasElementMaximumSize returns a boolean if a field has been set. func (o *Monitor) HasElementMaximumSize() bool { - if o != nil && o.ElementMaximumSize != nil { + if o != nil && !isNil(o.ElementMaximumSize) { return true } @@ -1764,7 +1733,7 @@ func (o *Monitor) SetElementMaximumSize(v int32) { // GetIgnoreExternalElements returns the IgnoreExternalElements field value if set, zero value otherwise. func (o *Monitor) GetIgnoreExternalElements() bool { - if o == nil || o.IgnoreExternalElements == nil { + if o == nil || isNil(o.IgnoreExternalElements) { var ret bool return ret } @@ -1774,15 +1743,15 @@ func (o *Monitor) GetIgnoreExternalElements() bool { // GetIgnoreExternalElementsOk returns a tuple with the IgnoreExternalElements field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetIgnoreExternalElementsOk() (*bool, bool) { - if o == nil || o.IgnoreExternalElements == nil { - return nil, false + if o == nil || isNil(o.IgnoreExternalElements) { + return nil, false } return o.IgnoreExternalElements, true } // HasIgnoreExternalElements returns a boolean if a field has been set. func (o *Monitor) HasIgnoreExternalElements() bool { - if o != nil && o.IgnoreExternalElements != nil { + if o != nil && !isNil(o.IgnoreExternalElements) { return true } @@ -1796,7 +1765,7 @@ func (o *Monitor) SetIgnoreExternalElements(v bool) { // GetAlertOnPercentageFail returns the AlertOnPercentageFail field value if set, zero value otherwise. func (o *Monitor) GetAlertOnPercentageFail() bool { - if o == nil || o.AlertOnPercentageFail == nil { + if o == nil || isNil(o.AlertOnPercentageFail) { var ret bool return ret } @@ -1806,15 +1775,15 @@ func (o *Monitor) GetAlertOnPercentageFail() bool { // GetAlertOnPercentageFailOk returns a tuple with the AlertOnPercentageFail field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetAlertOnPercentageFailOk() (*bool, bool) { - if o == nil || o.AlertOnPercentageFail == nil { - return nil, false + if o == nil || isNil(o.AlertOnPercentageFail) { + return nil, false } return o.AlertOnPercentageFail, true } // HasAlertOnPercentageFail returns a boolean if a field has been set. func (o *Monitor) HasAlertOnPercentageFail() bool { - if o != nil && o.AlertOnPercentageFail != nil { + if o != nil && !isNil(o.AlertOnPercentageFail) { return true } @@ -1828,7 +1797,7 @@ func (o *Monitor) SetAlertOnPercentageFail(v bool) { // GetFailedObjectPercentage returns the FailedObjectPercentage field value if set, zero value otherwise. func (o *Monitor) GetFailedObjectPercentage() int32 { - if o == nil || o.FailedObjectPercentage == nil { + if o == nil || isNil(o.FailedObjectPercentage) { var ret int32 return ret } @@ -1838,15 +1807,15 @@ func (o *Monitor) GetFailedObjectPercentage() int32 { // GetFailedObjectPercentageOk returns a tuple with the FailedObjectPercentage field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetFailedObjectPercentageOk() (*int32, bool) { - if o == nil || o.FailedObjectPercentage == nil { - return nil, false + if o == nil || isNil(o.FailedObjectPercentage) { + return nil, false } return o.FailedObjectPercentage, true } // HasFailedObjectPercentage returns a boolean if a field has been set. func (o *Monitor) HasFailedObjectPercentage() bool { - if o != nil && o.FailedObjectPercentage != nil { + if o != nil && !isNil(o.FailedObjectPercentage) { return true } @@ -1860,7 +1829,7 @@ func (o *Monitor) SetFailedObjectPercentage(v int32) { // GetDomainGroupGuid returns the DomainGroupGuid field value if set, zero value otherwise. func (o *Monitor) GetDomainGroupGuid() string { - if o == nil || o.DomainGroupGuid == nil { + if o == nil || isNil(o.DomainGroupGuid) { var ret string return ret } @@ -1870,15 +1839,15 @@ func (o *Monitor) GetDomainGroupGuid() string { // GetDomainGroupGuidOk returns a tuple with the DomainGroupGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetDomainGroupGuidOk() (*string, bool) { - if o == nil || o.DomainGroupGuid == nil { - return nil, false + if o == nil || isNil(o.DomainGroupGuid) { + return nil, false } return o.DomainGroupGuid, true } // HasDomainGroupGuid returns a boolean if a field has been set. func (o *Monitor) HasDomainGroupGuid() bool { - if o != nil && o.DomainGroupGuid != nil { + if o != nil && !isNil(o.DomainGroupGuid) { return true } @@ -1892,7 +1861,7 @@ func (o *Monitor) SetDomainGroupGuid(v string) { // GetDomainGroupGuidSpecified returns the DomainGroupGuidSpecified field value if set, zero value otherwise. func (o *Monitor) GetDomainGroupGuidSpecified() bool { - if o == nil || o.DomainGroupGuidSpecified == nil { + if o == nil || isNil(o.DomainGroupGuidSpecified) { var ret bool return ret } @@ -1902,15 +1871,15 @@ func (o *Monitor) GetDomainGroupGuidSpecified() bool { // GetDomainGroupGuidSpecifiedOk returns a tuple with the DomainGroupGuidSpecified field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetDomainGroupGuidSpecifiedOk() (*bool, bool) { - if o == nil || o.DomainGroupGuidSpecified == nil { - return nil, false + if o == nil || isNil(o.DomainGroupGuidSpecified) { + return nil, false } return o.DomainGroupGuidSpecified, true } // HasDomainGroupGuidSpecified returns a boolean if a field has been set. func (o *Monitor) HasDomainGroupGuidSpecified() bool { - if o != nil && o.DomainGroupGuidSpecified != nil { + if o != nil && !isNil(o.DomainGroupGuidSpecified) { return true } @@ -1924,7 +1893,7 @@ func (o *Monitor) SetDomainGroupGuidSpecified(v bool) { // GetDnsServer returns the DnsServer field value if set, zero value otherwise. func (o *Monitor) GetDnsServer() string { - if o == nil || o.DnsServer == nil { + if o == nil || isNil(o.DnsServer) { var ret string return ret } @@ -1934,15 +1903,15 @@ func (o *Monitor) GetDnsServer() string { // GetDnsServerOk returns a tuple with the DnsServer field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetDnsServerOk() (*string, bool) { - if o == nil || o.DnsServer == nil { - return nil, false + if o == nil || isNil(o.DnsServer) { + return nil, false } return o.DnsServer, true } // HasDnsServer returns a boolean if a field has been set. func (o *Monitor) HasDnsServer() bool { - if o != nil && o.DnsServer != nil { + if o != nil && !isNil(o.DnsServer) { return true } @@ -1956,7 +1925,7 @@ func (o *Monitor) SetDnsServer(v string) { // GetDnsQuery returns the DnsQuery field value if set, zero value otherwise. func (o *Monitor) GetDnsQuery() DnsQuery { - if o == nil || o.DnsQuery == nil { + if o == nil || isNil(o.DnsQuery) { var ret DnsQuery return ret } @@ -1966,15 +1935,15 @@ func (o *Monitor) GetDnsQuery() DnsQuery { // GetDnsQueryOk returns a tuple with the DnsQuery field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetDnsQueryOk() (*DnsQuery, bool) { - if o == nil || o.DnsQuery == nil { - return nil, false + if o == nil || isNil(o.DnsQuery) { + return nil, false } return o.DnsQuery, true } // HasDnsQuery returns a boolean if a field has been set. func (o *Monitor) HasDnsQuery() bool { - if o != nil && o.DnsQuery != nil { + if o != nil && !isNil(o.DnsQuery) { return true } @@ -1988,7 +1957,7 @@ func (o *Monitor) SetDnsQuery(v DnsQuery) { // GetDnsExpectedResult returns the DnsExpectedResult field value if set, zero value otherwise. func (o *Monitor) GetDnsExpectedResult() string { - if o == nil || o.DnsExpectedResult == nil { + if o == nil || isNil(o.DnsExpectedResult) { var ret string return ret } @@ -1998,15 +1967,15 @@ func (o *Monitor) GetDnsExpectedResult() string { // GetDnsExpectedResultOk returns a tuple with the DnsExpectedResult field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetDnsExpectedResultOk() (*string, bool) { - if o == nil || o.DnsExpectedResult == nil { - return nil, false + if o == nil || isNil(o.DnsExpectedResult) { + return nil, false } return o.DnsExpectedResult, true } // HasDnsExpectedResult returns a boolean if a field has been set. func (o *Monitor) HasDnsExpectedResult() bool { - if o != nil && o.DnsExpectedResult != nil { + if o != nil && !isNil(o.DnsExpectedResult) { return true } @@ -2020,7 +1989,7 @@ func (o *Monitor) SetDnsExpectedResult(v string) { // GetDnsTestValue returns the DnsTestValue field value if set, zero value otherwise. func (o *Monitor) GetDnsTestValue() string { - if o == nil || o.DnsTestValue == nil { + if o == nil || isNil(o.DnsTestValue) { var ret string return ret } @@ -2030,15 +1999,15 @@ func (o *Monitor) GetDnsTestValue() string { // GetDnsTestValueOk returns a tuple with the DnsTestValue field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetDnsTestValueOk() (*string, bool) { - if o == nil || o.DnsTestValue == nil { - return nil, false + if o == nil || isNil(o.DnsTestValue) { + return nil, false } return o.DnsTestValue, true } // HasDnsTestValue returns a boolean if a field has been set. func (o *Monitor) HasDnsTestValue() bool { - if o != nil && o.DnsTestValue != nil { + if o != nil && !isNil(o.DnsTestValue) { return true } @@ -2050,73 +2019,73 @@ func (o *Monitor) SetDnsTestValue(v string) { o.DnsTestValue = &v } -// GetIpVersion returns the IpVersion field value if set, zero value otherwise. -func (o *Monitor) GetIpVersion() IpVersion { - if o == nil || o.IpVersion == nil { - var ret IpVersion +// GetPort returns the Port field value if set, zero value otherwise. +func (o *Monitor) GetPort() int32 { + if o == nil || isNil(o.Port) { + var ret int32 return ret } - return *o.IpVersion + return *o.Port } -// GetIpVersionOk returns a tuple with the IpVersion field value if set, nil otherwise +// GetPortOk returns a tuple with the Port field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Monitor) GetIpVersionOk() (*IpVersion, bool) { - if o == nil || o.IpVersion == nil { - return nil, false +func (o *Monitor) GetPortOk() (*int32, bool) { + if o == nil || isNil(o.Port) { + return nil, false } - return o.IpVersion, true + return o.Port, true } -// HasIpVersion returns a boolean if a field has been set. -func (o *Monitor) HasIpVersion() bool { - if o != nil && o.IpVersion != nil { +// HasPort returns a boolean if a field has been set. +func (o *Monitor) HasPort() bool { + if o != nil && !isNil(o.Port) { return true } return false } -// SetIpVersion gets a reference to the given IpVersion and assigns it to the IpVersion field. -func (o *Monitor) SetIpVersion(v IpVersion) { - o.IpVersion = &v +// SetPort gets a reference to the given int32 and assigns it to the Port field. +func (o *Monitor) SetPort(v int32) { + o.Port = &v } -// GetNativeIPv6Only returns the NativeIPv6Only field value if set, zero value otherwise. -func (o *Monitor) GetNativeIPv6Only() bool { - if o == nil || o.NativeIPv6Only == nil { - var ret bool +// GetIpVersion returns the IpVersion field value if set, zero value otherwise. +func (o *Monitor) GetIpVersion() IpVersion { + if o == nil || isNil(o.IpVersion) { + var ret IpVersion return ret } - return *o.NativeIPv6Only + return *o.IpVersion } -// GetNativeIPv6OnlyOk returns a tuple with the NativeIPv6Only field value if set, nil otherwise +// GetIpVersionOk returns a tuple with the IpVersion field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Monitor) GetNativeIPv6OnlyOk() (*bool, bool) { - if o == nil || o.NativeIPv6Only == nil { - return nil, false +func (o *Monitor) GetIpVersionOk() (*IpVersion, bool) { + if o == nil || isNil(o.IpVersion) { + return nil, false } - return o.NativeIPv6Only, true + return o.IpVersion, true } -// HasNativeIPv6Only returns a boolean if a field has been set. -func (o *Monitor) HasNativeIPv6Only() bool { - if o != nil && o.NativeIPv6Only != nil { +// HasIpVersion returns a boolean if a field has been set. +func (o *Monitor) HasIpVersion() bool { + if o != nil && !isNil(o.IpVersion) { return true } return false } -// SetNativeIPv6Only gets a reference to the given bool and assigns it to the NativeIPv6Only field. -func (o *Monitor) SetNativeIPv6Only(v bool) { - o.NativeIPv6Only = &v +// SetIpVersion gets a reference to the given IpVersion and assigns it to the IpVersion field. +func (o *Monitor) SetIpVersion(v IpVersion) { + o.IpVersion = &v } // GetAlertOnMinimumBytes returns the AlertOnMinimumBytes field value if set, zero value otherwise. func (o *Monitor) GetAlertOnMinimumBytes() bool { - if o == nil || o.AlertOnMinimumBytes == nil { + if o == nil || isNil(o.AlertOnMinimumBytes) { var ret bool return ret } @@ -2126,15 +2095,15 @@ func (o *Monitor) GetAlertOnMinimumBytes() bool { // GetAlertOnMinimumBytesOk returns a tuple with the AlertOnMinimumBytes field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetAlertOnMinimumBytesOk() (*bool, bool) { - if o == nil || o.AlertOnMinimumBytes == nil { - return nil, false + if o == nil || isNil(o.AlertOnMinimumBytes) { + return nil, false } return o.AlertOnMinimumBytes, true } // HasAlertOnMinimumBytes returns a boolean if a field has been set. func (o *Monitor) HasAlertOnMinimumBytes() bool { - if o != nil && o.AlertOnMinimumBytes != nil { + if o != nil && !isNil(o.AlertOnMinimumBytes) { return true } @@ -2148,7 +2117,7 @@ func (o *Monitor) SetAlertOnMinimumBytes(v bool) { // GetMinimumBytes returns the MinimumBytes field value if set, zero value otherwise. func (o *Monitor) GetMinimumBytes() int32 { - if o == nil || o.MinimumBytes == nil { + if o == nil || isNil(o.MinimumBytes) { var ret int32 return ret } @@ -2158,15 +2127,15 @@ func (o *Monitor) GetMinimumBytes() int32 { // GetMinimumBytesOk returns a tuple with the MinimumBytes field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetMinimumBytesOk() (*int32, bool) { - if o == nil || o.MinimumBytes == nil { - return nil, false + if o == nil || isNil(o.MinimumBytes) { + return nil, false } return o.MinimumBytes, true } // HasMinimumBytes returns a boolean if a field has been set. func (o *Monitor) HasMinimumBytes() bool { - if o != nil && o.MinimumBytes != nil { + if o != nil && !isNil(o.MinimumBytes) { return true } @@ -2180,7 +2149,7 @@ func (o *Monitor) SetMinimumBytes(v int32) { // GetDatabaseName returns the DatabaseName field value if set, zero value otherwise. func (o *Monitor) GetDatabaseName() string { - if o == nil || o.DatabaseName == nil { + if o == nil || isNil(o.DatabaseName) { var ret string return ret } @@ -2190,15 +2159,15 @@ func (o *Monitor) GetDatabaseName() string { // GetDatabaseNameOk returns a tuple with the DatabaseName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetDatabaseNameOk() (*string, bool) { - if o == nil || o.DatabaseName == nil { - return nil, false + if o == nil || isNil(o.DatabaseName) { + return nil, false } return o.DatabaseName, true } // HasDatabaseName returns a boolean if a field has been set. func (o *Monitor) HasDatabaseName() bool { - if o != nil && o.DatabaseName != nil { + if o != nil && !isNil(o.DatabaseName) { return true } @@ -2210,9 +2179,41 @@ func (o *Monitor) SetDatabaseName(v string) { o.DatabaseName = &v } +// GetNetworkAddress returns the NetworkAddress field value if set, zero value otherwise. +func (o *Monitor) GetNetworkAddress() string { + if o == nil || isNil(o.NetworkAddress) { + var ret string + return ret + } + return *o.NetworkAddress +} + +// GetNetworkAddressOk returns a tuple with the NetworkAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Monitor) GetNetworkAddressOk() (*string, bool) { + if o == nil || isNil(o.NetworkAddress) { + return nil, false + } + return o.NetworkAddress, true +} + +// HasNetworkAddress returns a boolean if a field has been set. +func (o *Monitor) HasNetworkAddress() bool { + if o != nil && !isNil(o.NetworkAddress) { + return true + } + + return false +} + +// SetNetworkAddress gets a reference to the given string and assigns it to the NetworkAddress field. +func (o *Monitor) SetNetworkAddress(v string) { + o.NetworkAddress = &v +} + // GetImapSecureConnection returns the ImapSecureConnection field value if set, zero value otherwise. func (o *Monitor) GetImapSecureConnection() bool { - if o == nil || o.ImapSecureConnection == nil { + if o == nil || isNil(o.ImapSecureConnection) { var ret bool return ret } @@ -2222,15 +2223,15 @@ func (o *Monitor) GetImapSecureConnection() bool { // GetImapSecureConnectionOk returns a tuple with the ImapSecureConnection field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetImapSecureConnectionOk() (*bool, bool) { - if o == nil || o.ImapSecureConnection == nil { - return nil, false + if o == nil || isNil(o.ImapSecureConnection) { + return nil, false } return o.ImapSecureConnection, true } // HasImapSecureConnection returns a boolean if a field has been set. func (o *Monitor) HasImapSecureConnection() bool { - if o != nil && o.ImapSecureConnection != nil { + if o != nil && !isNil(o.ImapSecureConnection) { return true } @@ -2244,7 +2245,7 @@ func (o *Monitor) SetImapSecureConnection(v bool) { // GetSftpAction returns the SftpAction field value if set, zero value otherwise. func (o *Monitor) GetSftpAction() SftpAction { - if o == nil || o.SftpAction == nil { + if o == nil || isNil(o.SftpAction) { var ret SftpAction return ret } @@ -2254,15 +2255,15 @@ func (o *Monitor) GetSftpAction() SftpAction { // GetSftpActionOk returns a tuple with the SftpAction field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetSftpActionOk() (*SftpAction, bool) { - if o == nil || o.SftpAction == nil { - return nil, false + if o == nil || isNil(o.SftpAction) { + return nil, false } return o.SftpAction, true } // HasSftpAction returns a boolean if a field has been set. func (o *Monitor) HasSftpAction() bool { - if o != nil && o.SftpAction != nil { + if o != nil && !isNil(o.SftpAction) { return true } @@ -2276,7 +2277,7 @@ func (o *Monitor) SetSftpAction(v SftpAction) { // GetSftpActionPath returns the SftpActionPath field value if set, zero value otherwise. func (o *Monitor) GetSftpActionPath() string { - if o == nil || o.SftpActionPath == nil { + if o == nil || isNil(o.SftpActionPath) { var ret string return ret } @@ -2286,15 +2287,15 @@ func (o *Monitor) GetSftpActionPath() string { // GetSftpActionPathOk returns a tuple with the SftpActionPath field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetSftpActionPathOk() (*string, bool) { - if o == nil || o.SftpActionPath == nil { - return nil, false + if o == nil || isNil(o.SftpActionPath) { + return nil, false } return o.SftpActionPath, true } // HasSftpActionPath returns a boolean if a field has been set. func (o *Monitor) HasSftpActionPath() bool { - if o != nil && o.SftpActionPath != nil { + if o != nil && !isNil(o.SftpActionPath) { return true } @@ -2308,7 +2309,7 @@ func (o *Monitor) SetSftpActionPath(v string) { // GetHttpMethod returns the HttpMethod field value if set, zero value otherwise. func (o *Monitor) GetHttpMethod() HttpMethod { - if o == nil || o.HttpMethod == nil { + if o == nil || isNil(o.HttpMethod) { var ret HttpMethod return ret } @@ -2318,15 +2319,15 @@ func (o *Monitor) GetHttpMethod() HttpMethod { // GetHttpMethodOk returns a tuple with the HttpMethod field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetHttpMethodOk() (*HttpMethod, bool) { - if o == nil || o.HttpMethod == nil { - return nil, false + if o == nil || isNil(o.HttpMethod) { + return nil, false } return o.HttpMethod, true } // HasHttpMethod returns a boolean if a field has been set. func (o *Monitor) HasHttpMethod() bool { - if o != nil && o.HttpMethod != nil { + if o != nil && !isNil(o.HttpMethod) { return true } @@ -2340,7 +2341,7 @@ func (o *Monitor) SetHttpMethod(v HttpMethod) { // GetExpectedHttpStatusCode returns the ExpectedHttpStatusCode field value if set, zero value otherwise. func (o *Monitor) GetExpectedHttpStatusCode() int32 { - if o == nil || o.ExpectedHttpStatusCode == nil { + if o == nil || isNil(o.ExpectedHttpStatusCode) { var ret int32 return ret } @@ -2350,15 +2351,15 @@ func (o *Monitor) GetExpectedHttpStatusCode() int32 { // GetExpectedHttpStatusCodeOk returns a tuple with the ExpectedHttpStatusCode field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetExpectedHttpStatusCodeOk() (*int32, bool) { - if o == nil || o.ExpectedHttpStatusCode == nil { - return nil, false + if o == nil || isNil(o.ExpectedHttpStatusCode) { + return nil, false } return o.ExpectedHttpStatusCode, true } // HasExpectedHttpStatusCode returns a boolean if a field has been set. func (o *Monitor) HasExpectedHttpStatusCode() bool { - if o != nil && o.ExpectedHttpStatusCode != nil { + if o != nil && !isNil(o.ExpectedHttpStatusCode) { return true } @@ -2372,7 +2373,7 @@ func (o *Monitor) SetExpectedHttpStatusCode(v int32) { // GetExpectedHttpStatusCodeSpecified returns the ExpectedHttpStatusCodeSpecified field value if set, zero value otherwise. func (o *Monitor) GetExpectedHttpStatusCodeSpecified() bool { - if o == nil || o.ExpectedHttpStatusCodeSpecified == nil { + if o == nil || isNil(o.ExpectedHttpStatusCodeSpecified) { var ret bool return ret } @@ -2382,15 +2383,15 @@ func (o *Monitor) GetExpectedHttpStatusCodeSpecified() bool { // GetExpectedHttpStatusCodeSpecifiedOk returns a tuple with the ExpectedHttpStatusCodeSpecified field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetExpectedHttpStatusCodeSpecifiedOk() (*bool, bool) { - if o == nil || o.ExpectedHttpStatusCodeSpecified == nil { - return nil, false + if o == nil || isNil(o.ExpectedHttpStatusCodeSpecified) { + return nil, false } return o.ExpectedHttpStatusCodeSpecified, true } // HasExpectedHttpStatusCodeSpecified returns a boolean if a field has been set. func (o *Monitor) HasExpectedHttpStatusCodeSpecified() bool { - if o != nil && o.ExpectedHttpStatusCodeSpecified != nil { + if o != nil && !isNil(o.ExpectedHttpStatusCodeSpecified) { return true } @@ -2404,7 +2405,7 @@ func (o *Monitor) SetExpectedHttpStatusCodeSpecified(v bool) { // GetTlsVersion returns the TlsVersion field value if set, zero value otherwise. func (o *Monitor) GetTlsVersion() TlsVersion { - if o == nil || o.TlsVersion == nil { + if o == nil || isNil(o.TlsVersion) { var ret TlsVersion return ret } @@ -2414,15 +2415,15 @@ func (o *Monitor) GetTlsVersion() TlsVersion { // GetTlsVersionOk returns a tuple with the TlsVersion field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetTlsVersionOk() (*TlsVersion, bool) { - if o == nil || o.TlsVersion == nil { - return nil, false + if o == nil || isNil(o.TlsVersion) { + return nil, false } return o.TlsVersion, true } // HasTlsVersion returns a boolean if a field has been set. func (o *Monitor) HasTlsVersion() bool { - if o != nil && o.TlsVersion != nil { + if o != nil && !isNil(o.TlsVersion) { return true } @@ -2436,7 +2437,7 @@ func (o *Monitor) SetTlsVersion(v TlsVersion) { // GetRequestBody returns the RequestBody field value if set, zero value otherwise. func (o *Monitor) GetRequestBody() string { - if o == nil || o.RequestBody == nil { + if o == nil || isNil(o.RequestBody) { var ret string return ret } @@ -2446,15 +2447,15 @@ func (o *Monitor) GetRequestBody() string { // GetRequestBodyOk returns a tuple with the RequestBody field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetRequestBodyOk() (*string, bool) { - if o == nil || o.RequestBody == nil { - return nil, false + if o == nil || isNil(o.RequestBody) { + return nil, false } return o.RequestBody, true } // HasRequestBody returns a boolean if a field has been set. func (o *Monitor) HasRequestBody() bool { - if o != nil && o.RequestBody != nil { + if o != nil && !isNil(o.RequestBody) { return true } @@ -2468,25 +2469,25 @@ func (o *Monitor) SetRequestBody(v string) { // GetMatchPatterns returns the MatchPatterns field value if set, zero value otherwise. func (o *Monitor) GetMatchPatterns() []PatternMatch { - if o == nil || o.MatchPatterns == nil { + if o == nil || isNil(o.MatchPatterns) { var ret []PatternMatch return ret } - return *o.MatchPatterns + return o.MatchPatterns } // GetMatchPatternsOk returns a tuple with the MatchPatterns field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Monitor) GetMatchPatternsOk() (*[]PatternMatch, bool) { - if o == nil || o.MatchPatterns == nil { - return nil, false +func (o *Monitor) GetMatchPatternsOk() ([]PatternMatch, bool) { + if o == nil || isNil(o.MatchPatterns) { + return nil, false } return o.MatchPatterns, true } // HasMatchPatterns returns a boolean if a field has been set. func (o *Monitor) HasMatchPatterns() bool { - if o != nil && o.MatchPatterns != nil { + if o != nil && !isNil(o.MatchPatterns) { return true } @@ -2495,12 +2496,44 @@ func (o *Monitor) HasMatchPatterns() bool { // SetMatchPatterns gets a reference to the given []PatternMatch and assigns it to the MatchPatterns field. func (o *Monitor) SetMatchPatterns(v []PatternMatch) { - o.MatchPatterns = &v + o.MatchPatterns = v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *Monitor) GetUrl() string { + if o == nil || isNil(o.Url) { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Monitor) GetUrlOk() (*string, bool) { + if o == nil || isNil(o.Url) { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *Monitor) HasUrl() bool { + if o != nil && !isNil(o.Url) { + return true + } + + return false +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *Monitor) SetUrl(v string) { + o.Url = &v } // GetBrowserType returns the BrowserType field value if set, zero value otherwise. func (o *Monitor) GetBrowserType() BrowserType { - if o == nil || o.BrowserType == nil { + if o == nil || isNil(o.BrowserType) { var ret BrowserType return ret } @@ -2510,15 +2543,15 @@ func (o *Monitor) GetBrowserType() BrowserType { // GetBrowserTypeOk returns a tuple with the BrowserType field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetBrowserTypeOk() (*BrowserType, bool) { - if o == nil || o.BrowserType == nil { - return nil, false + if o == nil || isNil(o.BrowserType) { + return nil, false } return o.BrowserType, true } // HasBrowserType returns a boolean if a field has been set. func (o *Monitor) HasBrowserType() bool { - if o != nil && o.BrowserType != nil { + if o != nil && !isNil(o.BrowserType) { return true } @@ -2532,7 +2565,7 @@ func (o *Monitor) SetBrowserType(v BrowserType) { // GetBrowserWindowDimensions returns the BrowserWindowDimensions field value if set, zero value otherwise. func (o *Monitor) GetBrowserWindowDimensions() BrowserWindowDimensions { - if o == nil || o.BrowserWindowDimensions == nil { + if o == nil || isNil(o.BrowserWindowDimensions) { var ret BrowserWindowDimensions return ret } @@ -2542,15 +2575,15 @@ func (o *Monitor) GetBrowserWindowDimensions() BrowserWindowDimensions { // GetBrowserWindowDimensionsOk returns a tuple with the BrowserWindowDimensions field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetBrowserWindowDimensionsOk() (*BrowserWindowDimensions, bool) { - if o == nil || o.BrowserWindowDimensions == nil { - return nil, false + if o == nil || isNil(o.BrowserWindowDimensions) { + return nil, false } return o.BrowserWindowDimensions, true } // HasBrowserWindowDimensions returns a boolean if a field has been set. func (o *Monitor) HasBrowserWindowDimensions() bool { - if o != nil && o.BrowserWindowDimensions != nil { + if o != nil && !isNil(o.BrowserWindowDimensions) { return true } @@ -2564,7 +2597,7 @@ func (o *Monitor) SetBrowserWindowDimensions(v BrowserWindowDimensions) { // GetUseConcurrentMonitoring returns the UseConcurrentMonitoring field value if set, zero value otherwise. func (o *Monitor) GetUseConcurrentMonitoring() bool { - if o == nil || o.UseConcurrentMonitoring == nil { + if o == nil || isNil(o.UseConcurrentMonitoring) { var ret bool return ret } @@ -2574,15 +2607,15 @@ func (o *Monitor) GetUseConcurrentMonitoring() bool { // GetUseConcurrentMonitoringOk returns a tuple with the UseConcurrentMonitoring field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetUseConcurrentMonitoringOk() (*bool, bool) { - if o == nil || o.UseConcurrentMonitoring == nil { - return nil, false + if o == nil || isNil(o.UseConcurrentMonitoring) { + return nil, false } return o.UseConcurrentMonitoring, true } // HasUseConcurrentMonitoring returns a boolean if a field has been set. func (o *Monitor) HasUseConcurrentMonitoring() bool { - if o != nil && o.UseConcurrentMonitoring != nil { + if o != nil && !isNil(o.UseConcurrentMonitoring) { return true } @@ -2596,7 +2629,7 @@ func (o *Monitor) SetUseConcurrentMonitoring(v bool) { // GetConcurrentUnconfirmedErrorThreshold returns the ConcurrentUnconfirmedErrorThreshold field value if set, zero value otherwise. func (o *Monitor) GetConcurrentUnconfirmedErrorThreshold() int32 { - if o == nil || o.ConcurrentUnconfirmedErrorThreshold == nil { + if o == nil || isNil(o.ConcurrentUnconfirmedErrorThreshold) { var ret int32 return ret } @@ -2606,15 +2639,15 @@ func (o *Monitor) GetConcurrentUnconfirmedErrorThreshold() int32 { // GetConcurrentUnconfirmedErrorThresholdOk returns a tuple with the ConcurrentUnconfirmedErrorThreshold field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetConcurrentUnconfirmedErrorThresholdOk() (*int32, bool) { - if o == nil || o.ConcurrentUnconfirmedErrorThreshold == nil { - return nil, false + if o == nil || isNil(o.ConcurrentUnconfirmedErrorThreshold) { + return nil, false } return o.ConcurrentUnconfirmedErrorThreshold, true } // HasConcurrentUnconfirmedErrorThreshold returns a boolean if a field has been set. func (o *Monitor) HasConcurrentUnconfirmedErrorThreshold() bool { - if o != nil && o.ConcurrentUnconfirmedErrorThreshold != nil { + if o != nil && !isNil(o.ConcurrentUnconfirmedErrorThreshold) { return true } @@ -2628,7 +2661,7 @@ func (o *Monitor) SetConcurrentUnconfirmedErrorThreshold(v int32) { // GetConcurrentConfirmedErrorThreshold returns the ConcurrentConfirmedErrorThreshold field value if set, zero value otherwise. func (o *Monitor) GetConcurrentConfirmedErrorThreshold() int32 { - if o == nil || o.ConcurrentConfirmedErrorThreshold == nil { + if o == nil || isNil(o.ConcurrentConfirmedErrorThreshold) { var ret int32 return ret } @@ -2638,15 +2671,15 @@ func (o *Monitor) GetConcurrentConfirmedErrorThreshold() int32 { // GetConcurrentConfirmedErrorThresholdOk returns a tuple with the ConcurrentConfirmedErrorThreshold field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Monitor) GetConcurrentConfirmedErrorThresholdOk() (*int32, bool) { - if o == nil || o.ConcurrentConfirmedErrorThreshold == nil { - return nil, false + if o == nil || isNil(o.ConcurrentConfirmedErrorThreshold) { + return nil, false } return o.ConcurrentConfirmedErrorThreshold, true } // HasConcurrentConfirmedErrorThreshold returns a boolean if a field has been set. func (o *Monitor) HasConcurrentConfirmedErrorThreshold() bool { - if o != nil && o.ConcurrentConfirmedErrorThreshold != nil { + if o != nil && !isNil(o.ConcurrentConfirmedErrorThreshold) { return true } @@ -2658,245 +2691,283 @@ func (o *Monitor) SetConcurrentConfirmedErrorThreshold(v int32) { o.ConcurrentConfirmedErrorThreshold = &v } +// GetErrorConditions returns the ErrorConditions field value if set, zero value otherwise. +func (o *Monitor) GetErrorConditions() []ErrorCondition { + if o == nil || isNil(o.ErrorConditions) { + var ret []ErrorCondition + return ret + } + return o.ErrorConditions +} + +// GetErrorConditionsOk returns a tuple with the ErrorConditions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Monitor) GetErrorConditionsOk() ([]ErrorCondition, bool) { + if o == nil || isNil(o.ErrorConditions) { + return nil, false + } + return o.ErrorConditions, true +} + +// HasErrorConditions returns a boolean if a field has been set. +func (o *Monitor) HasErrorConditions() bool { + if o != nil && !isNil(o.ErrorConditions) { + return true + } + + return false +} + +// SetErrorConditions gets a reference to the given []ErrorCondition and assigns it to the ErrorConditions field. +func (o *Monitor) SetErrorConditions(v []ErrorCondition) { + o.ErrorConditions = v +} + func (o Monitor) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.MonitorGuid != nil { - toSerialize["MonitorGuid"] = o.MonitorGuid - } - if o.Name != nil { + if !isNil(o.Name) { toSerialize["Name"] = o.Name } - if o.MonitorType != nil { - toSerialize["MonitorType"] = o.MonitorType - } - if o.IsActive != nil { + if !isNil(o.IsActive) { toSerialize["IsActive"] = o.IsActive } - if o.CustomFields != nil { - toSerialize["CustomFields"] = o.CustomFields - } - if o.CheckInterval != nil { - toSerialize["CheckInterval"] = o.CheckInterval - } - if o.MonitorMode != nil { - toSerialize["MonitorMode"] = o.MonitorMode + if !isNil(o.MonitorGuid) { + toSerialize["MonitorGuid"] = o.MonitorGuid } - if o.Hash != nil { + if !isNil(o.Hash) { toSerialize["Hash"] = o.Hash } - if o.LoadTimeLimit1 != nil { - toSerialize["LoadTimeLimit1"] = o.LoadTimeLimit1 - } - if o.LoadTimeLimit2 != nil { - toSerialize["LoadTimeLimit2"] = o.LoadTimeLimit2 - } - if o.Url != nil { - toSerialize["Url"] = o.Url - } - if o.Port != nil { - toSerialize["Port"] = o.Port - } - if o.NetworkAddress != nil { - toSerialize["NetworkAddress"] = o.NetworkAddress - } - if o.GenerateAlert != nil { + if !isNil(o.GenerateAlert) { toSerialize["GenerateAlert"] = o.GenerateAlert } - if o.IsLocked != nil { + if !isNil(o.IsLocked) { toSerialize["IsLocked"] = o.IsLocked } - if o.Credits != nil { + if !isNil(o.CheckInterval) { + toSerialize["CheckInterval"] = o.CheckInterval + } + if !isNil(o.Credits) { toSerialize["Credits"] = o.Credits } - if o.PredefinedVariables != nil { + if !isNil(o.MonitorMode) { + toSerialize["MonitorMode"] = o.MonitorMode + } + if !isNil(o.PredefinedVariables) { toSerialize["PredefinedVariables"] = o.PredefinedVariables } - if o.MsaSteps != nil { + if !isNil(o.MsaSteps) { toSerialize["MsaSteps"] = o.MsaSteps } - if o.UserDefinedFunctions != nil { + if !isNil(o.UserDefinedFunctions) { toSerialize["UserDefinedFunctions"] = o.UserDefinedFunctions } - if o.CustomMetrics != nil { + if !isNil(o.CustomMetrics) { toSerialize["CustomMetrics"] = o.CustomMetrics } - if o.SelectedCheckpoints != nil { + if !isNil(o.CustomFields) { + toSerialize["CustomFields"] = o.CustomFields + } + if !isNil(o.SelectedCheckpoints) { toSerialize["SelectedCheckpoints"] = o.SelectedCheckpoints } - if o.UsePrimaryCheckpointsOnly != nil { + if !isNil(o.UsePrimaryCheckpointsOnly) { toSerialize["UsePrimaryCheckpointsOnly"] = o.UsePrimaryCheckpointsOnly } - if o.SelfServiceTransactionScript != nil { + if !isNil(o.SelfServiceTransactionScript) { toSerialize["SelfServiceTransactionScript"] = o.SelfServiceTransactionScript } - if o.Notes != nil { + if !isNil(o.MonitorType) { + toSerialize["MonitorType"] = o.MonitorType + } + if !isNil(o.Notes) { toSerialize["Notes"] = o.Notes } - if o.AlertOnLoadTimeLimit1 != nil { + if !isNil(o.AlertOnLoadTimeLimit1) { toSerialize["AlertOnLoadTimeLimit1"] = o.AlertOnLoadTimeLimit1 } - if o.AlertOnLoadTimeLimit2 != nil { + if !isNil(o.MultiStepApiTransactionScript) { + toSerialize["MultiStepApiTransactionScript"] = o.MultiStepApiTransactionScript + } + if !isNil(o.LoadTimeLimit1) { + toSerialize["LoadTimeLimit1"] = o.LoadTimeLimit1 + } + if !isNil(o.AlertOnLoadTimeLimit2) { toSerialize["AlertOnLoadTimeLimit2"] = o.AlertOnLoadTimeLimit2 } - if o.BlockGoogleAnalytics != nil { + if !isNil(o.LoadTimeLimit2) { + toSerialize["LoadTimeLimit2"] = o.LoadTimeLimit2 + } + if !isNil(o.BlockGoogleAnalytics) { toSerialize["BlockGoogleAnalytics"] = o.BlockGoogleAnalytics } - if o.BlockUptrendsRum != nil { + if !isNil(o.BlockUptrendsRum) { toSerialize["BlockUptrendsRum"] = o.BlockUptrendsRum } - if o.BlockUrls != nil { + if !isNil(o.BlockUrls) { toSerialize["BlockUrls"] = o.BlockUrls } - if o.RequestHeaders != nil { + if !isNil(o.RequestHeaders) { toSerialize["RequestHeaders"] = o.RequestHeaders } - if o.UserAgent != nil { + if !isNil(o.UserAgent) { toSerialize["UserAgent"] = o.UserAgent } - if o.Username != nil { + if !isNil(o.Username) { toSerialize["Username"] = o.Username } - if o.Password != nil { + if !isNil(o.Password) { toSerialize["Password"] = o.Password } - if o.NameForPhoneAlerts != nil { + if !isNil(o.NameForPhoneAlerts) { toSerialize["NameForPhoneAlerts"] = o.NameForPhoneAlerts } - if o.AuthenticationType != nil { + if !isNil(o.AuthenticationType) { toSerialize["AuthenticationType"] = o.AuthenticationType } - if o.ThrottlingOptions != nil { + if !isNil(o.ThrottlingOptions) { toSerialize["ThrottlingOptions"] = o.ThrottlingOptions } - if o.TransactionStepDefinition != nil { + if !isNil(o.DnsBypasses) { + toSerialize["DnsBypasses"] = o.DnsBypasses + } + if !isNil(o.TransactionStepDefinition) { toSerialize["TransactionStepDefinition"] = o.TransactionStepDefinition } - if o.CertificateName != nil { + if !isNil(o.CertificateName) { toSerialize["CertificateName"] = o.CertificateName } - if o.CertificateOrganization != nil { + if !isNil(o.CertificateOrganization) { toSerialize["CertificateOrganization"] = o.CertificateOrganization } - if o.CertificateOrganizationalUnit != nil { + if !isNil(o.CertificateOrganizationalUnit) { toSerialize["CertificateOrganizationalUnit"] = o.CertificateOrganizationalUnit } - if o.CertificateSerialNumber != nil { + if !isNil(o.CertificateSerialNumber) { toSerialize["CertificateSerialNumber"] = o.CertificateSerialNumber } - if o.CertificateFingerprint != nil { + if !isNil(o.CertificateFingerprint) { toSerialize["CertificateFingerprint"] = o.CertificateFingerprint } - if o.CertificateIssuerName != nil { + if !isNil(o.CertificateIssuerName) { toSerialize["CertificateIssuerName"] = o.CertificateIssuerName } - if o.CertificateIssuerCompanyName != nil { + if !isNil(o.CertificateIssuerCompanyName) { toSerialize["CertificateIssuerCompanyName"] = o.CertificateIssuerCompanyName } - if o.CertificateIssuerOrganizationalUnit != nil { + if !isNil(o.CertificateIssuerOrganizationalUnit) { toSerialize["CertificateIssuerOrganizationalUnit"] = o.CertificateIssuerOrganizationalUnit } - if o.CertificateExpirationWarningDays != nil { + if !isNil(o.CertificateExpirationWarningDays) { toSerialize["CertificateExpirationWarningDays"] = o.CertificateExpirationWarningDays } - if o.CheckCertificateErrors != nil { + if !isNil(o.CheckCertificateErrors) { toSerialize["CheckCertificateErrors"] = o.CheckCertificateErrors } - if o.AlertOnMaximumBytes != nil { + if !isNil(o.AlertOnMaximumBytes) { toSerialize["AlertOnMaximumBytes"] = o.AlertOnMaximumBytes } - if o.MaximumBytes != nil { + if !isNil(o.MaximumBytes) { toSerialize["MaximumBytes"] = o.MaximumBytes } - if o.AlertOnMaximumSize != nil { + if !isNil(o.AlertOnMaximumSize) { toSerialize["AlertOnMaximumSize"] = o.AlertOnMaximumSize } - if o.ElementMaximumSize != nil { + if !isNil(o.ElementMaximumSize) { toSerialize["ElementMaximumSize"] = o.ElementMaximumSize } - if o.IgnoreExternalElements != nil { + if !isNil(o.IgnoreExternalElements) { toSerialize["IgnoreExternalElements"] = o.IgnoreExternalElements } - if o.AlertOnPercentageFail != nil { + if !isNil(o.AlertOnPercentageFail) { toSerialize["AlertOnPercentageFail"] = o.AlertOnPercentageFail } - if o.FailedObjectPercentage != nil { + if !isNil(o.FailedObjectPercentage) { toSerialize["FailedObjectPercentage"] = o.FailedObjectPercentage } - if o.DomainGroupGuid != nil { + if !isNil(o.DomainGroupGuid) { toSerialize["DomainGroupGuid"] = o.DomainGroupGuid } - if o.DomainGroupGuidSpecified != nil { + if !isNil(o.DomainGroupGuidSpecified) { toSerialize["DomainGroupGuidSpecified"] = o.DomainGroupGuidSpecified } - if o.DnsServer != nil { + if !isNil(o.DnsServer) { toSerialize["DnsServer"] = o.DnsServer } - if o.DnsQuery != nil { + if !isNil(o.DnsQuery) { toSerialize["DnsQuery"] = o.DnsQuery } - if o.DnsExpectedResult != nil { + if !isNil(o.DnsExpectedResult) { toSerialize["DnsExpectedResult"] = o.DnsExpectedResult } - if o.DnsTestValue != nil { + if !isNil(o.DnsTestValue) { toSerialize["DnsTestValue"] = o.DnsTestValue } - if o.IpVersion != nil { - toSerialize["IpVersion"] = o.IpVersion + if !isNil(o.Port) { + toSerialize["Port"] = o.Port } - if o.NativeIPv6Only != nil { - toSerialize["NativeIPv6Only"] = o.NativeIPv6Only + if !isNil(o.IpVersion) { + toSerialize["IpVersion"] = o.IpVersion } - if o.AlertOnMinimumBytes != nil { + if !isNil(o.AlertOnMinimumBytes) { toSerialize["AlertOnMinimumBytes"] = o.AlertOnMinimumBytes } - if o.MinimumBytes != nil { + if !isNil(o.MinimumBytes) { toSerialize["MinimumBytes"] = o.MinimumBytes } - if o.DatabaseName != nil { + if !isNil(o.DatabaseName) { toSerialize["DatabaseName"] = o.DatabaseName } - if o.ImapSecureConnection != nil { + if !isNil(o.NetworkAddress) { + toSerialize["NetworkAddress"] = o.NetworkAddress + } + if !isNil(o.ImapSecureConnection) { toSerialize["ImapSecureConnection"] = o.ImapSecureConnection } - if o.SftpAction != nil { + if !isNil(o.SftpAction) { toSerialize["SftpAction"] = o.SftpAction } - if o.SftpActionPath != nil { + if !isNil(o.SftpActionPath) { toSerialize["SftpActionPath"] = o.SftpActionPath } - if o.HttpMethod != nil { + if !isNil(o.HttpMethod) { toSerialize["HttpMethod"] = o.HttpMethod } - if o.ExpectedHttpStatusCode != nil { + if !isNil(o.ExpectedHttpStatusCode) { toSerialize["ExpectedHttpStatusCode"] = o.ExpectedHttpStatusCode } - if o.ExpectedHttpStatusCodeSpecified != nil { + if !isNil(o.ExpectedHttpStatusCodeSpecified) { toSerialize["ExpectedHttpStatusCodeSpecified"] = o.ExpectedHttpStatusCodeSpecified } - if o.TlsVersion != nil { + if !isNil(o.TlsVersion) { toSerialize["TlsVersion"] = o.TlsVersion } - if o.RequestBody != nil { + if !isNil(o.RequestBody) { toSerialize["RequestBody"] = o.RequestBody } - if o.MatchPatterns != nil { + if !isNil(o.MatchPatterns) { toSerialize["MatchPatterns"] = o.MatchPatterns } - if o.BrowserType != nil { + if !isNil(o.Url) { + toSerialize["Url"] = o.Url + } + if !isNil(o.BrowserType) { toSerialize["BrowserType"] = o.BrowserType } - if o.BrowserWindowDimensions != nil { + if !isNil(o.BrowserWindowDimensions) { toSerialize["BrowserWindowDimensions"] = o.BrowserWindowDimensions } - if o.UseConcurrentMonitoring != nil { + if !isNil(o.UseConcurrentMonitoring) { toSerialize["UseConcurrentMonitoring"] = o.UseConcurrentMonitoring } - if o.ConcurrentUnconfirmedErrorThreshold != nil { + if !isNil(o.ConcurrentUnconfirmedErrorThreshold) { toSerialize["ConcurrentUnconfirmedErrorThreshold"] = o.ConcurrentUnconfirmedErrorThreshold } - if o.ConcurrentConfirmedErrorThreshold != nil { + if !isNil(o.ConcurrentConfirmedErrorThreshold) { toSerialize["ConcurrentConfirmedErrorThreshold"] = o.ConcurrentConfirmedErrorThreshold } + if !isNil(o.ErrorConditions) { + toSerialize["ErrorConditions"] = o.ErrorConditions + } return json.Marshal(toSerialize) } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_authorization.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_authorization.go index 0b4b14be..6f24954c 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_authorization.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_authorization.go @@ -16,9 +16,13 @@ import ( // MonitorAuthorization Monitor group authorization type MonitorAuthorization struct { + // The unique ID of this authorization AuthorizationId *string `json:"AuthorizationId,omitempty"` + // The authorization type AuthorizationType MonitorAuthorizationType `json:"AuthorizationType"` + // The GUID of the operator (NULL if this authorization is for an operator group) OperatorGuid *string `json:"OperatorGuid,omitempty"` + // The GUID of the operator group (NULL if this authorization is for an operator) OperatorGroupGuid *string `json:"OperatorGroupGuid,omitempty"` } @@ -42,7 +46,7 @@ func NewMonitorAuthorizationWithDefaults() *MonitorAuthorization { // GetAuthorizationId returns the AuthorizationId field value if set, zero value otherwise. func (o *MonitorAuthorization) GetAuthorizationId() string { - if o == nil || o.AuthorizationId == nil { + if o == nil || isNil(o.AuthorizationId) { var ret string return ret } @@ -52,15 +56,15 @@ func (o *MonitorAuthorization) GetAuthorizationId() string { // GetAuthorizationIdOk returns a tuple with the AuthorizationId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorAuthorization) GetAuthorizationIdOk() (*string, bool) { - if o == nil || o.AuthorizationId == nil { - return nil, false + if o == nil || isNil(o.AuthorizationId) { + return nil, false } return o.AuthorizationId, true } // HasAuthorizationId returns a boolean if a field has been set. func (o *MonitorAuthorization) HasAuthorizationId() bool { - if o != nil && o.AuthorizationId != nil { + if o != nil && !isNil(o.AuthorizationId) { return true } @@ -85,8 +89,8 @@ func (o *MonitorAuthorization) GetAuthorizationType() MonitorAuthorizationType { // GetAuthorizationTypeOk returns a tuple with the AuthorizationType field value // and a boolean to check if the value has been set. func (o *MonitorAuthorization) GetAuthorizationTypeOk() (*MonitorAuthorizationType, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.AuthorizationType, true } @@ -98,7 +102,7 @@ func (o *MonitorAuthorization) SetAuthorizationType(v MonitorAuthorizationType) // GetOperatorGuid returns the OperatorGuid field value if set, zero value otherwise. func (o *MonitorAuthorization) GetOperatorGuid() string { - if o == nil || o.OperatorGuid == nil { + if o == nil || isNil(o.OperatorGuid) { var ret string return ret } @@ -108,15 +112,15 @@ func (o *MonitorAuthorization) GetOperatorGuid() string { // GetOperatorGuidOk returns a tuple with the OperatorGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorAuthorization) GetOperatorGuidOk() (*string, bool) { - if o == nil || o.OperatorGuid == nil { - return nil, false + if o == nil || isNil(o.OperatorGuid) { + return nil, false } return o.OperatorGuid, true } // HasOperatorGuid returns a boolean if a field has been set. func (o *MonitorAuthorization) HasOperatorGuid() bool { - if o != nil && o.OperatorGuid != nil { + if o != nil && !isNil(o.OperatorGuid) { return true } @@ -130,7 +134,7 @@ func (o *MonitorAuthorization) SetOperatorGuid(v string) { // GetOperatorGroupGuid returns the OperatorGroupGuid field value if set, zero value otherwise. func (o *MonitorAuthorization) GetOperatorGroupGuid() string { - if o == nil || o.OperatorGroupGuid == nil { + if o == nil || isNil(o.OperatorGroupGuid) { var ret string return ret } @@ -140,15 +144,15 @@ func (o *MonitorAuthorization) GetOperatorGroupGuid() string { // GetOperatorGroupGuidOk returns a tuple with the OperatorGroupGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorAuthorization) GetOperatorGroupGuidOk() (*string, bool) { - if o == nil || o.OperatorGroupGuid == nil { - return nil, false + if o == nil || isNil(o.OperatorGroupGuid) { + return nil, false } return o.OperatorGroupGuid, true } // HasOperatorGroupGuid returns a boolean if a field has been set. func (o *MonitorAuthorization) HasOperatorGroupGuid() bool { - if o != nil && o.OperatorGroupGuid != nil { + if o != nil && !isNil(o.OperatorGroupGuid) { return true } @@ -162,16 +166,16 @@ func (o *MonitorAuthorization) SetOperatorGroupGuid(v string) { func (o MonitorAuthorization) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.AuthorizationId != nil { + if !isNil(o.AuthorizationId) { toSerialize["AuthorizationId"] = o.AuthorizationId } if true { toSerialize["AuthorizationType"] = o.AuthorizationType } - if o.OperatorGuid != nil { + if !isNil(o.OperatorGuid) { toSerialize["OperatorGuid"] = o.OperatorGuid } - if o.OperatorGroupGuid != nil { + if !isNil(o.OperatorGroupGuid) { toSerialize["OperatorGroupGuid"] = o.OperatorGroupGuid } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_authorization_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_authorization_type.go index e493ec18..d9476f7c 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_authorization_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_authorization_type.go @@ -25,7 +25,8 @@ const ( MONITORAUTHORIZATIONTYPE_EDIT_MONITOR MonitorAuthorizationType = "EditMonitor" ) -var allowedMonitorAuthorizationTypeEnumValues = []MonitorAuthorizationType{ +// All allowed values of MonitorAuthorizationType enum +var AllowedMonitorAuthorizationTypeEnumValues = []MonitorAuthorizationType{ "ViewMonitorData", "ViewMonitor", "EditMonitor", @@ -38,7 +39,7 @@ func (v *MonitorAuthorizationType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := MonitorAuthorizationType(value) - for _, existing := range allowedMonitorAuthorizationTypeEnumValues { + for _, existing := range AllowedMonitorAuthorizationTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -55,13 +56,13 @@ func NewMonitorAuthorizationTypeFromValue(v string) (*MonitorAuthorizationType, if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for MonitorAuthorizationType: valid values are %v", v, allowedMonitorAuthorizationTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for MonitorAuthorizationType: valid values are %v", v, AllowedMonitorAuthorizationTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v MonitorAuthorizationType) IsValid() bool { - for _, existing := range allowedMonitorAuthorizationTypeEnumValues { + for _, existing := range AllowedMonitorAuthorizationTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_check.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_check.go index 467d8a1a..27d16054 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_check.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_check.go @@ -17,9 +17,12 @@ import ( // MonitorCheck Represents the values/results of a single check done by a monitor type MonitorCheck struct { Attributes *MonitorCheckAttributes `json:"Attributes,omitempty"` + // Identifier Id int64 `json:"Id"` Type *string `json:"Type,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + // Links related to the object Links *map[string]string `json:"Links,omitempty"` } @@ -43,7 +46,7 @@ func NewMonitorCheckWithDefaults() *MonitorCheck { // GetAttributes returns the Attributes field value if set, zero value otherwise. func (o *MonitorCheck) GetAttributes() MonitorCheckAttributes { - if o == nil || o.Attributes == nil { + if o == nil || isNil(o.Attributes) { var ret MonitorCheckAttributes return ret } @@ -53,15 +56,15 @@ func (o *MonitorCheck) GetAttributes() MonitorCheckAttributes { // GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorCheck) GetAttributesOk() (*MonitorCheckAttributes, bool) { - if o == nil || o.Attributes == nil { - return nil, false + if o == nil || isNil(o.Attributes) { + return nil, false } return o.Attributes, true } // HasAttributes returns a boolean if a field has been set. func (o *MonitorCheck) HasAttributes() bool { - if o != nil && o.Attributes != nil { + if o != nil && !isNil(o.Attributes) { return true } @@ -86,8 +89,8 @@ func (o *MonitorCheck) GetId() int64 { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *MonitorCheck) GetIdOk() (*int64, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Id, true } @@ -99,7 +102,7 @@ func (o *MonitorCheck) SetId(v int64) { // GetType returns the Type field value if set, zero value otherwise. func (o *MonitorCheck) GetType() string { - if o == nil || o.Type == nil { + if o == nil || isNil(o.Type) { var ret string return ret } @@ -109,15 +112,15 @@ func (o *MonitorCheck) GetType() string { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorCheck) GetTypeOk() (*string, bool) { - if o == nil || o.Type == nil { - return nil, false + if o == nil || isNil(o.Type) { + return nil, false } return o.Type, true } // HasType returns a boolean if a field has been set. func (o *MonitorCheck) HasType() bool { - if o != nil && o.Type != nil { + if o != nil && !isNil(o.Type) { return true } @@ -131,25 +134,25 @@ func (o *MonitorCheck) SetType(v string) { // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *MonitorCheck) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MonitorCheck) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *MonitorCheck) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *MonitorCheck) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -158,12 +161,12 @@ func (o *MonitorCheck) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *MonitorCheck) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetLinks returns the Links field value if set, zero value otherwise. func (o *MonitorCheck) GetLinks() map[string]string { - if o == nil || o.Links == nil { + if o == nil || isNil(o.Links) { var ret map[string]string return ret } @@ -173,15 +176,15 @@ func (o *MonitorCheck) GetLinks() map[string]string { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorCheck) GetLinksOk() (*map[string]string, bool) { - if o == nil || o.Links == nil { - return nil, false + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *MonitorCheck) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } @@ -195,19 +198,19 @@ func (o *MonitorCheck) SetLinks(v map[string]string) { func (o MonitorCheck) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Attributes != nil { + if !isNil(o.Attributes) { toSerialize["Attributes"] = o.Attributes } if true { toSerialize["Id"] = o.Id } - if o.Type != nil { + if !isNil(o.Type) { toSerialize["Type"] = o.Type } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_check_attributes.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_check_attributes.go index 9ea5f592..ed3a0607 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_check_attributes.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_check_attributes.go @@ -12,15 +12,14 @@ package uptrends import ( "encoding/json" - "time" ) -// MonitorCheckAttributes Monitor check attributes +// MonitorCheckAttributes Object attributes type MonitorCheckAttributes struct { // Monitor identifier MonitorGuid string `json:"MonitorGuid"` // Date/time stamp of the check - Timestamp time.Time `json:"Timestamp"` + Timestamp map[string]interface{} `json:"Timestamp"` // The numeric Uptrends error code in case of an error result, or 0 in case of an OK result. ErrorCode int32 `json:"ErrorCode"` // The number of milliseconds needed to complete the monitor check. @@ -57,7 +56,7 @@ type MonitorCheckAttributes struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewMonitorCheckAttributes(monitorGuid string, timestamp time.Time, errorCode int32, totalTime float64, resolveTime float64, connectionTime float64, downloadTime float64, errorLevel ErrorLevel, stagingMode bool, isPartialCheck bool) *MonitorCheckAttributes { +func NewMonitorCheckAttributes(monitorGuid string, timestamp map[string]interface{}, errorCode int32, totalTime float64, resolveTime float64, connectionTime float64, downloadTime float64, errorLevel ErrorLevel, stagingMode bool, isPartialCheck bool) *MonitorCheckAttributes { this := MonitorCheckAttributes{} this.MonitorGuid = monitorGuid this.Timestamp = timestamp @@ -93,8 +92,8 @@ func (o *MonitorCheckAttributes) GetMonitorGuid() string { // GetMonitorGuidOk returns a tuple with the MonitorGuid field value // and a boolean to check if the value has been set. func (o *MonitorCheckAttributes) GetMonitorGuidOk() (*string, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.MonitorGuid, true } @@ -105,9 +104,9 @@ func (o *MonitorCheckAttributes) SetMonitorGuid(v string) { } // GetTimestamp returns the Timestamp field value -func (o *MonitorCheckAttributes) GetTimestamp() time.Time { +func (o *MonitorCheckAttributes) GetTimestamp() map[string]interface{} { if o == nil { - var ret time.Time + var ret map[string]interface{} return ret } @@ -116,15 +115,15 @@ func (o *MonitorCheckAttributes) GetTimestamp() time.Time { // GetTimestampOk returns a tuple with the Timestamp field value // and a boolean to check if the value has been set. -func (o *MonitorCheckAttributes) GetTimestampOk() (*time.Time, bool) { - if o == nil { - return nil, false +func (o *MonitorCheckAttributes) GetTimestampOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false } - return &o.Timestamp, true + return o.Timestamp, true } // SetTimestamp sets field value -func (o *MonitorCheckAttributes) SetTimestamp(v time.Time) { +func (o *MonitorCheckAttributes) SetTimestamp(v map[string]interface{}) { o.Timestamp = v } @@ -141,8 +140,8 @@ func (o *MonitorCheckAttributes) GetErrorCode() int32 { // GetErrorCodeOk returns a tuple with the ErrorCode field value // and a boolean to check if the value has been set. func (o *MonitorCheckAttributes) GetErrorCodeOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.ErrorCode, true } @@ -165,8 +164,8 @@ func (o *MonitorCheckAttributes) GetTotalTime() float64 { // GetTotalTimeOk returns a tuple with the TotalTime field value // and a boolean to check if the value has been set. func (o *MonitorCheckAttributes) GetTotalTimeOk() (*float64, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.TotalTime, true } @@ -189,8 +188,8 @@ func (o *MonitorCheckAttributes) GetResolveTime() float64 { // GetResolveTimeOk returns a tuple with the ResolveTime field value // and a boolean to check if the value has been set. func (o *MonitorCheckAttributes) GetResolveTimeOk() (*float64, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.ResolveTime, true } @@ -213,8 +212,8 @@ func (o *MonitorCheckAttributes) GetConnectionTime() float64 { // GetConnectionTimeOk returns a tuple with the ConnectionTime field value // and a boolean to check if the value has been set. func (o *MonitorCheckAttributes) GetConnectionTimeOk() (*float64, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.ConnectionTime, true } @@ -237,8 +236,8 @@ func (o *MonitorCheckAttributes) GetDownloadTime() float64 { // GetDownloadTimeOk returns a tuple with the DownloadTime field value // and a boolean to check if the value has been set. func (o *MonitorCheckAttributes) GetDownloadTimeOk() (*float64, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.DownloadTime, true } @@ -250,7 +249,7 @@ func (o *MonitorCheckAttributes) SetDownloadTime(v float64) { // GetTotalBytes returns the TotalBytes field value if set, zero value otherwise. func (o *MonitorCheckAttributes) GetTotalBytes() int32 { - if o == nil || o.TotalBytes == nil { + if o == nil || isNil(o.TotalBytes) { var ret int32 return ret } @@ -260,15 +259,15 @@ func (o *MonitorCheckAttributes) GetTotalBytes() int32 { // GetTotalBytesOk returns a tuple with the TotalBytes field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorCheckAttributes) GetTotalBytesOk() (*int32, bool) { - if o == nil || o.TotalBytes == nil { - return nil, false + if o == nil || isNil(o.TotalBytes) { + return nil, false } return o.TotalBytes, true } // HasTotalBytes returns a boolean if a field has been set. func (o *MonitorCheckAttributes) HasTotalBytes() bool { - if o != nil && o.TotalBytes != nil { + if o != nil && !isNil(o.TotalBytes) { return true } @@ -282,7 +281,7 @@ func (o *MonitorCheckAttributes) SetTotalBytes(v int32) { // GetResolvedIpAddress returns the ResolvedIpAddress field value if set, zero value otherwise. func (o *MonitorCheckAttributes) GetResolvedIpAddress() string { - if o == nil || o.ResolvedIpAddress == nil { + if o == nil || isNil(o.ResolvedIpAddress) { var ret string return ret } @@ -292,15 +291,15 @@ func (o *MonitorCheckAttributes) GetResolvedIpAddress() string { // GetResolvedIpAddressOk returns a tuple with the ResolvedIpAddress field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorCheckAttributes) GetResolvedIpAddressOk() (*string, bool) { - if o == nil || o.ResolvedIpAddress == nil { - return nil, false + if o == nil || isNil(o.ResolvedIpAddress) { + return nil, false } return o.ResolvedIpAddress, true } // HasResolvedIpAddress returns a boolean if a field has been set. func (o *MonitorCheckAttributes) HasResolvedIpAddress() bool { - if o != nil && o.ResolvedIpAddress != nil { + if o != nil && !isNil(o.ResolvedIpAddress) { return true } @@ -325,8 +324,8 @@ func (o *MonitorCheckAttributes) GetErrorLevel() ErrorLevel { // GetErrorLevelOk returns a tuple with the ErrorLevel field value // and a boolean to check if the value has been set. func (o *MonitorCheckAttributes) GetErrorLevelOk() (*ErrorLevel, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.ErrorLevel, true } @@ -338,7 +337,7 @@ func (o *MonitorCheckAttributes) SetErrorLevel(v ErrorLevel) { // GetErrorDescription returns the ErrorDescription field value if set, zero value otherwise. func (o *MonitorCheckAttributes) GetErrorDescription() string { - if o == nil || o.ErrorDescription == nil { + if o == nil || isNil(o.ErrorDescription) { var ret string return ret } @@ -348,15 +347,15 @@ func (o *MonitorCheckAttributes) GetErrorDescription() string { // GetErrorDescriptionOk returns a tuple with the ErrorDescription field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorCheckAttributes) GetErrorDescriptionOk() (*string, bool) { - if o == nil || o.ErrorDescription == nil { - return nil, false + if o == nil || isNil(o.ErrorDescription) { + return nil, false } return o.ErrorDescription, true } // HasErrorDescription returns a boolean if a field has been set. func (o *MonitorCheckAttributes) HasErrorDescription() bool { - if o != nil && o.ErrorDescription != nil { + if o != nil && !isNil(o.ErrorDescription) { return true } @@ -370,7 +369,7 @@ func (o *MonitorCheckAttributes) SetErrorDescription(v string) { // GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. func (o *MonitorCheckAttributes) GetErrorMessage() string { - if o == nil || o.ErrorMessage == nil { + if o == nil || isNil(o.ErrorMessage) { var ret string return ret } @@ -380,15 +379,15 @@ func (o *MonitorCheckAttributes) GetErrorMessage() string { // GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorCheckAttributes) GetErrorMessageOk() (*string, bool) { - if o == nil || o.ErrorMessage == nil { - return nil, false + if o == nil || isNil(o.ErrorMessage) { + return nil, false } return o.ErrorMessage, true } // HasErrorMessage returns a boolean if a field has been set. func (o *MonitorCheckAttributes) HasErrorMessage() bool { - if o != nil && o.ErrorMessage != nil { + if o != nil && !isNil(o.ErrorMessage) { return true } @@ -413,8 +412,8 @@ func (o *MonitorCheckAttributes) GetStagingMode() bool { // GetStagingModeOk returns a tuple with the StagingMode field value // and a boolean to check if the value has been set. func (o *MonitorCheckAttributes) GetStagingModeOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.StagingMode, true } @@ -426,7 +425,7 @@ func (o *MonitorCheckAttributes) SetStagingMode(v bool) { // GetServerId returns the ServerId field value if set, zero value otherwise. func (o *MonitorCheckAttributes) GetServerId() int32 { - if o == nil || o.ServerId == nil { + if o == nil || isNil(o.ServerId) { var ret int32 return ret } @@ -436,15 +435,15 @@ func (o *MonitorCheckAttributes) GetServerId() int32 { // GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorCheckAttributes) GetServerIdOk() (*int32, bool) { - if o == nil || o.ServerId == nil { - return nil, false + if o == nil || isNil(o.ServerId) { + return nil, false } return o.ServerId, true } // HasServerId returns a boolean if a field has been set. func (o *MonitorCheckAttributes) HasServerId() bool { - if o != nil && o.ServerId != nil { + if o != nil && !isNil(o.ServerId) { return true } @@ -458,7 +457,7 @@ func (o *MonitorCheckAttributes) SetServerId(v int32) { // GetHttpStatusCode returns the HttpStatusCode field value if set, zero value otherwise. func (o *MonitorCheckAttributes) GetHttpStatusCode() int32 { - if o == nil || o.HttpStatusCode == nil { + if o == nil || isNil(o.HttpStatusCode) { var ret int32 return ret } @@ -468,15 +467,15 @@ func (o *MonitorCheckAttributes) GetHttpStatusCode() int32 { // GetHttpStatusCodeOk returns a tuple with the HttpStatusCode field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorCheckAttributes) GetHttpStatusCodeOk() (*int32, bool) { - if o == nil || o.HttpStatusCode == nil { - return nil, false + if o == nil || isNil(o.HttpStatusCode) { + return nil, false } return o.HttpStatusCode, true } // HasHttpStatusCode returns a boolean if a field has been set. func (o *MonitorCheckAttributes) HasHttpStatusCode() bool { - if o != nil && o.HttpStatusCode != nil { + if o != nil && !isNil(o.HttpStatusCode) { return true } @@ -501,8 +500,8 @@ func (o *MonitorCheckAttributes) GetIsPartialCheck() bool { // GetIsPartialCheckOk returns a tuple with the IsPartialCheck field value // and a boolean to check if the value has been set. func (o *MonitorCheckAttributes) GetIsPartialCheckOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.IsPartialCheck, true } @@ -514,7 +513,7 @@ func (o *MonitorCheckAttributes) SetIsPartialCheck(v bool) { // GetIsConcurrentCheck returns the IsConcurrentCheck field value if set, zero value otherwise. func (o *MonitorCheckAttributes) GetIsConcurrentCheck() bool { - if o == nil || o.IsConcurrentCheck == nil { + if o == nil || isNil(o.IsConcurrentCheck) { var ret bool return ret } @@ -524,15 +523,15 @@ func (o *MonitorCheckAttributes) GetIsConcurrentCheck() bool { // GetIsConcurrentCheckOk returns a tuple with the IsConcurrentCheck field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorCheckAttributes) GetIsConcurrentCheckOk() (*bool, bool) { - if o == nil || o.IsConcurrentCheck == nil { - return nil, false + if o == nil || isNil(o.IsConcurrentCheck) { + return nil, false } return o.IsConcurrentCheck, true } // HasIsConcurrentCheck returns a boolean if a field has been set. func (o *MonitorCheckAttributes) HasIsConcurrentCheck() bool { - if o != nil && o.IsConcurrentCheck != nil { + if o != nil && !isNil(o.IsConcurrentCheck) { return true } @@ -567,34 +566,34 @@ func (o MonitorCheckAttributes) MarshalJSON() ([]byte, error) { if true { toSerialize["DownloadTime"] = o.DownloadTime } - if o.TotalBytes != nil { + if !isNil(o.TotalBytes) { toSerialize["TotalBytes"] = o.TotalBytes } - if o.ResolvedIpAddress != nil { + if !isNil(o.ResolvedIpAddress) { toSerialize["ResolvedIpAddress"] = o.ResolvedIpAddress } if true { toSerialize["ErrorLevel"] = o.ErrorLevel } - if o.ErrorDescription != nil { + if !isNil(o.ErrorDescription) { toSerialize["ErrorDescription"] = o.ErrorDescription } - if o.ErrorMessage != nil { + if !isNil(o.ErrorMessage) { toSerialize["ErrorMessage"] = o.ErrorMessage } if true { toSerialize["StagingMode"] = o.StagingMode } - if o.ServerId != nil { + if !isNil(o.ServerId) { toSerialize["ServerId"] = o.ServerId } - if o.HttpStatusCode != nil { + if !isNil(o.HttpStatusCode) { toSerialize["HttpStatusCode"] = o.HttpStatusCode } if true { toSerialize["IsPartialCheck"] = o.IsPartialCheck } - if o.IsConcurrentCheck != nil { + if !isNil(o.IsConcurrentCheck) { toSerialize["IsConcurrentCheck"] = o.IsConcurrentCheck } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_check_response.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_check_response.go index 6798c924..e7e54a80 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_check_response.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_check_response.go @@ -16,12 +16,13 @@ import ( // MonitorCheckResponse Response of the MonitorCheck endpoint type MonitorCheckResponse struct { - Data *[]MonitorCheck `json:"Data,omitempty"` - Links *LinksData `json:"Links,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` - Meta *MetaData `json:"Meta,omitempty"` - // Cursors can be used to navigate the dataset in a fixed manner - Cursors *CursorsData `json:"Cursors,omitempty"` + // The resposne data/monitor checks + Data []MonitorCheck `json:"Data,omitempty"` + Links *StatisticsResponseLinks `json:"Links,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + Meta *StatisticsResponseMeta `json:"Meta,omitempty"` + Cursors *AlertResponseCursors `json:"Cursors,omitempty"` } // NewMonitorCheckResponse instantiates a new MonitorCheckResponse object @@ -43,25 +44,25 @@ func NewMonitorCheckResponseWithDefaults() *MonitorCheckResponse { // GetData returns the Data field value if set, zero value otherwise. func (o *MonitorCheckResponse) GetData() []MonitorCheck { - if o == nil || o.Data == nil { + if o == nil || isNil(o.Data) { var ret []MonitorCheck return ret } - return *o.Data + return o.Data } // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MonitorCheckResponse) GetDataOk() (*[]MonitorCheck, bool) { - if o == nil || o.Data == nil { - return nil, false +func (o *MonitorCheckResponse) GetDataOk() ([]MonitorCheck, bool) { + if o == nil || isNil(o.Data) { + return nil, false } return o.Data, true } // HasData returns a boolean if a field has been set. func (o *MonitorCheckResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && !isNil(o.Data) { return true } @@ -70,13 +71,13 @@ func (o *MonitorCheckResponse) HasData() bool { // SetData gets a reference to the given []MonitorCheck and assigns it to the Data field. func (o *MonitorCheckResponse) SetData(v []MonitorCheck) { - o.Data = &v + o.Data = v } // GetLinks returns the Links field value if set, zero value otherwise. -func (o *MonitorCheckResponse) GetLinks() LinksData { - if o == nil || o.Links == nil { - var ret LinksData +func (o *MonitorCheckResponse) GetLinks() StatisticsResponseLinks { + if o == nil || isNil(o.Links) { + var ret StatisticsResponseLinks return ret } return *o.Links @@ -84,48 +85,48 @@ func (o *MonitorCheckResponse) GetLinks() LinksData { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MonitorCheckResponse) GetLinksOk() (*LinksData, bool) { - if o == nil || o.Links == nil { - return nil, false +func (o *MonitorCheckResponse) GetLinksOk() (*StatisticsResponseLinks, bool) { + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *MonitorCheckResponse) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } return false } -// SetLinks gets a reference to the given LinksData and assigns it to the Links field. -func (o *MonitorCheckResponse) SetLinks(v LinksData) { +// SetLinks gets a reference to the given StatisticsResponseLinks and assigns it to the Links field. +func (o *MonitorCheckResponse) SetLinks(v StatisticsResponseLinks) { o.Links = &v } // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *MonitorCheckResponse) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MonitorCheckResponse) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *MonitorCheckResponse) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *MonitorCheckResponse) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -134,13 +135,13 @@ func (o *MonitorCheckResponse) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *MonitorCheckResponse) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetMeta returns the Meta field value if set, zero value otherwise. -func (o *MonitorCheckResponse) GetMeta() MetaData { - if o == nil || o.Meta == nil { - var ret MetaData +func (o *MonitorCheckResponse) GetMeta() StatisticsResponseMeta { + if o == nil || isNil(o.Meta) { + var ret StatisticsResponseMeta return ret } return *o.Meta @@ -148,31 +149,31 @@ func (o *MonitorCheckResponse) GetMeta() MetaData { // GetMetaOk returns a tuple with the Meta field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MonitorCheckResponse) GetMetaOk() (*MetaData, bool) { - if o == nil || o.Meta == nil { - return nil, false +func (o *MonitorCheckResponse) GetMetaOk() (*StatisticsResponseMeta, bool) { + if o == nil || isNil(o.Meta) { + return nil, false } return o.Meta, true } // HasMeta returns a boolean if a field has been set. func (o *MonitorCheckResponse) HasMeta() bool { - if o != nil && o.Meta != nil { + if o != nil && !isNil(o.Meta) { return true } return false } -// SetMeta gets a reference to the given MetaData and assigns it to the Meta field. -func (o *MonitorCheckResponse) SetMeta(v MetaData) { +// SetMeta gets a reference to the given StatisticsResponseMeta and assigns it to the Meta field. +func (o *MonitorCheckResponse) SetMeta(v StatisticsResponseMeta) { o.Meta = &v } // GetCursors returns the Cursors field value if set, zero value otherwise. -func (o *MonitorCheckResponse) GetCursors() CursorsData { - if o == nil || o.Cursors == nil { - var ret CursorsData +func (o *MonitorCheckResponse) GetCursors() AlertResponseCursors { + if o == nil || isNil(o.Cursors) { + var ret AlertResponseCursors return ret } return *o.Cursors @@ -180,42 +181,42 @@ func (o *MonitorCheckResponse) GetCursors() CursorsData { // GetCursorsOk returns a tuple with the Cursors field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MonitorCheckResponse) GetCursorsOk() (*CursorsData, bool) { - if o == nil || o.Cursors == nil { - return nil, false +func (o *MonitorCheckResponse) GetCursorsOk() (*AlertResponseCursors, bool) { + if o == nil || isNil(o.Cursors) { + return nil, false } return o.Cursors, true } // HasCursors returns a boolean if a field has been set. func (o *MonitorCheckResponse) HasCursors() bool { - if o != nil && o.Cursors != nil { + if o != nil && !isNil(o.Cursors) { return true } return false } -// SetCursors gets a reference to the given CursorsData and assigns it to the Cursors field. -func (o *MonitorCheckResponse) SetCursors(v CursorsData) { +// SetCursors gets a reference to the given AlertResponseCursors and assigns it to the Cursors field. +func (o *MonitorCheckResponse) SetCursors(v AlertResponseCursors) { o.Cursors = &v } func (o MonitorCheckResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Data != nil { + if !isNil(o.Data) { toSerialize["Data"] = o.Data } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Meta != nil { + if !isNil(o.Meta) { toSerialize["Meta"] = o.Meta } - if o.Cursors != nil { + if !isNil(o.Cursors) { toSerialize["Cursors"] = o.Cursors } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_group.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_group.go index a7d7448f..365ef8c2 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_group.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_group.go @@ -22,6 +22,18 @@ type MonitorGroup struct { Description *string `json:"Description,omitempty"` // Indicates whether this is the default group for all probes IsAll bool `json:"IsAll"` + // Indicates whether the monitor quota is unlimited Only administrators can change this + IsQuotaUnlimited *bool `json:"IsQuotaUnlimited,omitempty"` + // The basic monitor quota for the monitor group Only administrators can change this + BasicMonitorQuota *int32 `json:"BasicMonitorQuota,omitempty"` + // The browser monitor quota for the monitor group Only administrators can change this + BrowserMonitorQuota *int32 `json:"BrowserMonitorQuota,omitempty"` + // The transaction monitor quota for the monitor group Only administrators can change this + TransactionMonitorQuota *int32 `json:"TransactionMonitorQuota,omitempty"` + // The api monitor quota for the monitor group Only administrators can change this + ApiMonitorQuota *int32 `json:"ApiMonitorQuota,omitempty"` + // The classic quota for the monitor group Only administrators can change this + ClassicQuota *int32 `json:"ClassicQuota,omitempty"` } // NewMonitorGroup instantiates a new MonitorGroup object @@ -44,7 +56,7 @@ func NewMonitorGroupWithDefaults() *MonitorGroup { // GetMonitorGroupGuid returns the MonitorGroupGuid field value if set, zero value otherwise. func (o *MonitorGroup) GetMonitorGroupGuid() string { - if o == nil || o.MonitorGroupGuid == nil { + if o == nil || isNil(o.MonitorGroupGuid) { var ret string return ret } @@ -54,15 +66,15 @@ func (o *MonitorGroup) GetMonitorGroupGuid() string { // GetMonitorGroupGuidOk returns a tuple with the MonitorGroupGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorGroup) GetMonitorGroupGuidOk() (*string, bool) { - if o == nil || o.MonitorGroupGuid == nil { - return nil, false + if o == nil || isNil(o.MonitorGroupGuid) { + return nil, false } return o.MonitorGroupGuid, true } // HasMonitorGroupGuid returns a boolean if a field has been set. func (o *MonitorGroup) HasMonitorGroupGuid() bool { - if o != nil && o.MonitorGroupGuid != nil { + if o != nil && !isNil(o.MonitorGroupGuid) { return true } @@ -76,7 +88,7 @@ func (o *MonitorGroup) SetMonitorGroupGuid(v string) { // GetDescription returns the Description field value if set, zero value otherwise. func (o *MonitorGroup) GetDescription() string { - if o == nil || o.Description == nil { + if o == nil || isNil(o.Description) { var ret string return ret } @@ -86,15 +98,15 @@ func (o *MonitorGroup) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorGroup) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { - return nil, false + if o == nil || isNil(o.Description) { + return nil, false } return o.Description, true } // HasDescription returns a boolean if a field has been set. func (o *MonitorGroup) HasDescription() bool { - if o != nil && o.Description != nil { + if o != nil && !isNil(o.Description) { return true } @@ -119,8 +131,8 @@ func (o *MonitorGroup) GetIsAll() bool { // GetIsAllOk returns a tuple with the IsAll field value // and a boolean to check if the value has been set. func (o *MonitorGroup) GetIsAllOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.IsAll, true } @@ -130,17 +142,227 @@ func (o *MonitorGroup) SetIsAll(v bool) { o.IsAll = v } +// GetIsQuotaUnlimited returns the IsQuotaUnlimited field value if set, zero value otherwise. +func (o *MonitorGroup) GetIsQuotaUnlimited() bool { + if o == nil || isNil(o.IsQuotaUnlimited) { + var ret bool + return ret + } + return *o.IsQuotaUnlimited +} + +// GetIsQuotaUnlimitedOk returns a tuple with the IsQuotaUnlimited field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MonitorGroup) GetIsQuotaUnlimitedOk() (*bool, bool) { + if o == nil || isNil(o.IsQuotaUnlimited) { + return nil, false + } + return o.IsQuotaUnlimited, true +} + +// HasIsQuotaUnlimited returns a boolean if a field has been set. +func (o *MonitorGroup) HasIsQuotaUnlimited() bool { + if o != nil && !isNil(o.IsQuotaUnlimited) { + return true + } + + return false +} + +// SetIsQuotaUnlimited gets a reference to the given bool and assigns it to the IsQuotaUnlimited field. +func (o *MonitorGroup) SetIsQuotaUnlimited(v bool) { + o.IsQuotaUnlimited = &v +} + +// GetBasicMonitorQuota returns the BasicMonitorQuota field value if set, zero value otherwise. +func (o *MonitorGroup) GetBasicMonitorQuota() int32 { + if o == nil || isNil(o.BasicMonitorQuota) { + var ret int32 + return ret + } + return *o.BasicMonitorQuota +} + +// GetBasicMonitorQuotaOk returns a tuple with the BasicMonitorQuota field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MonitorGroup) GetBasicMonitorQuotaOk() (*int32, bool) { + if o == nil || isNil(o.BasicMonitorQuota) { + return nil, false + } + return o.BasicMonitorQuota, true +} + +// HasBasicMonitorQuota returns a boolean if a field has been set. +func (o *MonitorGroup) HasBasicMonitorQuota() bool { + if o != nil && !isNil(o.BasicMonitorQuota) { + return true + } + + return false +} + +// SetBasicMonitorQuota gets a reference to the given int32 and assigns it to the BasicMonitorQuota field. +func (o *MonitorGroup) SetBasicMonitorQuota(v int32) { + o.BasicMonitorQuota = &v +} + +// GetBrowserMonitorQuota returns the BrowserMonitorQuota field value if set, zero value otherwise. +func (o *MonitorGroup) GetBrowserMonitorQuota() int32 { + if o == nil || isNil(o.BrowserMonitorQuota) { + var ret int32 + return ret + } + return *o.BrowserMonitorQuota +} + +// GetBrowserMonitorQuotaOk returns a tuple with the BrowserMonitorQuota field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MonitorGroup) GetBrowserMonitorQuotaOk() (*int32, bool) { + if o == nil || isNil(o.BrowserMonitorQuota) { + return nil, false + } + return o.BrowserMonitorQuota, true +} + +// HasBrowserMonitorQuota returns a boolean if a field has been set. +func (o *MonitorGroup) HasBrowserMonitorQuota() bool { + if o != nil && !isNil(o.BrowserMonitorQuota) { + return true + } + + return false +} + +// SetBrowserMonitorQuota gets a reference to the given int32 and assigns it to the BrowserMonitorQuota field. +func (o *MonitorGroup) SetBrowserMonitorQuota(v int32) { + o.BrowserMonitorQuota = &v +} + +// GetTransactionMonitorQuota returns the TransactionMonitorQuota field value if set, zero value otherwise. +func (o *MonitorGroup) GetTransactionMonitorQuota() int32 { + if o == nil || isNil(o.TransactionMonitorQuota) { + var ret int32 + return ret + } + return *o.TransactionMonitorQuota +} + +// GetTransactionMonitorQuotaOk returns a tuple with the TransactionMonitorQuota field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MonitorGroup) GetTransactionMonitorQuotaOk() (*int32, bool) { + if o == nil || isNil(o.TransactionMonitorQuota) { + return nil, false + } + return o.TransactionMonitorQuota, true +} + +// HasTransactionMonitorQuota returns a boolean if a field has been set. +func (o *MonitorGroup) HasTransactionMonitorQuota() bool { + if o != nil && !isNil(o.TransactionMonitorQuota) { + return true + } + + return false +} + +// SetTransactionMonitorQuota gets a reference to the given int32 and assigns it to the TransactionMonitorQuota field. +func (o *MonitorGroup) SetTransactionMonitorQuota(v int32) { + o.TransactionMonitorQuota = &v +} + +// GetApiMonitorQuota returns the ApiMonitorQuota field value if set, zero value otherwise. +func (o *MonitorGroup) GetApiMonitorQuota() int32 { + if o == nil || isNil(o.ApiMonitorQuota) { + var ret int32 + return ret + } + return *o.ApiMonitorQuota +} + +// GetApiMonitorQuotaOk returns a tuple with the ApiMonitorQuota field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MonitorGroup) GetApiMonitorQuotaOk() (*int32, bool) { + if o == nil || isNil(o.ApiMonitorQuota) { + return nil, false + } + return o.ApiMonitorQuota, true +} + +// HasApiMonitorQuota returns a boolean if a field has been set. +func (o *MonitorGroup) HasApiMonitorQuota() bool { + if o != nil && !isNil(o.ApiMonitorQuota) { + return true + } + + return false +} + +// SetApiMonitorQuota gets a reference to the given int32 and assigns it to the ApiMonitorQuota field. +func (o *MonitorGroup) SetApiMonitorQuota(v int32) { + o.ApiMonitorQuota = &v +} + +// GetClassicQuota returns the ClassicQuota field value if set, zero value otherwise. +func (o *MonitorGroup) GetClassicQuota() int32 { + if o == nil || isNil(o.ClassicQuota) { + var ret int32 + return ret + } + return *o.ClassicQuota +} + +// GetClassicQuotaOk returns a tuple with the ClassicQuota field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MonitorGroup) GetClassicQuotaOk() (*int32, bool) { + if o == nil || isNil(o.ClassicQuota) { + return nil, false + } + return o.ClassicQuota, true +} + +// HasClassicQuota returns a boolean if a field has been set. +func (o *MonitorGroup) HasClassicQuota() bool { + if o != nil && !isNil(o.ClassicQuota) { + return true + } + + return false +} + +// SetClassicQuota gets a reference to the given int32 and assigns it to the ClassicQuota field. +func (o *MonitorGroup) SetClassicQuota(v int32) { + o.ClassicQuota = &v +} + func (o MonitorGroup) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.MonitorGroupGuid != nil { + if !isNil(o.MonitorGroupGuid) { toSerialize["MonitorGroupGuid"] = o.MonitorGroupGuid } - if o.Description != nil { + if !isNil(o.Description) { toSerialize["Description"] = o.Description } if true { toSerialize["IsAll"] = o.IsAll } + if !isNil(o.IsQuotaUnlimited) { + toSerialize["IsQuotaUnlimited"] = o.IsQuotaUnlimited + } + if !isNil(o.BasicMonitorQuota) { + toSerialize["BasicMonitorQuota"] = o.BasicMonitorQuota + } + if !isNil(o.BrowserMonitorQuota) { + toSerialize["BrowserMonitorQuota"] = o.BrowserMonitorQuota + } + if !isNil(o.TransactionMonitorQuota) { + toSerialize["TransactionMonitorQuota"] = o.TransactionMonitorQuota + } + if !isNil(o.ApiMonitorQuota) { + toSerialize["ApiMonitorQuota"] = o.ApiMonitorQuota + } + if !isNil(o.ClassicQuota) { + toSerialize["ClassicQuota"] = o.ClassicQuota + } return json.Marshal(toSerialize) } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_group_authorization.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_group_authorization.go index 10ff9414..08cf650b 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_group_authorization.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_group_authorization.go @@ -16,9 +16,13 @@ import ( // MonitorGroupAuthorization Monitor group authorization type MonitorGroupAuthorization struct { + // The unique ID of this authorization AuthorizationId *string `json:"AuthorizationId,omitempty"` + // The authorization type AuthorizationType MonitorGroupAuthorizationType `json:"AuthorizationType"` + // The GUID of the operator (NULL if this authorization is for an operator group) OperatorGuid *string `json:"OperatorGuid,omitempty"` + // The GUID of the operator group (NULL if this authorization is for an operator) OperatorGroupGuid *string `json:"OperatorGroupGuid,omitempty"` } @@ -42,7 +46,7 @@ func NewMonitorGroupAuthorizationWithDefaults() *MonitorGroupAuthorization { // GetAuthorizationId returns the AuthorizationId field value if set, zero value otherwise. func (o *MonitorGroupAuthorization) GetAuthorizationId() string { - if o == nil || o.AuthorizationId == nil { + if o == nil || isNil(o.AuthorizationId) { var ret string return ret } @@ -52,15 +56,15 @@ func (o *MonitorGroupAuthorization) GetAuthorizationId() string { // GetAuthorizationIdOk returns a tuple with the AuthorizationId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorGroupAuthorization) GetAuthorizationIdOk() (*string, bool) { - if o == nil || o.AuthorizationId == nil { - return nil, false + if o == nil || isNil(o.AuthorizationId) { + return nil, false } return o.AuthorizationId, true } // HasAuthorizationId returns a boolean if a field has been set. func (o *MonitorGroupAuthorization) HasAuthorizationId() bool { - if o != nil && o.AuthorizationId != nil { + if o != nil && !isNil(o.AuthorizationId) { return true } @@ -85,8 +89,8 @@ func (o *MonitorGroupAuthorization) GetAuthorizationType() MonitorGroupAuthoriza // GetAuthorizationTypeOk returns a tuple with the AuthorizationType field value // and a boolean to check if the value has been set. func (o *MonitorGroupAuthorization) GetAuthorizationTypeOk() (*MonitorGroupAuthorizationType, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.AuthorizationType, true } @@ -98,7 +102,7 @@ func (o *MonitorGroupAuthorization) SetAuthorizationType(v MonitorGroupAuthoriza // GetOperatorGuid returns the OperatorGuid field value if set, zero value otherwise. func (o *MonitorGroupAuthorization) GetOperatorGuid() string { - if o == nil || o.OperatorGuid == nil { + if o == nil || isNil(o.OperatorGuid) { var ret string return ret } @@ -108,15 +112,15 @@ func (o *MonitorGroupAuthorization) GetOperatorGuid() string { // GetOperatorGuidOk returns a tuple with the OperatorGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorGroupAuthorization) GetOperatorGuidOk() (*string, bool) { - if o == nil || o.OperatorGuid == nil { - return nil, false + if o == nil || isNil(o.OperatorGuid) { + return nil, false } return o.OperatorGuid, true } // HasOperatorGuid returns a boolean if a field has been set. func (o *MonitorGroupAuthorization) HasOperatorGuid() bool { - if o != nil && o.OperatorGuid != nil { + if o != nil && !isNil(o.OperatorGuid) { return true } @@ -130,7 +134,7 @@ func (o *MonitorGroupAuthorization) SetOperatorGuid(v string) { // GetOperatorGroupGuid returns the OperatorGroupGuid field value if set, zero value otherwise. func (o *MonitorGroupAuthorization) GetOperatorGroupGuid() string { - if o == nil || o.OperatorGroupGuid == nil { + if o == nil || isNil(o.OperatorGroupGuid) { var ret string return ret } @@ -140,15 +144,15 @@ func (o *MonitorGroupAuthorization) GetOperatorGroupGuid() string { // GetOperatorGroupGuidOk returns a tuple with the OperatorGroupGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorGroupAuthorization) GetOperatorGroupGuidOk() (*string, bool) { - if o == nil || o.OperatorGroupGuid == nil { - return nil, false + if o == nil || isNil(o.OperatorGroupGuid) { + return nil, false } return o.OperatorGroupGuid, true } // HasOperatorGroupGuid returns a boolean if a field has been set. func (o *MonitorGroupAuthorization) HasOperatorGroupGuid() bool { - if o != nil && o.OperatorGroupGuid != nil { + if o != nil && !isNil(o.OperatorGroupGuid) { return true } @@ -162,16 +166,16 @@ func (o *MonitorGroupAuthorization) SetOperatorGroupGuid(v string) { func (o MonitorGroupAuthorization) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.AuthorizationId != nil { + if !isNil(o.AuthorizationId) { toSerialize["AuthorizationId"] = o.AuthorizationId } if true { toSerialize["AuthorizationType"] = o.AuthorizationType } - if o.OperatorGuid != nil { + if !isNil(o.OperatorGuid) { toSerialize["OperatorGuid"] = o.OperatorGuid } - if o.OperatorGroupGuid != nil { + if !isNil(o.OperatorGroupGuid) { toSerialize["OperatorGroupGuid"] = o.OperatorGroupGuid } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_group_authorization_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_group_authorization_type.go index f66f6775..8f250008 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_group_authorization_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_group_authorization_type.go @@ -26,7 +26,8 @@ const ( MONITORGROUPAUTHORIZATIONTYPE_CREATE_AND_DELETE_MONITORS_IN_GROUP MonitorGroupAuthorizationType = "CreateAndDeleteMonitorsInGroup" ) -var allowedMonitorGroupAuthorizationTypeEnumValues = []MonitorGroupAuthorizationType{ +// All allowed values of MonitorGroupAuthorizationType enum +var AllowedMonitorGroupAuthorizationTypeEnumValues = []MonitorGroupAuthorizationType{ "ViewMonitorDataInGroup", "ViewMonitorsInGroup", "EditMonitorsInGroup", @@ -40,7 +41,7 @@ func (v *MonitorGroupAuthorizationType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := MonitorGroupAuthorizationType(value) - for _, existing := range allowedMonitorGroupAuthorizationTypeEnumValues { + for _, existing := range AllowedMonitorGroupAuthorizationTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -57,13 +58,13 @@ func NewMonitorGroupAuthorizationTypeFromValue(v string) (*MonitorGroupAuthoriza if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for MonitorGroupAuthorizationType: valid values are %v", v, allowedMonitorGroupAuthorizationTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for MonitorGroupAuthorizationType: valid values are %v", v, AllowedMonitorGroupAuthorizationTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v MonitorGroupAuthorizationType) IsValid() bool { - for _, existing := range allowedMonitorGroupAuthorizationTypeEnumValues { + for _, existing := range AllowedMonitorGroupAuthorizationTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_group_member.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_group_member.go index 640fedc6..8b6ffcf7 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_group_member.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_group_member.go @@ -51,8 +51,8 @@ func (o *MonitorGroupMember) GetMonitorGuid() string { // GetMonitorGuidOk returns a tuple with the MonitorGuid field value // and a boolean to check if the value has been set. func (o *MonitorGroupMember) GetMonitorGuidOk() (*string, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.MonitorGuid, true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_mode.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_mode.go index ebe67c96..f8445f2b 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_mode.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_mode.go @@ -25,7 +25,8 @@ const ( MONITORMODE_PRODUCTION MonitorMode = "Production" ) -var allowedMonitorModeEnumValues = []MonitorMode{ +// All allowed values of MonitorMode enum +var AllowedMonitorModeEnumValues = []MonitorMode{ "Development", "Staging", "Production", @@ -38,7 +39,7 @@ func (v *MonitorMode) UnmarshalJSON(src []byte) error { return err } enumTypeValue := MonitorMode(value) - for _, existing := range allowedMonitorModeEnumValues { + for _, existing := range AllowedMonitorModeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -55,13 +56,13 @@ func NewMonitorModeFromValue(v string) (*MonitorMode, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for MonitorMode: valid values are %v", v, allowedMonitorModeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for MonitorMode: valid values are %v", v, AllowedMonitorModeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v MonitorMode) IsValid() bool { - for _, existing := range allowedMonitorModeEnumValues { + for _, existing := range AllowedMonitorModeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_quota.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_quota.go index dd4a82c7..eccc7c53 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_quota.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_quota.go @@ -47,7 +47,7 @@ func NewMonitorQuotaWithDefaults() *MonitorQuota { // GetBasicMonitors returns the BasicMonitors field value if set, zero value otherwise. func (o *MonitorQuota) GetBasicMonitors() int32 { - if o == nil || o.BasicMonitors == nil { + if o == nil || isNil(o.BasicMonitors) { var ret int32 return ret } @@ -57,15 +57,15 @@ func (o *MonitorQuota) GetBasicMonitors() int32 { // GetBasicMonitorsOk returns a tuple with the BasicMonitors field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorQuota) GetBasicMonitorsOk() (*int32, bool) { - if o == nil || o.BasicMonitors == nil { - return nil, false + if o == nil || isNil(o.BasicMonitors) { + return nil, false } return o.BasicMonitors, true } // HasBasicMonitors returns a boolean if a field has been set. func (o *MonitorQuota) HasBasicMonitors() bool { - if o != nil && o.BasicMonitors != nil { + if o != nil && !isNil(o.BasicMonitors) { return true } @@ -79,7 +79,7 @@ func (o *MonitorQuota) SetBasicMonitors(v int32) { // GetBasicMonitorsInUse returns the BasicMonitorsInUse field value if set, zero value otherwise. func (o *MonitorQuota) GetBasicMonitorsInUse() int32 { - if o == nil || o.BasicMonitorsInUse == nil { + if o == nil || isNil(o.BasicMonitorsInUse) { var ret int32 return ret } @@ -89,15 +89,15 @@ func (o *MonitorQuota) GetBasicMonitorsInUse() int32 { // GetBasicMonitorsInUseOk returns a tuple with the BasicMonitorsInUse field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorQuota) GetBasicMonitorsInUseOk() (*int32, bool) { - if o == nil || o.BasicMonitorsInUse == nil { - return nil, false + if o == nil || isNil(o.BasicMonitorsInUse) { + return nil, false } return o.BasicMonitorsInUse, true } // HasBasicMonitorsInUse returns a boolean if a field has been set. func (o *MonitorQuota) HasBasicMonitorsInUse() bool { - if o != nil && o.BasicMonitorsInUse != nil { + if o != nil && !isNil(o.BasicMonitorsInUse) { return true } @@ -111,7 +111,7 @@ func (o *MonitorQuota) SetBasicMonitorsInUse(v int32) { // GetBrowserMonitors returns the BrowserMonitors field value if set, zero value otherwise. func (o *MonitorQuota) GetBrowserMonitors() int32 { - if o == nil || o.BrowserMonitors == nil { + if o == nil || isNil(o.BrowserMonitors) { var ret int32 return ret } @@ -121,15 +121,15 @@ func (o *MonitorQuota) GetBrowserMonitors() int32 { // GetBrowserMonitorsOk returns a tuple with the BrowserMonitors field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorQuota) GetBrowserMonitorsOk() (*int32, bool) { - if o == nil || o.BrowserMonitors == nil { - return nil, false + if o == nil || isNil(o.BrowserMonitors) { + return nil, false } return o.BrowserMonitors, true } // HasBrowserMonitors returns a boolean if a field has been set. func (o *MonitorQuota) HasBrowserMonitors() bool { - if o != nil && o.BrowserMonitors != nil { + if o != nil && !isNil(o.BrowserMonitors) { return true } @@ -143,7 +143,7 @@ func (o *MonitorQuota) SetBrowserMonitors(v int32) { // GetBrowserMonitorsInUse returns the BrowserMonitorsInUse field value if set, zero value otherwise. func (o *MonitorQuota) GetBrowserMonitorsInUse() int32 { - if o == nil || o.BrowserMonitorsInUse == nil { + if o == nil || isNil(o.BrowserMonitorsInUse) { var ret int32 return ret } @@ -153,15 +153,15 @@ func (o *MonitorQuota) GetBrowserMonitorsInUse() int32 { // GetBrowserMonitorsInUseOk returns a tuple with the BrowserMonitorsInUse field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorQuota) GetBrowserMonitorsInUseOk() (*int32, bool) { - if o == nil || o.BrowserMonitorsInUse == nil { - return nil, false + if o == nil || isNil(o.BrowserMonitorsInUse) { + return nil, false } return o.BrowserMonitorsInUse, true } // HasBrowserMonitorsInUse returns a boolean if a field has been set. func (o *MonitorQuota) HasBrowserMonitorsInUse() bool { - if o != nil && o.BrowserMonitorsInUse != nil { + if o != nil && !isNil(o.BrowserMonitorsInUse) { return true } @@ -175,7 +175,7 @@ func (o *MonitorQuota) SetBrowserMonitorsInUse(v int32) { // GetApiMonitoringCredits returns the ApiMonitoringCredits field value if set, zero value otherwise. func (o *MonitorQuota) GetApiMonitoringCredits() int32 { - if o == nil || o.ApiMonitoringCredits == nil { + if o == nil || isNil(o.ApiMonitoringCredits) { var ret int32 return ret } @@ -185,15 +185,15 @@ func (o *MonitorQuota) GetApiMonitoringCredits() int32 { // GetApiMonitoringCreditsOk returns a tuple with the ApiMonitoringCredits field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorQuota) GetApiMonitoringCreditsOk() (*int32, bool) { - if o == nil || o.ApiMonitoringCredits == nil { - return nil, false + if o == nil || isNil(o.ApiMonitoringCredits) { + return nil, false } return o.ApiMonitoringCredits, true } // HasApiMonitoringCredits returns a boolean if a field has been set. func (o *MonitorQuota) HasApiMonitoringCredits() bool { - if o != nil && o.ApiMonitoringCredits != nil { + if o != nil && !isNil(o.ApiMonitoringCredits) { return true } @@ -207,7 +207,7 @@ func (o *MonitorQuota) SetApiMonitoringCredits(v int32) { // GetApiMonitoringCreditsInUse returns the ApiMonitoringCreditsInUse field value if set, zero value otherwise. func (o *MonitorQuota) GetApiMonitoringCreditsInUse() int32 { - if o == nil || o.ApiMonitoringCreditsInUse == nil { + if o == nil || isNil(o.ApiMonitoringCreditsInUse) { var ret int32 return ret } @@ -217,15 +217,15 @@ func (o *MonitorQuota) GetApiMonitoringCreditsInUse() int32 { // GetApiMonitoringCreditsInUseOk returns a tuple with the ApiMonitoringCreditsInUse field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorQuota) GetApiMonitoringCreditsInUseOk() (*int32, bool) { - if o == nil || o.ApiMonitoringCreditsInUse == nil { - return nil, false + if o == nil || isNil(o.ApiMonitoringCreditsInUse) { + return nil, false } return o.ApiMonitoringCreditsInUse, true } // HasApiMonitoringCreditsInUse returns a boolean if a field has been set. func (o *MonitorQuota) HasApiMonitoringCreditsInUse() bool { - if o != nil && o.ApiMonitoringCreditsInUse != nil { + if o != nil && !isNil(o.ApiMonitoringCreditsInUse) { return true } @@ -239,7 +239,7 @@ func (o *MonitorQuota) SetApiMonitoringCreditsInUse(v int32) { // GetTransactionCredits returns the TransactionCredits field value if set, zero value otherwise. func (o *MonitorQuota) GetTransactionCredits() int32 { - if o == nil || o.TransactionCredits == nil { + if o == nil || isNil(o.TransactionCredits) { var ret int32 return ret } @@ -249,15 +249,15 @@ func (o *MonitorQuota) GetTransactionCredits() int32 { // GetTransactionCreditsOk returns a tuple with the TransactionCredits field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorQuota) GetTransactionCreditsOk() (*int32, bool) { - if o == nil || o.TransactionCredits == nil { - return nil, false + if o == nil || isNil(o.TransactionCredits) { + return nil, false } return o.TransactionCredits, true } // HasTransactionCredits returns a boolean if a field has been set. func (o *MonitorQuota) HasTransactionCredits() bool { - if o != nil && o.TransactionCredits != nil { + if o != nil && !isNil(o.TransactionCredits) { return true } @@ -271,7 +271,7 @@ func (o *MonitorQuota) SetTransactionCredits(v int32) { // GetTransactionCreditsInUse returns the TransactionCreditsInUse field value if set, zero value otherwise. func (o *MonitorQuota) GetTransactionCreditsInUse() int32 { - if o == nil || o.TransactionCreditsInUse == nil { + if o == nil || isNil(o.TransactionCreditsInUse) { var ret int32 return ret } @@ -281,15 +281,15 @@ func (o *MonitorQuota) GetTransactionCreditsInUse() int32 { // GetTransactionCreditsInUseOk returns a tuple with the TransactionCreditsInUse field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorQuota) GetTransactionCreditsInUseOk() (*int32, bool) { - if o == nil || o.TransactionCreditsInUse == nil { - return nil, false + if o == nil || isNil(o.TransactionCreditsInUse) { + return nil, false } return o.TransactionCreditsInUse, true } // HasTransactionCreditsInUse returns a boolean if a field has been set. func (o *MonitorQuota) HasTransactionCreditsInUse() bool { - if o != nil && o.TransactionCreditsInUse != nil { + if o != nil && !isNil(o.TransactionCreditsInUse) { return true } @@ -303,7 +303,7 @@ func (o *MonitorQuota) SetTransactionCreditsInUse(v int32) { // GetMonitors returns the Monitors field value if set, zero value otherwise. func (o *MonitorQuota) GetMonitors() int32 { - if o == nil || o.Monitors == nil { + if o == nil || isNil(o.Monitors) { var ret int32 return ret } @@ -313,15 +313,15 @@ func (o *MonitorQuota) GetMonitors() int32 { // GetMonitorsOk returns a tuple with the Monitors field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorQuota) GetMonitorsOk() (*int32, bool) { - if o == nil || o.Monitors == nil { - return nil, false + if o == nil || isNil(o.Monitors) { + return nil, false } return o.Monitors, true } // HasMonitors returns a boolean if a field has been set. func (o *MonitorQuota) HasMonitors() bool { - if o != nil && o.Monitors != nil { + if o != nil && !isNil(o.Monitors) { return true } @@ -335,7 +335,7 @@ func (o *MonitorQuota) SetMonitors(v int32) { // GetMonitorsInUse returns the MonitorsInUse field value if set, zero value otherwise. func (o *MonitorQuota) GetMonitorsInUse() int32 { - if o == nil || o.MonitorsInUse == nil { + if o == nil || isNil(o.MonitorsInUse) { var ret int32 return ret } @@ -345,15 +345,15 @@ func (o *MonitorQuota) GetMonitorsInUse() int32 { // GetMonitorsInUseOk returns a tuple with the MonitorsInUse field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorQuota) GetMonitorsInUseOk() (*int32, bool) { - if o == nil || o.MonitorsInUse == nil { - return nil, false + if o == nil || isNil(o.MonitorsInUse) { + return nil, false } return o.MonitorsInUse, true } // HasMonitorsInUse returns a boolean if a field has been set. func (o *MonitorQuota) HasMonitorsInUse() bool { - if o != nil && o.MonitorsInUse != nil { + if o != nil && !isNil(o.MonitorsInUse) { return true } @@ -367,34 +367,34 @@ func (o *MonitorQuota) SetMonitorsInUse(v int32) { func (o MonitorQuota) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.BasicMonitors != nil { + if !isNil(o.BasicMonitors) { toSerialize["BasicMonitors"] = o.BasicMonitors } - if o.BasicMonitorsInUse != nil { + if !isNil(o.BasicMonitorsInUse) { toSerialize["BasicMonitorsInUse"] = o.BasicMonitorsInUse } - if o.BrowserMonitors != nil { + if !isNil(o.BrowserMonitors) { toSerialize["BrowserMonitors"] = o.BrowserMonitors } - if o.BrowserMonitorsInUse != nil { + if !isNil(o.BrowserMonitorsInUse) { toSerialize["BrowserMonitorsInUse"] = o.BrowserMonitorsInUse } - if o.ApiMonitoringCredits != nil { + if !isNil(o.ApiMonitoringCredits) { toSerialize["ApiMonitoringCredits"] = o.ApiMonitoringCredits } - if o.ApiMonitoringCreditsInUse != nil { + if !isNil(o.ApiMonitoringCreditsInUse) { toSerialize["ApiMonitoringCreditsInUse"] = o.ApiMonitoringCreditsInUse } - if o.TransactionCredits != nil { + if !isNil(o.TransactionCredits) { toSerialize["TransactionCredits"] = o.TransactionCredits } - if o.TransactionCreditsInUse != nil { + if !isNil(o.TransactionCreditsInUse) { toSerialize["TransactionCreditsInUse"] = o.TransactionCreditsInUse } - if o.Monitors != nil { + if !isNil(o.Monitors) { toSerialize["Monitors"] = o.Monitors } - if o.MonitorsInUse != nil { + if !isNil(o.MonitorsInUse) { toSerialize["MonitorsInUse"] = o.MonitorsInUse } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_status.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_status.go index a829432c..7fd8df8c 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_status.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_status.go @@ -17,9 +17,13 @@ import ( // MonitorStatus struct for MonitorStatus type MonitorStatus struct { Attributes *MonitorStatusAttributes `json:"Attributes,omitempty"` + // Identifier Id string `json:"Id"` + // Object type Type *string `json:"Type,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + // Links related to the object Links *map[string]string `json:"Links,omitempty"` } @@ -43,7 +47,7 @@ func NewMonitorStatusWithDefaults() *MonitorStatus { // GetAttributes returns the Attributes field value if set, zero value otherwise. func (o *MonitorStatus) GetAttributes() MonitorStatusAttributes { - if o == nil || o.Attributes == nil { + if o == nil || isNil(o.Attributes) { var ret MonitorStatusAttributes return ret } @@ -53,15 +57,15 @@ func (o *MonitorStatus) GetAttributes() MonitorStatusAttributes { // GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorStatus) GetAttributesOk() (*MonitorStatusAttributes, bool) { - if o == nil || o.Attributes == nil { - return nil, false + if o == nil || isNil(o.Attributes) { + return nil, false } return o.Attributes, true } // HasAttributes returns a boolean if a field has been set. func (o *MonitorStatus) HasAttributes() bool { - if o != nil && o.Attributes != nil { + if o != nil && !isNil(o.Attributes) { return true } @@ -86,8 +90,8 @@ func (o *MonitorStatus) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *MonitorStatus) GetIdOk() (*string, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Id, true } @@ -99,7 +103,7 @@ func (o *MonitorStatus) SetId(v string) { // GetType returns the Type field value if set, zero value otherwise. func (o *MonitorStatus) GetType() string { - if o == nil || o.Type == nil { + if o == nil || isNil(o.Type) { var ret string return ret } @@ -109,15 +113,15 @@ func (o *MonitorStatus) GetType() string { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorStatus) GetTypeOk() (*string, bool) { - if o == nil || o.Type == nil { - return nil, false + if o == nil || isNil(o.Type) { + return nil, false } return o.Type, true } // HasType returns a boolean if a field has been set. func (o *MonitorStatus) HasType() bool { - if o != nil && o.Type != nil { + if o != nil && !isNil(o.Type) { return true } @@ -131,25 +135,25 @@ func (o *MonitorStatus) SetType(v string) { // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *MonitorStatus) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MonitorStatus) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *MonitorStatus) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *MonitorStatus) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -158,12 +162,12 @@ func (o *MonitorStatus) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *MonitorStatus) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetLinks returns the Links field value if set, zero value otherwise. func (o *MonitorStatus) GetLinks() map[string]string { - if o == nil || o.Links == nil { + if o == nil || isNil(o.Links) { var ret map[string]string return ret } @@ -173,15 +177,15 @@ func (o *MonitorStatus) GetLinks() map[string]string { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorStatus) GetLinksOk() (*map[string]string, bool) { - if o == nil || o.Links == nil { - return nil, false + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *MonitorStatus) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } @@ -195,19 +199,19 @@ func (o *MonitorStatus) SetLinks(v map[string]string) { func (o MonitorStatus) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Attributes != nil { + if !isNil(o.Attributes) { toSerialize["Attributes"] = o.Attributes } if true { toSerialize["Id"] = o.Id } - if o.Type != nil { + if !isNil(o.Type) { toSerialize["Type"] = o.Type } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_status_attributes.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_status_attributes.go index f2fc3ede..b1d203db 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_status_attributes.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_status_attributes.go @@ -12,17 +12,18 @@ package uptrends import ( "encoding/json" - "time" ) -// MonitorStatusAttributes Monitor Status attributes +// MonitorStatusAttributes Object attributes type MonitorStatusAttributes struct { // The error level for the monitor status ErrorLevel LastErrorLevel `json:"ErrorLevel"` // Last checked timeStamp for this monitor - LastCheck *time.Time `json:"LastCheck,omitempty"` + LastCheck map[string]interface{} `json:"LastCheck,omitempty"` // Checkpoint id for the monitor status CheckpointId *int32 `json:"CheckpointId,omitempty"` + // Checkpoint name for the monitor status + CheckpointName *string `json:"CheckpointName,omitempty"` // Error description for the monitor status ErrorDescription *string `json:"ErrorDescription,omitempty"` // Uptime percentage for the monitor status @@ -31,6 +32,8 @@ type MonitorStatusAttributes struct { ErrorCode int32 `json:"ErrorCode"` // Last monitor check id LastMonitorCheckId *int64 `json:"LastMonitorCheckId,omitempty"` + // Total time for the monitor status + TotalTime *int32 `json:"TotalTime,omitempty"` } // NewMonitorStatusAttributes instantiates a new MonitorStatusAttributes object @@ -66,8 +69,8 @@ func (o *MonitorStatusAttributes) GetErrorLevel() LastErrorLevel { // GetErrorLevelOk returns a tuple with the ErrorLevel field value // and a boolean to check if the value has been set. func (o *MonitorStatusAttributes) GetErrorLevelOk() (*LastErrorLevel, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.ErrorLevel, true } @@ -78,40 +81,40 @@ func (o *MonitorStatusAttributes) SetErrorLevel(v LastErrorLevel) { } // GetLastCheck returns the LastCheck field value if set, zero value otherwise. -func (o *MonitorStatusAttributes) GetLastCheck() time.Time { - if o == nil || o.LastCheck == nil { - var ret time.Time +func (o *MonitorStatusAttributes) GetLastCheck() map[string]interface{} { + if o == nil || isNil(o.LastCheck) { + var ret map[string]interface{} return ret } - return *o.LastCheck + return o.LastCheck } // GetLastCheckOk returns a tuple with the LastCheck field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MonitorStatusAttributes) GetLastCheckOk() (*time.Time, bool) { - if o == nil || o.LastCheck == nil { - return nil, false +func (o *MonitorStatusAttributes) GetLastCheckOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.LastCheck) { + return map[string]interface{}{}, false } return o.LastCheck, true } // HasLastCheck returns a boolean if a field has been set. func (o *MonitorStatusAttributes) HasLastCheck() bool { - if o != nil && o.LastCheck != nil { + if o != nil && !isNil(o.LastCheck) { return true } return false } -// SetLastCheck gets a reference to the given time.Time and assigns it to the LastCheck field. -func (o *MonitorStatusAttributes) SetLastCheck(v time.Time) { - o.LastCheck = &v +// SetLastCheck gets a reference to the given map[string]interface{} and assigns it to the LastCheck field. +func (o *MonitorStatusAttributes) SetLastCheck(v map[string]interface{}) { + o.LastCheck = v } // GetCheckpointId returns the CheckpointId field value if set, zero value otherwise. func (o *MonitorStatusAttributes) GetCheckpointId() int32 { - if o == nil || o.CheckpointId == nil { + if o == nil || isNil(o.CheckpointId) { var ret int32 return ret } @@ -121,15 +124,15 @@ func (o *MonitorStatusAttributes) GetCheckpointId() int32 { // GetCheckpointIdOk returns a tuple with the CheckpointId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorStatusAttributes) GetCheckpointIdOk() (*int32, bool) { - if o == nil || o.CheckpointId == nil { - return nil, false + if o == nil || isNil(o.CheckpointId) { + return nil, false } return o.CheckpointId, true } // HasCheckpointId returns a boolean if a field has been set. func (o *MonitorStatusAttributes) HasCheckpointId() bool { - if o != nil && o.CheckpointId != nil { + if o != nil && !isNil(o.CheckpointId) { return true } @@ -141,9 +144,41 @@ func (o *MonitorStatusAttributes) SetCheckpointId(v int32) { o.CheckpointId = &v } +// GetCheckpointName returns the CheckpointName field value if set, zero value otherwise. +func (o *MonitorStatusAttributes) GetCheckpointName() string { + if o == nil || isNil(o.CheckpointName) { + var ret string + return ret + } + return *o.CheckpointName +} + +// GetCheckpointNameOk returns a tuple with the CheckpointName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MonitorStatusAttributes) GetCheckpointNameOk() (*string, bool) { + if o == nil || isNil(o.CheckpointName) { + return nil, false + } + return o.CheckpointName, true +} + +// HasCheckpointName returns a boolean if a field has been set. +func (o *MonitorStatusAttributes) HasCheckpointName() bool { + if o != nil && !isNil(o.CheckpointName) { + return true + } + + return false +} + +// SetCheckpointName gets a reference to the given string and assigns it to the CheckpointName field. +func (o *MonitorStatusAttributes) SetCheckpointName(v string) { + o.CheckpointName = &v +} + // GetErrorDescription returns the ErrorDescription field value if set, zero value otherwise. func (o *MonitorStatusAttributes) GetErrorDescription() string { - if o == nil || o.ErrorDescription == nil { + if o == nil || isNil(o.ErrorDescription) { var ret string return ret } @@ -153,15 +188,15 @@ func (o *MonitorStatusAttributes) GetErrorDescription() string { // GetErrorDescriptionOk returns a tuple with the ErrorDescription field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorStatusAttributes) GetErrorDescriptionOk() (*string, bool) { - if o == nil || o.ErrorDescription == nil { - return nil, false + if o == nil || isNil(o.ErrorDescription) { + return nil, false } return o.ErrorDescription, true } // HasErrorDescription returns a boolean if a field has been set. func (o *MonitorStatusAttributes) HasErrorDescription() bool { - if o != nil && o.ErrorDescription != nil { + if o != nil && !isNil(o.ErrorDescription) { return true } @@ -186,8 +221,8 @@ func (o *MonitorStatusAttributes) GetUptimePercentage() float64 { // GetUptimePercentageOk returns a tuple with the UptimePercentage field value // and a boolean to check if the value has been set. func (o *MonitorStatusAttributes) GetUptimePercentageOk() (*float64, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.UptimePercentage, true } @@ -210,8 +245,8 @@ func (o *MonitorStatusAttributes) GetErrorCode() int32 { // GetErrorCodeOk returns a tuple with the ErrorCode field value // and a boolean to check if the value has been set. func (o *MonitorStatusAttributes) GetErrorCodeOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.ErrorCode, true } @@ -223,7 +258,7 @@ func (o *MonitorStatusAttributes) SetErrorCode(v int32) { // GetLastMonitorCheckId returns the LastMonitorCheckId field value if set, zero value otherwise. func (o *MonitorStatusAttributes) GetLastMonitorCheckId() int64 { - if o == nil || o.LastMonitorCheckId == nil { + if o == nil || isNil(o.LastMonitorCheckId) { var ret int64 return ret } @@ -233,15 +268,15 @@ func (o *MonitorStatusAttributes) GetLastMonitorCheckId() int64 { // GetLastMonitorCheckIdOk returns a tuple with the LastMonitorCheckId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MonitorStatusAttributes) GetLastMonitorCheckIdOk() (*int64, bool) { - if o == nil || o.LastMonitorCheckId == nil { - return nil, false + if o == nil || isNil(o.LastMonitorCheckId) { + return nil, false } return o.LastMonitorCheckId, true } // HasLastMonitorCheckId returns a boolean if a field has been set. func (o *MonitorStatusAttributes) HasLastMonitorCheckId() bool { - if o != nil && o.LastMonitorCheckId != nil { + if o != nil && !isNil(o.LastMonitorCheckId) { return true } @@ -253,18 +288,53 @@ func (o *MonitorStatusAttributes) SetLastMonitorCheckId(v int64) { o.LastMonitorCheckId = &v } +// GetTotalTime returns the TotalTime field value if set, zero value otherwise. +func (o *MonitorStatusAttributes) GetTotalTime() int32 { + if o == nil || isNil(o.TotalTime) { + var ret int32 + return ret + } + return *o.TotalTime +} + +// GetTotalTimeOk returns a tuple with the TotalTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MonitorStatusAttributes) GetTotalTimeOk() (*int32, bool) { + if o == nil || isNil(o.TotalTime) { + return nil, false + } + return o.TotalTime, true +} + +// HasTotalTime returns a boolean if a field has been set. +func (o *MonitorStatusAttributes) HasTotalTime() bool { + if o != nil && !isNil(o.TotalTime) { + return true + } + + return false +} + +// SetTotalTime gets a reference to the given int32 and assigns it to the TotalTime field. +func (o *MonitorStatusAttributes) SetTotalTime(v int32) { + o.TotalTime = &v +} + func (o MonitorStatusAttributes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if true { toSerialize["ErrorLevel"] = o.ErrorLevel } - if o.LastCheck != nil { + if !isNil(o.LastCheck) { toSerialize["LastCheck"] = o.LastCheck } - if o.CheckpointId != nil { + if !isNil(o.CheckpointId) { toSerialize["CheckpointId"] = o.CheckpointId } - if o.ErrorDescription != nil { + if !isNil(o.CheckpointName) { + toSerialize["CheckpointName"] = o.CheckpointName + } + if !isNil(o.ErrorDescription) { toSerialize["ErrorDescription"] = o.ErrorDescription } if true { @@ -273,9 +343,12 @@ func (o MonitorStatusAttributes) MarshalJSON() ([]byte, error) { if true { toSerialize["ErrorCode"] = o.ErrorCode } - if o.LastMonitorCheckId != nil { + if !isNil(o.LastMonitorCheckId) { toSerialize["LastMonitorCheckId"] = o.LastMonitorCheckId } + if !isNil(o.TotalTime) { + toSerialize["TotalTime"] = o.TotalTime + } return json.Marshal(toSerialize) } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_status_list_response.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_status_list_response.go index 4e382fe4..2ffc112d 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_status_list_response.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_status_list_response.go @@ -16,10 +16,12 @@ import ( // MonitorStatusListResponse struct for MonitorStatusListResponse type MonitorStatusListResponse struct { - Data *[]MonitorStatus `json:"Data,omitempty"` - Links *LinksData `json:"Links,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` - Meta *MetaData `json:"Meta,omitempty"` + // The resposne data/monitor checks + Data []MonitorStatus `json:"Data,omitempty"` + Links *StatisticsResponseLinks `json:"Links,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + Meta *StatisticsResponseMeta `json:"Meta,omitempty"` } // NewMonitorStatusListResponse instantiates a new MonitorStatusListResponse object @@ -41,25 +43,25 @@ func NewMonitorStatusListResponseWithDefaults() *MonitorStatusListResponse { // GetData returns the Data field value if set, zero value otherwise. func (o *MonitorStatusListResponse) GetData() []MonitorStatus { - if o == nil || o.Data == nil { + if o == nil || isNil(o.Data) { var ret []MonitorStatus return ret } - return *o.Data + return o.Data } // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MonitorStatusListResponse) GetDataOk() (*[]MonitorStatus, bool) { - if o == nil || o.Data == nil { - return nil, false +func (o *MonitorStatusListResponse) GetDataOk() ([]MonitorStatus, bool) { + if o == nil || isNil(o.Data) { + return nil, false } return o.Data, true } // HasData returns a boolean if a field has been set. func (o *MonitorStatusListResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && !isNil(o.Data) { return true } @@ -68,13 +70,13 @@ func (o *MonitorStatusListResponse) HasData() bool { // SetData gets a reference to the given []MonitorStatus and assigns it to the Data field. func (o *MonitorStatusListResponse) SetData(v []MonitorStatus) { - o.Data = &v + o.Data = v } // GetLinks returns the Links field value if set, zero value otherwise. -func (o *MonitorStatusListResponse) GetLinks() LinksData { - if o == nil || o.Links == nil { - var ret LinksData +func (o *MonitorStatusListResponse) GetLinks() StatisticsResponseLinks { + if o == nil || isNil(o.Links) { + var ret StatisticsResponseLinks return ret } return *o.Links @@ -82,48 +84,48 @@ func (o *MonitorStatusListResponse) GetLinks() LinksData { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MonitorStatusListResponse) GetLinksOk() (*LinksData, bool) { - if o == nil || o.Links == nil { - return nil, false +func (o *MonitorStatusListResponse) GetLinksOk() (*StatisticsResponseLinks, bool) { + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *MonitorStatusListResponse) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } return false } -// SetLinks gets a reference to the given LinksData and assigns it to the Links field. -func (o *MonitorStatusListResponse) SetLinks(v LinksData) { +// SetLinks gets a reference to the given StatisticsResponseLinks and assigns it to the Links field. +func (o *MonitorStatusListResponse) SetLinks(v StatisticsResponseLinks) { o.Links = &v } // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *MonitorStatusListResponse) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MonitorStatusListResponse) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *MonitorStatusListResponse) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *MonitorStatusListResponse) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -132,13 +134,13 @@ func (o *MonitorStatusListResponse) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *MonitorStatusListResponse) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetMeta returns the Meta field value if set, zero value otherwise. -func (o *MonitorStatusListResponse) GetMeta() MetaData { - if o == nil || o.Meta == nil { - var ret MetaData +func (o *MonitorStatusListResponse) GetMeta() StatisticsResponseMeta { + if o == nil || isNil(o.Meta) { + var ret StatisticsResponseMeta return ret } return *o.Meta @@ -146,39 +148,39 @@ func (o *MonitorStatusListResponse) GetMeta() MetaData { // GetMetaOk returns a tuple with the Meta field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MonitorStatusListResponse) GetMetaOk() (*MetaData, bool) { - if o == nil || o.Meta == nil { - return nil, false +func (o *MonitorStatusListResponse) GetMetaOk() (*StatisticsResponseMeta, bool) { + if o == nil || isNil(o.Meta) { + return nil, false } return o.Meta, true } // HasMeta returns a boolean if a field has been set. func (o *MonitorStatusListResponse) HasMeta() bool { - if o != nil && o.Meta != nil { + if o != nil && !isNil(o.Meta) { return true } return false } -// SetMeta gets a reference to the given MetaData and assigns it to the Meta field. -func (o *MonitorStatusListResponse) SetMeta(v MetaData) { +// SetMeta gets a reference to the given StatisticsResponseMeta and assigns it to the Meta field. +func (o *MonitorStatusListResponse) SetMeta(v StatisticsResponseMeta) { o.Meta = &v } func (o MonitorStatusListResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Data != nil { + if !isNil(o.Data) { toSerialize["Data"] = o.Data } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Meta != nil { + if !isNil(o.Meta) { toSerialize["Meta"] = o.Meta } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_status_response.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_status_response.go index 687082a6..991d2e17 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_status_response.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_status_response.go @@ -16,10 +16,11 @@ import ( // MonitorStatusResponse struct for MonitorStatusResponse type MonitorStatusResponse struct { - Data *MonitorStatus `json:"Data,omitempty"` - Links *LinksData `json:"Links,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` - Meta *MetaData `json:"Meta,omitempty"` + Data *MonitorStatusResponseData `json:"Data,omitempty"` + Links *StatisticsResponseLinks `json:"Links,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + Meta *StatisticsResponseMeta `json:"Meta,omitempty"` } // NewMonitorStatusResponse instantiates a new MonitorStatusResponse object @@ -40,9 +41,9 @@ func NewMonitorStatusResponseWithDefaults() *MonitorStatusResponse { } // GetData returns the Data field value if set, zero value otherwise. -func (o *MonitorStatusResponse) GetData() MonitorStatus { - if o == nil || o.Data == nil { - var ret MonitorStatus +func (o *MonitorStatusResponse) GetData() MonitorStatusResponseData { + if o == nil || isNil(o.Data) { + var ret MonitorStatusResponseData return ret } return *o.Data @@ -50,31 +51,31 @@ func (o *MonitorStatusResponse) GetData() MonitorStatus { // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MonitorStatusResponse) GetDataOk() (*MonitorStatus, bool) { - if o == nil || o.Data == nil { - return nil, false +func (o *MonitorStatusResponse) GetDataOk() (*MonitorStatusResponseData, bool) { + if o == nil || isNil(o.Data) { + return nil, false } return o.Data, true } // HasData returns a boolean if a field has been set. func (o *MonitorStatusResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && !isNil(o.Data) { return true } return false } -// SetData gets a reference to the given MonitorStatus and assigns it to the Data field. -func (o *MonitorStatusResponse) SetData(v MonitorStatus) { +// SetData gets a reference to the given MonitorStatusResponseData and assigns it to the Data field. +func (o *MonitorStatusResponse) SetData(v MonitorStatusResponseData) { o.Data = &v } // GetLinks returns the Links field value if set, zero value otherwise. -func (o *MonitorStatusResponse) GetLinks() LinksData { - if o == nil || o.Links == nil { - var ret LinksData +func (o *MonitorStatusResponse) GetLinks() StatisticsResponseLinks { + if o == nil || isNil(o.Links) { + var ret StatisticsResponseLinks return ret } return *o.Links @@ -82,48 +83,48 @@ func (o *MonitorStatusResponse) GetLinks() LinksData { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MonitorStatusResponse) GetLinksOk() (*LinksData, bool) { - if o == nil || o.Links == nil { - return nil, false +func (o *MonitorStatusResponse) GetLinksOk() (*StatisticsResponseLinks, bool) { + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *MonitorStatusResponse) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } return false } -// SetLinks gets a reference to the given LinksData and assigns it to the Links field. -func (o *MonitorStatusResponse) SetLinks(v LinksData) { +// SetLinks gets a reference to the given StatisticsResponseLinks and assigns it to the Links field. +func (o *MonitorStatusResponse) SetLinks(v StatisticsResponseLinks) { o.Links = &v } // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *MonitorStatusResponse) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MonitorStatusResponse) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *MonitorStatusResponse) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *MonitorStatusResponse) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -132,13 +133,13 @@ func (o *MonitorStatusResponse) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *MonitorStatusResponse) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetMeta returns the Meta field value if set, zero value otherwise. -func (o *MonitorStatusResponse) GetMeta() MetaData { - if o == nil || o.Meta == nil { - var ret MetaData +func (o *MonitorStatusResponse) GetMeta() StatisticsResponseMeta { + if o == nil || isNil(o.Meta) { + var ret StatisticsResponseMeta return ret } return *o.Meta @@ -146,39 +147,39 @@ func (o *MonitorStatusResponse) GetMeta() MetaData { // GetMetaOk returns a tuple with the Meta field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MonitorStatusResponse) GetMetaOk() (*MetaData, bool) { - if o == nil || o.Meta == nil { - return nil, false +func (o *MonitorStatusResponse) GetMetaOk() (*StatisticsResponseMeta, bool) { + if o == nil || isNil(o.Meta) { + return nil, false } return o.Meta, true } // HasMeta returns a boolean if a field has been set. func (o *MonitorStatusResponse) HasMeta() bool { - if o != nil && o.Meta != nil { + if o != nil && !isNil(o.Meta) { return true } return false } -// SetMeta gets a reference to the given MetaData and assigns it to the Meta field. -func (o *MonitorStatusResponse) SetMeta(v MetaData) { +// SetMeta gets a reference to the given StatisticsResponseMeta and assigns it to the Meta field. +func (o *MonitorStatusResponse) SetMeta(v StatisticsResponseMeta) { o.Meta = &v } func (o MonitorStatusResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Data != nil { + if !isNil(o.Data) { toSerialize["Data"] = o.Data } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Meta != nil { + if !isNil(o.Meta) { toSerialize["Meta"] = o.Meta } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_status_response_data.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_status_response_data.go new file mode 100644 index 00000000..6edbbcab --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_status_response_data.go @@ -0,0 +1,256 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// MonitorStatusResponseData The resposne data/monitor checks +type MonitorStatusResponseData struct { + Attributes *MonitorStatusAttributes `json:"Attributes,omitempty"` + // Identifier + Id string `json:"Id"` + // Object type + Type *string `json:"Type,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + // Links related to the object + Links *map[string]string `json:"Links,omitempty"` +} + +// NewMonitorStatusResponseData instantiates a new MonitorStatusResponseData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMonitorStatusResponseData(id string) *MonitorStatusResponseData { + this := MonitorStatusResponseData{} + this.Id = id + return &this +} + +// NewMonitorStatusResponseDataWithDefaults instantiates a new MonitorStatusResponseData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMonitorStatusResponseDataWithDefaults() *MonitorStatusResponseData { + this := MonitorStatusResponseData{} + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *MonitorStatusResponseData) GetAttributes() MonitorStatusAttributes { + if o == nil || isNil(o.Attributes) { + var ret MonitorStatusAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MonitorStatusResponseData) GetAttributesOk() (*MonitorStatusAttributes, bool) { + if o == nil || isNil(o.Attributes) { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *MonitorStatusResponseData) HasAttributes() bool { + if o != nil && !isNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given MonitorStatusAttributes and assigns it to the Attributes field. +func (o *MonitorStatusResponseData) SetAttributes(v MonitorStatusAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value +func (o *MonitorStatusResponseData) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *MonitorStatusResponseData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *MonitorStatusResponseData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *MonitorStatusResponseData) GetType() string { + if o == nil || isNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MonitorStatusResponseData) GetTypeOk() (*string, bool) { + if o == nil || isNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *MonitorStatusResponseData) HasType() bool { + if o != nil && !isNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *MonitorStatusResponseData) SetType(v string) { + o.Type = &v +} + +// GetRelationships returns the Relationships field value if set, zero value otherwise. +func (o *MonitorStatusResponseData) GetRelationships() []RelationObject { + if o == nil || isNil(o.Relationships) { + var ret []RelationObject + return ret + } + return o.Relationships +} + +// GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MonitorStatusResponseData) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false + } + return o.Relationships, true +} + +// HasRelationships returns a boolean if a field has been set. +func (o *MonitorStatusResponseData) HasRelationships() bool { + if o != nil && !isNil(o.Relationships) { + return true + } + + return false +} + +// SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. +func (o *MonitorStatusResponseData) SetRelationships(v []RelationObject) { + o.Relationships = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *MonitorStatusResponseData) GetLinks() map[string]string { + if o == nil || isNil(o.Links) { + var ret map[string]string + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MonitorStatusResponseData) GetLinksOk() (*map[string]string, bool) { + if o == nil || isNil(o.Links) { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *MonitorStatusResponseData) HasLinks() bool { + if o != nil && !isNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given map[string]string and assigns it to the Links field. +func (o *MonitorStatusResponseData) SetLinks(v map[string]string) { + o.Links = &v +} + +func (o MonitorStatusResponseData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Attributes) { + toSerialize["Attributes"] = o.Attributes + } + if true { + toSerialize["Id"] = o.Id + } + if !isNil(o.Type) { + toSerialize["Type"] = o.Type + } + if !isNil(o.Relationships) { + toSerialize["Relationships"] = o.Relationships + } + if !isNil(o.Links) { + toSerialize["Links"] = o.Links + } + return json.Marshal(toSerialize) +} + +type NullableMonitorStatusResponseData struct { + value *MonitorStatusResponseData + isSet bool +} + +func (v NullableMonitorStatusResponseData) Get() *MonitorStatusResponseData { + return v.value +} + +func (v *NullableMonitorStatusResponseData) Set(val *MonitorStatusResponseData) { + v.value = val + v.isSet = true +} + +func (v NullableMonitorStatusResponseData) IsSet() bool { + return v.isSet +} + +func (v *NullableMonitorStatusResponseData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMonitorStatusResponseData(val *MonitorStatusResponseData) *NullableMonitorStatusResponseData { + return &NullableMonitorStatusResponseData{value: val, isSet: true} +} + +func (v NullableMonitorStatusResponseData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMonitorStatusResponseData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_transaction_step_definition.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_transaction_step_definition.go new file mode 100644 index 00000000..2060aa02 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_transaction_step_definition.go @@ -0,0 +1,115 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// MonitorTransactionStepDefinition Only valid for Transaction monitors: the data structure that specifies the transaction steps (and sub steps) to execute. +type MonitorTransactionStepDefinition struct { + Steps []TransactionStep2 `json:"Steps,omitempty"` +} + +// NewMonitorTransactionStepDefinition instantiates a new MonitorTransactionStepDefinition object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMonitorTransactionStepDefinition() *MonitorTransactionStepDefinition { + this := MonitorTransactionStepDefinition{} + return &this +} + +// NewMonitorTransactionStepDefinitionWithDefaults instantiates a new MonitorTransactionStepDefinition object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMonitorTransactionStepDefinitionWithDefaults() *MonitorTransactionStepDefinition { + this := MonitorTransactionStepDefinition{} + return &this +} + +// GetSteps returns the Steps field value if set, zero value otherwise. +func (o *MonitorTransactionStepDefinition) GetSteps() []TransactionStep2 { + if o == nil || isNil(o.Steps) { + var ret []TransactionStep2 + return ret + } + return o.Steps +} + +// GetStepsOk returns a tuple with the Steps field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MonitorTransactionStepDefinition) GetStepsOk() ([]TransactionStep2, bool) { + if o == nil || isNil(o.Steps) { + return nil, false + } + return o.Steps, true +} + +// HasSteps returns a boolean if a field has been set. +func (o *MonitorTransactionStepDefinition) HasSteps() bool { + if o != nil && !isNil(o.Steps) { + return true + } + + return false +} + +// SetSteps gets a reference to the given []TransactionStep2 and assigns it to the Steps field. +func (o *MonitorTransactionStepDefinition) SetSteps(v []TransactionStep2) { + o.Steps = v +} + +func (o MonitorTransactionStepDefinition) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Steps) { + toSerialize["Steps"] = o.Steps + } + return json.Marshal(toSerialize) +} + +type NullableMonitorTransactionStepDefinition struct { + value *MonitorTransactionStepDefinition + isSet bool +} + +func (v NullableMonitorTransactionStepDefinition) Get() *MonitorTransactionStepDefinition { + return v.value +} + +func (v *NullableMonitorTransactionStepDefinition) Set(val *MonitorTransactionStepDefinition) { + v.value = val + v.isSet = true +} + +func (v NullableMonitorTransactionStepDefinition) IsSet() bool { + return v.isSet +} + +func (v *NullableMonitorTransactionStepDefinition) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMonitorTransactionStepDefinition(val *MonitorTransactionStepDefinition) *NullableMonitorTransactionStepDefinition { + return &NullableMonitorTransactionStepDefinition{value: val, isSet: true} +} + +func (v NullableMonitorTransactionStepDefinition) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMonitorTransactionStepDefinition) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_type.go index 0dc04624..87cf4f42 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_monitor_type.go @@ -41,7 +41,8 @@ const ( MONITORTYPE_IMAP MonitorType = "IMAP" ) -var allowedMonitorTypeEnumValues = []MonitorType{ +// All allowed values of MonitorType enum +var AllowedMonitorTypeEnumValues = []MonitorType{ "Http", "Https", "Connect", @@ -70,7 +71,7 @@ func (v *MonitorType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := MonitorType(value) - for _, existing := range allowedMonitorTypeEnumValues { + for _, existing := range AllowedMonitorTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -87,13 +88,13 @@ func NewMonitorTypeFromValue(v string) (*MonitorType, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for MonitorType: valid values are %v", v, allowedMonitorTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for MonitorType: valid values are %v", v, AllowedMonitorTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v MonitorType) IsValid() bool { - for _, existing := range allowedMonitorTypeEnumValues { + for _, existing := range AllowedMonitorTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_msa_body_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_msa_body_type.go index 2063201e..a29f9e53 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_msa_body_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_msa_body_type.go @@ -22,11 +22,14 @@ type MsaBodyType string const ( MSABODYTYPE_RAW MsaBodyType = "Raw" MSABODYTYPE_VAULT_FILES MsaBodyType = "VaultFiles" + MSABODYTYPE_VAULT_FILE_AS_BINARY MsaBodyType = "VaultFileAsBinary" ) -var allowedMsaBodyTypeEnumValues = []MsaBodyType{ +// All allowed values of MsaBodyType enum +var AllowedMsaBodyTypeEnumValues = []MsaBodyType{ "Raw", "VaultFiles", + "VaultFileAsBinary", } func (v *MsaBodyType) UnmarshalJSON(src []byte) error { @@ -36,7 +39,7 @@ func (v *MsaBodyType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := MsaBodyType(value) - for _, existing := range allowedMsaBodyTypeEnumValues { + for _, existing := range AllowedMsaBodyTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -53,13 +56,13 @@ func NewMsaBodyTypeFromValue(v string) (*MsaBodyType, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for MsaBodyType: valid values are %v", v, allowedMsaBodyTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for MsaBodyType: valid values are %v", v, AllowedMsaBodyTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v MsaBodyType) IsValid() bool { - for _, existing := range allowedMsaBodyTypeEnumValues { + for _, existing := range AllowedMsaBodyTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_msa_details_response.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_msa_details_response.go index f7614f2a..87910bfc 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_msa_details_response.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_msa_details_response.go @@ -16,10 +16,11 @@ import ( // MsaDetailsResponse struct for MsaDetailsResponse type MsaDetailsResponse struct { - Data *HttpEngineCheckDetails `json:"Data,omitempty"` - Links *LinksData `json:"Links,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` - Meta *MetaData `json:"Meta,omitempty"` + Data *MsaDetailsResponseData `json:"Data,omitempty"` + Links *StatisticsResponseLinks `json:"Links,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + Meta *StatisticsResponseMeta `json:"Meta,omitempty"` } // NewMsaDetailsResponse instantiates a new MsaDetailsResponse object @@ -40,9 +41,9 @@ func NewMsaDetailsResponseWithDefaults() *MsaDetailsResponse { } // GetData returns the Data field value if set, zero value otherwise. -func (o *MsaDetailsResponse) GetData() HttpEngineCheckDetails { - if o == nil || o.Data == nil { - var ret HttpEngineCheckDetails +func (o *MsaDetailsResponse) GetData() MsaDetailsResponseData { + if o == nil || isNil(o.Data) { + var ret MsaDetailsResponseData return ret } return *o.Data @@ -50,31 +51,31 @@ func (o *MsaDetailsResponse) GetData() HttpEngineCheckDetails { // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MsaDetailsResponse) GetDataOk() (*HttpEngineCheckDetails, bool) { - if o == nil || o.Data == nil { - return nil, false +func (o *MsaDetailsResponse) GetDataOk() (*MsaDetailsResponseData, bool) { + if o == nil || isNil(o.Data) { + return nil, false } return o.Data, true } // HasData returns a boolean if a field has been set. func (o *MsaDetailsResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && !isNil(o.Data) { return true } return false } -// SetData gets a reference to the given HttpEngineCheckDetails and assigns it to the Data field. -func (o *MsaDetailsResponse) SetData(v HttpEngineCheckDetails) { +// SetData gets a reference to the given MsaDetailsResponseData and assigns it to the Data field. +func (o *MsaDetailsResponse) SetData(v MsaDetailsResponseData) { o.Data = &v } // GetLinks returns the Links field value if set, zero value otherwise. -func (o *MsaDetailsResponse) GetLinks() LinksData { - if o == nil || o.Links == nil { - var ret LinksData +func (o *MsaDetailsResponse) GetLinks() StatisticsResponseLinks { + if o == nil || isNil(o.Links) { + var ret StatisticsResponseLinks return ret } return *o.Links @@ -82,48 +83,48 @@ func (o *MsaDetailsResponse) GetLinks() LinksData { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MsaDetailsResponse) GetLinksOk() (*LinksData, bool) { - if o == nil || o.Links == nil { - return nil, false +func (o *MsaDetailsResponse) GetLinksOk() (*StatisticsResponseLinks, bool) { + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *MsaDetailsResponse) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } return false } -// SetLinks gets a reference to the given LinksData and assigns it to the Links field. -func (o *MsaDetailsResponse) SetLinks(v LinksData) { +// SetLinks gets a reference to the given StatisticsResponseLinks and assigns it to the Links field. +func (o *MsaDetailsResponse) SetLinks(v StatisticsResponseLinks) { o.Links = &v } // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *MsaDetailsResponse) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MsaDetailsResponse) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *MsaDetailsResponse) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *MsaDetailsResponse) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -132,13 +133,13 @@ func (o *MsaDetailsResponse) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *MsaDetailsResponse) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetMeta returns the Meta field value if set, zero value otherwise. -func (o *MsaDetailsResponse) GetMeta() MetaData { - if o == nil || o.Meta == nil { - var ret MetaData +func (o *MsaDetailsResponse) GetMeta() StatisticsResponseMeta { + if o == nil || isNil(o.Meta) { + var ret StatisticsResponseMeta return ret } return *o.Meta @@ -146,39 +147,39 @@ func (o *MsaDetailsResponse) GetMeta() MetaData { // GetMetaOk returns a tuple with the Meta field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MsaDetailsResponse) GetMetaOk() (*MetaData, bool) { - if o == nil || o.Meta == nil { - return nil, false +func (o *MsaDetailsResponse) GetMetaOk() (*StatisticsResponseMeta, bool) { + if o == nil || isNil(o.Meta) { + return nil, false } return o.Meta, true } // HasMeta returns a boolean if a field has been set. func (o *MsaDetailsResponse) HasMeta() bool { - if o != nil && o.Meta != nil { + if o != nil && !isNil(o.Meta) { return true } return false } -// SetMeta gets a reference to the given MetaData and assigns it to the Meta field. -func (o *MsaDetailsResponse) SetMeta(v MetaData) { +// SetMeta gets a reference to the given StatisticsResponseMeta and assigns it to the Meta field. +func (o *MsaDetailsResponse) SetMeta(v StatisticsResponseMeta) { o.Meta = &v } func (o MsaDetailsResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Data != nil { + if !isNil(o.Data) { toSerialize["Data"] = o.Data } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Meta != nil { + if !isNil(o.Meta) { toSerialize["Meta"] = o.Meta } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_msa_details_response_data.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_msa_details_response_data.go new file mode 100644 index 00000000..8dede959 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_msa_details_response_data.go @@ -0,0 +1,256 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// MsaDetailsResponseData The resposne data/monitor checks +type MsaDetailsResponseData struct { + Attributes *HttpEngineCheckDetailsAttributes `json:"Attributes,omitempty"` + // Identifier + Id int64 `json:"Id"` + // Object type + Type *string `json:"Type,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + // Links related to the object + Links *map[string]string `json:"Links,omitempty"` +} + +// NewMsaDetailsResponseData instantiates a new MsaDetailsResponseData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMsaDetailsResponseData(id int64) *MsaDetailsResponseData { + this := MsaDetailsResponseData{} + this.Id = id + return &this +} + +// NewMsaDetailsResponseDataWithDefaults instantiates a new MsaDetailsResponseData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMsaDetailsResponseDataWithDefaults() *MsaDetailsResponseData { + this := MsaDetailsResponseData{} + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *MsaDetailsResponseData) GetAttributes() HttpEngineCheckDetailsAttributes { + if o == nil || isNil(o.Attributes) { + var ret HttpEngineCheckDetailsAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MsaDetailsResponseData) GetAttributesOk() (*HttpEngineCheckDetailsAttributes, bool) { + if o == nil || isNil(o.Attributes) { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *MsaDetailsResponseData) HasAttributes() bool { + if o != nil && !isNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given HttpEngineCheckDetailsAttributes and assigns it to the Attributes field. +func (o *MsaDetailsResponseData) SetAttributes(v HttpEngineCheckDetailsAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value +func (o *MsaDetailsResponseData) GetId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *MsaDetailsResponseData) GetIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *MsaDetailsResponseData) SetId(v int64) { + o.Id = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *MsaDetailsResponseData) GetType() string { + if o == nil || isNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MsaDetailsResponseData) GetTypeOk() (*string, bool) { + if o == nil || isNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *MsaDetailsResponseData) HasType() bool { + if o != nil && !isNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *MsaDetailsResponseData) SetType(v string) { + o.Type = &v +} + +// GetRelationships returns the Relationships field value if set, zero value otherwise. +func (o *MsaDetailsResponseData) GetRelationships() []RelationObject { + if o == nil || isNil(o.Relationships) { + var ret []RelationObject + return ret + } + return o.Relationships +} + +// GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MsaDetailsResponseData) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false + } + return o.Relationships, true +} + +// HasRelationships returns a boolean if a field has been set. +func (o *MsaDetailsResponseData) HasRelationships() bool { + if o != nil && !isNil(o.Relationships) { + return true + } + + return false +} + +// SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. +func (o *MsaDetailsResponseData) SetRelationships(v []RelationObject) { + o.Relationships = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *MsaDetailsResponseData) GetLinks() map[string]string { + if o == nil || isNil(o.Links) { + var ret map[string]string + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MsaDetailsResponseData) GetLinksOk() (*map[string]string, bool) { + if o == nil || isNil(o.Links) { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *MsaDetailsResponseData) HasLinks() bool { + if o != nil && !isNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given map[string]string and assigns it to the Links field. +func (o *MsaDetailsResponseData) SetLinks(v map[string]string) { + o.Links = &v +} + +func (o MsaDetailsResponseData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Attributes) { + toSerialize["Attributes"] = o.Attributes + } + if true { + toSerialize["Id"] = o.Id + } + if !isNil(o.Type) { + toSerialize["Type"] = o.Type + } + if !isNil(o.Relationships) { + toSerialize["Relationships"] = o.Relationships + } + if !isNil(o.Links) { + toSerialize["Links"] = o.Links + } + return json.Marshal(toSerialize) +} + +type NullableMsaDetailsResponseData struct { + value *MsaDetailsResponseData + isSet bool +} + +func (v NullableMsaDetailsResponseData) Get() *MsaDetailsResponseData { + return v.value +} + +func (v *NullableMsaDetailsResponseData) Set(val *MsaDetailsResponseData) { + v.value = val + v.isSet = true +} + +func (v NullableMsaDetailsResponseData) IsSet() bool { + return v.isSet +} + +func (v *NullableMsaDetailsResponseData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMsaDetailsResponseData(val *MsaDetailsResponseData) *NullableMsaDetailsResponseData { + return &NullableMsaDetailsResponseData{value: val, isSet: true} +} + +func (v NullableMsaDetailsResponseData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMsaDetailsResponseData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_msa_step.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_msa_step.go index 15a08cbb..f9b91d07 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_msa_step.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_msa_step.go @@ -17,16 +17,16 @@ import ( // MsaStep struct for MsaStep type MsaStep struct { Url *string `json:"Url,omitempty"` - Method *string `json:"Method,omitempty"` + Method HttpMethods `json:"Method"` // The body that will be send in the request. Only used if BodyType equals Raw Body *string `json:"Body,omitempty"` // Determines what kind of body the request will have. BodyType *MsaBodyType `json:"BodyType,omitempty"` // The guid of the vaultfile that will be send in the request. Only used if BodyType equals VaultFiles VaultFileId *string `json:"VaultFileId,omitempty"` - RequestHeaders *[]ApiHttpHeaderValue `json:"RequestHeaders,omitempty"` - Variables *[]ApiVariableDefinition `json:"Variables,omitempty"` - Assertions *[]ApiAssertion `json:"Assertions,omitempty"` + RequestHeaders []ApiHttpHeaderValue `json:"RequestHeaders,omitempty"` + Variables []ApiVariableDefinition `json:"Variables,omitempty"` + Assertions []ApiAssertion `json:"Assertions,omitempty"` Name *string `json:"Name,omitempty"` UseFixedClientCertificate bool `json:"UseFixedClientCertificate"` Authentication *ApiAuthenticationInfo `json:"Authentication,omitempty"` @@ -36,14 +36,16 @@ type MsaStep struct { StepType MsaStepType `json:"StepType"` RetryUntilSuccessful bool `json:"RetryUntilSuccessful"` MaxAttempts int32 `json:"MaxAttempts"` + RetryWaitMilliseconds *int32 `json:"RetryWaitMilliseconds,omitempty"` } // NewMsaStep instantiates a new MsaStep object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewMsaStep(useFixedClientCertificate bool, ignoreCertificateErrors bool, delay int32, stepType MsaStepType, retryUntilSuccessful bool, maxAttempts int32) *MsaStep { +func NewMsaStep(method HttpMethods, useFixedClientCertificate bool, ignoreCertificateErrors bool, delay int32, stepType MsaStepType, retryUntilSuccessful bool, maxAttempts int32) *MsaStep { this := MsaStep{} + this.Method = method this.UseFixedClientCertificate = useFixedClientCertificate this.IgnoreCertificateErrors = ignoreCertificateErrors this.Delay = delay @@ -63,7 +65,7 @@ func NewMsaStepWithDefaults() *MsaStep { // GetUrl returns the Url field value if set, zero value otherwise. func (o *MsaStep) GetUrl() string { - if o == nil || o.Url == nil { + if o == nil || isNil(o.Url) { var ret string return ret } @@ -73,15 +75,15 @@ func (o *MsaStep) GetUrl() string { // GetUrlOk returns a tuple with the Url field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MsaStep) GetUrlOk() (*string, bool) { - if o == nil || o.Url == nil { - return nil, false + if o == nil || isNil(o.Url) { + return nil, false } return o.Url, true } // HasUrl returns a boolean if a field has been set. func (o *MsaStep) HasUrl() bool { - if o != nil && o.Url != nil { + if o != nil && !isNil(o.Url) { return true } @@ -93,41 +95,33 @@ func (o *MsaStep) SetUrl(v string) { o.Url = &v } -// GetMethod returns the Method field value if set, zero value otherwise. -func (o *MsaStep) GetMethod() string { - if o == nil || o.Method == nil { - var ret string +// GetMethod returns the Method field value +func (o *MsaStep) GetMethod() HttpMethods { + if o == nil { + var ret HttpMethods return ret } - return *o.Method -} -// GetMethodOk returns a tuple with the Method field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *MsaStep) GetMethodOk() (*string, bool) { - if o == nil || o.Method == nil { - return nil, false - } - return o.Method, true + return o.Method } -// HasMethod returns a boolean if a field has been set. -func (o *MsaStep) HasMethod() bool { - if o != nil && o.Method != nil { - return true +// GetMethodOk returns a tuple with the Method field value +// and a boolean to check if the value has been set. +func (o *MsaStep) GetMethodOk() (*HttpMethods, bool) { + if o == nil { + return nil, false } - - return false + return &o.Method, true } -// SetMethod gets a reference to the given string and assigns it to the Method field. -func (o *MsaStep) SetMethod(v string) { - o.Method = &v +// SetMethod sets field value +func (o *MsaStep) SetMethod(v HttpMethods) { + o.Method = v } // GetBody returns the Body field value if set, zero value otherwise. func (o *MsaStep) GetBody() string { - if o == nil || o.Body == nil { + if o == nil || isNil(o.Body) { var ret string return ret } @@ -137,15 +131,15 @@ func (o *MsaStep) GetBody() string { // GetBodyOk returns a tuple with the Body field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MsaStep) GetBodyOk() (*string, bool) { - if o == nil || o.Body == nil { - return nil, false + if o == nil || isNil(o.Body) { + return nil, false } return o.Body, true } // HasBody returns a boolean if a field has been set. func (o *MsaStep) HasBody() bool { - if o != nil && o.Body != nil { + if o != nil && !isNil(o.Body) { return true } @@ -159,7 +153,7 @@ func (o *MsaStep) SetBody(v string) { // GetBodyType returns the BodyType field value if set, zero value otherwise. func (o *MsaStep) GetBodyType() MsaBodyType { - if o == nil || o.BodyType == nil { + if o == nil || isNil(o.BodyType) { var ret MsaBodyType return ret } @@ -169,15 +163,15 @@ func (o *MsaStep) GetBodyType() MsaBodyType { // GetBodyTypeOk returns a tuple with the BodyType field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MsaStep) GetBodyTypeOk() (*MsaBodyType, bool) { - if o == nil || o.BodyType == nil { - return nil, false + if o == nil || isNil(o.BodyType) { + return nil, false } return o.BodyType, true } // HasBodyType returns a boolean if a field has been set. func (o *MsaStep) HasBodyType() bool { - if o != nil && o.BodyType != nil { + if o != nil && !isNil(o.BodyType) { return true } @@ -191,7 +185,7 @@ func (o *MsaStep) SetBodyType(v MsaBodyType) { // GetVaultFileId returns the VaultFileId field value if set, zero value otherwise. func (o *MsaStep) GetVaultFileId() string { - if o == nil || o.VaultFileId == nil { + if o == nil || isNil(o.VaultFileId) { var ret string return ret } @@ -201,15 +195,15 @@ func (o *MsaStep) GetVaultFileId() string { // GetVaultFileIdOk returns a tuple with the VaultFileId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MsaStep) GetVaultFileIdOk() (*string, bool) { - if o == nil || o.VaultFileId == nil { - return nil, false + if o == nil || isNil(o.VaultFileId) { + return nil, false } return o.VaultFileId, true } // HasVaultFileId returns a boolean if a field has been set. func (o *MsaStep) HasVaultFileId() bool { - if o != nil && o.VaultFileId != nil { + if o != nil && !isNil(o.VaultFileId) { return true } @@ -223,25 +217,25 @@ func (o *MsaStep) SetVaultFileId(v string) { // GetRequestHeaders returns the RequestHeaders field value if set, zero value otherwise. func (o *MsaStep) GetRequestHeaders() []ApiHttpHeaderValue { - if o == nil || o.RequestHeaders == nil { + if o == nil || isNil(o.RequestHeaders) { var ret []ApiHttpHeaderValue return ret } - return *o.RequestHeaders + return o.RequestHeaders } // GetRequestHeadersOk returns a tuple with the RequestHeaders field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MsaStep) GetRequestHeadersOk() (*[]ApiHttpHeaderValue, bool) { - if o == nil || o.RequestHeaders == nil { - return nil, false +func (o *MsaStep) GetRequestHeadersOk() ([]ApiHttpHeaderValue, bool) { + if o == nil || isNil(o.RequestHeaders) { + return nil, false } return o.RequestHeaders, true } // HasRequestHeaders returns a boolean if a field has been set. func (o *MsaStep) HasRequestHeaders() bool { - if o != nil && o.RequestHeaders != nil { + if o != nil && !isNil(o.RequestHeaders) { return true } @@ -250,30 +244,30 @@ func (o *MsaStep) HasRequestHeaders() bool { // SetRequestHeaders gets a reference to the given []ApiHttpHeaderValue and assigns it to the RequestHeaders field. func (o *MsaStep) SetRequestHeaders(v []ApiHttpHeaderValue) { - o.RequestHeaders = &v + o.RequestHeaders = v } // GetVariables returns the Variables field value if set, zero value otherwise. func (o *MsaStep) GetVariables() []ApiVariableDefinition { - if o == nil || o.Variables == nil { + if o == nil || isNil(o.Variables) { var ret []ApiVariableDefinition return ret } - return *o.Variables + return o.Variables } // GetVariablesOk returns a tuple with the Variables field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MsaStep) GetVariablesOk() (*[]ApiVariableDefinition, bool) { - if o == nil || o.Variables == nil { - return nil, false +func (o *MsaStep) GetVariablesOk() ([]ApiVariableDefinition, bool) { + if o == nil || isNil(o.Variables) { + return nil, false } return o.Variables, true } // HasVariables returns a boolean if a field has been set. func (o *MsaStep) HasVariables() bool { - if o != nil && o.Variables != nil { + if o != nil && !isNil(o.Variables) { return true } @@ -282,30 +276,30 @@ func (o *MsaStep) HasVariables() bool { // SetVariables gets a reference to the given []ApiVariableDefinition and assigns it to the Variables field. func (o *MsaStep) SetVariables(v []ApiVariableDefinition) { - o.Variables = &v + o.Variables = v } // GetAssertions returns the Assertions field value if set, zero value otherwise. func (o *MsaStep) GetAssertions() []ApiAssertion { - if o == nil || o.Assertions == nil { + if o == nil || isNil(o.Assertions) { var ret []ApiAssertion return ret } - return *o.Assertions + return o.Assertions } // GetAssertionsOk returns a tuple with the Assertions field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MsaStep) GetAssertionsOk() (*[]ApiAssertion, bool) { - if o == nil || o.Assertions == nil { - return nil, false +func (o *MsaStep) GetAssertionsOk() ([]ApiAssertion, bool) { + if o == nil || isNil(o.Assertions) { + return nil, false } return o.Assertions, true } // HasAssertions returns a boolean if a field has been set. func (o *MsaStep) HasAssertions() bool { - if o != nil && o.Assertions != nil { + if o != nil && !isNil(o.Assertions) { return true } @@ -314,12 +308,12 @@ func (o *MsaStep) HasAssertions() bool { // SetAssertions gets a reference to the given []ApiAssertion and assigns it to the Assertions field. func (o *MsaStep) SetAssertions(v []ApiAssertion) { - o.Assertions = &v + o.Assertions = v } // GetName returns the Name field value if set, zero value otherwise. func (o *MsaStep) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -329,15 +323,15 @@ func (o *MsaStep) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MsaStep) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *MsaStep) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -362,8 +356,8 @@ func (o *MsaStep) GetUseFixedClientCertificate() bool { // GetUseFixedClientCertificateOk returns a tuple with the UseFixedClientCertificate field value // and a boolean to check if the value has been set. func (o *MsaStep) GetUseFixedClientCertificateOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.UseFixedClientCertificate, true } @@ -375,7 +369,7 @@ func (o *MsaStep) SetUseFixedClientCertificate(v bool) { // GetAuthentication returns the Authentication field value if set, zero value otherwise. func (o *MsaStep) GetAuthentication() ApiAuthenticationInfo { - if o == nil || o.Authentication == nil { + if o == nil || isNil(o.Authentication) { var ret ApiAuthenticationInfo return ret } @@ -385,15 +379,15 @@ func (o *MsaStep) GetAuthentication() ApiAuthenticationInfo { // GetAuthenticationOk returns a tuple with the Authentication field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MsaStep) GetAuthenticationOk() (*ApiAuthenticationInfo, bool) { - if o == nil || o.Authentication == nil { - return nil, false + if o == nil || isNil(o.Authentication) { + return nil, false } return o.Authentication, true } // HasAuthentication returns a boolean if a field has been set. func (o *MsaStep) HasAuthentication() bool { - if o != nil && o.Authentication != nil { + if o != nil && !isNil(o.Authentication) { return true } @@ -418,8 +412,8 @@ func (o *MsaStep) GetIgnoreCertificateErrors() bool { // GetIgnoreCertificateErrorsOk returns a tuple with the IgnoreCertificateErrors field value // and a boolean to check if the value has been set. func (o *MsaStep) GetIgnoreCertificateErrorsOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.IgnoreCertificateErrors, true } @@ -431,7 +425,7 @@ func (o *MsaStep) SetIgnoreCertificateErrors(v bool) { // GetClientCertificateVaultItem returns the ClientCertificateVaultItem field value if set, zero value otherwise. func (o *MsaStep) GetClientCertificateVaultItem() string { - if o == nil || o.ClientCertificateVaultItem == nil { + if o == nil || isNil(o.ClientCertificateVaultItem) { var ret string return ret } @@ -441,15 +435,15 @@ func (o *MsaStep) GetClientCertificateVaultItem() string { // GetClientCertificateVaultItemOk returns a tuple with the ClientCertificateVaultItem field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MsaStep) GetClientCertificateVaultItemOk() (*string, bool) { - if o == nil || o.ClientCertificateVaultItem == nil { - return nil, false + if o == nil || isNil(o.ClientCertificateVaultItem) { + return nil, false } return o.ClientCertificateVaultItem, true } // HasClientCertificateVaultItem returns a boolean if a field has been set. func (o *MsaStep) HasClientCertificateVaultItem() bool { - if o != nil && o.ClientCertificateVaultItem != nil { + if o != nil && !isNil(o.ClientCertificateVaultItem) { return true } @@ -474,8 +468,8 @@ func (o *MsaStep) GetDelay() int32 { // GetDelayOk returns a tuple with the Delay field value // and a boolean to check if the value has been set. func (o *MsaStep) GetDelayOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Delay, true } @@ -498,8 +492,8 @@ func (o *MsaStep) GetStepType() MsaStepType { // GetStepTypeOk returns a tuple with the StepType field value // and a boolean to check if the value has been set. func (o *MsaStep) GetStepTypeOk() (*MsaStepType, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.StepType, true } @@ -522,8 +516,8 @@ func (o *MsaStep) GetRetryUntilSuccessful() bool { // GetRetryUntilSuccessfulOk returns a tuple with the RetryUntilSuccessful field value // and a boolean to check if the value has been set. func (o *MsaStep) GetRetryUntilSuccessfulOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.RetryUntilSuccessful, true } @@ -546,8 +540,8 @@ func (o *MsaStep) GetMaxAttempts() int32 { // GetMaxAttemptsOk returns a tuple with the MaxAttempts field value // and a boolean to check if the value has been set. func (o *MsaStep) GetMaxAttemptsOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.MaxAttempts, true } @@ -557,45 +551,77 @@ func (o *MsaStep) SetMaxAttempts(v int32) { o.MaxAttempts = v } +// GetRetryWaitMilliseconds returns the RetryWaitMilliseconds field value if set, zero value otherwise. +func (o *MsaStep) GetRetryWaitMilliseconds() int32 { + if o == nil || isNil(o.RetryWaitMilliseconds) { + var ret int32 + return ret + } + return *o.RetryWaitMilliseconds +} + +// GetRetryWaitMillisecondsOk returns a tuple with the RetryWaitMilliseconds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MsaStep) GetRetryWaitMillisecondsOk() (*int32, bool) { + if o == nil || isNil(o.RetryWaitMilliseconds) { + return nil, false + } + return o.RetryWaitMilliseconds, true +} + +// HasRetryWaitMilliseconds returns a boolean if a field has been set. +func (o *MsaStep) HasRetryWaitMilliseconds() bool { + if o != nil && !isNil(o.RetryWaitMilliseconds) { + return true + } + + return false +} + +// SetRetryWaitMilliseconds gets a reference to the given int32 and assigns it to the RetryWaitMilliseconds field. +func (o *MsaStep) SetRetryWaitMilliseconds(v int32) { + o.RetryWaitMilliseconds = &v +} + func (o MsaStep) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Url != nil { + if !isNil(o.Url) { toSerialize["Url"] = o.Url } - if o.Method != nil { + if true { toSerialize["Method"] = o.Method } - if o.Body != nil { + if !isNil(o.Body) { toSerialize["Body"] = o.Body } - if o.BodyType != nil { + if !isNil(o.BodyType) { toSerialize["BodyType"] = o.BodyType } - if o.VaultFileId != nil { + if !isNil(o.VaultFileId) { toSerialize["VaultFileId"] = o.VaultFileId } - if o.RequestHeaders != nil { + if !isNil(o.RequestHeaders) { toSerialize["RequestHeaders"] = o.RequestHeaders } - if o.Variables != nil { + if !isNil(o.Variables) { toSerialize["Variables"] = o.Variables } - if o.Assertions != nil { + if !isNil(o.Assertions) { toSerialize["Assertions"] = o.Assertions } - if o.Name != nil { + if !isNil(o.Name) { toSerialize["Name"] = o.Name } if true { toSerialize["UseFixedClientCertificate"] = o.UseFixedClientCertificate } - if o.Authentication != nil { + if !isNil(o.Authentication) { toSerialize["Authentication"] = o.Authentication } if true { toSerialize["IgnoreCertificateErrors"] = o.IgnoreCertificateErrors } - if o.ClientCertificateVaultItem != nil { + if !isNil(o.ClientCertificateVaultItem) { toSerialize["ClientCertificateVaultItem"] = o.ClientCertificateVaultItem } if true { @@ -610,6 +636,9 @@ func (o MsaStep) MarshalJSON() ([]byte, error) { if true { toSerialize["MaxAttempts"] = o.MaxAttempts } + if !isNil(o.RetryWaitMilliseconds) { + toSerialize["RetryWaitMilliseconds"] = o.RetryWaitMilliseconds + } return json.Marshal(toSerialize) } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_msa_step_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_msa_step_type.go index af4c5cb2..4de0080e 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_msa_step_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_msa_step_type.go @@ -24,7 +24,8 @@ const ( MSASTEPTYPE_DELAY MsaStepType = "Delay" ) -var allowedMsaStepTypeEnumValues = []MsaStepType{ +// All allowed values of MsaStepType enum +var AllowedMsaStepTypeEnumValues = []MsaStepType{ "HttpRequest", "Delay", } @@ -36,7 +37,7 @@ func (v *MsaStepType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := MsaStepType(value) - for _, existing := range allowedMsaStepTypeEnumValues { + for _, existing := range AllowedMsaStepTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -53,13 +54,13 @@ func NewMsaStepTypeFromValue(v string) (*MsaStepType, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for MsaStepType: valid values are %v", v, allowedMsaStepTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for MsaStepType: valid values are %v", v, AllowedMsaStepTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v MsaStepType) IsValid() bool { - for _, existing := range allowedMsaStepTypeEnumValues { + for _, existing := range AllowedMsaStepTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_one_time_password_info.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_one_time_password_info.go new file mode 100644 index 00000000..af9500b6 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_one_time_password_info.go @@ -0,0 +1,202 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// OneTimePasswordInfo struct for OneTimePasswordInfo +type OneTimePasswordInfo struct { + Secret *string `json:"Secret,omitempty"` + Digits int32 `json:"Digits"` + Period int32 `json:"Period"` + HashAlgorithm HashAlgorithm `json:"HashAlgorithm"` +} + +// NewOneTimePasswordInfo instantiates a new OneTimePasswordInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOneTimePasswordInfo(digits int32, period int32, hashAlgorithm HashAlgorithm) *OneTimePasswordInfo { + this := OneTimePasswordInfo{} + this.Digits = digits + this.Period = period + this.HashAlgorithm = hashAlgorithm + return &this +} + +// NewOneTimePasswordInfoWithDefaults instantiates a new OneTimePasswordInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOneTimePasswordInfoWithDefaults() *OneTimePasswordInfo { + this := OneTimePasswordInfo{} + return &this +} + +// GetSecret returns the Secret field value if set, zero value otherwise. +func (o *OneTimePasswordInfo) GetSecret() string { + if o == nil || isNil(o.Secret) { + var ret string + return ret + } + return *o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OneTimePasswordInfo) GetSecretOk() (*string, bool) { + if o == nil || isNil(o.Secret) { + return nil, false + } + return o.Secret, true +} + +// HasSecret returns a boolean if a field has been set. +func (o *OneTimePasswordInfo) HasSecret() bool { + if o != nil && !isNil(o.Secret) { + return true + } + + return false +} + +// SetSecret gets a reference to the given string and assigns it to the Secret field. +func (o *OneTimePasswordInfo) SetSecret(v string) { + o.Secret = &v +} + +// GetDigits returns the Digits field value +func (o *OneTimePasswordInfo) GetDigits() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Digits +} + +// GetDigitsOk returns a tuple with the Digits field value +// and a boolean to check if the value has been set. +func (o *OneTimePasswordInfo) GetDigitsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Digits, true +} + +// SetDigits sets field value +func (o *OneTimePasswordInfo) SetDigits(v int32) { + o.Digits = v +} + +// GetPeriod returns the Period field value +func (o *OneTimePasswordInfo) GetPeriod() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Period +} + +// GetPeriodOk returns a tuple with the Period field value +// and a boolean to check if the value has been set. +func (o *OneTimePasswordInfo) GetPeriodOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Period, true +} + +// SetPeriod sets field value +func (o *OneTimePasswordInfo) SetPeriod(v int32) { + o.Period = v +} + +// GetHashAlgorithm returns the HashAlgorithm field value +func (o *OneTimePasswordInfo) GetHashAlgorithm() HashAlgorithm { + if o == nil { + var ret HashAlgorithm + return ret + } + + return o.HashAlgorithm +} + +// GetHashAlgorithmOk returns a tuple with the HashAlgorithm field value +// and a boolean to check if the value has been set. +func (o *OneTimePasswordInfo) GetHashAlgorithmOk() (*HashAlgorithm, bool) { + if o == nil { + return nil, false + } + return &o.HashAlgorithm, true +} + +// SetHashAlgorithm sets field value +func (o *OneTimePasswordInfo) SetHashAlgorithm(v HashAlgorithm) { + o.HashAlgorithm = v +} + +func (o OneTimePasswordInfo) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Secret) { + toSerialize["Secret"] = o.Secret + } + if true { + toSerialize["Digits"] = o.Digits + } + if true { + toSerialize["Period"] = o.Period + } + if true { + toSerialize["HashAlgorithm"] = o.HashAlgorithm + } + return json.Marshal(toSerialize) +} + +type NullableOneTimePasswordInfo struct { + value *OneTimePasswordInfo + isSet bool +} + +func (v NullableOneTimePasswordInfo) Get() *OneTimePasswordInfo { + return v.value +} + +func (v *NullableOneTimePasswordInfo) Set(val *OneTimePasswordInfo) { + v.value = val + v.isSet = true +} + +func (v NullableOneTimePasswordInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableOneTimePasswordInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOneTimePasswordInfo(val *OneTimePasswordInfo) *NullableOneTimePasswordInfo { + return &NullableOneTimePasswordInfo{value: val, isSet: true} +} + +func (v NullableOneTimePasswordInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOneTimePasswordInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_operator.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_operator.go index bfeca2d6..6d905a2e 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_operator.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_operator.go @@ -54,6 +54,7 @@ type Operator struct { // This can only be set to true if the account has SSO enabled. Ommitting or providing null will use the account default AllowSingleSignon *bool `json:"AllowSingleSignon,omitempty"` AllowSingleSignonSpecified *bool `json:"AllowSingleSignonSpecified,omitempty"` + // This is used to set the default dashboard for the operator. Valid options are: UseAccountSpecifiedDashboard (This will use the dashboard specified for the account) Any built-in dashboard: e.g. AccountOverview Any custom dashboard to which the operator has access to, defined by the guid of this dashboard DefaultDashboard *string `json:"DefaultDashboard,omitempty"` SetupMode *OperatorSetupMode `json:"SetupMode,omitempty"` } @@ -77,7 +78,7 @@ func NewOperatorWithDefaults() *Operator { // GetOperatorGuid returns the OperatorGuid field value if set, zero value otherwise. func (o *Operator) GetOperatorGuid() string { - if o == nil || o.OperatorGuid == nil { + if o == nil || isNil(o.OperatorGuid) { var ret string return ret } @@ -87,15 +88,15 @@ func (o *Operator) GetOperatorGuid() string { // GetOperatorGuidOk returns a tuple with the OperatorGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetOperatorGuidOk() (*string, bool) { - if o == nil || o.OperatorGuid == nil { - return nil, false + if o == nil || isNil(o.OperatorGuid) { + return nil, false } return o.OperatorGuid, true } // HasOperatorGuid returns a boolean if a field has been set. func (o *Operator) HasOperatorGuid() bool { - if o != nil && o.OperatorGuid != nil { + if o != nil && !isNil(o.OperatorGuid) { return true } @@ -109,7 +110,7 @@ func (o *Operator) SetOperatorGuid(v string) { // GetHash returns the Hash field value if set, zero value otherwise. func (o *Operator) GetHash() string { - if o == nil || o.Hash == nil { + if o == nil || isNil(o.Hash) { var ret string return ret } @@ -119,15 +120,15 @@ func (o *Operator) GetHash() string { // GetHashOk returns a tuple with the Hash field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetHashOk() (*string, bool) { - if o == nil || o.Hash == nil { - return nil, false + if o == nil || isNil(o.Hash) { + return nil, false } return o.Hash, true } // HasHash returns a boolean if a field has been set. func (o *Operator) HasHash() bool { - if o != nil && o.Hash != nil { + if o != nil && !isNil(o.Hash) { return true } @@ -141,7 +142,7 @@ func (o *Operator) SetHash(v string) { // GetPassword returns the Password field value if set, zero value otherwise. func (o *Operator) GetPassword() string { - if o == nil || o.Password == nil { + if o == nil || isNil(o.Password) { var ret string return ret } @@ -151,15 +152,15 @@ func (o *Operator) GetPassword() string { // GetPasswordOk returns a tuple with the Password field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetPasswordOk() (*string, bool) { - if o == nil || o.Password == nil { - return nil, false + if o == nil || isNil(o.Password) { + return nil, false } return o.Password, true } // HasPassword returns a boolean if a field has been set. func (o *Operator) HasPassword() bool { - if o != nil && o.Password != nil { + if o != nil && !isNil(o.Password) { return true } @@ -173,7 +174,7 @@ func (o *Operator) SetPassword(v string) { // GetFullName returns the FullName field value if set, zero value otherwise. func (o *Operator) GetFullName() string { - if o == nil || o.FullName == nil { + if o == nil || isNil(o.FullName) { var ret string return ret } @@ -183,15 +184,15 @@ func (o *Operator) GetFullName() string { // GetFullNameOk returns a tuple with the FullName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetFullNameOk() (*string, bool) { - if o == nil || o.FullName == nil { - return nil, false + if o == nil || isNil(o.FullName) { + return nil, false } return o.FullName, true } // HasFullName returns a boolean if a field has been set. func (o *Operator) HasFullName() bool { - if o != nil && o.FullName != nil { + if o != nil && !isNil(o.FullName) { return true } @@ -205,7 +206,7 @@ func (o *Operator) SetFullName(v string) { // GetEmail returns the Email field value if set, zero value otherwise. func (o *Operator) GetEmail() string { - if o == nil || o.Email == nil { + if o == nil || isNil(o.Email) { var ret string return ret } @@ -215,15 +216,15 @@ func (o *Operator) GetEmail() string { // GetEmailOk returns a tuple with the Email field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetEmailOk() (*string, bool) { - if o == nil || o.Email == nil { - return nil, false + if o == nil || isNil(o.Email) { + return nil, false } return o.Email, true } // HasEmail returns a boolean if a field has been set. func (o *Operator) HasEmail() bool { - if o != nil && o.Email != nil { + if o != nil && !isNil(o.Email) { return true } @@ -237,7 +238,7 @@ func (o *Operator) SetEmail(v string) { // GetMobilePhone returns the MobilePhone field value if set, zero value otherwise. func (o *Operator) GetMobilePhone() string { - if o == nil || o.MobilePhone == nil { + if o == nil || isNil(o.MobilePhone) { var ret string return ret } @@ -247,15 +248,15 @@ func (o *Operator) GetMobilePhone() string { // GetMobilePhoneOk returns a tuple with the MobilePhone field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetMobilePhoneOk() (*string, bool) { - if o == nil || o.MobilePhone == nil { - return nil, false + if o == nil || isNil(o.MobilePhone) { + return nil, false } return o.MobilePhone, true } // HasMobilePhone returns a boolean if a field has been set. func (o *Operator) HasMobilePhone() bool { - if o != nil && o.MobilePhone != nil { + if o != nil && !isNil(o.MobilePhone) { return true } @@ -269,7 +270,7 @@ func (o *Operator) SetMobilePhone(v string) { // GetOutgoingPhoneNumberId returns the OutgoingPhoneNumberId field value if set, zero value otherwise. func (o *Operator) GetOutgoingPhoneNumberId() int32 { - if o == nil || o.OutgoingPhoneNumberId == nil { + if o == nil || isNil(o.OutgoingPhoneNumberId) { var ret int32 return ret } @@ -279,15 +280,15 @@ func (o *Operator) GetOutgoingPhoneNumberId() int32 { // GetOutgoingPhoneNumberIdOk returns a tuple with the OutgoingPhoneNumberId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetOutgoingPhoneNumberIdOk() (*int32, bool) { - if o == nil || o.OutgoingPhoneNumberId == nil { - return nil, false + if o == nil || isNil(o.OutgoingPhoneNumberId) { + return nil, false } return o.OutgoingPhoneNumberId, true } // HasOutgoingPhoneNumberId returns a boolean if a field has been set. func (o *Operator) HasOutgoingPhoneNumberId() bool { - if o != nil && o.OutgoingPhoneNumberId != nil { + if o != nil && !isNil(o.OutgoingPhoneNumberId) { return true } @@ -301,7 +302,7 @@ func (o *Operator) SetOutgoingPhoneNumberId(v int32) { // GetOutgoingPhoneNumberIdSpecified returns the OutgoingPhoneNumberIdSpecified field value if set, zero value otherwise. func (o *Operator) GetOutgoingPhoneNumberIdSpecified() bool { - if o == nil || o.OutgoingPhoneNumberIdSpecified == nil { + if o == nil || isNil(o.OutgoingPhoneNumberIdSpecified) { var ret bool return ret } @@ -311,15 +312,15 @@ func (o *Operator) GetOutgoingPhoneNumberIdSpecified() bool { // GetOutgoingPhoneNumberIdSpecifiedOk returns a tuple with the OutgoingPhoneNumberIdSpecified field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetOutgoingPhoneNumberIdSpecifiedOk() (*bool, bool) { - if o == nil || o.OutgoingPhoneNumberIdSpecified == nil { - return nil, false + if o == nil || isNil(o.OutgoingPhoneNumberIdSpecified) { + return nil, false } return o.OutgoingPhoneNumberIdSpecified, true } // HasOutgoingPhoneNumberIdSpecified returns a boolean if a field has been set. func (o *Operator) HasOutgoingPhoneNumberIdSpecified() bool { - if o != nil && o.OutgoingPhoneNumberIdSpecified != nil { + if o != nil && !isNil(o.OutgoingPhoneNumberIdSpecified) { return true } @@ -333,7 +334,7 @@ func (o *Operator) SetOutgoingPhoneNumberIdSpecified(v bool) { // GetIsAccountAdministrator returns the IsAccountAdministrator field value if set, zero value otherwise. func (o *Operator) GetIsAccountAdministrator() bool { - if o == nil || o.IsAccountAdministrator == nil { + if o == nil || isNil(o.IsAccountAdministrator) { var ret bool return ret } @@ -343,15 +344,15 @@ func (o *Operator) GetIsAccountAdministrator() bool { // GetIsAccountAdministratorOk returns a tuple with the IsAccountAdministrator field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetIsAccountAdministratorOk() (*bool, bool) { - if o == nil || o.IsAccountAdministrator == nil { - return nil, false + if o == nil || isNil(o.IsAccountAdministrator) { + return nil, false } return o.IsAccountAdministrator, true } // HasIsAccountAdministrator returns a boolean if a field has been set. func (o *Operator) HasIsAccountAdministrator() bool { - if o != nil && o.IsAccountAdministrator != nil { + if o != nil && !isNil(o.IsAccountAdministrator) { return true } @@ -365,7 +366,7 @@ func (o *Operator) SetIsAccountAdministrator(v bool) { // GetBackupEmail returns the BackupEmail field value if set, zero value otherwise. func (o *Operator) GetBackupEmail() string { - if o == nil || o.BackupEmail == nil { + if o == nil || isNil(o.BackupEmail) { var ret string return ret } @@ -375,15 +376,15 @@ func (o *Operator) GetBackupEmail() string { // GetBackupEmailOk returns a tuple with the BackupEmail field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetBackupEmailOk() (*string, bool) { - if o == nil || o.BackupEmail == nil { - return nil, false + if o == nil || isNil(o.BackupEmail) { + return nil, false } return o.BackupEmail, true } // HasBackupEmail returns a boolean if a field has been set. func (o *Operator) HasBackupEmail() bool { - if o != nil && o.BackupEmail != nil { + if o != nil && !isNil(o.BackupEmail) { return true } @@ -397,7 +398,7 @@ func (o *Operator) SetBackupEmail(v string) { // GetIsOnDuty returns the IsOnDuty field value if set, zero value otherwise. func (o *Operator) GetIsOnDuty() bool { - if o == nil || o.IsOnDuty == nil { + if o == nil || isNil(o.IsOnDuty) { var ret bool return ret } @@ -407,15 +408,15 @@ func (o *Operator) GetIsOnDuty() bool { // GetIsOnDutyOk returns a tuple with the IsOnDuty field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetIsOnDutyOk() (*bool, bool) { - if o == nil || o.IsOnDuty == nil { - return nil, false + if o == nil || isNil(o.IsOnDuty) { + return nil, false } return o.IsOnDuty, true } // HasIsOnDuty returns a boolean if a field has been set. func (o *Operator) HasIsOnDuty() bool { - if o != nil && o.IsOnDuty != nil { + if o != nil && !isNil(o.IsOnDuty) { return true } @@ -429,7 +430,7 @@ func (o *Operator) SetIsOnDuty(v bool) { // GetCultureName returns the CultureName field value if set, zero value otherwise. func (o *Operator) GetCultureName() string { - if o == nil || o.CultureName == nil { + if o == nil || isNil(o.CultureName) { var ret string return ret } @@ -439,15 +440,15 @@ func (o *Operator) GetCultureName() string { // GetCultureNameOk returns a tuple with the CultureName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetCultureNameOk() (*string, bool) { - if o == nil || o.CultureName == nil { - return nil, false + if o == nil || isNil(o.CultureName) { + return nil, false } return o.CultureName, true } // HasCultureName returns a boolean if a field has been set. func (o *Operator) HasCultureName() bool { - if o != nil && o.CultureName != nil { + if o != nil && !isNil(o.CultureName) { return true } @@ -461,7 +462,7 @@ func (o *Operator) SetCultureName(v string) { // GetCultureNameSpecified returns the CultureNameSpecified field value if set, zero value otherwise. func (o *Operator) GetCultureNameSpecified() bool { - if o == nil || o.CultureNameSpecified == nil { + if o == nil || isNil(o.CultureNameSpecified) { var ret bool return ret } @@ -471,15 +472,15 @@ func (o *Operator) GetCultureNameSpecified() bool { // GetCultureNameSpecifiedOk returns a tuple with the CultureNameSpecified field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetCultureNameSpecifiedOk() (*bool, bool) { - if o == nil || o.CultureNameSpecified == nil { - return nil, false + if o == nil || isNil(o.CultureNameSpecified) { + return nil, false } return o.CultureNameSpecified, true } // HasCultureNameSpecified returns a boolean if a field has been set. func (o *Operator) HasCultureNameSpecified() bool { - if o != nil && o.CultureNameSpecified != nil { + if o != nil && !isNil(o.CultureNameSpecified) { return true } @@ -493,7 +494,7 @@ func (o *Operator) SetCultureNameSpecified(v bool) { // GetTimeZoneId returns the TimeZoneId field value if set, zero value otherwise. func (o *Operator) GetTimeZoneId() int32 { - if o == nil || o.TimeZoneId == nil { + if o == nil || isNil(o.TimeZoneId) { var ret int32 return ret } @@ -503,15 +504,15 @@ func (o *Operator) GetTimeZoneId() int32 { // GetTimeZoneIdOk returns a tuple with the TimeZoneId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetTimeZoneIdOk() (*int32, bool) { - if o == nil || o.TimeZoneId == nil { - return nil, false + if o == nil || isNil(o.TimeZoneId) { + return nil, false } return o.TimeZoneId, true } // HasTimeZoneId returns a boolean if a field has been set. func (o *Operator) HasTimeZoneId() bool { - if o != nil && o.TimeZoneId != nil { + if o != nil && !isNil(o.TimeZoneId) { return true } @@ -525,7 +526,7 @@ func (o *Operator) SetTimeZoneId(v int32) { // GetTimeZoneIdSpecified returns the TimeZoneIdSpecified field value if set, zero value otherwise. func (o *Operator) GetTimeZoneIdSpecified() bool { - if o == nil || o.TimeZoneIdSpecified == nil { + if o == nil || isNil(o.TimeZoneIdSpecified) { var ret bool return ret } @@ -535,15 +536,15 @@ func (o *Operator) GetTimeZoneIdSpecified() bool { // GetTimeZoneIdSpecifiedOk returns a tuple with the TimeZoneIdSpecified field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetTimeZoneIdSpecifiedOk() (*bool, bool) { - if o == nil || o.TimeZoneIdSpecified == nil { - return nil, false + if o == nil || isNil(o.TimeZoneIdSpecified) { + return nil, false } return o.TimeZoneIdSpecified, true } // HasTimeZoneIdSpecified returns a boolean if a field has been set. func (o *Operator) HasTimeZoneIdSpecified() bool { - if o != nil && o.TimeZoneIdSpecified != nil { + if o != nil && !isNil(o.TimeZoneIdSpecified) { return true } @@ -557,7 +558,7 @@ func (o *Operator) SetTimeZoneIdSpecified(v bool) { // GetSmsProvider returns the SmsProvider field value if set, zero value otherwise. func (o *Operator) GetSmsProvider() SmsProvider { - if o == nil || o.SmsProvider == nil { + if o == nil || isNil(o.SmsProvider) { var ret SmsProvider return ret } @@ -567,15 +568,15 @@ func (o *Operator) GetSmsProvider() SmsProvider { // GetSmsProviderOk returns a tuple with the SmsProvider field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetSmsProviderOk() (*SmsProvider, bool) { - if o == nil || o.SmsProvider == nil { - return nil, false + if o == nil || isNil(o.SmsProvider) { + return nil, false } return o.SmsProvider, true } // HasSmsProvider returns a boolean if a field has been set. func (o *Operator) HasSmsProvider() bool { - if o != nil && o.SmsProvider != nil { + if o != nil && !isNil(o.SmsProvider) { return true } @@ -589,7 +590,7 @@ func (o *Operator) SetSmsProvider(v SmsProvider) { // GetUseNumericSender returns the UseNumericSender field value if set, zero value otherwise. func (o *Operator) GetUseNumericSender() bool { - if o == nil || o.UseNumericSender == nil { + if o == nil || isNil(o.UseNumericSender) { var ret bool return ret } @@ -599,15 +600,15 @@ func (o *Operator) GetUseNumericSender() bool { // GetUseNumericSenderOk returns a tuple with the UseNumericSender field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetUseNumericSenderOk() (*bool, bool) { - if o == nil || o.UseNumericSender == nil { - return nil, false + if o == nil || isNil(o.UseNumericSender) { + return nil, false } return o.UseNumericSender, true } // HasUseNumericSender returns a boolean if a field has been set. func (o *Operator) HasUseNumericSender() bool { - if o != nil && o.UseNumericSender != nil { + if o != nil && !isNil(o.UseNumericSender) { return true } @@ -621,7 +622,7 @@ func (o *Operator) SetUseNumericSender(v bool) { // GetUseNumericSenderSpecified returns the UseNumericSenderSpecified field value if set, zero value otherwise. func (o *Operator) GetUseNumericSenderSpecified() bool { - if o == nil || o.UseNumericSenderSpecified == nil { + if o == nil || isNil(o.UseNumericSenderSpecified) { var ret bool return ret } @@ -631,15 +632,15 @@ func (o *Operator) GetUseNumericSenderSpecified() bool { // GetUseNumericSenderSpecifiedOk returns a tuple with the UseNumericSenderSpecified field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetUseNumericSenderSpecifiedOk() (*bool, bool) { - if o == nil || o.UseNumericSenderSpecified == nil { - return nil, false + if o == nil || isNil(o.UseNumericSenderSpecified) { + return nil, false } return o.UseNumericSenderSpecified, true } // HasUseNumericSenderSpecified returns a boolean if a field has been set. func (o *Operator) HasUseNumericSenderSpecified() bool { - if o != nil && o.UseNumericSenderSpecified != nil { + if o != nil && !isNil(o.UseNumericSenderSpecified) { return true } @@ -653,7 +654,7 @@ func (o *Operator) SetUseNumericSenderSpecified(v bool) { // GetAllowNativeLogin returns the AllowNativeLogin field value if set, zero value otherwise. func (o *Operator) GetAllowNativeLogin() bool { - if o == nil || o.AllowNativeLogin == nil { + if o == nil || isNil(o.AllowNativeLogin) { var ret bool return ret } @@ -663,15 +664,15 @@ func (o *Operator) GetAllowNativeLogin() bool { // GetAllowNativeLoginOk returns a tuple with the AllowNativeLogin field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetAllowNativeLoginOk() (*bool, bool) { - if o == nil || o.AllowNativeLogin == nil { - return nil, false + if o == nil || isNil(o.AllowNativeLogin) { + return nil, false } return o.AllowNativeLogin, true } // HasAllowNativeLogin returns a boolean if a field has been set. func (o *Operator) HasAllowNativeLogin() bool { - if o != nil && o.AllowNativeLogin != nil { + if o != nil && !isNil(o.AllowNativeLogin) { return true } @@ -685,7 +686,7 @@ func (o *Operator) SetAllowNativeLogin(v bool) { // GetAllowNativeLoginSpecified returns the AllowNativeLoginSpecified field value if set, zero value otherwise. func (o *Operator) GetAllowNativeLoginSpecified() bool { - if o == nil || o.AllowNativeLoginSpecified == nil { + if o == nil || isNil(o.AllowNativeLoginSpecified) { var ret bool return ret } @@ -695,15 +696,15 @@ func (o *Operator) GetAllowNativeLoginSpecified() bool { // GetAllowNativeLoginSpecifiedOk returns a tuple with the AllowNativeLoginSpecified field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetAllowNativeLoginSpecifiedOk() (*bool, bool) { - if o == nil || o.AllowNativeLoginSpecified == nil { - return nil, false + if o == nil || isNil(o.AllowNativeLoginSpecified) { + return nil, false } return o.AllowNativeLoginSpecified, true } // HasAllowNativeLoginSpecified returns a boolean if a field has been set. func (o *Operator) HasAllowNativeLoginSpecified() bool { - if o != nil && o.AllowNativeLoginSpecified != nil { + if o != nil && !isNil(o.AllowNativeLoginSpecified) { return true } @@ -717,7 +718,7 @@ func (o *Operator) SetAllowNativeLoginSpecified(v bool) { // GetAllowSingleSignon returns the AllowSingleSignon field value if set, zero value otherwise. func (o *Operator) GetAllowSingleSignon() bool { - if o == nil || o.AllowSingleSignon == nil { + if o == nil || isNil(o.AllowSingleSignon) { var ret bool return ret } @@ -727,15 +728,15 @@ func (o *Operator) GetAllowSingleSignon() bool { // GetAllowSingleSignonOk returns a tuple with the AllowSingleSignon field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetAllowSingleSignonOk() (*bool, bool) { - if o == nil || o.AllowSingleSignon == nil { - return nil, false + if o == nil || isNil(o.AllowSingleSignon) { + return nil, false } return o.AllowSingleSignon, true } // HasAllowSingleSignon returns a boolean if a field has been set. func (o *Operator) HasAllowSingleSignon() bool { - if o != nil && o.AllowSingleSignon != nil { + if o != nil && !isNil(o.AllowSingleSignon) { return true } @@ -749,7 +750,7 @@ func (o *Operator) SetAllowSingleSignon(v bool) { // GetAllowSingleSignonSpecified returns the AllowSingleSignonSpecified field value if set, zero value otherwise. func (o *Operator) GetAllowSingleSignonSpecified() bool { - if o == nil || o.AllowSingleSignonSpecified == nil { + if o == nil || isNil(o.AllowSingleSignonSpecified) { var ret bool return ret } @@ -759,15 +760,15 @@ func (o *Operator) GetAllowSingleSignonSpecified() bool { // GetAllowSingleSignonSpecifiedOk returns a tuple with the AllowSingleSignonSpecified field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetAllowSingleSignonSpecifiedOk() (*bool, bool) { - if o == nil || o.AllowSingleSignonSpecified == nil { - return nil, false + if o == nil || isNil(o.AllowSingleSignonSpecified) { + return nil, false } return o.AllowSingleSignonSpecified, true } // HasAllowSingleSignonSpecified returns a boolean if a field has been set. func (o *Operator) HasAllowSingleSignonSpecified() bool { - if o != nil && o.AllowSingleSignonSpecified != nil { + if o != nil && !isNil(o.AllowSingleSignonSpecified) { return true } @@ -781,7 +782,7 @@ func (o *Operator) SetAllowSingleSignonSpecified(v bool) { // GetDefaultDashboard returns the DefaultDashboard field value if set, zero value otherwise. func (o *Operator) GetDefaultDashboard() string { - if o == nil || o.DefaultDashboard == nil { + if o == nil || isNil(o.DefaultDashboard) { var ret string return ret } @@ -791,15 +792,15 @@ func (o *Operator) GetDefaultDashboard() string { // GetDefaultDashboardOk returns a tuple with the DefaultDashboard field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetDefaultDashboardOk() (*string, bool) { - if o == nil || o.DefaultDashboard == nil { - return nil, false + if o == nil || isNil(o.DefaultDashboard) { + return nil, false } return o.DefaultDashboard, true } // HasDefaultDashboard returns a boolean if a field has been set. func (o *Operator) HasDefaultDashboard() bool { - if o != nil && o.DefaultDashboard != nil { + if o != nil && !isNil(o.DefaultDashboard) { return true } @@ -813,7 +814,7 @@ func (o *Operator) SetDefaultDashboard(v string) { // GetSetupMode returns the SetupMode field value if set, zero value otherwise. func (o *Operator) GetSetupMode() OperatorSetupMode { - if o == nil || o.SetupMode == nil { + if o == nil || isNil(o.SetupMode) { var ret OperatorSetupMode return ret } @@ -823,15 +824,15 @@ func (o *Operator) GetSetupMode() OperatorSetupMode { // GetSetupModeOk returns a tuple with the SetupMode field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Operator) GetSetupModeOk() (*OperatorSetupMode, bool) { - if o == nil || o.SetupMode == nil { - return nil, false + if o == nil || isNil(o.SetupMode) { + return nil, false } return o.SetupMode, true } // HasSetupMode returns a boolean if a field has been set. func (o *Operator) HasSetupMode() bool { - if o != nil && o.SetupMode != nil { + if o != nil && !isNil(o.SetupMode) { return true } @@ -845,76 +846,76 @@ func (o *Operator) SetSetupMode(v OperatorSetupMode) { func (o Operator) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.OperatorGuid != nil { + if !isNil(o.OperatorGuid) { toSerialize["OperatorGuid"] = o.OperatorGuid } - if o.Hash != nil { + if !isNil(o.Hash) { toSerialize["Hash"] = o.Hash } - if o.Password != nil { + if !isNil(o.Password) { toSerialize["Password"] = o.Password } - if o.FullName != nil { + if !isNil(o.FullName) { toSerialize["FullName"] = o.FullName } - if o.Email != nil { + if !isNil(o.Email) { toSerialize["Email"] = o.Email } - if o.MobilePhone != nil { + if !isNil(o.MobilePhone) { toSerialize["MobilePhone"] = o.MobilePhone } - if o.OutgoingPhoneNumberId != nil { + if !isNil(o.OutgoingPhoneNumberId) { toSerialize["OutgoingPhoneNumberId"] = o.OutgoingPhoneNumberId } - if o.OutgoingPhoneNumberIdSpecified != nil { + if !isNil(o.OutgoingPhoneNumberIdSpecified) { toSerialize["OutgoingPhoneNumberIdSpecified"] = o.OutgoingPhoneNumberIdSpecified } - if o.IsAccountAdministrator != nil { + if !isNil(o.IsAccountAdministrator) { toSerialize["IsAccountAdministrator"] = o.IsAccountAdministrator } - if o.BackupEmail != nil { + if !isNil(o.BackupEmail) { toSerialize["BackupEmail"] = o.BackupEmail } - if o.IsOnDuty != nil { + if !isNil(o.IsOnDuty) { toSerialize["IsOnDuty"] = o.IsOnDuty } - if o.CultureName != nil { + if !isNil(o.CultureName) { toSerialize["CultureName"] = o.CultureName } - if o.CultureNameSpecified != nil { + if !isNil(o.CultureNameSpecified) { toSerialize["CultureNameSpecified"] = o.CultureNameSpecified } - if o.TimeZoneId != nil { + if !isNil(o.TimeZoneId) { toSerialize["TimeZoneId"] = o.TimeZoneId } - if o.TimeZoneIdSpecified != nil { + if !isNil(o.TimeZoneIdSpecified) { toSerialize["TimeZoneIdSpecified"] = o.TimeZoneIdSpecified } - if o.SmsProvider != nil { + if !isNil(o.SmsProvider) { toSerialize["SmsProvider"] = o.SmsProvider } - if o.UseNumericSender != nil { + if !isNil(o.UseNumericSender) { toSerialize["UseNumericSender"] = o.UseNumericSender } - if o.UseNumericSenderSpecified != nil { + if !isNil(o.UseNumericSenderSpecified) { toSerialize["UseNumericSenderSpecified"] = o.UseNumericSenderSpecified } - if o.AllowNativeLogin != nil { + if !isNil(o.AllowNativeLogin) { toSerialize["AllowNativeLogin"] = o.AllowNativeLogin } - if o.AllowNativeLoginSpecified != nil { + if !isNil(o.AllowNativeLoginSpecified) { toSerialize["AllowNativeLoginSpecified"] = o.AllowNativeLoginSpecified } - if o.AllowSingleSignon != nil { + if !isNil(o.AllowSingleSignon) { toSerialize["AllowSingleSignon"] = o.AllowSingleSignon } - if o.AllowSingleSignonSpecified != nil { + if !isNil(o.AllowSingleSignonSpecified) { toSerialize["AllowSingleSignonSpecified"] = o.AllowSingleSignonSpecified } - if o.DefaultDashboard != nil { + if !isNil(o.DefaultDashboard) { toSerialize["DefaultDashboard"] = o.DefaultDashboard } - if o.SetupMode != nil { + if !isNil(o.SetupMode) { toSerialize["SetupMode"] = o.SetupMode } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_authorization_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_authorization_type.go index e5c064d3..2ca79388 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_authorization_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_authorization_type.go @@ -26,15 +26,20 @@ const ( OPERATORAUTHORIZATIONTYPE_FINANCIAL_OPERATOR OperatorAuthorizationType = "FinancialOperator" OPERATORAUTHORIZATIONTYPE_TECHNICAL_CONTACT OperatorAuthorizationType = "TechnicalContact" OPERATORAUTHORIZATIONTYPE_SHARE_DASHBOARDS OperatorAuthorizationType = "ShareDashboards" + OPERATORAUTHORIZATIONTYPE_CREATE_ALERT_DEFINITION OperatorAuthorizationType = "CreateAlertDefinition" + OPERATORAUTHORIZATIONTYPE_CREATE_INTEGRATION OperatorAuthorizationType = "CreateIntegration" ) -var allowedOperatorAuthorizationTypeEnumValues = []OperatorAuthorizationType{ +// All allowed values of OperatorAuthorizationType enum +var AllowedOperatorAuthorizationTypeEnumValues = []OperatorAuthorizationType{ "AccountAccess", "AccountAdministrator", "AllowInfra", "FinancialOperator", "TechnicalContact", "ShareDashboards", + "CreateAlertDefinition", + "CreateIntegration", } func (v *OperatorAuthorizationType) UnmarshalJSON(src []byte) error { @@ -44,7 +49,7 @@ func (v *OperatorAuthorizationType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := OperatorAuthorizationType(value) - for _, existing := range allowedOperatorAuthorizationTypeEnumValues { + for _, existing := range AllowedOperatorAuthorizationTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -61,13 +66,13 @@ func NewOperatorAuthorizationTypeFromValue(v string) (*OperatorAuthorizationType if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for OperatorAuthorizationType: valid values are %v", v, allowedOperatorAuthorizationTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for OperatorAuthorizationType: valid values are %v", v, AllowedOperatorAuthorizationTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v OperatorAuthorizationType) IsValid() bool { - for _, existing := range allowedOperatorAuthorizationTypeEnumValues { + for _, existing := range AllowedOperatorAuthorizationTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_duty_schedule.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_duty_schedule.go index 05f29896..7c5b2e0d 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_duty_schedule.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_duty_schedule.go @@ -12,7 +12,6 @@ package uptrends import ( "encoding/json" - "time" ) // OperatorDutySchedule struct for OperatorDutySchedule @@ -22,9 +21,9 @@ type OperatorDutySchedule struct { // The schedule mode (one time, daily, weekly, monthly) ScheduleMode OperatorScheduleMode `json:"ScheduleMode"` // The start date/time for this schedule (for one-time schedules only) - StartDateTime *time.Time `json:"StartDateTime,omitempty"` + StartDateTime map[string]interface{} `json:"StartDateTime,omitempty"` // The end date/time for this maintenance period (for one-time maintenance periods only) - EndDateTime *time.Time `json:"EndDateTime,omitempty"` + EndDateTime map[string]interface{} `json:"EndDateTime,omitempty"` // The weekday for this maintenance period (for weekly maintenance periods only) WeekDay *DayOfWeek `json:"WeekDay,omitempty"` // the month day for this maintenance period (for montly maintenance periods only) @@ -67,8 +66,8 @@ func (o *OperatorDutySchedule) GetId() int32 { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *OperatorDutySchedule) GetIdOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Id, true } @@ -91,8 +90,8 @@ func (o *OperatorDutySchedule) GetScheduleMode() OperatorScheduleMode { // GetScheduleModeOk returns a tuple with the ScheduleMode field value // and a boolean to check if the value has been set. func (o *OperatorDutySchedule) GetScheduleModeOk() (*OperatorScheduleMode, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.ScheduleMode, true } @@ -103,72 +102,72 @@ func (o *OperatorDutySchedule) SetScheduleMode(v OperatorScheduleMode) { } // GetStartDateTime returns the StartDateTime field value if set, zero value otherwise. -func (o *OperatorDutySchedule) GetStartDateTime() time.Time { - if o == nil || o.StartDateTime == nil { - var ret time.Time +func (o *OperatorDutySchedule) GetStartDateTime() map[string]interface{} { + if o == nil || isNil(o.StartDateTime) { + var ret map[string]interface{} return ret } - return *o.StartDateTime + return o.StartDateTime } // GetStartDateTimeOk returns a tuple with the StartDateTime field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *OperatorDutySchedule) GetStartDateTimeOk() (*time.Time, bool) { - if o == nil || o.StartDateTime == nil { - return nil, false +func (o *OperatorDutySchedule) GetStartDateTimeOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.StartDateTime) { + return map[string]interface{}{}, false } return o.StartDateTime, true } // HasStartDateTime returns a boolean if a field has been set. func (o *OperatorDutySchedule) HasStartDateTime() bool { - if o != nil && o.StartDateTime != nil { + if o != nil && !isNil(o.StartDateTime) { return true } return false } -// SetStartDateTime gets a reference to the given time.Time and assigns it to the StartDateTime field. -func (o *OperatorDutySchedule) SetStartDateTime(v time.Time) { - o.StartDateTime = &v +// SetStartDateTime gets a reference to the given map[string]interface{} and assigns it to the StartDateTime field. +func (o *OperatorDutySchedule) SetStartDateTime(v map[string]interface{}) { + o.StartDateTime = v } // GetEndDateTime returns the EndDateTime field value if set, zero value otherwise. -func (o *OperatorDutySchedule) GetEndDateTime() time.Time { - if o == nil || o.EndDateTime == nil { - var ret time.Time +func (o *OperatorDutySchedule) GetEndDateTime() map[string]interface{} { + if o == nil || isNil(o.EndDateTime) { + var ret map[string]interface{} return ret } - return *o.EndDateTime + return o.EndDateTime } // GetEndDateTimeOk returns a tuple with the EndDateTime field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *OperatorDutySchedule) GetEndDateTimeOk() (*time.Time, bool) { - if o == nil || o.EndDateTime == nil { - return nil, false +func (o *OperatorDutySchedule) GetEndDateTimeOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.EndDateTime) { + return map[string]interface{}{}, false } return o.EndDateTime, true } // HasEndDateTime returns a boolean if a field has been set. func (o *OperatorDutySchedule) HasEndDateTime() bool { - if o != nil && o.EndDateTime != nil { + if o != nil && !isNil(o.EndDateTime) { return true } return false } -// SetEndDateTime gets a reference to the given time.Time and assigns it to the EndDateTime field. -func (o *OperatorDutySchedule) SetEndDateTime(v time.Time) { - o.EndDateTime = &v +// SetEndDateTime gets a reference to the given map[string]interface{} and assigns it to the EndDateTime field. +func (o *OperatorDutySchedule) SetEndDateTime(v map[string]interface{}) { + o.EndDateTime = v } // GetWeekDay returns the WeekDay field value if set, zero value otherwise. func (o *OperatorDutySchedule) GetWeekDay() DayOfWeek { - if o == nil || o.WeekDay == nil { + if o == nil || isNil(o.WeekDay) { var ret DayOfWeek return ret } @@ -178,15 +177,15 @@ func (o *OperatorDutySchedule) GetWeekDay() DayOfWeek { // GetWeekDayOk returns a tuple with the WeekDay field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OperatorDutySchedule) GetWeekDayOk() (*DayOfWeek, bool) { - if o == nil || o.WeekDay == nil { - return nil, false + if o == nil || isNil(o.WeekDay) { + return nil, false } return o.WeekDay, true } // HasWeekDay returns a boolean if a field has been set. func (o *OperatorDutySchedule) HasWeekDay() bool { - if o != nil && o.WeekDay != nil { + if o != nil && !isNil(o.WeekDay) { return true } @@ -200,7 +199,7 @@ func (o *OperatorDutySchedule) SetWeekDay(v DayOfWeek) { // GetMonthDay returns the MonthDay field value if set, zero value otherwise. func (o *OperatorDutySchedule) GetMonthDay() int32 { - if o == nil || o.MonthDay == nil { + if o == nil || isNil(o.MonthDay) { var ret int32 return ret } @@ -210,15 +209,15 @@ func (o *OperatorDutySchedule) GetMonthDay() int32 { // GetMonthDayOk returns a tuple with the MonthDay field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OperatorDutySchedule) GetMonthDayOk() (*int32, bool) { - if o == nil || o.MonthDay == nil { - return nil, false + if o == nil || isNil(o.MonthDay) { + return nil, false } return o.MonthDay, true } // HasMonthDay returns a boolean if a field has been set. func (o *OperatorDutySchedule) HasMonthDay() bool { - if o != nil && o.MonthDay != nil { + if o != nil && !isNil(o.MonthDay) { return true } @@ -232,7 +231,7 @@ func (o *OperatorDutySchedule) SetMonthDay(v int32) { // GetStartTime returns the StartTime field value if set, zero value otherwise. func (o *OperatorDutySchedule) GetStartTime() string { - if o == nil || o.StartTime == nil { + if o == nil || isNil(o.StartTime) { var ret string return ret } @@ -242,15 +241,15 @@ func (o *OperatorDutySchedule) GetStartTime() string { // GetStartTimeOk returns a tuple with the StartTime field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OperatorDutySchedule) GetStartTimeOk() (*string, bool) { - if o == nil || o.StartTime == nil { - return nil, false + if o == nil || isNil(o.StartTime) { + return nil, false } return o.StartTime, true } // HasStartTime returns a boolean if a field has been set. func (o *OperatorDutySchedule) HasStartTime() bool { - if o != nil && o.StartTime != nil { + if o != nil && !isNil(o.StartTime) { return true } @@ -264,7 +263,7 @@ func (o *OperatorDutySchedule) SetStartTime(v string) { // GetEndTime returns the EndTime field value if set, zero value otherwise. func (o *OperatorDutySchedule) GetEndTime() string { - if o == nil || o.EndTime == nil { + if o == nil || isNil(o.EndTime) { var ret string return ret } @@ -274,15 +273,15 @@ func (o *OperatorDutySchedule) GetEndTime() string { // GetEndTimeOk returns a tuple with the EndTime field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OperatorDutySchedule) GetEndTimeOk() (*string, bool) { - if o == nil || o.EndTime == nil { - return nil, false + if o == nil || isNil(o.EndTime) { + return nil, false } return o.EndTime, true } // HasEndTime returns a boolean if a field has been set. func (o *OperatorDutySchedule) HasEndTime() bool { - if o != nil && o.EndTime != nil { + if o != nil && !isNil(o.EndTime) { return true } @@ -302,22 +301,22 @@ func (o OperatorDutySchedule) MarshalJSON() ([]byte, error) { if true { toSerialize["ScheduleMode"] = o.ScheduleMode } - if o.StartDateTime != nil { + if !isNil(o.StartDateTime) { toSerialize["StartDateTime"] = o.StartDateTime } - if o.EndDateTime != nil { + if !isNil(o.EndDateTime) { toSerialize["EndDateTime"] = o.EndDateTime } - if o.WeekDay != nil { + if !isNil(o.WeekDay) { toSerialize["WeekDay"] = o.WeekDay } - if o.MonthDay != nil { + if !isNil(o.MonthDay) { toSerialize["MonthDay"] = o.MonthDay } - if o.StartTime != nil { + if !isNil(o.StartTime) { toSerialize["StartTime"] = o.StartTime } - if o.EndTime != nil { + if !isNil(o.EndTime) { toSerialize["EndTime"] = o.EndTime } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_group.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_group.go index 0f05989d..72fcb9a9 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_group.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_group.go @@ -44,7 +44,7 @@ func NewOperatorGroupWithDefaults() *OperatorGroup { // GetOperatorGroupGuid returns the OperatorGroupGuid field value if set, zero value otherwise. func (o *OperatorGroup) GetOperatorGroupGuid() string { - if o == nil || o.OperatorGroupGuid == nil { + if o == nil || isNil(o.OperatorGroupGuid) { var ret string return ret } @@ -54,15 +54,15 @@ func (o *OperatorGroup) GetOperatorGroupGuid() string { // GetOperatorGroupGuidOk returns a tuple with the OperatorGroupGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OperatorGroup) GetOperatorGroupGuidOk() (*string, bool) { - if o == nil || o.OperatorGroupGuid == nil { - return nil, false + if o == nil || isNil(o.OperatorGroupGuid) { + return nil, false } return o.OperatorGroupGuid, true } // HasOperatorGroupGuid returns a boolean if a field has been set. func (o *OperatorGroup) HasOperatorGroupGuid() bool { - if o != nil && o.OperatorGroupGuid != nil { + if o != nil && !isNil(o.OperatorGroupGuid) { return true } @@ -76,7 +76,7 @@ func (o *OperatorGroup) SetOperatorGroupGuid(v string) { // GetDescription returns the Description field value if set, zero value otherwise. func (o *OperatorGroup) GetDescription() string { - if o == nil || o.Description == nil { + if o == nil || isNil(o.Description) { var ret string return ret } @@ -86,15 +86,15 @@ func (o *OperatorGroup) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OperatorGroup) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { - return nil, false + if o == nil || isNil(o.Description) { + return nil, false } return o.Description, true } // HasDescription returns a boolean if a field has been set. func (o *OperatorGroup) HasDescription() bool { - if o != nil && o.Description != nil { + if o != nil && !isNil(o.Description) { return true } @@ -108,7 +108,7 @@ func (o *OperatorGroup) SetDescription(v string) { // GetIsEveryone returns the IsEveryone field value if set, zero value otherwise. func (o *OperatorGroup) GetIsEveryone() bool { - if o == nil || o.IsEveryone == nil { + if o == nil || isNil(o.IsEveryone) { var ret bool return ret } @@ -118,15 +118,15 @@ func (o *OperatorGroup) GetIsEveryone() bool { // GetIsEveryoneOk returns a tuple with the IsEveryone field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OperatorGroup) GetIsEveryoneOk() (*bool, bool) { - if o == nil || o.IsEveryone == nil { - return nil, false + if o == nil || isNil(o.IsEveryone) { + return nil, false } return o.IsEveryone, true } // HasIsEveryone returns a boolean if a field has been set. func (o *OperatorGroup) HasIsEveryone() bool { - if o != nil && o.IsEveryone != nil { + if o != nil && !isNil(o.IsEveryone) { return true } @@ -140,7 +140,7 @@ func (o *OperatorGroup) SetIsEveryone(v bool) { // GetIsAdministratorsGroup returns the IsAdministratorsGroup field value if set, zero value otherwise. func (o *OperatorGroup) GetIsAdministratorsGroup() bool { - if o == nil || o.IsAdministratorsGroup == nil { + if o == nil || isNil(o.IsAdministratorsGroup) { var ret bool return ret } @@ -150,15 +150,15 @@ func (o *OperatorGroup) GetIsAdministratorsGroup() bool { // GetIsAdministratorsGroupOk returns a tuple with the IsAdministratorsGroup field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OperatorGroup) GetIsAdministratorsGroupOk() (*bool, bool) { - if o == nil || o.IsAdministratorsGroup == nil { - return nil, false + if o == nil || isNil(o.IsAdministratorsGroup) { + return nil, false } return o.IsAdministratorsGroup, true } // HasIsAdministratorsGroup returns a boolean if a field has been set. func (o *OperatorGroup) HasIsAdministratorsGroup() bool { - if o != nil && o.IsAdministratorsGroup != nil { + if o != nil && !isNil(o.IsAdministratorsGroup) { return true } @@ -172,16 +172,16 @@ func (o *OperatorGroup) SetIsAdministratorsGroup(v bool) { func (o OperatorGroup) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.OperatorGroupGuid != nil { + if !isNil(o.OperatorGroupGuid) { toSerialize["OperatorGroupGuid"] = o.OperatorGroupGuid } - if o.Description != nil { + if !isNil(o.Description) { toSerialize["Description"] = o.Description } - if o.IsEveryone != nil { + if !isNil(o.IsEveryone) { toSerialize["IsEveryone"] = o.IsEveryone } - if o.IsAdministratorsGroup != nil { + if !isNil(o.IsAdministratorsGroup) { toSerialize["IsAdministratorsGroup"] = o.IsAdministratorsGroup } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_group_authorization_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_group_authorization_type.go index 67eb2592..3556d878 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_group_authorization_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_group_authorization_type.go @@ -26,15 +26,20 @@ const ( OPERATORGROUPAUTHORIZATIONTYPE_TECHNICAL_CONTACT OperatorGroupAuthorizationType = "TechnicalContact" OPERATORGROUPAUTHORIZATIONTYPE_FINANCIAL_OPERATOR OperatorGroupAuthorizationType = "FinancialOperator" OPERATORGROUPAUTHORIZATIONTYPE_BASIC_OPERATOR OperatorGroupAuthorizationType = "BasicOperator" + OPERATORGROUPAUTHORIZATIONTYPE_CREATE_ALERT_DEFINITION OperatorGroupAuthorizationType = "CreateAlertDefinition" + OPERATORGROUPAUTHORIZATIONTYPE_CREATE_INTEGRATION OperatorGroupAuthorizationType = "CreateIntegration" ) -var allowedOperatorGroupAuthorizationTypeEnumValues = []OperatorGroupAuthorizationType{ +// All allowed values of OperatorGroupAuthorizationType enum +var AllowedOperatorGroupAuthorizationTypeEnumValues = []OperatorGroupAuthorizationType{ "ShareDashboards", "AllowInfra", "Administrator", "TechnicalContact", "FinancialOperator", "BasicOperator", + "CreateAlertDefinition", + "CreateIntegration", } func (v *OperatorGroupAuthorizationType) UnmarshalJSON(src []byte) error { @@ -44,7 +49,7 @@ func (v *OperatorGroupAuthorizationType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := OperatorGroupAuthorizationType(value) - for _, existing := range allowedOperatorGroupAuthorizationTypeEnumValues { + for _, existing := range AllowedOperatorGroupAuthorizationTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -61,13 +66,13 @@ func NewOperatorGroupAuthorizationTypeFromValue(v string) (*OperatorGroupAuthori if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for OperatorGroupAuthorizationType: valid values are %v", v, allowedOperatorGroupAuthorizationTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for OperatorGroupAuthorizationType: valid values are %v", v, AllowedOperatorGroupAuthorizationTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v OperatorGroupAuthorizationType) IsValid() bool { - for _, existing := range allowedOperatorGroupAuthorizationTypeEnumValues { + for _, existing := range AllowedOperatorGroupAuthorizationTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_group_member.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_group_member.go index e018bb4c..8597f996 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_group_member.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_group_member.go @@ -51,8 +51,8 @@ func (o *OperatorGroupMember) GetOperatorGuid() string { // GetOperatorGuidOk returns a tuple with the OperatorGuid field value // and a boolean to check if the value has been set. func (o *OperatorGroupMember) GetOperatorGuidOk() (*string, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.OperatorGuid, true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_member.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_member.go index 706b734b..ecd8ea06 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_member.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_member.go @@ -51,8 +51,8 @@ func (o *OperatorMember) GetOperatorGroupGuid() string { // GetOperatorGroupGuidOk returns a tuple with the OperatorGroupGuid field value // and a boolean to check if the value has been set. func (o *OperatorMember) GetOperatorGroupGuidOk() (*string, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.OperatorGroupGuid, true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_quota.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_quota.go index 35fbbd0f..46127de0 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_quota.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_quota.go @@ -39,7 +39,7 @@ func NewOperatorQuotaWithDefaults() *OperatorQuota { // GetOperators returns the Operators field value if set, zero value otherwise. func (o *OperatorQuota) GetOperators() int32 { - if o == nil || o.Operators == nil { + if o == nil || isNil(o.Operators) { var ret int32 return ret } @@ -49,15 +49,15 @@ func (o *OperatorQuota) GetOperators() int32 { // GetOperatorsOk returns a tuple with the Operators field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OperatorQuota) GetOperatorsOk() (*int32, bool) { - if o == nil || o.Operators == nil { - return nil, false + if o == nil || isNil(o.Operators) { + return nil, false } return o.Operators, true } // HasOperators returns a boolean if a field has been set. func (o *OperatorQuota) HasOperators() bool { - if o != nil && o.Operators != nil { + if o != nil && !isNil(o.Operators) { return true } @@ -71,7 +71,7 @@ func (o *OperatorQuota) SetOperators(v int32) { // GetOperatorsInUse returns the OperatorsInUse field value if set, zero value otherwise. func (o *OperatorQuota) GetOperatorsInUse() int32 { - if o == nil || o.OperatorsInUse == nil { + if o == nil || isNil(o.OperatorsInUse) { var ret int32 return ret } @@ -81,15 +81,15 @@ func (o *OperatorQuota) GetOperatorsInUse() int32 { // GetOperatorsInUseOk returns a tuple with the OperatorsInUse field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OperatorQuota) GetOperatorsInUseOk() (*int32, bool) { - if o == nil || o.OperatorsInUse == nil { - return nil, false + if o == nil || isNil(o.OperatorsInUse) { + return nil, false } return o.OperatorsInUse, true } // HasOperatorsInUse returns a boolean if a field has been set. func (o *OperatorQuota) HasOperatorsInUse() bool { - if o != nil && o.OperatorsInUse != nil { + if o != nil && !isNil(o.OperatorsInUse) { return true } @@ -103,10 +103,10 @@ func (o *OperatorQuota) SetOperatorsInUse(v int32) { func (o OperatorQuota) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Operators != nil { + if !isNil(o.Operators) { toSerialize["Operators"] = o.Operators } - if o.OperatorsInUse != nil { + if !isNil(o.OperatorsInUse) { toSerialize["OperatorsInUse"] = o.OperatorsInUse } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_schedule_mode.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_schedule_mode.go index bb417dc0..cd23d08a 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_schedule_mode.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_schedule_mode.go @@ -26,7 +26,8 @@ const ( OPERATORSCHEDULEMODE_MONTHLY OperatorScheduleMode = "Monthly" ) -var allowedOperatorScheduleModeEnumValues = []OperatorScheduleMode{ +// All allowed values of OperatorScheduleMode enum +var AllowedOperatorScheduleModeEnumValues = []OperatorScheduleMode{ "OneTime", "Daily", "Weekly", @@ -40,7 +41,7 @@ func (v *OperatorScheduleMode) UnmarshalJSON(src []byte) error { return err } enumTypeValue := OperatorScheduleMode(value) - for _, existing := range allowedOperatorScheduleModeEnumValues { + for _, existing := range AllowedOperatorScheduleModeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -57,13 +58,13 @@ func NewOperatorScheduleModeFromValue(v string) (*OperatorScheduleMode, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for OperatorScheduleMode: valid values are %v", v, allowedOperatorScheduleModeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for OperatorScheduleMode: valid values are %v", v, AllowedOperatorScheduleModeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v OperatorScheduleMode) IsValid() bool { - for _, existing := range allowedOperatorScheduleModeEnumValues { + for _, existing := range AllowedOperatorScheduleModeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_setup_mode.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_setup_mode.go index d874bcf0..18957601 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_setup_mode.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_operator_setup_mode.go @@ -24,7 +24,8 @@ const ( OPERATORSETUPMODE_INVITATION OperatorSetupMode = "Invitation" ) -var allowedOperatorSetupModeEnumValues = []OperatorSetupMode{ +// All allowed values of OperatorSetupMode enum +var AllowedOperatorSetupModeEnumValues = []OperatorSetupMode{ "Manual", "Invitation", } @@ -36,7 +37,7 @@ func (v *OperatorSetupMode) UnmarshalJSON(src []byte) error { return err } enumTypeValue := OperatorSetupMode(value) - for _, existing := range allowedOperatorSetupModeEnumValues { + for _, existing := range AllowedOperatorSetupModeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -53,13 +54,13 @@ func NewOperatorSetupModeFromValue(v string) (*OperatorSetupMode, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for OperatorSetupMode: valid values are %v", v, allowedOperatorSetupModeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for OperatorSetupMode: valid values are %v", v, AllowedOperatorSetupModeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v OperatorSetupMode) IsValid() bool { - for _, existing := range allowedOperatorSetupModeEnumValues { + for _, existing := range AllowedOperatorSetupModeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_outgoing_phone_number_details.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_outgoing_phone_number_details.go index 10d22db0..bcfb37f4 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_outgoing_phone_number_details.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_outgoing_phone_number_details.go @@ -52,8 +52,8 @@ func (o *OutgoingPhoneNumberDetails) GetId() int32 { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *OutgoingPhoneNumberDetails) GetIdOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Id, true } @@ -65,7 +65,7 @@ func (o *OutgoingPhoneNumberDetails) SetId(v int32) { // GetPhoneNumber returns the PhoneNumber field value if set, zero value otherwise. func (o *OutgoingPhoneNumberDetails) GetPhoneNumber() string { - if o == nil || o.PhoneNumber == nil { + if o == nil || isNil(o.PhoneNumber) { var ret string return ret } @@ -75,15 +75,15 @@ func (o *OutgoingPhoneNumberDetails) GetPhoneNumber() string { // GetPhoneNumberOk returns a tuple with the PhoneNumber field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OutgoingPhoneNumberDetails) GetPhoneNumberOk() (*string, bool) { - if o == nil || o.PhoneNumber == nil { - return nil, false + if o == nil || isNil(o.PhoneNumber) { + return nil, false } return o.PhoneNumber, true } // HasPhoneNumber returns a boolean if a field has been set. func (o *OutgoingPhoneNumberDetails) HasPhoneNumber() bool { - if o != nil && o.PhoneNumber != nil { + if o != nil && !isNil(o.PhoneNumber) { return true } @@ -97,7 +97,7 @@ func (o *OutgoingPhoneNumberDetails) SetPhoneNumber(v string) { // GetDescription returns the Description field value if set, zero value otherwise. func (o *OutgoingPhoneNumberDetails) GetDescription() string { - if o == nil || o.Description == nil { + if o == nil || isNil(o.Description) { var ret string return ret } @@ -107,15 +107,15 @@ func (o *OutgoingPhoneNumberDetails) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OutgoingPhoneNumberDetails) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { - return nil, false + if o == nil || isNil(o.Description) { + return nil, false } return o.Description, true } // HasDescription returns a boolean if a field has been set. func (o *OutgoingPhoneNumberDetails) HasDescription() bool { - if o != nil && o.Description != nil { + if o != nil && !isNil(o.Description) { return true } @@ -132,10 +132,10 @@ func (o OutgoingPhoneNumberDetails) MarshalJSON() ([]byte, error) { if true { toSerialize["Id"] = o.Id } - if o.PhoneNumber != nil { + if !isNil(o.PhoneNumber) { toSerialize["PhoneNumber"] = o.PhoneNumber } - if o.Description != nil { + if !isNil(o.Description) { toSerialize["Description"] = o.Description } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_page_element.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_page_element.go index d7e72890..7d0d99cd 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_page_element.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_page_element.go @@ -53,8 +53,8 @@ type PageElement struct { // The HTTP response headers retrieved ResponseHeaders *string `json:"ResponseHeaders,omitempty"` // The IP address that was found for the specified domain name as part of this monitor check. - ResolvedIpAddress *map[string]interface{} `json:"ResolvedIpAddress,omitempty"` - GroupIds *[]int32 `json:"GroupIds,omitempty"` + ResolvedIpAddress map[string]interface{} `json:"ResolvedIpAddress,omitempty"` + GroupIds []int32 `json:"GroupIds,omitempty"` // Was the Url excluded from waterfall (timing) data by the user? UrlIsBlocked bool `json:"UrlIsBlocked"` } @@ -104,8 +104,8 @@ func (o *PageElement) GetIndex() int32 { // GetIndexOk returns a tuple with the Index field value // and a boolean to check if the value has been set. func (o *PageElement) GetIndexOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Index, true } @@ -128,8 +128,8 @@ func (o *PageElement) GetStartTime() int32 { // GetStartTimeOk returns a tuple with the StartTime field value // and a boolean to check if the value has been set. func (o *PageElement) GetStartTimeOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.StartTime, true } @@ -152,8 +152,8 @@ func (o *PageElement) GetQueueTime() int32 { // GetQueueTimeOk returns a tuple with the QueueTime field value // and a boolean to check if the value has been set. func (o *PageElement) GetQueueTimeOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.QueueTime, true } @@ -176,8 +176,8 @@ func (o *PageElement) GetResolveTime() int32 { // GetResolveTimeOk returns a tuple with the ResolveTime field value // and a boolean to check if the value has been set. func (o *PageElement) GetResolveTimeOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.ResolveTime, true } @@ -200,8 +200,8 @@ func (o *PageElement) GetConnectTime() int32 { // GetConnectTimeOk returns a tuple with the ConnectTime field value // and a boolean to check if the value has been set. func (o *PageElement) GetConnectTimeOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.ConnectTime, true } @@ -224,8 +224,8 @@ func (o *PageElement) GetStaleTime() int32 { // GetStaleTimeOk returns a tuple with the StaleTime field value // and a boolean to check if the value has been set. func (o *PageElement) GetStaleTimeOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.StaleTime, true } @@ -248,8 +248,8 @@ func (o *PageElement) GetHttpsHandshakeTime() int32 { // GetHttpsHandshakeTimeOk returns a tuple with the HttpsHandshakeTime field value // and a boolean to check if the value has been set. func (o *PageElement) GetHttpsHandshakeTimeOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.HttpsHandshakeTime, true } @@ -272,8 +272,8 @@ func (o *PageElement) GetSendTime() int32 { // GetSendTimeOk returns a tuple with the SendTime field value // and a boolean to check if the value has been set. func (o *PageElement) GetSendTimeOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.SendTime, true } @@ -296,8 +296,8 @@ func (o *PageElement) GetWaitTime() int32 { // GetWaitTimeOk returns a tuple with the WaitTime field value // and a boolean to check if the value has been set. func (o *PageElement) GetWaitTimeOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.WaitTime, true } @@ -320,8 +320,8 @@ func (o *PageElement) GetReceiveTime() int32 { // GetReceiveTimeOk returns a tuple with the ReceiveTime field value // and a boolean to check if the value has been set. func (o *PageElement) GetReceiveTimeOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.ReceiveTime, true } @@ -344,8 +344,8 @@ func (o *PageElement) GetTimeoutTime() int32 { // GetTimeoutTimeOk returns a tuple with the TimeoutTime field value // and a boolean to check if the value has been set. func (o *PageElement) GetTimeoutTimeOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.TimeoutTime, true } @@ -368,8 +368,8 @@ func (o *PageElement) GetTotalTime() int32 { // GetTotalTimeOk returns a tuple with the TotalTime field value // and a boolean to check if the value has been set. func (o *PageElement) GetTotalTimeOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.TotalTime, true } @@ -392,8 +392,8 @@ func (o *PageElement) GetHttpStatusCode() int32 { // GetHttpStatusCodeOk returns a tuple with the HttpStatusCode field value // and a boolean to check if the value has been set. func (o *PageElement) GetHttpStatusCodeOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.HttpStatusCode, true } @@ -405,7 +405,7 @@ func (o *PageElement) SetHttpStatusCode(v int32) { // GetUrl returns the Url field value if set, zero value otherwise. func (o *PageElement) GetUrl() string { - if o == nil || o.Url == nil { + if o == nil || isNil(o.Url) { var ret string return ret } @@ -415,15 +415,15 @@ func (o *PageElement) GetUrl() string { // GetUrlOk returns a tuple with the Url field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PageElement) GetUrlOk() (*string, bool) { - if o == nil || o.Url == nil { - return nil, false + if o == nil || isNil(o.Url) { + return nil, false } return o.Url, true } // HasUrl returns a boolean if a field has been set. func (o *PageElement) HasUrl() bool { - if o != nil && o.Url != nil { + if o != nil && !isNil(o.Url) { return true } @@ -448,8 +448,8 @@ func (o *PageElement) GetTotalBytes() int32 { // GetTotalBytesOk returns a tuple with the TotalBytes field value // and a boolean to check if the value has been set. func (o *PageElement) GetTotalBytesOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.TotalBytes, true } @@ -461,7 +461,7 @@ func (o *PageElement) SetTotalBytes(v int32) { // GetElementType returns the ElementType field value if set, zero value otherwise. func (o *PageElement) GetElementType() string { - if o == nil || o.ElementType == nil { + if o == nil || isNil(o.ElementType) { var ret string return ret } @@ -471,15 +471,15 @@ func (o *PageElement) GetElementType() string { // GetElementTypeOk returns a tuple with the ElementType field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PageElement) GetElementTypeOk() (*string, bool) { - if o == nil || o.ElementType == nil { - return nil, false + if o == nil || isNil(o.ElementType) { + return nil, false } return o.ElementType, true } // HasElementType returns a boolean if a field has been set. func (o *PageElement) HasElementType() bool { - if o != nil && o.ElementType != nil { + if o != nil && !isNil(o.ElementType) { return true } @@ -493,7 +493,7 @@ func (o *PageElement) SetElementType(v string) { // GetRequestHeaders returns the RequestHeaders field value if set, zero value otherwise. func (o *PageElement) GetRequestHeaders() string { - if o == nil || o.RequestHeaders == nil { + if o == nil || isNil(o.RequestHeaders) { var ret string return ret } @@ -503,15 +503,15 @@ func (o *PageElement) GetRequestHeaders() string { // GetRequestHeadersOk returns a tuple with the RequestHeaders field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PageElement) GetRequestHeadersOk() (*string, bool) { - if o == nil || o.RequestHeaders == nil { - return nil, false + if o == nil || isNil(o.RequestHeaders) { + return nil, false } return o.RequestHeaders, true } // HasRequestHeaders returns a boolean if a field has been set. func (o *PageElement) HasRequestHeaders() bool { - if o != nil && o.RequestHeaders != nil { + if o != nil && !isNil(o.RequestHeaders) { return true } @@ -525,7 +525,7 @@ func (o *PageElement) SetRequestHeaders(v string) { // GetResponseHeaders returns the ResponseHeaders field value if set, zero value otherwise. func (o *PageElement) GetResponseHeaders() string { - if o == nil || o.ResponseHeaders == nil { + if o == nil || isNil(o.ResponseHeaders) { var ret string return ret } @@ -535,15 +535,15 @@ func (o *PageElement) GetResponseHeaders() string { // GetResponseHeadersOk returns a tuple with the ResponseHeaders field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PageElement) GetResponseHeadersOk() (*string, bool) { - if o == nil || o.ResponseHeaders == nil { - return nil, false + if o == nil || isNil(o.ResponseHeaders) { + return nil, false } return o.ResponseHeaders, true } // HasResponseHeaders returns a boolean if a field has been set. func (o *PageElement) HasResponseHeaders() bool { - if o != nil && o.ResponseHeaders != nil { + if o != nil && !isNil(o.ResponseHeaders) { return true } @@ -557,25 +557,25 @@ func (o *PageElement) SetResponseHeaders(v string) { // GetResolvedIpAddress returns the ResolvedIpAddress field value if set, zero value otherwise. func (o *PageElement) GetResolvedIpAddress() map[string]interface{} { - if o == nil || o.ResolvedIpAddress == nil { + if o == nil || isNil(o.ResolvedIpAddress) { var ret map[string]interface{} return ret } - return *o.ResolvedIpAddress + return o.ResolvedIpAddress } // GetResolvedIpAddressOk returns a tuple with the ResolvedIpAddress field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PageElement) GetResolvedIpAddressOk() (*map[string]interface{}, bool) { - if o == nil || o.ResolvedIpAddress == nil { - return nil, false +func (o *PageElement) GetResolvedIpAddressOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.ResolvedIpAddress) { + return map[string]interface{}{}, false } return o.ResolvedIpAddress, true } // HasResolvedIpAddress returns a boolean if a field has been set. func (o *PageElement) HasResolvedIpAddress() bool { - if o != nil && o.ResolvedIpAddress != nil { + if o != nil && !isNil(o.ResolvedIpAddress) { return true } @@ -584,30 +584,30 @@ func (o *PageElement) HasResolvedIpAddress() bool { // SetResolvedIpAddress gets a reference to the given map[string]interface{} and assigns it to the ResolvedIpAddress field. func (o *PageElement) SetResolvedIpAddress(v map[string]interface{}) { - o.ResolvedIpAddress = &v + o.ResolvedIpAddress = v } // GetGroupIds returns the GroupIds field value if set, zero value otherwise. func (o *PageElement) GetGroupIds() []int32 { - if o == nil || o.GroupIds == nil { + if o == nil || isNil(o.GroupIds) { var ret []int32 return ret } - return *o.GroupIds + return o.GroupIds } // GetGroupIdsOk returns a tuple with the GroupIds field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PageElement) GetGroupIdsOk() (*[]int32, bool) { - if o == nil || o.GroupIds == nil { - return nil, false +func (o *PageElement) GetGroupIdsOk() ([]int32, bool) { + if o == nil || isNil(o.GroupIds) { + return nil, false } return o.GroupIds, true } // HasGroupIds returns a boolean if a field has been set. func (o *PageElement) HasGroupIds() bool { - if o != nil && o.GroupIds != nil { + if o != nil && !isNil(o.GroupIds) { return true } @@ -616,7 +616,7 @@ func (o *PageElement) HasGroupIds() bool { // SetGroupIds gets a reference to the given []int32 and assigns it to the GroupIds field. func (o *PageElement) SetGroupIds(v []int32) { - o.GroupIds = &v + o.GroupIds = v } // GetUrlIsBlocked returns the UrlIsBlocked field value @@ -632,8 +632,8 @@ func (o *PageElement) GetUrlIsBlocked() bool { // GetUrlIsBlockedOk returns a tuple with the UrlIsBlocked field value // and a boolean to check if the value has been set. func (o *PageElement) GetUrlIsBlockedOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.UrlIsBlocked, true } @@ -684,25 +684,25 @@ func (o PageElement) MarshalJSON() ([]byte, error) { if true { toSerialize["HttpStatusCode"] = o.HttpStatusCode } - if o.Url != nil { + if !isNil(o.Url) { toSerialize["Url"] = o.Url } if true { toSerialize["TotalBytes"] = o.TotalBytes } - if o.ElementType != nil { + if !isNil(o.ElementType) { toSerialize["ElementType"] = o.ElementType } - if o.RequestHeaders != nil { + if !isNil(o.RequestHeaders) { toSerialize["RequestHeaders"] = o.RequestHeaders } - if o.ResponseHeaders != nil { + if !isNil(o.ResponseHeaders) { toSerialize["ResponseHeaders"] = o.ResponseHeaders } - if o.ResolvedIpAddress != nil { + if !isNil(o.ResolvedIpAddress) { toSerialize["ResolvedIpAddress"] = o.ResolvedIpAddress } - if o.GroupIds != nil { + if !isNil(o.GroupIds) { toSerialize["GroupIds"] = o.GroupIds } if true { diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_page_load_metrics.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_page_load_metrics.go index faeff802..0233e8bc 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_page_load_metrics.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_page_load_metrics.go @@ -47,7 +47,7 @@ func NewPageLoadMetricsWithDefaults() *PageLoadMetrics { // GetCumulativeLayoutShift returns the CumulativeLayoutShift field value if set, zero value otherwise. func (o *PageLoadMetrics) GetCumulativeLayoutShift() float32 { - if o == nil || o.CumulativeLayoutShift == nil { + if o == nil || isNil(o.CumulativeLayoutShift) { var ret float32 return ret } @@ -57,15 +57,15 @@ func (o *PageLoadMetrics) GetCumulativeLayoutShift() float32 { // GetCumulativeLayoutShiftOk returns a tuple with the CumulativeLayoutShift field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PageLoadMetrics) GetCumulativeLayoutShiftOk() (*float32, bool) { - if o == nil || o.CumulativeLayoutShift == nil { - return nil, false + if o == nil || isNil(o.CumulativeLayoutShift) { + return nil, false } return o.CumulativeLayoutShift, true } // HasCumulativeLayoutShift returns a boolean if a field has been set. func (o *PageLoadMetrics) HasCumulativeLayoutShift() bool { - if o != nil && o.CumulativeLayoutShift != nil { + if o != nil && !isNil(o.CumulativeLayoutShift) { return true } @@ -79,7 +79,7 @@ func (o *PageLoadMetrics) SetCumulativeLayoutShift(v float32) { // GetFirstContentfulPaint returns the FirstContentfulPaint field value if set, zero value otherwise. func (o *PageLoadMetrics) GetFirstContentfulPaint() int32 { - if o == nil || o.FirstContentfulPaint == nil { + if o == nil || isNil(o.FirstContentfulPaint) { var ret int32 return ret } @@ -89,15 +89,15 @@ func (o *PageLoadMetrics) GetFirstContentfulPaint() int32 { // GetFirstContentfulPaintOk returns a tuple with the FirstContentfulPaint field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PageLoadMetrics) GetFirstContentfulPaintOk() (*int32, bool) { - if o == nil || o.FirstContentfulPaint == nil { - return nil, false + if o == nil || isNil(o.FirstContentfulPaint) { + return nil, false } return o.FirstContentfulPaint, true } // HasFirstContentfulPaint returns a boolean if a field has been set. func (o *PageLoadMetrics) HasFirstContentfulPaint() bool { - if o != nil && o.FirstContentfulPaint != nil { + if o != nil && !isNil(o.FirstContentfulPaint) { return true } @@ -111,7 +111,7 @@ func (o *PageLoadMetrics) SetFirstContentfulPaint(v int32) { // GetLargestContentfulPaint returns the LargestContentfulPaint field value if set, zero value otherwise. func (o *PageLoadMetrics) GetLargestContentfulPaint() int32 { - if o == nil || o.LargestContentfulPaint == nil { + if o == nil || isNil(o.LargestContentfulPaint) { var ret int32 return ret } @@ -121,15 +121,15 @@ func (o *PageLoadMetrics) GetLargestContentfulPaint() int32 { // GetLargestContentfulPaintOk returns a tuple with the LargestContentfulPaint field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PageLoadMetrics) GetLargestContentfulPaintOk() (*int32, bool) { - if o == nil || o.LargestContentfulPaint == nil { - return nil, false + if o == nil || isNil(o.LargestContentfulPaint) { + return nil, false } return o.LargestContentfulPaint, true } // HasLargestContentfulPaint returns a boolean if a field has been set. func (o *PageLoadMetrics) HasLargestContentfulPaint() bool { - if o != nil && o.LargestContentfulPaint != nil { + if o != nil && !isNil(o.LargestContentfulPaint) { return true } @@ -143,7 +143,7 @@ func (o *PageLoadMetrics) SetLargestContentfulPaint(v int32) { // GetTotalBlockingTime returns the TotalBlockingTime field value if set, zero value otherwise. func (o *PageLoadMetrics) GetTotalBlockingTime() int32 { - if o == nil || o.TotalBlockingTime == nil { + if o == nil || isNil(o.TotalBlockingTime) { var ret int32 return ret } @@ -153,15 +153,15 @@ func (o *PageLoadMetrics) GetTotalBlockingTime() int32 { // GetTotalBlockingTimeOk returns a tuple with the TotalBlockingTime field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PageLoadMetrics) GetTotalBlockingTimeOk() (*int32, bool) { - if o == nil || o.TotalBlockingTime == nil { - return nil, false + if o == nil || isNil(o.TotalBlockingTime) { + return nil, false } return o.TotalBlockingTime, true } // HasTotalBlockingTime returns a boolean if a field has been set. func (o *PageLoadMetrics) HasTotalBlockingTime() bool { - if o != nil && o.TotalBlockingTime != nil { + if o != nil && !isNil(o.TotalBlockingTime) { return true } @@ -175,7 +175,7 @@ func (o *PageLoadMetrics) SetTotalBlockingTime(v int32) { // GetTimeToInteractive returns the TimeToInteractive field value if set, zero value otherwise. func (o *PageLoadMetrics) GetTimeToInteractive() int32 { - if o == nil || o.TimeToInteractive == nil { + if o == nil || isNil(o.TimeToInteractive) { var ret int32 return ret } @@ -185,15 +185,15 @@ func (o *PageLoadMetrics) GetTimeToInteractive() int32 { // GetTimeToInteractiveOk returns a tuple with the TimeToInteractive field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PageLoadMetrics) GetTimeToInteractiveOk() (*int32, bool) { - if o == nil || o.TimeToInteractive == nil { - return nil, false + if o == nil || isNil(o.TimeToInteractive) { + return nil, false } return o.TimeToInteractive, true } // HasTimeToInteractive returns a boolean if a field has been set. func (o *PageLoadMetrics) HasTimeToInteractive() bool { - if o != nil && o.TimeToInteractive != nil { + if o != nil && !isNil(o.TimeToInteractive) { return true } @@ -207,19 +207,19 @@ func (o *PageLoadMetrics) SetTimeToInteractive(v int32) { func (o PageLoadMetrics) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.CumulativeLayoutShift != nil { + if !isNil(o.CumulativeLayoutShift) { toSerialize["CumulativeLayoutShift"] = o.CumulativeLayoutShift } - if o.FirstContentfulPaint != nil { + if !isNil(o.FirstContentfulPaint) { toSerialize["FirstContentfulPaint"] = o.FirstContentfulPaint } - if o.LargestContentfulPaint != nil { + if !isNil(o.LargestContentfulPaint) { toSerialize["LargestContentfulPaint"] = o.LargestContentfulPaint } - if o.TotalBlockingTime != nil { + if !isNil(o.TotalBlockingTime) { toSerialize["TotalBlockingTime"] = o.TotalBlockingTime } - if o.TimeToInteractive != nil { + if !isNil(o.TimeToInteractive) { toSerialize["TimeToInteractive"] = o.TimeToInteractive } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_pattern_match.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_pattern_match.go index e73ea0c7..53014f4a 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_pattern_match.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_pattern_match.go @@ -41,7 +41,7 @@ func NewPatternMatchWithDefaults() *PatternMatch { // GetPattern returns the Pattern field value if set, zero value otherwise. func (o *PatternMatch) GetPattern() string { - if o == nil || o.Pattern == nil { + if o == nil || isNil(o.Pattern) { var ret string return ret } @@ -51,15 +51,15 @@ func (o *PatternMatch) GetPattern() string { // GetPatternOk returns a tuple with the Pattern field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PatternMatch) GetPatternOk() (*string, bool) { - if o == nil || o.Pattern == nil { - return nil, false + if o == nil || isNil(o.Pattern) { + return nil, false } return o.Pattern, true } // HasPattern returns a boolean if a field has been set. func (o *PatternMatch) HasPattern() bool { - if o != nil && o.Pattern != nil { + if o != nil && !isNil(o.Pattern) { return true } @@ -84,8 +84,8 @@ func (o *PatternMatch) GetIsPositive() bool { // GetIsPositiveOk returns a tuple with the IsPositive field value // and a boolean to check if the value has been set. func (o *PatternMatch) GetIsPositiveOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.IsPositive, true } @@ -97,7 +97,7 @@ func (o *PatternMatch) SetIsPositive(v bool) { // GetDateTime returns the DateTime field value if set, zero value otherwise. func (o *PatternMatch) GetDateTime() DateTimePatternMatch { - if o == nil || o.DateTime == nil { + if o == nil || isNil(o.DateTime) { var ret DateTimePatternMatch return ret } @@ -107,15 +107,15 @@ func (o *PatternMatch) GetDateTime() DateTimePatternMatch { // GetDateTimeOk returns a tuple with the DateTime field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PatternMatch) GetDateTimeOk() (*DateTimePatternMatch, bool) { - if o == nil || o.DateTime == nil { - return nil, false + if o == nil || isNil(o.DateTime) { + return nil, false } return o.DateTime, true } // HasDateTime returns a boolean if a field has been set. func (o *PatternMatch) HasDateTime() bool { - if o != nil && o.DateTime != nil { + if o != nil && !isNil(o.DateTime) { return true } @@ -129,13 +129,13 @@ func (o *PatternMatch) SetDateTime(v DateTimePatternMatch) { func (o PatternMatch) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Pattern != nil { + if !isNil(o.Pattern) { toSerialize["Pattern"] = o.Pattern } if true { toSerialize["IsPositive"] = o.IsPositive } - if o.DateTime != nil { + if !isNil(o.DateTime) { toSerialize["DateTime"] = o.DateTime } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_period_meta_data.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_period_meta_data.go index 84f83f91..d367004e 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_period_meta_data.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_period_meta_data.go @@ -40,7 +40,7 @@ func NewPeriodMetaDataWithDefaults() *PeriodMetaData { // GetWarning returns the Warning field value if set, zero value otherwise. func (o *PeriodMetaData) GetWarning() string { - if o == nil || o.Warning == nil { + if o == nil || isNil(o.Warning) { var ret string return ret } @@ -50,15 +50,15 @@ func (o *PeriodMetaData) GetWarning() string { // GetWarningOk returns a tuple with the Warning field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PeriodMetaData) GetWarningOk() (*string, bool) { - if o == nil || o.Warning == nil { - return nil, false + if o == nil || isNil(o.Warning) { + return nil, false } return o.Warning, true } // HasWarning returns a boolean if a field has been set. func (o *PeriodMetaData) HasWarning() bool { - if o != nil && o.Warning != nil { + if o != nil && !isNil(o.Warning) { return true } @@ -83,8 +83,8 @@ func (o *PeriodMetaData) GetMaximumRetentionDays() int32 { // GetMaximumRetentionDaysOk returns a tuple with the MaximumRetentionDays field value // and a boolean to check if the value has been set. func (o *PeriodMetaData) GetMaximumRetentionDaysOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.MaximumRetentionDays, true } @@ -96,7 +96,7 @@ func (o *PeriodMetaData) SetMaximumRetentionDays(v int32) { func (o PeriodMetaData) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Warning != nil { + if !isNil(o.Warning) { toSerialize["Warning"] = o.Warning } if true { diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_predefined_variable.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_predefined_variable.go index fba92240..956af345 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_predefined_variable.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_predefined_variable.go @@ -39,7 +39,7 @@ func NewPredefinedVariableWithDefaults() *PredefinedVariable { // GetKey returns the Key field value if set, zero value otherwise. func (o *PredefinedVariable) GetKey() string { - if o == nil || o.Key == nil { + if o == nil || isNil(o.Key) { var ret string return ret } @@ -49,15 +49,15 @@ func (o *PredefinedVariable) GetKey() string { // GetKeyOk returns a tuple with the Key field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PredefinedVariable) GetKeyOk() (*string, bool) { - if o == nil || o.Key == nil { - return nil, false + if o == nil || isNil(o.Key) { + return nil, false } return o.Key, true } // HasKey returns a boolean if a field has been set. func (o *PredefinedVariable) HasKey() bool { - if o != nil && o.Key != nil { + if o != nil && !isNil(o.Key) { return true } @@ -71,7 +71,7 @@ func (o *PredefinedVariable) SetKey(v string) { // GetValue returns the Value field value if set, zero value otherwise. func (o *PredefinedVariable) GetValue() string { - if o == nil || o.Value == nil { + if o == nil || isNil(o.Value) { var ret string return ret } @@ -81,15 +81,15 @@ func (o *PredefinedVariable) GetValue() string { // GetValueOk returns a tuple with the Value field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PredefinedVariable) GetValueOk() (*string, bool) { - if o == nil || o.Value == nil { - return nil, false + if o == nil || isNil(o.Value) { + return nil, false } return o.Value, true } // HasValue returns a boolean if a field has been set. func (o *PredefinedVariable) HasValue() bool { - if o != nil && o.Value != nil { + if o != nil && !isNil(o.Value) { return true } @@ -103,10 +103,10 @@ func (o *PredefinedVariable) SetValue(v string) { func (o PredefinedVariable) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Key != nil { + if !isNil(o.Key) { toSerialize["Key"] = o.Key } - if o.Value != nil { + if !isNil(o.Value) { toSerialize["Value"] = o.Value } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_preset_period_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_preset_period_type.go index 84b7139c..6baa35c0 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_preset_period_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_preset_period_type.go @@ -23,11 +23,16 @@ const ( PRESETPERIODTYPE_CURRENT_DAY PresetPeriodType = "CurrentDay" PRESETPERIODTYPE_CURRENT_WEEK PresetPeriodType = "CurrentWeek" PRESETPERIODTYPE_CURRENT_MONTH PresetPeriodType = "CurrentMonth" + PRESETPERIODTYPE_CURRENT_QUARTER PresetPeriodType = "CurrentQuarter" PRESETPERIODTYPE_CURRENT_YEAR PresetPeriodType = "CurrentYear" PRESETPERIODTYPE_PREVIOUS_DAY PresetPeriodType = "PreviousDay" PRESETPERIODTYPE_PREVIOUS_WEEK PresetPeriodType = "PreviousWeek" PRESETPERIODTYPE_PREVIOUS_MONTH PresetPeriodType = "PreviousMonth" + PRESETPERIODTYPE_PREVIOUS_QUARTER PresetPeriodType = "PreviousQuarter" PRESETPERIODTYPE_PREVIOUS_YEAR PresetPeriodType = "PreviousYear" + PRESETPERIODTYPE_LAST2_HOURS PresetPeriodType = "Last2Hours" + PRESETPERIODTYPE_LAST6_HOURS PresetPeriodType = "Last6Hours" + PRESETPERIODTYPE_LAST12_HOURS PresetPeriodType = "Last12Hours" PRESETPERIODTYPE_LAST24_HOURS PresetPeriodType = "Last24Hours" PRESETPERIODTYPE_LAST48_HOURS PresetPeriodType = "Last48Hours" PRESETPERIODTYPE_LAST7_DAYS PresetPeriodType = "Last7Days" @@ -42,15 +47,21 @@ const ( PRESETPERIODTYPE_ALL PresetPeriodType = "All" ) -var allowedPresetPeriodTypeEnumValues = []PresetPeriodType{ +// All allowed values of PresetPeriodType enum +var AllowedPresetPeriodTypeEnumValues = []PresetPeriodType{ "CurrentDay", "CurrentWeek", "CurrentMonth", + "CurrentQuarter", "CurrentYear", "PreviousDay", "PreviousWeek", "PreviousMonth", + "PreviousQuarter", "PreviousYear", + "Last2Hours", + "Last6Hours", + "Last12Hours", "Last24Hours", "Last48Hours", "Last7Days", @@ -72,7 +83,7 @@ func (v *PresetPeriodType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := PresetPeriodType(value) - for _, existing := range allowedPresetPeriodTypeEnumValues { + for _, existing := range AllowedPresetPeriodTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -89,13 +100,13 @@ func NewPresetPeriodTypeFromValue(v string) (*PresetPeriodType, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for PresetPeriodType: valid values are %v", v, allowedPresetPeriodTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for PresetPeriodType: valid values are %v", v, AllowedPresetPeriodTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v PresetPeriodType) IsValid() bool { - for _, existing := range allowedPresetPeriodTypeEnumValues { + for _, existing := range AllowedPresetPeriodTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_preset_period_type_with_exclusive.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_preset_period_type_with_exclusive.go index 02328c5b..7835b0e4 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_preset_period_type_with_exclusive.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_preset_period_type_with_exclusive.go @@ -23,11 +23,16 @@ const ( PRESETPERIODTYPEWITHEXCLUSIVE_CURRENT_DAY PresetPeriodTypeWithExclusive = "CurrentDay" PRESETPERIODTYPEWITHEXCLUSIVE_CURRENT_WEEK PresetPeriodTypeWithExclusive = "CurrentWeek" PRESETPERIODTYPEWITHEXCLUSIVE_CURRENT_MONTH PresetPeriodTypeWithExclusive = "CurrentMonth" + PRESETPERIODTYPEWITHEXCLUSIVE_CURRENT_QUARTER PresetPeriodTypeWithExclusive = "CurrentQuarter" PRESETPERIODTYPEWITHEXCLUSIVE_CURRENT_YEAR PresetPeriodTypeWithExclusive = "CurrentYear" PRESETPERIODTYPEWITHEXCLUSIVE_PREVIOUS_DAY PresetPeriodTypeWithExclusive = "PreviousDay" PRESETPERIODTYPEWITHEXCLUSIVE_PREVIOUS_WEEK PresetPeriodTypeWithExclusive = "PreviousWeek" PRESETPERIODTYPEWITHEXCLUSIVE_PREVIOUS_MONTH PresetPeriodTypeWithExclusive = "PreviousMonth" + PRESETPERIODTYPEWITHEXCLUSIVE_PREVIOUS_QUARTER PresetPeriodTypeWithExclusive = "PreviousQuarter" PRESETPERIODTYPEWITHEXCLUSIVE_PREVIOUS_YEAR PresetPeriodTypeWithExclusive = "PreviousYear" + PRESETPERIODTYPEWITHEXCLUSIVE_LAST2_HOURS PresetPeriodTypeWithExclusive = "Last2Hours" + PRESETPERIODTYPEWITHEXCLUSIVE_LAST6_HOURS PresetPeriodTypeWithExclusive = "Last6Hours" + PRESETPERIODTYPEWITHEXCLUSIVE_LAST12_HOURS PresetPeriodTypeWithExclusive = "Last12Hours" PRESETPERIODTYPEWITHEXCLUSIVE_LAST24_HOURS PresetPeriodTypeWithExclusive = "Last24Hours" PRESETPERIODTYPEWITHEXCLUSIVE_LAST48_HOURS PresetPeriodTypeWithExclusive = "Last48Hours" PRESETPERIODTYPEWITHEXCLUSIVE_LAST7_DAYS PresetPeriodTypeWithExclusive = "Last7Days" @@ -39,6 +44,9 @@ const ( PRESETPERIODTYPEWITHEXCLUSIVE_LAST6_MONTHS PresetPeriodTypeWithExclusive = "Last6Months" PRESETPERIODTYPEWITHEXCLUSIVE_LAST12_MONTHS PresetPeriodTypeWithExclusive = "Last12Months" PRESETPERIODTYPEWITHEXCLUSIVE_LAST24_MONTHS PresetPeriodTypeWithExclusive = "Last24Months" + PRESETPERIODTYPEWITHEXCLUSIVE_LAST2_HOURS_EXCL PresetPeriodTypeWithExclusive = "Last2HoursExcl" + PRESETPERIODTYPEWITHEXCLUSIVE_LAST6_HOURS_EXCL PresetPeriodTypeWithExclusive = "Last6HoursExcl" + PRESETPERIODTYPEWITHEXCLUSIVE_LAST12_HOURS_EXCL PresetPeriodTypeWithExclusive = "Last12HoursExcl" PRESETPERIODTYPEWITHEXCLUSIVE_LAST24_HOURS_EXCL PresetPeriodTypeWithExclusive = "Last24HoursExcl" PRESETPERIODTYPEWITHEXCLUSIVE_LAST48_HOURS_EXCL PresetPeriodTypeWithExclusive = "Last48HoursExcl" PRESETPERIODTYPEWITHEXCLUSIVE_LAST7_DAYS_EXCL PresetPeriodTypeWithExclusive = "Last7DaysExcl" @@ -53,15 +61,21 @@ const ( PRESETPERIODTYPEWITHEXCLUSIVE_ALL PresetPeriodTypeWithExclusive = "All" ) -var allowedPresetPeriodTypeWithExclusiveEnumValues = []PresetPeriodTypeWithExclusive{ +// All allowed values of PresetPeriodTypeWithExclusive enum +var AllowedPresetPeriodTypeWithExclusiveEnumValues = []PresetPeriodTypeWithExclusive{ "CurrentDay", "CurrentWeek", "CurrentMonth", + "CurrentQuarter", "CurrentYear", "PreviousDay", "PreviousWeek", "PreviousMonth", + "PreviousQuarter", "PreviousYear", + "Last2Hours", + "Last6Hours", + "Last12Hours", "Last24Hours", "Last48Hours", "Last7Days", @@ -73,6 +87,9 @@ var allowedPresetPeriodTypeWithExclusiveEnumValues = []PresetPeriodTypeWithExclu "Last6Months", "Last12Months", "Last24Months", + "Last2HoursExcl", + "Last6HoursExcl", + "Last12HoursExcl", "Last24HoursExcl", "Last48HoursExcl", "Last7DaysExcl", @@ -94,7 +111,7 @@ func (v *PresetPeriodTypeWithExclusive) UnmarshalJSON(src []byte) error { return err } enumTypeValue := PresetPeriodTypeWithExclusive(value) - for _, existing := range allowedPresetPeriodTypeWithExclusiveEnumValues { + for _, existing := range AllowedPresetPeriodTypeWithExclusiveEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -111,13 +128,13 @@ func NewPresetPeriodTypeWithExclusiveFromValue(v string) (*PresetPeriodTypeWithE if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for PresetPeriodTypeWithExclusive: valid values are %v", v, allowedPresetPeriodTypeWithExclusiveEnumValues) + return nil, fmt.Errorf("invalid value '%v' for PresetPeriodTypeWithExclusive: valid values are %v", v, AllowedPresetPeriodTypeWithExclusiveEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v PresetPeriodTypeWithExclusive) IsValid() bool { - for _, existing := range allowedPresetPeriodTypeWithExclusiveEnumValues { + for _, existing := range AllowedPresetPeriodTypeWithExclusiveEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_psp_authorization.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_psp_authorization.go index d9cf8dbe..5f12c433 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_psp_authorization.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_psp_authorization.go @@ -16,9 +16,13 @@ import ( // PSPAuthorization struct for PSPAuthorization type PSPAuthorization struct { + // The unique ID of this authorization AuthorizationId *string `json:"AuthorizationId,omitempty"` + // The authorization type AuthorizationType PSPAuthorizationType `json:"AuthorizationType"` + // The GUID of the operator (NULL if this authorization is for an operator group) OperatorGuid *string `json:"OperatorGuid,omitempty"` + // The GUID of the operator group (NULL if this authorization is for an operator) OperatorGroupGuid *string `json:"OperatorGroupGuid,omitempty"` } @@ -42,7 +46,7 @@ func NewPSPAuthorizationWithDefaults() *PSPAuthorization { // GetAuthorizationId returns the AuthorizationId field value if set, zero value otherwise. func (o *PSPAuthorization) GetAuthorizationId() string { - if o == nil || o.AuthorizationId == nil { + if o == nil || isNil(o.AuthorizationId) { var ret string return ret } @@ -52,15 +56,15 @@ func (o *PSPAuthorization) GetAuthorizationId() string { // GetAuthorizationIdOk returns a tuple with the AuthorizationId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PSPAuthorization) GetAuthorizationIdOk() (*string, bool) { - if o == nil || o.AuthorizationId == nil { - return nil, false + if o == nil || isNil(o.AuthorizationId) { + return nil, false } return o.AuthorizationId, true } // HasAuthorizationId returns a boolean if a field has been set. func (o *PSPAuthorization) HasAuthorizationId() bool { - if o != nil && o.AuthorizationId != nil { + if o != nil && !isNil(o.AuthorizationId) { return true } @@ -85,8 +89,8 @@ func (o *PSPAuthorization) GetAuthorizationType() PSPAuthorizationType { // GetAuthorizationTypeOk returns a tuple with the AuthorizationType field value // and a boolean to check if the value has been set. func (o *PSPAuthorization) GetAuthorizationTypeOk() (*PSPAuthorizationType, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.AuthorizationType, true } @@ -98,7 +102,7 @@ func (o *PSPAuthorization) SetAuthorizationType(v PSPAuthorizationType) { // GetOperatorGuid returns the OperatorGuid field value if set, zero value otherwise. func (o *PSPAuthorization) GetOperatorGuid() string { - if o == nil || o.OperatorGuid == nil { + if o == nil || isNil(o.OperatorGuid) { var ret string return ret } @@ -108,15 +112,15 @@ func (o *PSPAuthorization) GetOperatorGuid() string { // GetOperatorGuidOk returns a tuple with the OperatorGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PSPAuthorization) GetOperatorGuidOk() (*string, bool) { - if o == nil || o.OperatorGuid == nil { - return nil, false + if o == nil || isNil(o.OperatorGuid) { + return nil, false } return o.OperatorGuid, true } // HasOperatorGuid returns a boolean if a field has been set. func (o *PSPAuthorization) HasOperatorGuid() bool { - if o != nil && o.OperatorGuid != nil { + if o != nil && !isNil(o.OperatorGuid) { return true } @@ -130,7 +134,7 @@ func (o *PSPAuthorization) SetOperatorGuid(v string) { // GetOperatorGroupGuid returns the OperatorGroupGuid field value if set, zero value otherwise. func (o *PSPAuthorization) GetOperatorGroupGuid() string { - if o == nil || o.OperatorGroupGuid == nil { + if o == nil || isNil(o.OperatorGroupGuid) { var ret string return ret } @@ -140,15 +144,15 @@ func (o *PSPAuthorization) GetOperatorGroupGuid() string { // GetOperatorGroupGuidOk returns a tuple with the OperatorGroupGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PSPAuthorization) GetOperatorGroupGuidOk() (*string, bool) { - if o == nil || o.OperatorGroupGuid == nil { - return nil, false + if o == nil || isNil(o.OperatorGroupGuid) { + return nil, false } return o.OperatorGroupGuid, true } // HasOperatorGroupGuid returns a boolean if a field has been set. func (o *PSPAuthorization) HasOperatorGroupGuid() bool { - if o != nil && o.OperatorGroupGuid != nil { + if o != nil && !isNil(o.OperatorGroupGuid) { return true } @@ -162,16 +166,16 @@ func (o *PSPAuthorization) SetOperatorGroupGuid(v string) { func (o PSPAuthorization) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.AuthorizationId != nil { + if !isNil(o.AuthorizationId) { toSerialize["AuthorizationId"] = o.AuthorizationId } if true { toSerialize["AuthorizationType"] = o.AuthorizationType } - if o.OperatorGuid != nil { + if !isNil(o.OperatorGuid) { toSerialize["OperatorGuid"] = o.OperatorGuid } - if o.OperatorGroupGuid != nil { + if !isNil(o.OperatorGroupGuid) { toSerialize["OperatorGroupGuid"] = o.OperatorGroupGuid } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_psp_authorization_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_psp_authorization_type.go index fdd8ef6d..4cf362f1 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_psp_authorization_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_psp_authorization_type.go @@ -23,7 +23,8 @@ const ( PSPAUTHORIZATIONTYPE_VIEW_PUBLIC_DASHBOARD PSPAuthorizationType = "ViewPublicDashboard" ) -var allowedPSPAuthorizationTypeEnumValues = []PSPAuthorizationType{ +// All allowed values of PSPAuthorizationType enum +var AllowedPSPAuthorizationTypeEnumValues = []PSPAuthorizationType{ "ViewPublicDashboard", } @@ -34,7 +35,7 @@ func (v *PSPAuthorizationType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := PSPAuthorizationType(value) - for _, existing := range allowedPSPAuthorizationTypeEnumValues { + for _, existing := range AllowedPSPAuthorizationTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -51,13 +52,13 @@ func NewPSPAuthorizationTypeFromValue(v string) (*PSPAuthorizationType, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for PSPAuthorizationType: valid values are %v", v, allowedPSPAuthorizationTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for PSPAuthorizationType: valid values are %v", v, AllowedPSPAuthorizationTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v PSPAuthorizationType) IsValid() bool { - for _, existing := range allowedPSPAuthorizationTypeEnumValues { + for _, existing := range AllowedPSPAuthorizationTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_public_status_page.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_public_status_page.go index 7be5ed1c..35840f39 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_public_status_page.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_public_status_page.go @@ -23,8 +23,8 @@ type PublicStatusPage struct { CustomizationInfo *CustomizationInfo `json:"CustomizationInfo,omitempty"` SlaGuid *string `json:"SlaGuid,omitempty"` SlaGuidSpecified *bool `json:"SlaGuidSpecified,omitempty"` - MonitorGuids *[]string `json:"MonitorGuids,omitempty"` - MonitorGroupGuids *[]string `json:"MonitorGroupGuids,omitempty"` + MonitorGuids []string `json:"MonitorGuids,omitempty"` + MonitorGroupGuids []string `json:"MonitorGroupGuids,omitempty"` } // NewPublicStatusPage instantiates a new PublicStatusPage object @@ -46,7 +46,7 @@ func NewPublicStatusPageWithDefaults() *PublicStatusPage { // GetPublicDashboardGuid returns the PublicDashboardGuid field value if set, zero value otherwise. func (o *PublicStatusPage) GetPublicDashboardGuid() string { - if o == nil || o.PublicDashboardGuid == nil { + if o == nil || isNil(o.PublicDashboardGuid) { var ret string return ret } @@ -56,15 +56,15 @@ func (o *PublicStatusPage) GetPublicDashboardGuid() string { // GetPublicDashboardGuidOk returns a tuple with the PublicDashboardGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PublicStatusPage) GetPublicDashboardGuidOk() (*string, bool) { - if o == nil || o.PublicDashboardGuid == nil { - return nil, false + if o == nil || isNil(o.PublicDashboardGuid) { + return nil, false } return o.PublicDashboardGuid, true } // HasPublicDashboardGuid returns a boolean if a field has been set. func (o *PublicStatusPage) HasPublicDashboardGuid() bool { - if o != nil && o.PublicDashboardGuid != nil { + if o != nil && !isNil(o.PublicDashboardGuid) { return true } @@ -78,7 +78,7 @@ func (o *PublicStatusPage) SetPublicDashboardGuid(v string) { // GetName returns the Name field value if set, zero value otherwise. func (o *PublicStatusPage) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -88,15 +88,15 @@ func (o *PublicStatusPage) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PublicStatusPage) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *PublicStatusPage) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -110,7 +110,7 @@ func (o *PublicStatusPage) SetName(v string) { // GetIsPublished returns the IsPublished field value if set, zero value otherwise. func (o *PublicStatusPage) GetIsPublished() bool { - if o == nil || o.IsPublished == nil { + if o == nil || isNil(o.IsPublished) { var ret bool return ret } @@ -120,15 +120,15 @@ func (o *PublicStatusPage) GetIsPublished() bool { // GetIsPublishedOk returns a tuple with the IsPublished field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PublicStatusPage) GetIsPublishedOk() (*bool, bool) { - if o == nil || o.IsPublished == nil { - return nil, false + if o == nil || isNil(o.IsPublished) { + return nil, false } return o.IsPublished, true } // HasIsPublished returns a boolean if a field has been set. func (o *PublicStatusPage) HasIsPublished() bool { - if o != nil && o.IsPublished != nil { + if o != nil && !isNil(o.IsPublished) { return true } @@ -142,7 +142,7 @@ func (o *PublicStatusPage) SetIsPublished(v bool) { // GetPresetPeriodType returns the PresetPeriodType field value if set, zero value otherwise. func (o *PublicStatusPage) GetPresetPeriodType() PresetPeriodType { - if o == nil || o.PresetPeriodType == nil { + if o == nil || isNil(o.PresetPeriodType) { var ret PresetPeriodType return ret } @@ -152,15 +152,15 @@ func (o *PublicStatusPage) GetPresetPeriodType() PresetPeriodType { // GetPresetPeriodTypeOk returns a tuple with the PresetPeriodType field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PublicStatusPage) GetPresetPeriodTypeOk() (*PresetPeriodType, bool) { - if o == nil || o.PresetPeriodType == nil { - return nil, false + if o == nil || isNil(o.PresetPeriodType) { + return nil, false } return o.PresetPeriodType, true } // HasPresetPeriodType returns a boolean if a field has been set. func (o *PublicStatusPage) HasPresetPeriodType() bool { - if o != nil && o.PresetPeriodType != nil { + if o != nil && !isNil(o.PresetPeriodType) { return true } @@ -174,7 +174,7 @@ func (o *PublicStatusPage) SetPresetPeriodType(v PresetPeriodType) { // GetCustomizationInfo returns the CustomizationInfo field value if set, zero value otherwise. func (o *PublicStatusPage) GetCustomizationInfo() CustomizationInfo { - if o == nil || o.CustomizationInfo == nil { + if o == nil || isNil(o.CustomizationInfo) { var ret CustomizationInfo return ret } @@ -184,15 +184,15 @@ func (o *PublicStatusPage) GetCustomizationInfo() CustomizationInfo { // GetCustomizationInfoOk returns a tuple with the CustomizationInfo field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PublicStatusPage) GetCustomizationInfoOk() (*CustomizationInfo, bool) { - if o == nil || o.CustomizationInfo == nil { - return nil, false + if o == nil || isNil(o.CustomizationInfo) { + return nil, false } return o.CustomizationInfo, true } // HasCustomizationInfo returns a boolean if a field has been set. func (o *PublicStatusPage) HasCustomizationInfo() bool { - if o != nil && o.CustomizationInfo != nil { + if o != nil && !isNil(o.CustomizationInfo) { return true } @@ -206,7 +206,7 @@ func (o *PublicStatusPage) SetCustomizationInfo(v CustomizationInfo) { // GetSlaGuid returns the SlaGuid field value if set, zero value otherwise. func (o *PublicStatusPage) GetSlaGuid() string { - if o == nil || o.SlaGuid == nil { + if o == nil || isNil(o.SlaGuid) { var ret string return ret } @@ -216,15 +216,15 @@ func (o *PublicStatusPage) GetSlaGuid() string { // GetSlaGuidOk returns a tuple with the SlaGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PublicStatusPage) GetSlaGuidOk() (*string, bool) { - if o == nil || o.SlaGuid == nil { - return nil, false + if o == nil || isNil(o.SlaGuid) { + return nil, false } return o.SlaGuid, true } // HasSlaGuid returns a boolean if a field has been set. func (o *PublicStatusPage) HasSlaGuid() bool { - if o != nil && o.SlaGuid != nil { + if o != nil && !isNil(o.SlaGuid) { return true } @@ -238,7 +238,7 @@ func (o *PublicStatusPage) SetSlaGuid(v string) { // GetSlaGuidSpecified returns the SlaGuidSpecified field value if set, zero value otherwise. func (o *PublicStatusPage) GetSlaGuidSpecified() bool { - if o == nil || o.SlaGuidSpecified == nil { + if o == nil || isNil(o.SlaGuidSpecified) { var ret bool return ret } @@ -248,15 +248,15 @@ func (o *PublicStatusPage) GetSlaGuidSpecified() bool { // GetSlaGuidSpecifiedOk returns a tuple with the SlaGuidSpecified field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PublicStatusPage) GetSlaGuidSpecifiedOk() (*bool, bool) { - if o == nil || o.SlaGuidSpecified == nil { - return nil, false + if o == nil || isNil(o.SlaGuidSpecified) { + return nil, false } return o.SlaGuidSpecified, true } // HasSlaGuidSpecified returns a boolean if a field has been set. func (o *PublicStatusPage) HasSlaGuidSpecified() bool { - if o != nil && o.SlaGuidSpecified != nil { + if o != nil && !isNil(o.SlaGuidSpecified) { return true } @@ -270,25 +270,25 @@ func (o *PublicStatusPage) SetSlaGuidSpecified(v bool) { // GetMonitorGuids returns the MonitorGuids field value if set, zero value otherwise. func (o *PublicStatusPage) GetMonitorGuids() []string { - if o == nil || o.MonitorGuids == nil { + if o == nil || isNil(o.MonitorGuids) { var ret []string return ret } - return *o.MonitorGuids + return o.MonitorGuids } // GetMonitorGuidsOk returns a tuple with the MonitorGuids field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PublicStatusPage) GetMonitorGuidsOk() (*[]string, bool) { - if o == nil || o.MonitorGuids == nil { - return nil, false +func (o *PublicStatusPage) GetMonitorGuidsOk() ([]string, bool) { + if o == nil || isNil(o.MonitorGuids) { + return nil, false } return o.MonitorGuids, true } // HasMonitorGuids returns a boolean if a field has been set. func (o *PublicStatusPage) HasMonitorGuids() bool { - if o != nil && o.MonitorGuids != nil { + if o != nil && !isNil(o.MonitorGuids) { return true } @@ -297,30 +297,30 @@ func (o *PublicStatusPage) HasMonitorGuids() bool { // SetMonitorGuids gets a reference to the given []string and assigns it to the MonitorGuids field. func (o *PublicStatusPage) SetMonitorGuids(v []string) { - o.MonitorGuids = &v + o.MonitorGuids = v } // GetMonitorGroupGuids returns the MonitorGroupGuids field value if set, zero value otherwise. func (o *PublicStatusPage) GetMonitorGroupGuids() []string { - if o == nil || o.MonitorGroupGuids == nil { + if o == nil || isNil(o.MonitorGroupGuids) { var ret []string return ret } - return *o.MonitorGroupGuids + return o.MonitorGroupGuids } // GetMonitorGroupGuidsOk returns a tuple with the MonitorGroupGuids field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PublicStatusPage) GetMonitorGroupGuidsOk() (*[]string, bool) { - if o == nil || o.MonitorGroupGuids == nil { - return nil, false +func (o *PublicStatusPage) GetMonitorGroupGuidsOk() ([]string, bool) { + if o == nil || isNil(o.MonitorGroupGuids) { + return nil, false } return o.MonitorGroupGuids, true } // HasMonitorGroupGuids returns a boolean if a field has been set. func (o *PublicStatusPage) HasMonitorGroupGuids() bool { - if o != nil && o.MonitorGroupGuids != nil { + if o != nil && !isNil(o.MonitorGroupGuids) { return true } @@ -329,36 +329,36 @@ func (o *PublicStatusPage) HasMonitorGroupGuids() bool { // SetMonitorGroupGuids gets a reference to the given []string and assigns it to the MonitorGroupGuids field. func (o *PublicStatusPage) SetMonitorGroupGuids(v []string) { - o.MonitorGroupGuids = &v + o.MonitorGroupGuids = v } func (o PublicStatusPage) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.PublicDashboardGuid != nil { + if !isNil(o.PublicDashboardGuid) { toSerialize["PublicDashboardGuid"] = o.PublicDashboardGuid } - if o.Name != nil { + if !isNil(o.Name) { toSerialize["Name"] = o.Name } - if o.IsPublished != nil { + if !isNil(o.IsPublished) { toSerialize["IsPublished"] = o.IsPublished } - if o.PresetPeriodType != nil { + if !isNil(o.PresetPeriodType) { toSerialize["PresetPeriodType"] = o.PresetPeriodType } - if o.CustomizationInfo != nil { + if !isNil(o.CustomizationInfo) { toSerialize["CustomizationInfo"] = o.CustomizationInfo } - if o.SlaGuid != nil { + if !isNil(o.SlaGuid) { toSerialize["SlaGuid"] = o.SlaGuid } - if o.SlaGuidSpecified != nil { + if !isNil(o.SlaGuidSpecified) { toSerialize["SlaGuidSpecified"] = o.SlaGuidSpecified } - if o.MonitorGuids != nil { + if !isNil(o.MonitorGuids) { toSerialize["MonitorGuids"] = o.MonitorGuids } - if o.MonitorGroupGuids != nil { + if !isNil(o.MonitorGroupGuids) { toSerialize["MonitorGroupGuids"] = o.MonitorGroupGuids } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_recipients.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_recipients.go index cfa5a0d8..8991059b 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_recipients.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_recipients.go @@ -16,9 +16,9 @@ import ( // Recipients struct for Recipients type Recipients struct { - Operators *[]string `json:"Operators,omitempty"` - OperatorGroups *[]string `json:"OperatorGroups,omitempty"` - ExtraEmailAddresses *[]string `json:"ExtraEmailAddresses,omitempty"` + Operators []string `json:"Operators,omitempty"` + OperatorGroups []string `json:"OperatorGroups,omitempty"` + ExtraEmailAddresses []string `json:"ExtraEmailAddresses,omitempty"` } // NewRecipients instantiates a new Recipients object @@ -40,25 +40,25 @@ func NewRecipientsWithDefaults() *Recipients { // GetOperators returns the Operators field value if set, zero value otherwise. func (o *Recipients) GetOperators() []string { - if o == nil || o.Operators == nil { + if o == nil || isNil(o.Operators) { var ret []string return ret } - return *o.Operators + return o.Operators } // GetOperatorsOk returns a tuple with the Operators field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Recipients) GetOperatorsOk() (*[]string, bool) { - if o == nil || o.Operators == nil { - return nil, false +func (o *Recipients) GetOperatorsOk() ([]string, bool) { + if o == nil || isNil(o.Operators) { + return nil, false } return o.Operators, true } // HasOperators returns a boolean if a field has been set. func (o *Recipients) HasOperators() bool { - if o != nil && o.Operators != nil { + if o != nil && !isNil(o.Operators) { return true } @@ -67,30 +67,30 @@ func (o *Recipients) HasOperators() bool { // SetOperators gets a reference to the given []string and assigns it to the Operators field. func (o *Recipients) SetOperators(v []string) { - o.Operators = &v + o.Operators = v } // GetOperatorGroups returns the OperatorGroups field value if set, zero value otherwise. func (o *Recipients) GetOperatorGroups() []string { - if o == nil || o.OperatorGroups == nil { + if o == nil || isNil(o.OperatorGroups) { var ret []string return ret } - return *o.OperatorGroups + return o.OperatorGroups } // GetOperatorGroupsOk returns a tuple with the OperatorGroups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Recipients) GetOperatorGroupsOk() (*[]string, bool) { - if o == nil || o.OperatorGroups == nil { - return nil, false +func (o *Recipients) GetOperatorGroupsOk() ([]string, bool) { + if o == nil || isNil(o.OperatorGroups) { + return nil, false } return o.OperatorGroups, true } // HasOperatorGroups returns a boolean if a field has been set. func (o *Recipients) HasOperatorGroups() bool { - if o != nil && o.OperatorGroups != nil { + if o != nil && !isNil(o.OperatorGroups) { return true } @@ -99,30 +99,30 @@ func (o *Recipients) HasOperatorGroups() bool { // SetOperatorGroups gets a reference to the given []string and assigns it to the OperatorGroups field. func (o *Recipients) SetOperatorGroups(v []string) { - o.OperatorGroups = &v + o.OperatorGroups = v } // GetExtraEmailAddresses returns the ExtraEmailAddresses field value if set, zero value otherwise. func (o *Recipients) GetExtraEmailAddresses() []string { - if o == nil || o.ExtraEmailAddresses == nil { + if o == nil || isNil(o.ExtraEmailAddresses) { var ret []string return ret } - return *o.ExtraEmailAddresses + return o.ExtraEmailAddresses } // GetExtraEmailAddressesOk returns a tuple with the ExtraEmailAddresses field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Recipients) GetExtraEmailAddressesOk() (*[]string, bool) { - if o == nil || o.ExtraEmailAddresses == nil { - return nil, false +func (o *Recipients) GetExtraEmailAddressesOk() ([]string, bool) { + if o == nil || isNil(o.ExtraEmailAddresses) { + return nil, false } return o.ExtraEmailAddresses, true } // HasExtraEmailAddresses returns a boolean if a field has been set. func (o *Recipients) HasExtraEmailAddresses() bool { - if o != nil && o.ExtraEmailAddresses != nil { + if o != nil && !isNil(o.ExtraEmailAddresses) { return true } @@ -131,18 +131,18 @@ func (o *Recipients) HasExtraEmailAddresses() bool { // SetExtraEmailAddresses gets a reference to the given []string and assigns it to the ExtraEmailAddresses field. func (o *Recipients) SetExtraEmailAddresses(v []string) { - o.ExtraEmailAddresses = &v + o.ExtraEmailAddresses = v } func (o Recipients) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Operators != nil { + if !isNil(o.Operators) { toSerialize["Operators"] = o.Operators } - if o.OperatorGroups != nil { + if !isNil(o.OperatorGroups) { toSerialize["OperatorGroups"] = o.OperatorGroups } - if o.ExtraEmailAddresses != nil { + if !isNil(o.ExtraEmailAddresses) { toSerialize["ExtraEmailAddresses"] = o.ExtraEmailAddresses } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_register_status.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_register_status.go index 62cd58f3..ac070786 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_register_status.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_register_status.go @@ -24,7 +24,8 @@ const ( REGISTERSTATUS_UNEXPECTED_ERROR RegisterStatus = "UnexpectedError" ) -var allowedRegisterStatusEnumValues = []RegisterStatus{ +// All allowed values of RegisterStatus enum +var AllowedRegisterStatusEnumValues = []RegisterStatus{ "OK", "UnexpectedError", } @@ -36,7 +37,7 @@ func (v *RegisterStatus) UnmarshalJSON(src []byte) error { return err } enumTypeValue := RegisterStatus(value) - for _, existing := range allowedRegisterStatusEnumValues { + for _, existing := range AllowedRegisterStatusEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -53,13 +54,13 @@ func NewRegisterStatusFromValue(v string) (*RegisterStatus, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for RegisterStatus: valid values are %v", v, allowedRegisterStatusEnumValues) + return nil, fmt.Errorf("invalid value '%v' for RegisterStatus: valid values are %v", v, AllowedRegisterStatusEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v RegisterStatus) IsValid() bool { - for _, existing := range allowedRegisterStatusEnumValues { + for _, existing := range AllowedRegisterStatusEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_registration_response.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_registration_response.go index f5bb0876..910bfc7d 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_registration_response.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_registration_response.go @@ -48,7 +48,7 @@ func NewRegistrationResponseWithDefaults() *RegistrationResponse { // GetUserName returns the UserName field value if set, zero value otherwise. func (o *RegistrationResponse) GetUserName() string { - if o == nil || o.UserName == nil { + if o == nil || isNil(o.UserName) { var ret string return ret } @@ -58,15 +58,15 @@ func (o *RegistrationResponse) GetUserName() string { // GetUserNameOk returns a tuple with the UserName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *RegistrationResponse) GetUserNameOk() (*string, bool) { - if o == nil || o.UserName == nil { - return nil, false + if o == nil || isNil(o.UserName) { + return nil, false } return o.UserName, true } // HasUserName returns a boolean if a field has been set. func (o *RegistrationResponse) HasUserName() bool { - if o != nil && o.UserName != nil { + if o != nil && !isNil(o.UserName) { return true } @@ -80,7 +80,7 @@ func (o *RegistrationResponse) SetUserName(v string) { // GetPassword returns the Password field value if set, zero value otherwise. func (o *RegistrationResponse) GetPassword() string { - if o == nil || o.Password == nil { + if o == nil || isNil(o.Password) { var ret string return ret } @@ -90,15 +90,15 @@ func (o *RegistrationResponse) GetPassword() string { // GetPasswordOk returns a tuple with the Password field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *RegistrationResponse) GetPasswordOk() (*string, bool) { - if o == nil || o.Password == nil { - return nil, false + if o == nil || isNil(o.Password) { + return nil, false } return o.Password, true } // HasPassword returns a boolean if a field has been set. func (o *RegistrationResponse) HasPassword() bool { - if o != nil && o.Password != nil { + if o != nil && !isNil(o.Password) { return true } @@ -112,7 +112,7 @@ func (o *RegistrationResponse) SetPassword(v string) { // GetAccountId returns the AccountId field value if set, zero value otherwise. func (o *RegistrationResponse) GetAccountId() string { - if o == nil || o.AccountId == nil { + if o == nil || isNil(o.AccountId) { var ret string return ret } @@ -122,15 +122,15 @@ func (o *RegistrationResponse) GetAccountId() string { // GetAccountIdOk returns a tuple with the AccountId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *RegistrationResponse) GetAccountIdOk() (*string, bool) { - if o == nil || o.AccountId == nil { - return nil, false + if o == nil || isNil(o.AccountId) { + return nil, false } return o.AccountId, true } // HasAccountId returns a boolean if a field has been set. func (o *RegistrationResponse) HasAccountId() bool { - if o != nil && o.AccountId != nil { + if o != nil && !isNil(o.AccountId) { return true } @@ -144,7 +144,7 @@ func (o *RegistrationResponse) SetAccountId(v string) { // GetOperatorName returns the OperatorName field value if set, zero value otherwise. func (o *RegistrationResponse) GetOperatorName() string { - if o == nil || o.OperatorName == nil { + if o == nil || isNil(o.OperatorName) { var ret string return ret } @@ -154,15 +154,15 @@ func (o *RegistrationResponse) GetOperatorName() string { // GetOperatorNameOk returns a tuple with the OperatorName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *RegistrationResponse) GetOperatorNameOk() (*string, bool) { - if o == nil || o.OperatorName == nil { - return nil, false + if o == nil || isNil(o.OperatorName) { + return nil, false } return o.OperatorName, true } // HasOperatorName returns a boolean if a field has been set. func (o *RegistrationResponse) HasOperatorName() bool { - if o != nil && o.OperatorName != nil { + if o != nil && !isNil(o.OperatorName) { return true } @@ -187,8 +187,8 @@ func (o *RegistrationResponse) GetStatus() RegisterStatus { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. func (o *RegistrationResponse) GetStatusOk() (*RegisterStatus, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Status, true } @@ -200,7 +200,7 @@ func (o *RegistrationResponse) SetStatus(v RegisterStatus) { // GetMessage returns the Message field value if set, zero value otherwise. func (o *RegistrationResponse) GetMessage() string { - if o == nil || o.Message == nil { + if o == nil || isNil(o.Message) { var ret string return ret } @@ -210,15 +210,15 @@ func (o *RegistrationResponse) GetMessage() string { // GetMessageOk returns a tuple with the Message field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *RegistrationResponse) GetMessageOk() (*string, bool) { - if o == nil || o.Message == nil { - return nil, false + if o == nil || isNil(o.Message) { + return nil, false } return o.Message, true } // HasMessage returns a boolean if a field has been set. func (o *RegistrationResponse) HasMessage() bool { - if o != nil && o.Message != nil { + if o != nil && !isNil(o.Message) { return true } @@ -232,22 +232,22 @@ func (o *RegistrationResponse) SetMessage(v string) { func (o RegistrationResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.UserName != nil { + if !isNil(o.UserName) { toSerialize["UserName"] = o.UserName } - if o.Password != nil { + if !isNil(o.Password) { toSerialize["Password"] = o.Password } - if o.AccountId != nil { + if !isNil(o.AccountId) { toSerialize["AccountId"] = o.AccountId } - if o.OperatorName != nil { + if !isNil(o.OperatorName) { toSerialize["OperatorName"] = o.OperatorName } if true { toSerialize["status"] = o.Status } - if o.Message != nil { + if !isNil(o.Message) { toSerialize["message"] = o.Message } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_relation_object.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_relation_object.go index 8ff00664..a036b6f5 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_relation_object.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_relation_object.go @@ -16,10 +16,15 @@ import ( // RelationObject struct for RelationObject type RelationObject struct { - Attributes *map[string]interface{} `json:"Attributes,omitempty"` - Id *map[string]interface{} `json:"Id,omitempty"` + // Object attributes + Attributes map[string]interface{} `json:"Attributes,omitempty"` + // Identifier + Id map[string]interface{} `json:"Id,omitempty"` + // Object type Type *string `json:"Type,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + // Links related to the object Links *map[string]string `json:"Links,omitempty"` } @@ -42,25 +47,25 @@ func NewRelationObjectWithDefaults() *RelationObject { // GetAttributes returns the Attributes field value if set, zero value otherwise. func (o *RelationObject) GetAttributes() map[string]interface{} { - if o == nil || o.Attributes == nil { + if o == nil || isNil(o.Attributes) { var ret map[string]interface{} return ret } - return *o.Attributes + return o.Attributes } // GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RelationObject) GetAttributesOk() (*map[string]interface{}, bool) { - if o == nil || o.Attributes == nil { - return nil, false +func (o *RelationObject) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.Attributes) { + return map[string]interface{}{}, false } return o.Attributes, true } // HasAttributes returns a boolean if a field has been set. func (o *RelationObject) HasAttributes() bool { - if o != nil && o.Attributes != nil { + if o != nil && !isNil(o.Attributes) { return true } @@ -69,30 +74,30 @@ func (o *RelationObject) HasAttributes() bool { // SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. func (o *RelationObject) SetAttributes(v map[string]interface{}) { - o.Attributes = &v + o.Attributes = v } // GetId returns the Id field value if set, zero value otherwise. func (o *RelationObject) GetId() map[string]interface{} { - if o == nil || o.Id == nil { + if o == nil || isNil(o.Id) { var ret map[string]interface{} return ret } - return *o.Id + return o.Id } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RelationObject) GetIdOk() (*map[string]interface{}, bool) { - if o == nil || o.Id == nil { - return nil, false +func (o *RelationObject) GetIdOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.Id) { + return map[string]interface{}{}, false } return o.Id, true } // HasId returns a boolean if a field has been set. func (o *RelationObject) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !isNil(o.Id) { return true } @@ -101,12 +106,12 @@ func (o *RelationObject) HasId() bool { // SetId gets a reference to the given map[string]interface{} and assigns it to the Id field. func (o *RelationObject) SetId(v map[string]interface{}) { - o.Id = &v + o.Id = v } // GetType returns the Type field value if set, zero value otherwise. func (o *RelationObject) GetType() string { - if o == nil || o.Type == nil { + if o == nil || isNil(o.Type) { var ret string return ret } @@ -116,15 +121,15 @@ func (o *RelationObject) GetType() string { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *RelationObject) GetTypeOk() (*string, bool) { - if o == nil || o.Type == nil { - return nil, false + if o == nil || isNil(o.Type) { + return nil, false } return o.Type, true } // HasType returns a boolean if a field has been set. func (o *RelationObject) HasType() bool { - if o != nil && o.Type != nil { + if o != nil && !isNil(o.Type) { return true } @@ -138,25 +143,25 @@ func (o *RelationObject) SetType(v string) { // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *RelationObject) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RelationObject) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *RelationObject) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *RelationObject) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -165,12 +170,12 @@ func (o *RelationObject) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *RelationObject) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetLinks returns the Links field value if set, zero value otherwise. func (o *RelationObject) GetLinks() map[string]string { - if o == nil || o.Links == nil { + if o == nil || isNil(o.Links) { var ret map[string]string return ret } @@ -180,15 +185,15 @@ func (o *RelationObject) GetLinks() map[string]string { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *RelationObject) GetLinksOk() (*map[string]string, bool) { - if o == nil || o.Links == nil { - return nil, false + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *RelationObject) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } @@ -202,19 +207,19 @@ func (o *RelationObject) SetLinks(v map[string]string) { func (o RelationObject) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Attributes != nil { + if !isNil(o.Attributes) { toSerialize["Attributes"] = o.Attributes } - if o.Id != nil { + if !isNil(o.Id) { toSerialize["Id"] = o.Id } - if o.Type != nil { + if !isNil(o.Type) { toSerialize["Type"] = o.Type } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_request_header.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_request_header.go index ef7ee69c..46933c36 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_request_header.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_request_header.go @@ -39,7 +39,7 @@ func NewRequestHeaderWithDefaults() *RequestHeader { // GetName returns the Name field value if set, zero value otherwise. func (o *RequestHeader) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -49,15 +49,15 @@ func (o *RequestHeader) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *RequestHeader) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *RequestHeader) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -71,7 +71,7 @@ func (o *RequestHeader) SetName(v string) { // GetValue returns the Value field value if set, zero value otherwise. func (o *RequestHeader) GetValue() string { - if o == nil || o.Value == nil { + if o == nil || isNil(o.Value) { var ret string return ret } @@ -81,15 +81,15 @@ func (o *RequestHeader) GetValue() string { // GetValueOk returns a tuple with the Value field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *RequestHeader) GetValueOk() (*string, bool) { - if o == nil || o.Value == nil { - return nil, false + if o == nil || isNil(o.Value) { + return nil, false } return o.Value, true } // HasValue returns a boolean if a field has been set. func (o *RequestHeader) HasValue() bool { - if o != nil && o.Value != nil { + if o != nil && !isNil(o.Value) { return true } @@ -103,10 +103,10 @@ func (o *RequestHeader) SetValue(v string) { func (o RequestHeader) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !isNil(o.Name) { toSerialize["Name"] = o.Name } - if o.Value != nil { + if !isNil(o.Value) { toSerialize["Value"] = o.Value } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_rum_metric.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_rum_metric.go new file mode 100644 index 00000000..3549cac4 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_rum_metric.go @@ -0,0 +1,137 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" + "fmt" +) + +// RumMetric Defines a RUM metric. +type RumMetric string + +// List of RumMetric +const ( + RUMMETRIC_PAGE_VIEWS RumMetric = "PageViews" + RUMMETRIC_LOAD_TIME RumMetric = "LoadTime" + RUMMETRIC_TIME_TO_FIRST_BYTE RumMetric = "TimeToFirstByte" + RUMMETRIC_PAGE_READY_TIME RumMetric = "PageReadyTime" + RUMMETRIC_NETWORK_DURATION RumMetric = "NetworkDuration" + RUMMETRIC_REDIRECT_DURATION RumMetric = "RedirectDuration" + RUMMETRIC_DNS_DURATION RumMetric = "DnsDuration" + RUMMETRIC_CONNECT_DURATION RumMetric = "ConnectDuration" + RUMMETRIC_BACKEND_DURATION RumMetric = "BackendDuration" + RUMMETRIC_SEND_DURATION RumMetric = "SendDuration" + RUMMETRIC_RECEIVE_DURATION RumMetric = "ReceiveDuration" + RUMMETRIC_FRONT_END_DURATION RumMetric = "FrontEndDuration" + RUMMETRIC_DOM_DURATION RumMetric = "DomDuration" + RUMMETRIC_RENDER_DURATION RumMetric = "RenderDuration" + RUMMETRIC_DOWNLOAD_TIME RumMetric = "DownloadTime" +) + +// All allowed values of RumMetric enum +var AllowedRumMetricEnumValues = []RumMetric{ + "PageViews", + "LoadTime", + "TimeToFirstByte", + "PageReadyTime", + "NetworkDuration", + "RedirectDuration", + "DnsDuration", + "ConnectDuration", + "BackendDuration", + "SendDuration", + "ReceiveDuration", + "FrontEndDuration", + "DomDuration", + "RenderDuration", + "DownloadTime", +} + +func (v *RumMetric) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RumMetric(value) + for _, existing := range AllowedRumMetricEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid RumMetric", value) +} + +// NewRumMetricFromValue returns a pointer to a valid RumMetric +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRumMetricFromValue(v string) (*RumMetric, error) { + ev := RumMetric(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RumMetric: valid values are %v", v, AllowedRumMetricEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RumMetric) IsValid() bool { + for _, existing := range AllowedRumMetricEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to RumMetric value +func (v RumMetric) Ptr() *RumMetric { + return &v +} + +type NullableRumMetric struct { + value *RumMetric + isSet bool +} + +func (v NullableRumMetric) Get() *RumMetric { + return v.value +} + +func (v *NullableRumMetric) Set(val *RumMetric) { + v.value = val + v.isSet = true +} + +func (v NullableRumMetric) IsSet() bool { + return v.isSet +} + +func (v *NullableRumMetric) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRumMetric(val *RumMetric) *NullableRumMetric { + return &NullableRumMetric{value: val, isSet: true} +} + +func (v NullableRumMetric) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRumMetric) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_rum_metric_values.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_rum_metric_values.go new file mode 100644 index 00000000..2d490807 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_rum_metric_values.go @@ -0,0 +1,288 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// RumMetricValues struct for RumMetricValues +type RumMetricValues struct { + Metric RumMetric `json:"Metric"` + Median *int32 `json:"Median,omitempty"` + Minimum *int32 `json:"Minimum,omitempty"` + Maximum *int32 `json:"Maximum,omitempty"` + Average *int32 `json:"Average,omitempty"` + Count *int32 `json:"Count,omitempty"` +} + +// NewRumMetricValues instantiates a new RumMetricValues object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRumMetricValues(metric RumMetric) *RumMetricValues { + this := RumMetricValues{} + this.Metric = metric + return &this +} + +// NewRumMetricValuesWithDefaults instantiates a new RumMetricValues object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRumMetricValuesWithDefaults() *RumMetricValues { + this := RumMetricValues{} + return &this +} + +// GetMetric returns the Metric field value +func (o *RumMetricValues) GetMetric() RumMetric { + if o == nil { + var ret RumMetric + return ret + } + + return o.Metric +} + +// GetMetricOk returns a tuple with the Metric field value +// and a boolean to check if the value has been set. +func (o *RumMetricValues) GetMetricOk() (*RumMetric, bool) { + if o == nil { + return nil, false + } + return &o.Metric, true +} + +// SetMetric sets field value +func (o *RumMetricValues) SetMetric(v RumMetric) { + o.Metric = v +} + +// GetMedian returns the Median field value if set, zero value otherwise. +func (o *RumMetricValues) GetMedian() int32 { + if o == nil || isNil(o.Median) { + var ret int32 + return ret + } + return *o.Median +} + +// GetMedianOk returns a tuple with the Median field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RumMetricValues) GetMedianOk() (*int32, bool) { + if o == nil || isNil(o.Median) { + return nil, false + } + return o.Median, true +} + +// HasMedian returns a boolean if a field has been set. +func (o *RumMetricValues) HasMedian() bool { + if o != nil && !isNil(o.Median) { + return true + } + + return false +} + +// SetMedian gets a reference to the given int32 and assigns it to the Median field. +func (o *RumMetricValues) SetMedian(v int32) { + o.Median = &v +} + +// GetMinimum returns the Minimum field value if set, zero value otherwise. +func (o *RumMetricValues) GetMinimum() int32 { + if o == nil || isNil(o.Minimum) { + var ret int32 + return ret + } + return *o.Minimum +} + +// GetMinimumOk returns a tuple with the Minimum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RumMetricValues) GetMinimumOk() (*int32, bool) { + if o == nil || isNil(o.Minimum) { + return nil, false + } + return o.Minimum, true +} + +// HasMinimum returns a boolean if a field has been set. +func (o *RumMetricValues) HasMinimum() bool { + if o != nil && !isNil(o.Minimum) { + return true + } + + return false +} + +// SetMinimum gets a reference to the given int32 and assigns it to the Minimum field. +func (o *RumMetricValues) SetMinimum(v int32) { + o.Minimum = &v +} + +// GetMaximum returns the Maximum field value if set, zero value otherwise. +func (o *RumMetricValues) GetMaximum() int32 { + if o == nil || isNil(o.Maximum) { + var ret int32 + return ret + } + return *o.Maximum +} + +// GetMaximumOk returns a tuple with the Maximum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RumMetricValues) GetMaximumOk() (*int32, bool) { + if o == nil || isNil(o.Maximum) { + return nil, false + } + return o.Maximum, true +} + +// HasMaximum returns a boolean if a field has been set. +func (o *RumMetricValues) HasMaximum() bool { + if o != nil && !isNil(o.Maximum) { + return true + } + + return false +} + +// SetMaximum gets a reference to the given int32 and assigns it to the Maximum field. +func (o *RumMetricValues) SetMaximum(v int32) { + o.Maximum = &v +} + +// GetAverage returns the Average field value if set, zero value otherwise. +func (o *RumMetricValues) GetAverage() int32 { + if o == nil || isNil(o.Average) { + var ret int32 + return ret + } + return *o.Average +} + +// GetAverageOk returns a tuple with the Average field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RumMetricValues) GetAverageOk() (*int32, bool) { + if o == nil || isNil(o.Average) { + return nil, false + } + return o.Average, true +} + +// HasAverage returns a boolean if a field has been set. +func (o *RumMetricValues) HasAverage() bool { + if o != nil && !isNil(o.Average) { + return true + } + + return false +} + +// SetAverage gets a reference to the given int32 and assigns it to the Average field. +func (o *RumMetricValues) SetAverage(v int32) { + o.Average = &v +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *RumMetricValues) GetCount() int32 { + if o == nil || isNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RumMetricValues) GetCountOk() (*int32, bool) { + if o == nil || isNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *RumMetricValues) HasCount() bool { + if o != nil && !isNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *RumMetricValues) SetCount(v int32) { + o.Count = &v +} + +func (o RumMetricValues) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["Metric"] = o.Metric + } + if !isNil(o.Median) { + toSerialize["Median"] = o.Median + } + if !isNil(o.Minimum) { + toSerialize["Minimum"] = o.Minimum + } + if !isNil(o.Maximum) { + toSerialize["Maximum"] = o.Maximum + } + if !isNil(o.Average) { + toSerialize["Average"] = o.Average + } + if !isNil(o.Count) { + toSerialize["Count"] = o.Count + } + return json.Marshal(toSerialize) +} + +type NullableRumMetricValues struct { + value *RumMetricValues + isSet bool +} + +func (v NullableRumMetricValues) Get() *RumMetricValues { + return v.value +} + +func (v *NullableRumMetricValues) Set(val *RumMetricValues) { + v.value = val + v.isSet = true +} + +func (v NullableRumMetricValues) IsSet() bool { + return v.isSet +} + +func (v *NullableRumMetricValues) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRumMetricValues(val *RumMetricValues) *NullableRumMetricValues { + return &NullableRumMetricValues{value: val, isSet: true} +} + +func (v NullableRumMetricValues) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRumMetricValues) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_rum_website.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_rum_website.go new file mode 100644 index 00000000..1dad2839 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_rum_website.go @@ -0,0 +1,144 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// RumWebsite struct for RumWebsite +type RumWebsite struct { + RumWebsiteId string `json:"RumWebsiteId"` + Description *string `json:"Description,omitempty"` +} + +// NewRumWebsite instantiates a new RumWebsite object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRumWebsite(rumWebsiteId string) *RumWebsite { + this := RumWebsite{} + this.RumWebsiteId = rumWebsiteId + return &this +} + +// NewRumWebsiteWithDefaults instantiates a new RumWebsite object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRumWebsiteWithDefaults() *RumWebsite { + this := RumWebsite{} + return &this +} + +// GetRumWebsiteId returns the RumWebsiteId field value +func (o *RumWebsite) GetRumWebsiteId() string { + if o == nil { + var ret string + return ret + } + + return o.RumWebsiteId +} + +// GetRumWebsiteIdOk returns a tuple with the RumWebsiteId field value +// and a boolean to check if the value has been set. +func (o *RumWebsite) GetRumWebsiteIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RumWebsiteId, true +} + +// SetRumWebsiteId sets field value +func (o *RumWebsite) SetRumWebsiteId(v string) { + o.RumWebsiteId = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RumWebsite) GetDescription() string { + if o == nil || isNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RumWebsite) GetDescriptionOk() (*string, bool) { + if o == nil || isNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RumWebsite) HasDescription() bool { + if o != nil && !isNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RumWebsite) SetDescription(v string) { + o.Description = &v +} + +func (o RumWebsite) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["RumWebsiteId"] = o.RumWebsiteId + } + if !isNil(o.Description) { + toSerialize["Description"] = o.Description + } + return json.Marshal(toSerialize) +} + +type NullableRumWebsite struct { + value *RumWebsite + isSet bool +} + +func (v NullableRumWebsite) Get() *RumWebsite { + return v.value +} + +func (v *NullableRumWebsite) Set(val *RumWebsite) { + v.value = val + v.isSet = true +} + +func (v NullableRumWebsite) IsSet() bool { + return v.isSet +} + +func (v *NullableRumWebsite) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRumWebsite(val *RumWebsite) *NullableRumWebsite { + return &NullableRumWebsite{value: val, isSet: true} +} + +func (v NullableRumWebsite) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRumWebsite) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_rum_website_with_metric_values.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_rum_website_with_metric_values.go new file mode 100644 index 00000000..dc9eddca --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_rum_website_with_metric_values.go @@ -0,0 +1,180 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// RumWebsiteWithMetricValues struct for RumWebsiteWithMetricValues +type RumWebsiteWithMetricValues struct { + RumWebsiteId string `json:"RumWebsiteId"` + Description *string `json:"Description,omitempty"` + MetricValues []RumMetricValues `json:"MetricValues,omitempty"` +} + +// NewRumWebsiteWithMetricValues instantiates a new RumWebsiteWithMetricValues object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRumWebsiteWithMetricValues(rumWebsiteId string) *RumWebsiteWithMetricValues { + this := RumWebsiteWithMetricValues{} + this.RumWebsiteId = rumWebsiteId + return &this +} + +// NewRumWebsiteWithMetricValuesWithDefaults instantiates a new RumWebsiteWithMetricValues object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRumWebsiteWithMetricValuesWithDefaults() *RumWebsiteWithMetricValues { + this := RumWebsiteWithMetricValues{} + return &this +} + +// GetRumWebsiteId returns the RumWebsiteId field value +func (o *RumWebsiteWithMetricValues) GetRumWebsiteId() string { + if o == nil { + var ret string + return ret + } + + return o.RumWebsiteId +} + +// GetRumWebsiteIdOk returns a tuple with the RumWebsiteId field value +// and a boolean to check if the value has been set. +func (o *RumWebsiteWithMetricValues) GetRumWebsiteIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RumWebsiteId, true +} + +// SetRumWebsiteId sets field value +func (o *RumWebsiteWithMetricValues) SetRumWebsiteId(v string) { + o.RumWebsiteId = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RumWebsiteWithMetricValues) GetDescription() string { + if o == nil || isNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RumWebsiteWithMetricValues) GetDescriptionOk() (*string, bool) { + if o == nil || isNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RumWebsiteWithMetricValues) HasDescription() bool { + if o != nil && !isNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RumWebsiteWithMetricValues) SetDescription(v string) { + o.Description = &v +} + +// GetMetricValues returns the MetricValues field value if set, zero value otherwise. +func (o *RumWebsiteWithMetricValues) GetMetricValues() []RumMetricValues { + if o == nil || isNil(o.MetricValues) { + var ret []RumMetricValues + return ret + } + return o.MetricValues +} + +// GetMetricValuesOk returns a tuple with the MetricValues field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RumWebsiteWithMetricValues) GetMetricValuesOk() ([]RumMetricValues, bool) { + if o == nil || isNil(o.MetricValues) { + return nil, false + } + return o.MetricValues, true +} + +// HasMetricValues returns a boolean if a field has been set. +func (o *RumWebsiteWithMetricValues) HasMetricValues() bool { + if o != nil && !isNil(o.MetricValues) { + return true + } + + return false +} + +// SetMetricValues gets a reference to the given []RumMetricValues and assigns it to the MetricValues field. +func (o *RumWebsiteWithMetricValues) SetMetricValues(v []RumMetricValues) { + o.MetricValues = v +} + +func (o RumWebsiteWithMetricValues) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["RumWebsiteId"] = o.RumWebsiteId + } + if !isNil(o.Description) { + toSerialize["Description"] = o.Description + } + if !isNil(o.MetricValues) { + toSerialize["MetricValues"] = o.MetricValues + } + return json.Marshal(toSerialize) +} + +type NullableRumWebsiteWithMetricValues struct { + value *RumWebsiteWithMetricValues + isSet bool +} + +func (v NullableRumWebsiteWithMetricValues) Get() *RumWebsiteWithMetricValues { + return v.value +} + +func (v *NullableRumWebsiteWithMetricValues) Set(val *RumWebsiteWithMetricValues) { + v.value = val + v.isSet = true +} + +func (v NullableRumWebsiteWithMetricValues) IsSet() bool { + return v.isSet +} + +func (v *NullableRumWebsiteWithMetricValues) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRumWebsiteWithMetricValues(val *RumWebsiteWithMetricValues) *NullableRumWebsiteWithMetricValues { + return &NullableRumWebsiteWithMetricValues{value: val, isSet: true} +} + +func (v NullableRumWebsiteWithMetricValues) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRumWebsiteWithMetricValues) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_schedule.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_schedule.go index 1d57ac23..dc4739c8 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_schedule.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_schedule.go @@ -43,7 +43,7 @@ func NewScheduleWithDefaults() *Schedule { // GetScheduleType returns the ScheduleType field value if set, zero value otherwise. func (o *Schedule) GetScheduleType() ScheduleType { - if o == nil || o.ScheduleType == nil { + if o == nil || isNil(o.ScheduleType) { var ret ScheduleType return ret } @@ -53,15 +53,15 @@ func (o *Schedule) GetScheduleType() ScheduleType { // GetScheduleTypeOk returns a tuple with the ScheduleType field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Schedule) GetScheduleTypeOk() (*ScheduleType, bool) { - if o == nil || o.ScheduleType == nil { - return nil, false + if o == nil || isNil(o.ScheduleType) { + return nil, false } return o.ScheduleType, true } // HasScheduleType returns a boolean if a field has been set. func (o *Schedule) HasScheduleType() bool { - if o != nil && o.ScheduleType != nil { + if o != nil && !isNil(o.ScheduleType) { return true } @@ -75,7 +75,7 @@ func (o *Schedule) SetScheduleType(v ScheduleType) { // GetTime returns the Time field value if set, zero value otherwise. func (o *Schedule) GetTime() string { - if o == nil || o.Time == nil { + if o == nil || isNil(o.Time) { var ret string return ret } @@ -85,15 +85,15 @@ func (o *Schedule) GetTime() string { // GetTimeOk returns a tuple with the Time field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Schedule) GetTimeOk() (*string, bool) { - if o == nil || o.Time == nil { - return nil, false + if o == nil || isNil(o.Time) { + return nil, false } return o.Time, true } // HasTime returns a boolean if a field has been set. func (o *Schedule) HasTime() bool { - if o != nil && o.Time != nil { + if o != nil && !isNil(o.Time) { return true } @@ -107,7 +107,7 @@ func (o *Schedule) SetTime(v string) { // GetWeekDay returns the WeekDay field value if set, zero value otherwise. func (o *Schedule) GetWeekDay() DayOfWeek { - if o == nil || o.WeekDay == nil { + if o == nil || isNil(o.WeekDay) { var ret DayOfWeek return ret } @@ -117,15 +117,15 @@ func (o *Schedule) GetWeekDay() DayOfWeek { // GetWeekDayOk returns a tuple with the WeekDay field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Schedule) GetWeekDayOk() (*DayOfWeek, bool) { - if o == nil || o.WeekDay == nil { - return nil, false + if o == nil || isNil(o.WeekDay) { + return nil, false } return o.WeekDay, true } // HasWeekDay returns a boolean if a field has been set. func (o *Schedule) HasWeekDay() bool { - if o != nil && o.WeekDay != nil { + if o != nil && !isNil(o.WeekDay) { return true } @@ -139,7 +139,7 @@ func (o *Schedule) SetWeekDay(v DayOfWeek) { // GetMonth returns the Month field value if set, zero value otherwise. func (o *Schedule) GetMonth() int32 { - if o == nil || o.Month == nil { + if o == nil || isNil(o.Month) { var ret int32 return ret } @@ -149,15 +149,15 @@ func (o *Schedule) GetMonth() int32 { // GetMonthOk returns a tuple with the Month field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Schedule) GetMonthOk() (*int32, bool) { - if o == nil || o.Month == nil { - return nil, false + if o == nil || isNil(o.Month) { + return nil, false } return o.Month, true } // HasMonth returns a boolean if a field has been set. func (o *Schedule) HasMonth() bool { - if o != nil && o.Month != nil { + if o != nil && !isNil(o.Month) { return true } @@ -171,7 +171,7 @@ func (o *Schedule) SetMonth(v int32) { // GetMonthDay returns the MonthDay field value if set, zero value otherwise. func (o *Schedule) GetMonthDay() int32 { - if o == nil || o.MonthDay == nil { + if o == nil || isNil(o.MonthDay) { var ret int32 return ret } @@ -181,15 +181,15 @@ func (o *Schedule) GetMonthDay() int32 { // GetMonthDayOk returns a tuple with the MonthDay field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Schedule) GetMonthDayOk() (*int32, bool) { - if o == nil || o.MonthDay == nil { - return nil, false + if o == nil || isNil(o.MonthDay) { + return nil, false } return o.MonthDay, true } // HasMonthDay returns a boolean if a field has been set. func (o *Schedule) HasMonthDay() bool { - if o != nil && o.MonthDay != nil { + if o != nil && !isNil(o.MonthDay) { return true } @@ -203,7 +203,7 @@ func (o *Schedule) SetMonthDay(v int32) { // GetQuarterStartMonth returns the QuarterStartMonth field value if set, zero value otherwise. func (o *Schedule) GetQuarterStartMonth() int32 { - if o == nil || o.QuarterStartMonth == nil { + if o == nil || isNil(o.QuarterStartMonth) { var ret int32 return ret } @@ -213,15 +213,15 @@ func (o *Schedule) GetQuarterStartMonth() int32 { // GetQuarterStartMonthOk returns a tuple with the QuarterStartMonth field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Schedule) GetQuarterStartMonthOk() (*int32, bool) { - if o == nil || o.QuarterStartMonth == nil { - return nil, false + if o == nil || isNil(o.QuarterStartMonth) { + return nil, false } return o.QuarterStartMonth, true } // HasQuarterStartMonth returns a boolean if a field has been set. func (o *Schedule) HasQuarterStartMonth() bool { - if o != nil && o.QuarterStartMonth != nil { + if o != nil && !isNil(o.QuarterStartMonth) { return true } @@ -235,22 +235,22 @@ func (o *Schedule) SetQuarterStartMonth(v int32) { func (o Schedule) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.ScheduleType != nil { + if !isNil(o.ScheduleType) { toSerialize["ScheduleType"] = o.ScheduleType } - if o.Time != nil { + if !isNil(o.Time) { toSerialize["Time"] = o.Time } - if o.WeekDay != nil { + if !isNil(o.WeekDay) { toSerialize["WeekDay"] = o.WeekDay } - if o.Month != nil { + if !isNil(o.Month) { toSerialize["Month"] = o.Month } - if o.MonthDay != nil { + if !isNil(o.MonthDay) { toSerialize["MonthDay"] = o.MonthDay } - if o.QuarterStartMonth != nil { + if !isNil(o.QuarterStartMonth) { toSerialize["QuarterStartMonth"] = o.QuarterStartMonth } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_schedule_mode.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_schedule_mode.go index 391d92d8..8904a1e2 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_schedule_mode.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_schedule_mode.go @@ -26,7 +26,8 @@ const ( SCHEDULEMODE_MONTHLY ScheduleMode = "Monthly" ) -var allowedScheduleModeEnumValues = []ScheduleMode{ +// All allowed values of ScheduleMode enum +var AllowedScheduleModeEnumValues = []ScheduleMode{ "OneTime", "Daily", "Weekly", @@ -40,7 +41,7 @@ func (v *ScheduleMode) UnmarshalJSON(src []byte) error { return err } enumTypeValue := ScheduleMode(value) - for _, existing := range allowedScheduleModeEnumValues { + for _, existing := range AllowedScheduleModeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -57,13 +58,13 @@ func NewScheduleModeFromValue(v string) (*ScheduleMode, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for ScheduleMode: valid values are %v", v, allowedScheduleModeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for ScheduleMode: valid values are %v", v, AllowedScheduleModeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v ScheduleMode) IsValid() bool { - for _, existing := range allowedScheduleModeEnumValues { + for _, existing := range AllowedScheduleModeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_schedule_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_schedule_type.go index 53a95fd8..96aeed71 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_schedule_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_schedule_type.go @@ -27,7 +27,8 @@ const ( SCHEDULETYPE_YEARLY ScheduleType = "Yearly" ) -var allowedScheduleTypeEnumValues = []ScheduleType{ +// All allowed values of ScheduleType enum +var AllowedScheduleTypeEnumValues = []ScheduleType{ "Daily", "Weekly", "Monthly", @@ -42,7 +43,7 @@ func (v *ScheduleType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := ScheduleType(value) - for _, existing := range allowedScheduleTypeEnumValues { + for _, existing := range AllowedScheduleTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -59,13 +60,13 @@ func NewScheduleTypeFromValue(v string) (*ScheduleType, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for ScheduleType: valid values are %v", v, allowedScheduleTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for ScheduleType: valid values are %v", v, AllowedScheduleTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v ScheduleType) IsValid() bool { - for _, existing := range allowedScheduleTypeEnumValues { + for _, existing := range AllowedScheduleTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_scheduled_report.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_scheduled_report.go index a167a2f7..5ed599a8 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_scheduled_report.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_scheduled_report.go @@ -48,7 +48,7 @@ func NewScheduledReportWithDefaults() *ScheduledReport { // GetScheduledReportGuid returns the ScheduledReportGuid field value if set, zero value otherwise. func (o *ScheduledReport) GetScheduledReportGuid() string { - if o == nil || o.ScheduledReportGuid == nil { + if o == nil || isNil(o.ScheduledReportGuid) { var ret string return ret } @@ -58,15 +58,15 @@ func (o *ScheduledReport) GetScheduledReportGuid() string { // GetScheduledReportGuidOk returns a tuple with the ScheduledReportGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ScheduledReport) GetScheduledReportGuidOk() (*string, bool) { - if o == nil || o.ScheduledReportGuid == nil { - return nil, false + if o == nil || isNil(o.ScheduledReportGuid) { + return nil, false } return o.ScheduledReportGuid, true } // HasScheduledReportGuid returns a boolean if a field has been set. func (o *ScheduledReport) HasScheduledReportGuid() bool { - if o != nil && o.ScheduledReportGuid != nil { + if o != nil && !isNil(o.ScheduledReportGuid) { return true } @@ -80,7 +80,7 @@ func (o *ScheduledReport) SetScheduledReportGuid(v string) { // GetHash returns the Hash field value if set, zero value otherwise. func (o *ScheduledReport) GetHash() string { - if o == nil || o.Hash == nil { + if o == nil || isNil(o.Hash) { var ret string return ret } @@ -90,15 +90,15 @@ func (o *ScheduledReport) GetHash() string { // GetHashOk returns a tuple with the Hash field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ScheduledReport) GetHashOk() (*string, bool) { - if o == nil || o.Hash == nil { - return nil, false + if o == nil || isNil(o.Hash) { + return nil, false } return o.Hash, true } // HasHash returns a boolean if a field has been set. func (o *ScheduledReport) HasHash() bool { - if o != nil && o.Hash != nil { + if o != nil && !isNil(o.Hash) { return true } @@ -112,7 +112,7 @@ func (o *ScheduledReport) SetHash(v string) { // GetDashboardGuid returns the DashboardGuid field value if set, zero value otherwise. func (o *ScheduledReport) GetDashboardGuid() string { - if o == nil || o.DashboardGuid == nil { + if o == nil || isNil(o.DashboardGuid) { var ret string return ret } @@ -122,15 +122,15 @@ func (o *ScheduledReport) GetDashboardGuid() string { // GetDashboardGuidOk returns a tuple with the DashboardGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ScheduledReport) GetDashboardGuidOk() (*string, bool) { - if o == nil || o.DashboardGuid == nil { - return nil, false + if o == nil || isNil(o.DashboardGuid) { + return nil, false } return o.DashboardGuid, true } // HasDashboardGuid returns a boolean if a field has been set. func (o *ScheduledReport) HasDashboardGuid() bool { - if o != nil && o.DashboardGuid != nil { + if o != nil && !isNil(o.DashboardGuid) { return true } @@ -144,7 +144,7 @@ func (o *ScheduledReport) SetDashboardGuid(v string) { // GetDashboardGuidSpecified returns the DashboardGuidSpecified field value if set, zero value otherwise. func (o *ScheduledReport) GetDashboardGuidSpecified() bool { - if o == nil || o.DashboardGuidSpecified == nil { + if o == nil || isNil(o.DashboardGuidSpecified) { var ret bool return ret } @@ -154,15 +154,15 @@ func (o *ScheduledReport) GetDashboardGuidSpecified() bool { // GetDashboardGuidSpecifiedOk returns a tuple with the DashboardGuidSpecified field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ScheduledReport) GetDashboardGuidSpecifiedOk() (*bool, bool) { - if o == nil || o.DashboardGuidSpecified == nil { - return nil, false + if o == nil || isNil(o.DashboardGuidSpecified) { + return nil, false } return o.DashboardGuidSpecified, true } // HasDashboardGuidSpecified returns a boolean if a field has been set. func (o *ScheduledReport) HasDashboardGuidSpecified() bool { - if o != nil && o.DashboardGuidSpecified != nil { + if o != nil && !isNil(o.DashboardGuidSpecified) { return true } @@ -176,7 +176,7 @@ func (o *ScheduledReport) SetDashboardGuidSpecified(v bool) { // GetFileType returns the FileType field value if set, zero value otherwise. func (o *ScheduledReport) GetFileType() ScheduledReportFileType { - if o == nil || o.FileType == nil { + if o == nil || isNil(o.FileType) { var ret ScheduledReportFileType return ret } @@ -186,15 +186,15 @@ func (o *ScheduledReport) GetFileType() ScheduledReportFileType { // GetFileTypeOk returns a tuple with the FileType field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ScheduledReport) GetFileTypeOk() (*ScheduledReportFileType, bool) { - if o == nil || o.FileType == nil { - return nil, false + if o == nil || isNil(o.FileType) { + return nil, false } return o.FileType, true } // HasFileType returns a boolean if a field has been set. func (o *ScheduledReport) HasFileType() bool { - if o != nil && o.FileType != nil { + if o != nil && !isNil(o.FileType) { return true } @@ -208,7 +208,7 @@ func (o *ScheduledReport) SetFileType(v ScheduledReportFileType) { // GetIsActive returns the IsActive field value if set, zero value otherwise. func (o *ScheduledReport) GetIsActive() bool { - if o == nil || o.IsActive == nil { + if o == nil || isNil(o.IsActive) { var ret bool return ret } @@ -218,15 +218,15 @@ func (o *ScheduledReport) GetIsActive() bool { // GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ScheduledReport) GetIsActiveOk() (*bool, bool) { - if o == nil || o.IsActive == nil { - return nil, false + if o == nil || isNil(o.IsActive) { + return nil, false } return o.IsActive, true } // HasIsActive returns a boolean if a field has been set. func (o *ScheduledReport) HasIsActive() bool { - if o != nil && o.IsActive != nil { + if o != nil && !isNil(o.IsActive) { return true } @@ -240,7 +240,7 @@ func (o *ScheduledReport) SetIsActive(v bool) { // GetSchedule returns the Schedule field value if set, zero value otherwise. func (o *ScheduledReport) GetSchedule() Schedule { - if o == nil || o.Schedule == nil { + if o == nil || isNil(o.Schedule) { var ret Schedule return ret } @@ -250,15 +250,15 @@ func (o *ScheduledReport) GetSchedule() Schedule { // GetScheduleOk returns a tuple with the Schedule field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ScheduledReport) GetScheduleOk() (*Schedule, bool) { - if o == nil || o.Schedule == nil { - return nil, false + if o == nil || isNil(o.Schedule) { + return nil, false } return o.Schedule, true } // HasSchedule returns a boolean if a field has been set. func (o *ScheduledReport) HasSchedule() bool { - if o != nil && o.Schedule != nil { + if o != nil && !isNil(o.Schedule) { return true } @@ -272,7 +272,7 @@ func (o *ScheduledReport) SetSchedule(v Schedule) { // GetSelectedPeriod returns the SelectedPeriod field value if set, zero value otherwise. func (o *ScheduledReport) GetSelectedPeriod() PresetPeriodTypeWithExclusive { - if o == nil || o.SelectedPeriod == nil { + if o == nil || isNil(o.SelectedPeriod) { var ret PresetPeriodTypeWithExclusive return ret } @@ -282,15 +282,15 @@ func (o *ScheduledReport) GetSelectedPeriod() PresetPeriodTypeWithExclusive { // GetSelectedPeriodOk returns a tuple with the SelectedPeriod field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ScheduledReport) GetSelectedPeriodOk() (*PresetPeriodTypeWithExclusive, bool) { - if o == nil || o.SelectedPeriod == nil { - return nil, false + if o == nil || isNil(o.SelectedPeriod) { + return nil, false } return o.SelectedPeriod, true } // HasSelectedPeriod returns a boolean if a field has been set. func (o *ScheduledReport) HasSelectedPeriod() bool { - if o != nil && o.SelectedPeriod != nil { + if o != nil && !isNil(o.SelectedPeriod) { return true } @@ -304,7 +304,7 @@ func (o *ScheduledReport) SetSelectedPeriod(v PresetPeriodTypeWithExclusive) { // GetInternalNotes returns the InternalNotes field value if set, zero value otherwise. func (o *ScheduledReport) GetInternalNotes() string { - if o == nil || o.InternalNotes == nil { + if o == nil || isNil(o.InternalNotes) { var ret string return ret } @@ -314,15 +314,15 @@ func (o *ScheduledReport) GetInternalNotes() string { // GetInternalNotesOk returns a tuple with the InternalNotes field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ScheduledReport) GetInternalNotesOk() (*string, bool) { - if o == nil || o.InternalNotes == nil { - return nil, false + if o == nil || isNil(o.InternalNotes) { + return nil, false } return o.InternalNotes, true } // HasInternalNotes returns a boolean if a field has been set. func (o *ScheduledReport) HasInternalNotes() bool { - if o != nil && o.InternalNotes != nil { + if o != nil && !isNil(o.InternalNotes) { return true } @@ -336,7 +336,7 @@ func (o *ScheduledReport) SetInternalNotes(v string) { // GetNotes returns the Notes field value if set, zero value otherwise. func (o *ScheduledReport) GetNotes() string { - if o == nil || o.Notes == nil { + if o == nil || isNil(o.Notes) { var ret string return ret } @@ -346,15 +346,15 @@ func (o *ScheduledReport) GetNotes() string { // GetNotesOk returns a tuple with the Notes field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ScheduledReport) GetNotesOk() (*string, bool) { - if o == nil || o.Notes == nil { - return nil, false + if o == nil || isNil(o.Notes) { + return nil, false } return o.Notes, true } // HasNotes returns a boolean if a field has been set. func (o *ScheduledReport) HasNotes() bool { - if o != nil && o.Notes != nil { + if o != nil && !isNil(o.Notes) { return true } @@ -368,7 +368,7 @@ func (o *ScheduledReport) SetNotes(v string) { // GetRecipients returns the Recipients field value if set, zero value otherwise. func (o *ScheduledReport) GetRecipients() Recipients { - if o == nil || o.Recipients == nil { + if o == nil || isNil(o.Recipients) { var ret Recipients return ret } @@ -378,15 +378,15 @@ func (o *ScheduledReport) GetRecipients() Recipients { // GetRecipientsOk returns a tuple with the Recipients field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ScheduledReport) GetRecipientsOk() (*Recipients, bool) { - if o == nil || o.Recipients == nil { - return nil, false + if o == nil || isNil(o.Recipients) { + return nil, false } return o.Recipients, true } // HasRecipients returns a boolean if a field has been set. func (o *ScheduledReport) HasRecipients() bool { - if o != nil && o.Recipients != nil { + if o != nil && !isNil(o.Recipients) { return true } @@ -400,37 +400,37 @@ func (o *ScheduledReport) SetRecipients(v Recipients) { func (o ScheduledReport) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.ScheduledReportGuid != nil { + if !isNil(o.ScheduledReportGuid) { toSerialize["ScheduledReportGuid"] = o.ScheduledReportGuid } - if o.Hash != nil { + if !isNil(o.Hash) { toSerialize["Hash"] = o.Hash } - if o.DashboardGuid != nil { + if !isNil(o.DashboardGuid) { toSerialize["DashboardGuid"] = o.DashboardGuid } - if o.DashboardGuidSpecified != nil { + if !isNil(o.DashboardGuidSpecified) { toSerialize["DashboardGuidSpecified"] = o.DashboardGuidSpecified } - if o.FileType != nil { + if !isNil(o.FileType) { toSerialize["FileType"] = o.FileType } - if o.IsActive != nil { + if !isNil(o.IsActive) { toSerialize["IsActive"] = o.IsActive } - if o.Schedule != nil { + if !isNil(o.Schedule) { toSerialize["Schedule"] = o.Schedule } - if o.SelectedPeriod != nil { + if !isNil(o.SelectedPeriod) { toSerialize["SelectedPeriod"] = o.SelectedPeriod } - if o.InternalNotes != nil { + if !isNil(o.InternalNotes) { toSerialize["InternalNotes"] = o.InternalNotes } - if o.Notes != nil { + if !isNil(o.Notes) { toSerialize["Notes"] = o.Notes } - if o.Recipients != nil { + if !isNil(o.Recipients) { toSerialize["Recipients"] = o.Recipients } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_scheduled_report_file_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_scheduled_report_file_type.go index ab7b561c..2367d8f9 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_scheduled_report_file_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_scheduled_report_file_type.go @@ -15,19 +15,24 @@ import ( "fmt" ) -// ScheduledReportFileType +// ScheduledReportFileType Scheduled report file type type ScheduledReportFileType string // List of ScheduledReportFileType const ( - SCHEDULEDREPORTFILETYPE_PDF ScheduledReportFileType = "PDF" - SCHEDULEDREPORTFILETYPE_EXCEL ScheduledReportFileType = "Excel" + SCHEDULEDREPORTFILETYPE_PDF_ATTACHMENT ScheduledReportFileType = "PDFAttachment" + SCHEDULEDREPORTFILETYPE_PDF_LINK ScheduledReportFileType = "PDFLink" + SCHEDULEDREPORTFILETYPE_EXCEL_ATTACHMENT ScheduledReportFileType = "ExcelAttachment" + SCHEDULEDREPORTFILETYPE_EXCEL_LINK ScheduledReportFileType = "ExcelLink" SCHEDULEDREPORTFILETYPE_HTML ScheduledReportFileType = "Html" ) -var allowedScheduledReportFileTypeEnumValues = []ScheduledReportFileType{ - "PDF", - "Excel", +// All allowed values of ScheduledReportFileType enum +var AllowedScheduledReportFileTypeEnumValues = []ScheduledReportFileType{ + "PDFAttachment", + "PDFLink", + "ExcelAttachment", + "ExcelLink", "Html", } @@ -38,7 +43,7 @@ func (v *ScheduledReportFileType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := ScheduledReportFileType(value) - for _, existing := range allowedScheduledReportFileTypeEnumValues { + for _, existing := range AllowedScheduledReportFileTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -55,13 +60,13 @@ func NewScheduledReportFileTypeFromValue(v string) (*ScheduledReportFileType, er if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for ScheduledReportFileType: valid values are %v", v, allowedScheduledReportFileTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for ScheduledReportFileType: valid values are %v", v, AllowedScheduledReportFileTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v ScheduledReportFileType) IsValid() bool { - for _, existing := range allowedScheduledReportFileTypeEnumValues { + for _, existing := range AllowedScheduledReportFileTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_screenshot_response.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_screenshot_response.go index 0fbdf32b..7664cd98 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_screenshot_response.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_screenshot_response.go @@ -16,10 +16,12 @@ import ( // ScreenshotResponse struct for ScreenshotResponse type ScreenshotResponse struct { + // The resposne data/monitor checks Data *string `json:"Data,omitempty"` - Links *LinksData `json:"Links,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` - Meta *MetaData `json:"Meta,omitempty"` + Links *StatisticsResponseLinks `json:"Links,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + Meta *StatisticsResponseMeta `json:"Meta,omitempty"` } // NewScreenshotResponse instantiates a new ScreenshotResponse object @@ -41,7 +43,7 @@ func NewScreenshotResponseWithDefaults() *ScreenshotResponse { // GetData returns the Data field value if set, zero value otherwise. func (o *ScreenshotResponse) GetData() string { - if o == nil || o.Data == nil { + if o == nil || isNil(o.Data) { var ret string return ret } @@ -51,15 +53,15 @@ func (o *ScreenshotResponse) GetData() string { // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ScreenshotResponse) GetDataOk() (*string, bool) { - if o == nil || o.Data == nil { - return nil, false + if o == nil || isNil(o.Data) { + return nil, false } return o.Data, true } // HasData returns a boolean if a field has been set. func (o *ScreenshotResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && !isNil(o.Data) { return true } @@ -72,9 +74,9 @@ func (o *ScreenshotResponse) SetData(v string) { } // GetLinks returns the Links field value if set, zero value otherwise. -func (o *ScreenshotResponse) GetLinks() LinksData { - if o == nil || o.Links == nil { - var ret LinksData +func (o *ScreenshotResponse) GetLinks() StatisticsResponseLinks { + if o == nil || isNil(o.Links) { + var ret StatisticsResponseLinks return ret } return *o.Links @@ -82,48 +84,48 @@ func (o *ScreenshotResponse) GetLinks() LinksData { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ScreenshotResponse) GetLinksOk() (*LinksData, bool) { - if o == nil || o.Links == nil { - return nil, false +func (o *ScreenshotResponse) GetLinksOk() (*StatisticsResponseLinks, bool) { + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *ScreenshotResponse) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } return false } -// SetLinks gets a reference to the given LinksData and assigns it to the Links field. -func (o *ScreenshotResponse) SetLinks(v LinksData) { +// SetLinks gets a reference to the given StatisticsResponseLinks and assigns it to the Links field. +func (o *ScreenshotResponse) SetLinks(v StatisticsResponseLinks) { o.Links = &v } // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *ScreenshotResponse) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ScreenshotResponse) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *ScreenshotResponse) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *ScreenshotResponse) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -132,13 +134,13 @@ func (o *ScreenshotResponse) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *ScreenshotResponse) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetMeta returns the Meta field value if set, zero value otherwise. -func (o *ScreenshotResponse) GetMeta() MetaData { - if o == nil || o.Meta == nil { - var ret MetaData +func (o *ScreenshotResponse) GetMeta() StatisticsResponseMeta { + if o == nil || isNil(o.Meta) { + var ret StatisticsResponseMeta return ret } return *o.Meta @@ -146,39 +148,39 @@ func (o *ScreenshotResponse) GetMeta() MetaData { // GetMetaOk returns a tuple with the Meta field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ScreenshotResponse) GetMetaOk() (*MetaData, bool) { - if o == nil || o.Meta == nil { - return nil, false +func (o *ScreenshotResponse) GetMetaOk() (*StatisticsResponseMeta, bool) { + if o == nil || isNil(o.Meta) { + return nil, false } return o.Meta, true } // HasMeta returns a boolean if a field has been set. func (o *ScreenshotResponse) HasMeta() bool { - if o != nil && o.Meta != nil { + if o != nil && !isNil(o.Meta) { return true } return false } -// SetMeta gets a reference to the given MetaData and assigns it to the Meta field. -func (o *ScreenshotResponse) SetMeta(v MetaData) { +// SetMeta gets a reference to the given StatisticsResponseMeta and assigns it to the Meta field. +func (o *ScreenshotResponse) SetMeta(v StatisticsResponseMeta) { o.Meta = &v } func (o ScreenshotResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Data != nil { + if !isNil(o.Data) { toSerialize["Data"] = o.Data } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Meta != nil { + if !isNil(o.Meta) { toSerialize["Meta"] = o.Meta } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_selected_checkpoints.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_selected_checkpoints.go index c9e807db..5cf1b52d 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_selected_checkpoints.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_selected_checkpoints.go @@ -16,9 +16,9 @@ import ( // SelectedCheckpoints struct for SelectedCheckpoints type SelectedCheckpoints struct { - Checkpoints *[]int32 `json:"Checkpoints,omitempty"` - Regions *[]int32 `json:"Regions,omitempty"` - ExcludeLocations *[]int32 `json:"ExcludeLocations,omitempty"` + Checkpoints []int32 `json:"Checkpoints,omitempty"` + Regions []int32 `json:"Regions,omitempty"` + ExcludeLocations []int32 `json:"ExcludeLocations,omitempty"` } // NewSelectedCheckpoints instantiates a new SelectedCheckpoints object @@ -40,25 +40,25 @@ func NewSelectedCheckpointsWithDefaults() *SelectedCheckpoints { // GetCheckpoints returns the Checkpoints field value if set, zero value otherwise. func (o *SelectedCheckpoints) GetCheckpoints() []int32 { - if o == nil || o.Checkpoints == nil { + if o == nil || isNil(o.Checkpoints) { var ret []int32 return ret } - return *o.Checkpoints + return o.Checkpoints } // GetCheckpointsOk returns a tuple with the Checkpoints field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SelectedCheckpoints) GetCheckpointsOk() (*[]int32, bool) { - if o == nil || o.Checkpoints == nil { - return nil, false +func (o *SelectedCheckpoints) GetCheckpointsOk() ([]int32, bool) { + if o == nil || isNil(o.Checkpoints) { + return nil, false } return o.Checkpoints, true } // HasCheckpoints returns a boolean if a field has been set. func (o *SelectedCheckpoints) HasCheckpoints() bool { - if o != nil && o.Checkpoints != nil { + if o != nil && !isNil(o.Checkpoints) { return true } @@ -67,30 +67,30 @@ func (o *SelectedCheckpoints) HasCheckpoints() bool { // SetCheckpoints gets a reference to the given []int32 and assigns it to the Checkpoints field. func (o *SelectedCheckpoints) SetCheckpoints(v []int32) { - o.Checkpoints = &v + o.Checkpoints = v } // GetRegions returns the Regions field value if set, zero value otherwise. func (o *SelectedCheckpoints) GetRegions() []int32 { - if o == nil || o.Regions == nil { + if o == nil || isNil(o.Regions) { var ret []int32 return ret } - return *o.Regions + return o.Regions } // GetRegionsOk returns a tuple with the Regions field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SelectedCheckpoints) GetRegionsOk() (*[]int32, bool) { - if o == nil || o.Regions == nil { - return nil, false +func (o *SelectedCheckpoints) GetRegionsOk() ([]int32, bool) { + if o == nil || isNil(o.Regions) { + return nil, false } return o.Regions, true } // HasRegions returns a boolean if a field has been set. func (o *SelectedCheckpoints) HasRegions() bool { - if o != nil && o.Regions != nil { + if o != nil && !isNil(o.Regions) { return true } @@ -99,30 +99,30 @@ func (o *SelectedCheckpoints) HasRegions() bool { // SetRegions gets a reference to the given []int32 and assigns it to the Regions field. func (o *SelectedCheckpoints) SetRegions(v []int32) { - o.Regions = &v + o.Regions = v } // GetExcludeLocations returns the ExcludeLocations field value if set, zero value otherwise. func (o *SelectedCheckpoints) GetExcludeLocations() []int32 { - if o == nil || o.ExcludeLocations == nil { + if o == nil || isNil(o.ExcludeLocations) { var ret []int32 return ret } - return *o.ExcludeLocations + return o.ExcludeLocations } // GetExcludeLocationsOk returns a tuple with the ExcludeLocations field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SelectedCheckpoints) GetExcludeLocationsOk() (*[]int32, bool) { - if o == nil || o.ExcludeLocations == nil { - return nil, false +func (o *SelectedCheckpoints) GetExcludeLocationsOk() ([]int32, bool) { + if o == nil || isNil(o.ExcludeLocations) { + return nil, false } return o.ExcludeLocations, true } // HasExcludeLocations returns a boolean if a field has been set. func (o *SelectedCheckpoints) HasExcludeLocations() bool { - if o != nil && o.ExcludeLocations != nil { + if o != nil && !isNil(o.ExcludeLocations) { return true } @@ -131,18 +131,18 @@ func (o *SelectedCheckpoints) HasExcludeLocations() bool { // SetExcludeLocations gets a reference to the given []int32 and assigns it to the ExcludeLocations field. func (o *SelectedCheckpoints) SetExcludeLocations(v []int32) { - o.ExcludeLocations = &v + o.ExcludeLocations = v } func (o SelectedCheckpoints) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Checkpoints != nil { + if !isNil(o.Checkpoints) { toSerialize["Checkpoints"] = o.Checkpoints } - if o.Regions != nil { + if !isNil(o.Regions) { toSerialize["Regions"] = o.Regions } - if o.ExcludeLocations != nil { + if !isNil(o.ExcludeLocations) { toSerialize["ExcludeLocations"] = o.ExcludeLocations } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_selected_period.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_selected_period.go index b0278f63..1e1f58e1 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_selected_period.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_selected_period.go @@ -12,7 +12,6 @@ package uptrends import ( "encoding/json" - "time" ) // SelectedPeriod struct for SelectedPeriod @@ -20,9 +19,9 @@ type SelectedPeriod struct { // The type of period SelectedPeriodType *SelectedPeriodType `json:"SelectedPeriodType,omitempty"` // The start of a custom period (can't be used together with the SelectedPeriodType parameter) - Start *time.Time `json:"Start,omitempty"` + Start map[string]interface{} `json:"Start,omitempty"` // The end of a custom period - End *time.Time `json:"End,omitempty"` + End map[string]interface{} `json:"End,omitempty"` // The requested time period. PresetPeriod *PresetPeriodType `json:"PresetPeriod,omitempty"` } @@ -46,7 +45,7 @@ func NewSelectedPeriodWithDefaults() *SelectedPeriod { // GetSelectedPeriodType returns the SelectedPeriodType field value if set, zero value otherwise. func (o *SelectedPeriod) GetSelectedPeriodType() SelectedPeriodType { - if o == nil || o.SelectedPeriodType == nil { + if o == nil || isNil(o.SelectedPeriodType) { var ret SelectedPeriodType return ret } @@ -56,15 +55,15 @@ func (o *SelectedPeriod) GetSelectedPeriodType() SelectedPeriodType { // GetSelectedPeriodTypeOk returns a tuple with the SelectedPeriodType field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SelectedPeriod) GetSelectedPeriodTypeOk() (*SelectedPeriodType, bool) { - if o == nil || o.SelectedPeriodType == nil { - return nil, false + if o == nil || isNil(o.SelectedPeriodType) { + return nil, false } return o.SelectedPeriodType, true } // HasSelectedPeriodType returns a boolean if a field has been set. func (o *SelectedPeriod) HasSelectedPeriodType() bool { - if o != nil && o.SelectedPeriodType != nil { + if o != nil && !isNil(o.SelectedPeriodType) { return true } @@ -77,72 +76,72 @@ func (o *SelectedPeriod) SetSelectedPeriodType(v SelectedPeriodType) { } // GetStart returns the Start field value if set, zero value otherwise. -func (o *SelectedPeriod) GetStart() time.Time { - if o == nil || o.Start == nil { - var ret time.Time +func (o *SelectedPeriod) GetStart() map[string]interface{} { + if o == nil || isNil(o.Start) { + var ret map[string]interface{} return ret } - return *o.Start + return o.Start } // GetStartOk returns a tuple with the Start field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SelectedPeriod) GetStartOk() (*time.Time, bool) { - if o == nil || o.Start == nil { - return nil, false +func (o *SelectedPeriod) GetStartOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.Start) { + return map[string]interface{}{}, false } return o.Start, true } // HasStart returns a boolean if a field has been set. func (o *SelectedPeriod) HasStart() bool { - if o != nil && o.Start != nil { + if o != nil && !isNil(o.Start) { return true } return false } -// SetStart gets a reference to the given time.Time and assigns it to the Start field. -func (o *SelectedPeriod) SetStart(v time.Time) { - o.Start = &v +// SetStart gets a reference to the given map[string]interface{} and assigns it to the Start field. +func (o *SelectedPeriod) SetStart(v map[string]interface{}) { + o.Start = v } // GetEnd returns the End field value if set, zero value otherwise. -func (o *SelectedPeriod) GetEnd() time.Time { - if o == nil || o.End == nil { - var ret time.Time +func (o *SelectedPeriod) GetEnd() map[string]interface{} { + if o == nil || isNil(o.End) { + var ret map[string]interface{} return ret } - return *o.End + return o.End } // GetEndOk returns a tuple with the End field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SelectedPeriod) GetEndOk() (*time.Time, bool) { - if o == nil || o.End == nil { - return nil, false +func (o *SelectedPeriod) GetEndOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.End) { + return map[string]interface{}{}, false } return o.End, true } // HasEnd returns a boolean if a field has been set. func (o *SelectedPeriod) HasEnd() bool { - if o != nil && o.End != nil { + if o != nil && !isNil(o.End) { return true } return false } -// SetEnd gets a reference to the given time.Time and assigns it to the End field. -func (o *SelectedPeriod) SetEnd(v time.Time) { - o.End = &v +// SetEnd gets a reference to the given map[string]interface{} and assigns it to the End field. +func (o *SelectedPeriod) SetEnd(v map[string]interface{}) { + o.End = v } // GetPresetPeriod returns the PresetPeriod field value if set, zero value otherwise. func (o *SelectedPeriod) GetPresetPeriod() PresetPeriodType { - if o == nil || o.PresetPeriod == nil { + if o == nil || isNil(o.PresetPeriod) { var ret PresetPeriodType return ret } @@ -152,15 +151,15 @@ func (o *SelectedPeriod) GetPresetPeriod() PresetPeriodType { // GetPresetPeriodOk returns a tuple with the PresetPeriod field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SelectedPeriod) GetPresetPeriodOk() (*PresetPeriodType, bool) { - if o == nil || o.PresetPeriod == nil { - return nil, false + if o == nil || isNil(o.PresetPeriod) { + return nil, false } return o.PresetPeriod, true } // HasPresetPeriod returns a boolean if a field has been set. func (o *SelectedPeriod) HasPresetPeriod() bool { - if o != nil && o.PresetPeriod != nil { + if o != nil && !isNil(o.PresetPeriod) { return true } @@ -174,16 +173,16 @@ func (o *SelectedPeriod) SetPresetPeriod(v PresetPeriodType) { func (o SelectedPeriod) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.SelectedPeriodType != nil { + if !isNil(o.SelectedPeriodType) { toSerialize["SelectedPeriodType"] = o.SelectedPeriodType } - if o.Start != nil { + if !isNil(o.Start) { toSerialize["Start"] = o.Start } - if o.End != nil { + if !isNil(o.End) { toSerialize["End"] = o.End } - if o.PresetPeriod != nil { + if !isNil(o.PresetPeriod) { toSerialize["PresetPeriod"] = o.PresetPeriod } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_selected_period_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_selected_period_type.go index 6a92c4b7..c04c85a7 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_selected_period_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_selected_period_type.go @@ -24,7 +24,8 @@ const ( SELECTEDPERIODTYPE_SPECIFIC_DATES SelectedPeriodType = "SpecificDates" ) -var allowedSelectedPeriodTypeEnumValues = []SelectedPeriodType{ +// All allowed values of SelectedPeriodType enum +var AllowedSelectedPeriodTypeEnumValues = []SelectedPeriodType{ "PresetPeriod", "SpecificDates", } @@ -36,7 +37,7 @@ func (v *SelectedPeriodType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := SelectedPeriodType(value) - for _, existing := range allowedSelectedPeriodTypeEnumValues { + for _, existing := range AllowedSelectedPeriodTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -53,13 +54,13 @@ func NewSelectedPeriodTypeFromValue(v string) (*SelectedPeriodType, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for SelectedPeriodType: valid values are %v", v, allowedSelectedPeriodTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for SelectedPeriodType: valid values are %v", v, AllowedSelectedPeriodTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v SelectedPeriodType) IsValid() bool { - for _, existing := range allowedSelectedPeriodTypeEnumValues { + for _, existing := range AllowedSelectedPeriodTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_server_health.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_server_health.go new file mode 100644 index 00000000..794c511e --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_server_health.go @@ -0,0 +1,189 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// ServerHealth ServerHealth +type ServerHealth struct { + // The name of the checkpoint + CheckpointName *string `json:"CheckpointName,omitempty"` + // The status of the server + Status *string `json:"Status,omitempty"` + StatusDetails *ServerHealthStatusDetails `json:"StatusDetails,omitempty"` +} + +// NewServerHealth instantiates a new ServerHealth object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerHealth() *ServerHealth { + this := ServerHealth{} + return &this +} + +// NewServerHealthWithDefaults instantiates a new ServerHealth object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerHealthWithDefaults() *ServerHealth { + this := ServerHealth{} + return &this +} + +// GetCheckpointName returns the CheckpointName field value if set, zero value otherwise. +func (o *ServerHealth) GetCheckpointName() string { + if o == nil || isNil(o.CheckpointName) { + var ret string + return ret + } + return *o.CheckpointName +} + +// GetCheckpointNameOk returns a tuple with the CheckpointName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerHealth) GetCheckpointNameOk() (*string, bool) { + if o == nil || isNil(o.CheckpointName) { + return nil, false + } + return o.CheckpointName, true +} + +// HasCheckpointName returns a boolean if a field has been set. +func (o *ServerHealth) HasCheckpointName() bool { + if o != nil && !isNil(o.CheckpointName) { + return true + } + + return false +} + +// SetCheckpointName gets a reference to the given string and assigns it to the CheckpointName field. +func (o *ServerHealth) SetCheckpointName(v string) { + o.CheckpointName = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *ServerHealth) GetStatus() string { + if o == nil || isNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerHealth) GetStatusOk() (*string, bool) { + if o == nil || isNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *ServerHealth) HasStatus() bool { + if o != nil && !isNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *ServerHealth) SetStatus(v string) { + o.Status = &v +} + +// GetStatusDetails returns the StatusDetails field value if set, zero value otherwise. +func (o *ServerHealth) GetStatusDetails() ServerHealthStatusDetails { + if o == nil || isNil(o.StatusDetails) { + var ret ServerHealthStatusDetails + return ret + } + return *o.StatusDetails +} + +// GetStatusDetailsOk returns a tuple with the StatusDetails field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerHealth) GetStatusDetailsOk() (*ServerHealthStatusDetails, bool) { + if o == nil || isNil(o.StatusDetails) { + return nil, false + } + return o.StatusDetails, true +} + +// HasStatusDetails returns a boolean if a field has been set. +func (o *ServerHealth) HasStatusDetails() bool { + if o != nil && !isNil(o.StatusDetails) { + return true + } + + return false +} + +// SetStatusDetails gets a reference to the given ServerHealthStatusDetails and assigns it to the StatusDetails field. +func (o *ServerHealth) SetStatusDetails(v ServerHealthStatusDetails) { + o.StatusDetails = &v +} + +func (o ServerHealth) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.CheckpointName) { + toSerialize["CheckpointName"] = o.CheckpointName + } + if !isNil(o.Status) { + toSerialize["Status"] = o.Status + } + if !isNil(o.StatusDetails) { + toSerialize["StatusDetails"] = o.StatusDetails + } + return json.Marshal(toSerialize) +} + +type NullableServerHealth struct { + value *ServerHealth + isSet bool +} + +func (v NullableServerHealth) Get() *ServerHealth { + return v.value +} + +func (v *NullableServerHealth) Set(val *ServerHealth) { + v.value = val + v.isSet = true +} + +func (v NullableServerHealth) IsSet() bool { + return v.isSet +} + +func (v *NullableServerHealth) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerHealth(val *ServerHealth) *NullableServerHealth { + return &NullableServerHealth{value: val, isSet: true} +} + +func (v NullableServerHealth) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerHealth) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_server_health_status_details.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_server_health_status_details.go new file mode 100644 index 00000000..556cd1c0 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_server_health_status_details.go @@ -0,0 +1,116 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// ServerHealthStatusDetails The detailed status of the server +type ServerHealthStatusDetails struct { + // The UTC time the server was last online + LastOnlineUtc map[string]interface{} `json:"LastOnlineUtc,omitempty"` +} + +// NewServerHealthStatusDetails instantiates a new ServerHealthStatusDetails object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerHealthStatusDetails() *ServerHealthStatusDetails { + this := ServerHealthStatusDetails{} + return &this +} + +// NewServerHealthStatusDetailsWithDefaults instantiates a new ServerHealthStatusDetails object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerHealthStatusDetailsWithDefaults() *ServerHealthStatusDetails { + this := ServerHealthStatusDetails{} + return &this +} + +// GetLastOnlineUtc returns the LastOnlineUtc field value if set, zero value otherwise. +func (o *ServerHealthStatusDetails) GetLastOnlineUtc() map[string]interface{} { + if o == nil || isNil(o.LastOnlineUtc) { + var ret map[string]interface{} + return ret + } + return o.LastOnlineUtc +} + +// GetLastOnlineUtcOk returns a tuple with the LastOnlineUtc field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerHealthStatusDetails) GetLastOnlineUtcOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.LastOnlineUtc) { + return map[string]interface{}{}, false + } + return o.LastOnlineUtc, true +} + +// HasLastOnlineUtc returns a boolean if a field has been set. +func (o *ServerHealthStatusDetails) HasLastOnlineUtc() bool { + if o != nil && !isNil(o.LastOnlineUtc) { + return true + } + + return false +} + +// SetLastOnlineUtc gets a reference to the given map[string]interface{} and assigns it to the LastOnlineUtc field. +func (o *ServerHealthStatusDetails) SetLastOnlineUtc(v map[string]interface{}) { + o.LastOnlineUtc = v +} + +func (o ServerHealthStatusDetails) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.LastOnlineUtc) { + toSerialize["LastOnlineUtc"] = o.LastOnlineUtc + } + return json.Marshal(toSerialize) +} + +type NullableServerHealthStatusDetails struct { + value *ServerHealthStatusDetails + isSet bool +} + +func (v NullableServerHealthStatusDetails) Get() *ServerHealthStatusDetails { + return v.value +} + +func (v *NullableServerHealthStatusDetails) Set(val *ServerHealthStatusDetails) { + v.value = val + v.isSet = true +} + +func (v NullableServerHealthStatusDetails) IsSet() bool { + return v.isSet +} + +func (v *NullableServerHealthStatusDetails) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerHealthStatusDetails(val *ServerHealthStatusDetails) *NullableServerHealthStatusDetails { + return &NullableServerHealthStatusDetails{value: val, isSet: true} +} + +func (v NullableServerHealthStatusDetails) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerHealthStatusDetails) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_server_status_details.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_server_status_details.go new file mode 100644 index 00000000..c94fd613 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_server_status_details.go @@ -0,0 +1,116 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// ServerStatusDetails ServerStatusDetails +type ServerStatusDetails struct { + // The UTC time the server was last online + LastOnlineUtc map[string]interface{} `json:"LastOnlineUtc,omitempty"` +} + +// NewServerStatusDetails instantiates a new ServerStatusDetails object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerStatusDetails() *ServerStatusDetails { + this := ServerStatusDetails{} + return &this +} + +// NewServerStatusDetailsWithDefaults instantiates a new ServerStatusDetails object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerStatusDetailsWithDefaults() *ServerStatusDetails { + this := ServerStatusDetails{} + return &this +} + +// GetLastOnlineUtc returns the LastOnlineUtc field value if set, zero value otherwise. +func (o *ServerStatusDetails) GetLastOnlineUtc() map[string]interface{} { + if o == nil || isNil(o.LastOnlineUtc) { + var ret map[string]interface{} + return ret + } + return o.LastOnlineUtc +} + +// GetLastOnlineUtcOk returns a tuple with the LastOnlineUtc field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerStatusDetails) GetLastOnlineUtcOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.LastOnlineUtc) { + return map[string]interface{}{}, false + } + return o.LastOnlineUtc, true +} + +// HasLastOnlineUtc returns a boolean if a field has been set. +func (o *ServerStatusDetails) HasLastOnlineUtc() bool { + if o != nil && !isNil(o.LastOnlineUtc) { + return true + } + + return false +} + +// SetLastOnlineUtc gets a reference to the given map[string]interface{} and assigns it to the LastOnlineUtc field. +func (o *ServerStatusDetails) SetLastOnlineUtc(v map[string]interface{}) { + o.LastOnlineUtc = v +} + +func (o ServerStatusDetails) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.LastOnlineUtc) { + toSerialize["LastOnlineUtc"] = o.LastOnlineUtc + } + return json.Marshal(toSerialize) +} + +type NullableServerStatusDetails struct { + value *ServerStatusDetails + isSet bool +} + +func (v NullableServerStatusDetails) Get() *ServerStatusDetails { + return v.value +} + +func (v *NullableServerStatusDetails) Set(val *ServerStatusDetails) { + v.value = val + v.isSet = true +} + +func (v NullableServerStatusDetails) IsSet() bool { + return v.isSet +} + +func (v *NullableServerStatusDetails) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerStatusDetails(val *ServerStatusDetails) *NullableServerStatusDetails { + return &NullableServerStatusDetails{value: val, isSet: true} +} + +func (v NullableServerStatusDetails) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerStatusDetails) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_sftp_action.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_sftp_action.go index fa78cba9..034af4c9 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_sftp_action.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_sftp_action.go @@ -26,7 +26,8 @@ const ( SFTPACTION_DOWN_LOAD_FILE SftpAction = "DownLoadFile" ) -var allowedSftpActionEnumValues = []SftpAction{ +// All allowed values of SftpAction enum +var AllowedSftpActionEnumValues = []SftpAction{ "ConnectOnly", "TestFileExists", "TestFileDoesNotExist", @@ -40,7 +41,7 @@ func (v *SftpAction) UnmarshalJSON(src []byte) error { return err } enumTypeValue := SftpAction(value) - for _, existing := range allowedSftpActionEnumValues { + for _, existing := range AllowedSftpActionEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -57,13 +58,13 @@ func NewSftpActionFromValue(v string) (*SftpAction, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for SftpAction: valid values are %v", v, allowedSftpActionEnumValues) + return nil, fmt.Errorf("invalid value '%v' for SftpAction: valid values are %v", v, AllowedSftpActionEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v SftpAction) IsValid() bool { - for _, existing := range allowedSftpActionEnumValues { + for _, existing := range AllowedSftpActionEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_single_monitor_check_response.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_single_monitor_check_response.go index e8ff1bf2..3627ee08 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_single_monitor_check_response.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_single_monitor_check_response.go @@ -16,10 +16,11 @@ import ( // SingleMonitorCheckResponse struct for SingleMonitorCheckResponse type SingleMonitorCheckResponse struct { - Data *MonitorCheck `json:"Data,omitempty"` - Links *LinksData `json:"Links,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` - Meta *MetaData `json:"Meta,omitempty"` + Data *SingleMonitorCheckResponseData `json:"Data,omitempty"` + Links *StatisticsResponseLinks `json:"Links,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + Meta *StatisticsResponseMeta `json:"Meta,omitempty"` } // NewSingleMonitorCheckResponse instantiates a new SingleMonitorCheckResponse object @@ -40,9 +41,9 @@ func NewSingleMonitorCheckResponseWithDefaults() *SingleMonitorCheckResponse { } // GetData returns the Data field value if set, zero value otherwise. -func (o *SingleMonitorCheckResponse) GetData() MonitorCheck { - if o == nil || o.Data == nil { - var ret MonitorCheck +func (o *SingleMonitorCheckResponse) GetData() SingleMonitorCheckResponseData { + if o == nil || isNil(o.Data) { + var ret SingleMonitorCheckResponseData return ret } return *o.Data @@ -50,31 +51,31 @@ func (o *SingleMonitorCheckResponse) GetData() MonitorCheck { // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SingleMonitorCheckResponse) GetDataOk() (*MonitorCheck, bool) { - if o == nil || o.Data == nil { - return nil, false +func (o *SingleMonitorCheckResponse) GetDataOk() (*SingleMonitorCheckResponseData, bool) { + if o == nil || isNil(o.Data) { + return nil, false } return o.Data, true } // HasData returns a boolean if a field has been set. func (o *SingleMonitorCheckResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && !isNil(o.Data) { return true } return false } -// SetData gets a reference to the given MonitorCheck and assigns it to the Data field. -func (o *SingleMonitorCheckResponse) SetData(v MonitorCheck) { +// SetData gets a reference to the given SingleMonitorCheckResponseData and assigns it to the Data field. +func (o *SingleMonitorCheckResponse) SetData(v SingleMonitorCheckResponseData) { o.Data = &v } // GetLinks returns the Links field value if set, zero value otherwise. -func (o *SingleMonitorCheckResponse) GetLinks() LinksData { - if o == nil || o.Links == nil { - var ret LinksData +func (o *SingleMonitorCheckResponse) GetLinks() StatisticsResponseLinks { + if o == nil || isNil(o.Links) { + var ret StatisticsResponseLinks return ret } return *o.Links @@ -82,48 +83,48 @@ func (o *SingleMonitorCheckResponse) GetLinks() LinksData { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SingleMonitorCheckResponse) GetLinksOk() (*LinksData, bool) { - if o == nil || o.Links == nil { - return nil, false +func (o *SingleMonitorCheckResponse) GetLinksOk() (*StatisticsResponseLinks, bool) { + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *SingleMonitorCheckResponse) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } return false } -// SetLinks gets a reference to the given LinksData and assigns it to the Links field. -func (o *SingleMonitorCheckResponse) SetLinks(v LinksData) { +// SetLinks gets a reference to the given StatisticsResponseLinks and assigns it to the Links field. +func (o *SingleMonitorCheckResponse) SetLinks(v StatisticsResponseLinks) { o.Links = &v } // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *SingleMonitorCheckResponse) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SingleMonitorCheckResponse) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *SingleMonitorCheckResponse) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *SingleMonitorCheckResponse) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -132,13 +133,13 @@ func (o *SingleMonitorCheckResponse) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *SingleMonitorCheckResponse) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetMeta returns the Meta field value if set, zero value otherwise. -func (o *SingleMonitorCheckResponse) GetMeta() MetaData { - if o == nil || o.Meta == nil { - var ret MetaData +func (o *SingleMonitorCheckResponse) GetMeta() StatisticsResponseMeta { + if o == nil || isNil(o.Meta) { + var ret StatisticsResponseMeta return ret } return *o.Meta @@ -146,39 +147,39 @@ func (o *SingleMonitorCheckResponse) GetMeta() MetaData { // GetMetaOk returns a tuple with the Meta field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SingleMonitorCheckResponse) GetMetaOk() (*MetaData, bool) { - if o == nil || o.Meta == nil { - return nil, false +func (o *SingleMonitorCheckResponse) GetMetaOk() (*StatisticsResponseMeta, bool) { + if o == nil || isNil(o.Meta) { + return nil, false } return o.Meta, true } // HasMeta returns a boolean if a field has been set. func (o *SingleMonitorCheckResponse) HasMeta() bool { - if o != nil && o.Meta != nil { + if o != nil && !isNil(o.Meta) { return true } return false } -// SetMeta gets a reference to the given MetaData and assigns it to the Meta field. -func (o *SingleMonitorCheckResponse) SetMeta(v MetaData) { +// SetMeta gets a reference to the given StatisticsResponseMeta and assigns it to the Meta field. +func (o *SingleMonitorCheckResponse) SetMeta(v StatisticsResponseMeta) { o.Meta = &v } func (o SingleMonitorCheckResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Data != nil { + if !isNil(o.Data) { toSerialize["Data"] = o.Data } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Meta != nil { + if !isNil(o.Meta) { toSerialize["Meta"] = o.Meta } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_single_monitor_check_response_data.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_single_monitor_check_response_data.go new file mode 100644 index 00000000..e3333cd9 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_single_monitor_check_response_data.go @@ -0,0 +1,255 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// SingleMonitorCheckResponseData The resposne data/monitor checks +type SingleMonitorCheckResponseData struct { + Attributes *MonitorCheckAttributes `json:"Attributes,omitempty"` + // Identifier + Id int64 `json:"Id"` + Type *string `json:"Type,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + // Links related to the object + Links *map[string]string `json:"Links,omitempty"` +} + +// NewSingleMonitorCheckResponseData instantiates a new SingleMonitorCheckResponseData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSingleMonitorCheckResponseData(id int64) *SingleMonitorCheckResponseData { + this := SingleMonitorCheckResponseData{} + this.Id = id + return &this +} + +// NewSingleMonitorCheckResponseDataWithDefaults instantiates a new SingleMonitorCheckResponseData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSingleMonitorCheckResponseDataWithDefaults() *SingleMonitorCheckResponseData { + this := SingleMonitorCheckResponseData{} + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *SingleMonitorCheckResponseData) GetAttributes() MonitorCheckAttributes { + if o == nil || isNil(o.Attributes) { + var ret MonitorCheckAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SingleMonitorCheckResponseData) GetAttributesOk() (*MonitorCheckAttributes, bool) { + if o == nil || isNil(o.Attributes) { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *SingleMonitorCheckResponseData) HasAttributes() bool { + if o != nil && !isNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given MonitorCheckAttributes and assigns it to the Attributes field. +func (o *SingleMonitorCheckResponseData) SetAttributes(v MonitorCheckAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value +func (o *SingleMonitorCheckResponseData) GetId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *SingleMonitorCheckResponseData) GetIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *SingleMonitorCheckResponseData) SetId(v int64) { + o.Id = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SingleMonitorCheckResponseData) GetType() string { + if o == nil || isNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SingleMonitorCheckResponseData) GetTypeOk() (*string, bool) { + if o == nil || isNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SingleMonitorCheckResponseData) HasType() bool { + if o != nil && !isNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SingleMonitorCheckResponseData) SetType(v string) { + o.Type = &v +} + +// GetRelationships returns the Relationships field value if set, zero value otherwise. +func (o *SingleMonitorCheckResponseData) GetRelationships() []RelationObject { + if o == nil || isNil(o.Relationships) { + var ret []RelationObject + return ret + } + return o.Relationships +} + +// GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SingleMonitorCheckResponseData) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false + } + return o.Relationships, true +} + +// HasRelationships returns a boolean if a field has been set. +func (o *SingleMonitorCheckResponseData) HasRelationships() bool { + if o != nil && !isNil(o.Relationships) { + return true + } + + return false +} + +// SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. +func (o *SingleMonitorCheckResponseData) SetRelationships(v []RelationObject) { + o.Relationships = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *SingleMonitorCheckResponseData) GetLinks() map[string]string { + if o == nil || isNil(o.Links) { + var ret map[string]string + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SingleMonitorCheckResponseData) GetLinksOk() (*map[string]string, bool) { + if o == nil || isNil(o.Links) { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *SingleMonitorCheckResponseData) HasLinks() bool { + if o != nil && !isNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given map[string]string and assigns it to the Links field. +func (o *SingleMonitorCheckResponseData) SetLinks(v map[string]string) { + o.Links = &v +} + +func (o SingleMonitorCheckResponseData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Attributes) { + toSerialize["Attributes"] = o.Attributes + } + if true { + toSerialize["Id"] = o.Id + } + if !isNil(o.Type) { + toSerialize["Type"] = o.Type + } + if !isNil(o.Relationships) { + toSerialize["Relationships"] = o.Relationships + } + if !isNil(o.Links) { + toSerialize["Links"] = o.Links + } + return json.Marshal(toSerialize) +} + +type NullableSingleMonitorCheckResponseData struct { + value *SingleMonitorCheckResponseData + isSet bool +} + +func (v NullableSingleMonitorCheckResponseData) Get() *SingleMonitorCheckResponseData { + return v.value +} + +func (v *NullableSingleMonitorCheckResponseData) Set(val *SingleMonitorCheckResponseData) { + v.value = val + v.isSet = true +} + +func (v NullableSingleMonitorCheckResponseData) IsSet() bool { + return v.isSet +} + +func (v *NullableSingleMonitorCheckResponseData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSingleMonitorCheckResponseData(val *SingleMonitorCheckResponseData) *NullableSingleMonitorCheckResponseData { + return &NullableSingleMonitorCheckResponseData{value: val, isSet: true} +} + +func (v NullableSingleMonitorCheckResponseData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSingleMonitorCheckResponseData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_sla.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_sla.go index 32d92ca3..cf7bc894 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_sla.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_sla.go @@ -47,7 +47,7 @@ func NewSlaWithDefaults() *Sla { // GetSlaGuid returns the SlaGuid field value if set, zero value otherwise. func (o *Sla) GetSlaGuid() string { - if o == nil || o.SlaGuid == nil { + if o == nil || isNil(o.SlaGuid) { var ret string return ret } @@ -57,15 +57,15 @@ func (o *Sla) GetSlaGuid() string { // GetSlaGuidOk returns a tuple with the SlaGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Sla) GetSlaGuidOk() (*string, bool) { - if o == nil || o.SlaGuid == nil { - return nil, false + if o == nil || isNil(o.SlaGuid) { + return nil, false } return o.SlaGuid, true } // HasSlaGuid returns a boolean if a field has been set. func (o *Sla) HasSlaGuid() bool { - if o != nil && o.SlaGuid != nil { + if o != nil && !isNil(o.SlaGuid) { return true } @@ -79,7 +79,7 @@ func (o *Sla) SetSlaGuid(v string) { // GetHash returns the Hash field value if set, zero value otherwise. func (o *Sla) GetHash() string { - if o == nil || o.Hash == nil { + if o == nil || isNil(o.Hash) { var ret string return ret } @@ -89,15 +89,15 @@ func (o *Sla) GetHash() string { // GetHashOk returns a tuple with the Hash field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Sla) GetHashOk() (*string, bool) { - if o == nil || o.Hash == nil { - return nil, false + if o == nil || isNil(o.Hash) { + return nil, false } return o.Hash, true } // HasHash returns a boolean if a field has been set. func (o *Sla) HasHash() bool { - if o != nil && o.Hash != nil { + if o != nil && !isNil(o.Hash) { return true } @@ -111,7 +111,7 @@ func (o *Sla) SetHash(v string) { // GetDescription returns the Description field value if set, zero value otherwise. func (o *Sla) GetDescription() string { - if o == nil || o.Description == nil { + if o == nil || isNil(o.Description) { var ret string return ret } @@ -121,15 +121,15 @@ func (o *Sla) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Sla) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { - return nil, false + if o == nil || isNil(o.Description) { + return nil, false } return o.Description, true } // HasDescription returns a boolean if a field has been set. func (o *Sla) HasDescription() bool { - if o != nil && o.Description != nil { + if o != nil && !isNil(o.Description) { return true } @@ -143,7 +143,7 @@ func (o *Sla) SetDescription(v string) { // GetUptimeErrorThreshold returns the UptimeErrorThreshold field value if set, zero value otherwise. func (o *Sla) GetUptimeErrorThreshold() float64 { - if o == nil || o.UptimeErrorThreshold == nil { + if o == nil || isNil(o.UptimeErrorThreshold) { var ret float64 return ret } @@ -153,15 +153,15 @@ func (o *Sla) GetUptimeErrorThreshold() float64 { // GetUptimeErrorThresholdOk returns a tuple with the UptimeErrorThreshold field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Sla) GetUptimeErrorThresholdOk() (*float64, bool) { - if o == nil || o.UptimeErrorThreshold == nil { - return nil, false + if o == nil || isNil(o.UptimeErrorThreshold) { + return nil, false } return o.UptimeErrorThreshold, true } // HasUptimeErrorThreshold returns a boolean if a field has been set. func (o *Sla) HasUptimeErrorThreshold() bool { - if o != nil && o.UptimeErrorThreshold != nil { + if o != nil && !isNil(o.UptimeErrorThreshold) { return true } @@ -175,7 +175,7 @@ func (o *Sla) SetUptimeErrorThreshold(v float64) { // GetUptimeWarningThreshold returns the UptimeWarningThreshold field value if set, zero value otherwise. func (o *Sla) GetUptimeWarningThreshold() float64 { - if o == nil || o.UptimeWarningThreshold == nil { + if o == nil || isNil(o.UptimeWarningThreshold) { var ret float64 return ret } @@ -185,15 +185,15 @@ func (o *Sla) GetUptimeWarningThreshold() float64 { // GetUptimeWarningThresholdOk returns a tuple with the UptimeWarningThreshold field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Sla) GetUptimeWarningThresholdOk() (*float64, bool) { - if o == nil || o.UptimeWarningThreshold == nil { - return nil, false + if o == nil || isNil(o.UptimeWarningThreshold) { + return nil, false } return o.UptimeWarningThreshold, true } // HasUptimeWarningThreshold returns a boolean if a field has been set. func (o *Sla) HasUptimeWarningThreshold() bool { - if o != nil && o.UptimeWarningThreshold != nil { + if o != nil && !isNil(o.UptimeWarningThreshold) { return true } @@ -207,7 +207,7 @@ func (o *Sla) SetUptimeWarningThreshold(v float64) { // GetLoadTimeErrorThreshold returns the LoadTimeErrorThreshold field value if set, zero value otherwise. func (o *Sla) GetLoadTimeErrorThreshold() float64 { - if o == nil || o.LoadTimeErrorThreshold == nil { + if o == nil || isNil(o.LoadTimeErrorThreshold) { var ret float64 return ret } @@ -217,15 +217,15 @@ func (o *Sla) GetLoadTimeErrorThreshold() float64 { // GetLoadTimeErrorThresholdOk returns a tuple with the LoadTimeErrorThreshold field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Sla) GetLoadTimeErrorThresholdOk() (*float64, bool) { - if o == nil || o.LoadTimeErrorThreshold == nil { - return nil, false + if o == nil || isNil(o.LoadTimeErrorThreshold) { + return nil, false } return o.LoadTimeErrorThreshold, true } // HasLoadTimeErrorThreshold returns a boolean if a field has been set. func (o *Sla) HasLoadTimeErrorThreshold() bool { - if o != nil && o.LoadTimeErrorThreshold != nil { + if o != nil && !isNil(o.LoadTimeErrorThreshold) { return true } @@ -239,7 +239,7 @@ func (o *Sla) SetLoadTimeErrorThreshold(v float64) { // GetOperatorReponseTimeThreshold returns the OperatorReponseTimeThreshold field value if set, zero value otherwise. func (o *Sla) GetOperatorReponseTimeThreshold() int32 { - if o == nil || o.OperatorReponseTimeThreshold == nil { + if o == nil || isNil(o.OperatorReponseTimeThreshold) { var ret int32 return ret } @@ -249,15 +249,15 @@ func (o *Sla) GetOperatorReponseTimeThreshold() int32 { // GetOperatorReponseTimeThresholdOk returns a tuple with the OperatorReponseTimeThreshold field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Sla) GetOperatorReponseTimeThresholdOk() (*int32, bool) { - if o == nil || o.OperatorReponseTimeThreshold == nil { - return nil, false + if o == nil || isNil(o.OperatorReponseTimeThreshold) { + return nil, false } return o.OperatorReponseTimeThreshold, true } // HasOperatorReponseTimeThreshold returns a boolean if a field has been set. func (o *Sla) HasOperatorReponseTimeThreshold() bool { - if o != nil && o.OperatorReponseTimeThreshold != nil { + if o != nil && !isNil(o.OperatorReponseTimeThreshold) { return true } @@ -271,25 +271,25 @@ func (o *Sla) SetOperatorReponseTimeThreshold(v int32) { func (o Sla) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.SlaGuid != nil { + if !isNil(o.SlaGuid) { toSerialize["SlaGuid"] = o.SlaGuid } - if o.Hash != nil { + if !isNil(o.Hash) { toSerialize["Hash"] = o.Hash } - if o.Description != nil { + if !isNil(o.Description) { toSerialize["Description"] = o.Description } - if o.UptimeErrorThreshold != nil { + if !isNil(o.UptimeErrorThreshold) { toSerialize["UptimeErrorThreshold"] = o.UptimeErrorThreshold } - if o.UptimeWarningThreshold != nil { + if !isNil(o.UptimeWarningThreshold) { toSerialize["UptimeWarningThreshold"] = o.UptimeWarningThreshold } - if o.LoadTimeErrorThreshold != nil { + if !isNil(o.LoadTimeErrorThreshold) { toSerialize["LoadTimeErrorThreshold"] = o.LoadTimeErrorThreshold } - if o.OperatorReponseTimeThreshold != nil { + if !isNil(o.OperatorReponseTimeThreshold) { toSerialize["OperatorReponseTimeThreshold"] = o.OperatorReponseTimeThreshold } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_sms_provider.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_sms_provider.go index 09e62484..3cb07254 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_sms_provider.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_sms_provider.go @@ -27,7 +27,8 @@ const ( SMSPROVIDER_SMS_PROVIDER_USA SmsProvider = "SmsProviderUSA" ) -var allowedSmsProviderEnumValues = []SmsProvider{ +// All allowed values of SmsProvider enum +var AllowedSmsProviderEnumValues = []SmsProvider{ "UseAccountSetting", "SmsProviderEurope", "SmsProviderInternational", @@ -42,7 +43,7 @@ func (v *SmsProvider) UnmarshalJSON(src []byte) error { return err } enumTypeValue := SmsProvider(value) - for _, existing := range allowedSmsProviderEnumValues { + for _, existing := range AllowedSmsProviderEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -59,13 +60,13 @@ func NewSmsProviderFromValue(v string) (*SmsProvider, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for SmsProvider: valid values are %v", v, allowedSmsProviderEnumValues) + return nil, fmt.Errorf("invalid value '%v' for SmsProvider: valid values are %v", v, AllowedSmsProviderEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v SmsProvider) IsValid() bool { - for _, existing := range allowedSmsProviderEnumValues { + for _, existing := range AllowedSmsProviderEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_sort_direction.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_sort_direction.go index e78875dd..cb298b14 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_sort_direction.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_sort_direction.go @@ -24,7 +24,8 @@ const ( SORTDIRECTION_DESCENDING SortDirection = "Descending" ) -var allowedSortDirectionEnumValues = []SortDirection{ +// All allowed values of SortDirection enum +var AllowedSortDirectionEnumValues = []SortDirection{ "Ascending", "Descending", } @@ -36,7 +37,7 @@ func (v *SortDirection) UnmarshalJSON(src []byte) error { return err } enumTypeValue := SortDirection(value) - for _, existing := range allowedSortDirectionEnumValues { + for _, existing := range AllowedSortDirectionEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -53,13 +54,13 @@ func NewSortDirectionFromValue(v string) (*SortDirection, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for SortDirection: valid values are %v", v, allowedSortDirectionEnumValues) + return nil, fmt.Errorf("invalid value '%v' for SortDirection: valid values are %v", v, AllowedSortDirectionEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v SortDirection) IsValid() bool { - for _, existing := range allowedSortDirectionEnumValues { + for _, existing := range AllowedSortDirectionEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_sort_order_enum.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_sort_order_enum.go index b4ce7960..2b47f9d9 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_sort_order_enum.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_sort_order_enum.go @@ -24,7 +24,8 @@ const ( SORTORDERENUM_BY_STATUS SortOrderEnum = "ByStatus" ) -var allowedSortOrderEnumEnumValues = []SortOrderEnum{ +// All allowed values of SortOrderEnum enum +var AllowedSortOrderEnumEnumValues = []SortOrderEnum{ "Alphabetical", "ByStatus", } @@ -36,7 +37,7 @@ func (v *SortOrderEnum) UnmarshalJSON(src []byte) error { return err } enumTypeValue := SortOrderEnum(value) - for _, existing := range allowedSortOrderEnumEnumValues { + for _, existing := range AllowedSortOrderEnumEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -53,13 +54,13 @@ func NewSortOrderEnumFromValue(v string) (*SortOrderEnum, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for SortOrderEnum: valid values are %v", v, allowedSortOrderEnumEnumValues) + return nil, fmt.Errorf("invalid value '%v' for SortOrderEnum: valid values are %v", v, AllowedSortOrderEnumEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v SortOrderEnum) IsValid() bool { - for _, existing := range allowedSortOrderEnumEnumValues { + for _, existing := range AllowedSortOrderEnumEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_statistics.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_statistics.go index ce2faf8c..90494634 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_statistics.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_statistics.go @@ -17,9 +17,13 @@ import ( // Statistics struct for Statistics type Statistics struct { Attributes *StatisticsAttributes `json:"Attributes,omitempty"` + // Identifier Id *string `json:"Id,omitempty"` + // Object type Type *string `json:"Type,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + // Links related to the object Links *map[string]string `json:"Links,omitempty"` } @@ -42,7 +46,7 @@ func NewStatisticsWithDefaults() *Statistics { // GetAttributes returns the Attributes field value if set, zero value otherwise. func (o *Statistics) GetAttributes() StatisticsAttributes { - if o == nil || o.Attributes == nil { + if o == nil || isNil(o.Attributes) { var ret StatisticsAttributes return ret } @@ -52,15 +56,15 @@ func (o *Statistics) GetAttributes() StatisticsAttributes { // GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Statistics) GetAttributesOk() (*StatisticsAttributes, bool) { - if o == nil || o.Attributes == nil { - return nil, false + if o == nil || isNil(o.Attributes) { + return nil, false } return o.Attributes, true } // HasAttributes returns a boolean if a field has been set. func (o *Statistics) HasAttributes() bool { - if o != nil && o.Attributes != nil { + if o != nil && !isNil(o.Attributes) { return true } @@ -74,7 +78,7 @@ func (o *Statistics) SetAttributes(v StatisticsAttributes) { // GetId returns the Id field value if set, zero value otherwise. func (o *Statistics) GetId() string { - if o == nil || o.Id == nil { + if o == nil || isNil(o.Id) { var ret string return ret } @@ -84,15 +88,15 @@ func (o *Statistics) GetId() string { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Statistics) GetIdOk() (*string, bool) { - if o == nil || o.Id == nil { - return nil, false + if o == nil || isNil(o.Id) { + return nil, false } return o.Id, true } // HasId returns a boolean if a field has been set. func (o *Statistics) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !isNil(o.Id) { return true } @@ -106,7 +110,7 @@ func (o *Statistics) SetId(v string) { // GetType returns the Type field value if set, zero value otherwise. func (o *Statistics) GetType() string { - if o == nil || o.Type == nil { + if o == nil || isNil(o.Type) { var ret string return ret } @@ -116,15 +120,15 @@ func (o *Statistics) GetType() string { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Statistics) GetTypeOk() (*string, bool) { - if o == nil || o.Type == nil { - return nil, false + if o == nil || isNil(o.Type) { + return nil, false } return o.Type, true } // HasType returns a boolean if a field has been set. func (o *Statistics) HasType() bool { - if o != nil && o.Type != nil { + if o != nil && !isNil(o.Type) { return true } @@ -138,25 +142,25 @@ func (o *Statistics) SetType(v string) { // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *Statistics) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Statistics) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *Statistics) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *Statistics) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -165,12 +169,12 @@ func (o *Statistics) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *Statistics) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetLinks returns the Links field value if set, zero value otherwise. func (o *Statistics) GetLinks() map[string]string { - if o == nil || o.Links == nil { + if o == nil || isNil(o.Links) { var ret map[string]string return ret } @@ -180,15 +184,15 @@ func (o *Statistics) GetLinks() map[string]string { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Statistics) GetLinksOk() (*map[string]string, bool) { - if o == nil || o.Links == nil { - return nil, false + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *Statistics) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } @@ -202,19 +206,19 @@ func (o *Statistics) SetLinks(v map[string]string) { func (o Statistics) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Attributes != nil { + if !isNil(o.Attributes) { toSerialize["Attributes"] = o.Attributes } - if o.Id != nil { + if !isNil(o.Id) { toSerialize["Id"] = o.Id } - if o.Type != nil { + if !isNil(o.Type) { toSerialize["Type"] = o.Type } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_statistics_attributes.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_statistics_attributes.go index 9084d0d7..582b7f81 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_statistics_attributes.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_statistics_attributes.go @@ -12,13 +12,12 @@ package uptrends import ( "encoding/json" - "time" ) -// StatisticsAttributes struct for StatisticsAttributes +// StatisticsAttributes Object attributes type StatisticsAttributes struct { - StartDateTime time.Time `json:"StartDateTime"` - EndDateTime time.Time `json:"EndDateTime"` + StartDateTime map[string]interface{} `json:"StartDateTime"` + EndDateTime map[string]interface{} `json:"EndDateTime"` Alerts *int32 `json:"Alerts,omitempty"` SlaTarget *float64 `json:"SlaTarget,omitempty"` SlaTargetTotalTime *float64 `json:"SlaTargetTotalTime,omitempty"` @@ -42,7 +41,7 @@ type StatisticsAttributes struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewStatisticsAttributes(startDateTime time.Time, endDateTime time.Time) *StatisticsAttributes { +func NewStatisticsAttributes(startDateTime map[string]interface{}, endDateTime map[string]interface{}) *StatisticsAttributes { this := StatisticsAttributes{} this.StartDateTime = startDateTime this.EndDateTime = endDateTime @@ -58,9 +57,9 @@ func NewStatisticsAttributesWithDefaults() *StatisticsAttributes { } // GetStartDateTime returns the StartDateTime field value -func (o *StatisticsAttributes) GetStartDateTime() time.Time { +func (o *StatisticsAttributes) GetStartDateTime() map[string]interface{} { if o == nil { - var ret time.Time + var ret map[string]interface{} return ret } @@ -69,22 +68,22 @@ func (o *StatisticsAttributes) GetStartDateTime() time.Time { // GetStartDateTimeOk returns a tuple with the StartDateTime field value // and a boolean to check if the value has been set. -func (o *StatisticsAttributes) GetStartDateTimeOk() (*time.Time, bool) { - if o == nil { - return nil, false +func (o *StatisticsAttributes) GetStartDateTimeOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false } - return &o.StartDateTime, true + return o.StartDateTime, true } // SetStartDateTime sets field value -func (o *StatisticsAttributes) SetStartDateTime(v time.Time) { +func (o *StatisticsAttributes) SetStartDateTime(v map[string]interface{}) { o.StartDateTime = v } // GetEndDateTime returns the EndDateTime field value -func (o *StatisticsAttributes) GetEndDateTime() time.Time { +func (o *StatisticsAttributes) GetEndDateTime() map[string]interface{} { if o == nil { - var ret time.Time + var ret map[string]interface{} return ret } @@ -93,21 +92,21 @@ func (o *StatisticsAttributes) GetEndDateTime() time.Time { // GetEndDateTimeOk returns a tuple with the EndDateTime field value // and a boolean to check if the value has been set. -func (o *StatisticsAttributes) GetEndDateTimeOk() (*time.Time, bool) { - if o == nil { - return nil, false +func (o *StatisticsAttributes) GetEndDateTimeOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false } - return &o.EndDateTime, true + return o.EndDateTime, true } // SetEndDateTime sets field value -func (o *StatisticsAttributes) SetEndDateTime(v time.Time) { +func (o *StatisticsAttributes) SetEndDateTime(v map[string]interface{}) { o.EndDateTime = v } // GetAlerts returns the Alerts field value if set, zero value otherwise. func (o *StatisticsAttributes) GetAlerts() int32 { - if o == nil || o.Alerts == nil { + if o == nil || isNil(o.Alerts) { var ret int32 return ret } @@ -117,15 +116,15 @@ func (o *StatisticsAttributes) GetAlerts() int32 { // GetAlertsOk returns a tuple with the Alerts field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *StatisticsAttributes) GetAlertsOk() (*int32, bool) { - if o == nil || o.Alerts == nil { - return nil, false + if o == nil || isNil(o.Alerts) { + return nil, false } return o.Alerts, true } // HasAlerts returns a boolean if a field has been set. func (o *StatisticsAttributes) HasAlerts() bool { - if o != nil && o.Alerts != nil { + if o != nil && !isNil(o.Alerts) { return true } @@ -139,7 +138,7 @@ func (o *StatisticsAttributes) SetAlerts(v int32) { // GetSlaTarget returns the SlaTarget field value if set, zero value otherwise. func (o *StatisticsAttributes) GetSlaTarget() float64 { - if o == nil || o.SlaTarget == nil { + if o == nil || isNil(o.SlaTarget) { var ret float64 return ret } @@ -149,15 +148,15 @@ func (o *StatisticsAttributes) GetSlaTarget() float64 { // GetSlaTargetOk returns a tuple with the SlaTarget field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *StatisticsAttributes) GetSlaTargetOk() (*float64, bool) { - if o == nil || o.SlaTarget == nil { - return nil, false + if o == nil || isNil(o.SlaTarget) { + return nil, false } return o.SlaTarget, true } // HasSlaTarget returns a boolean if a field has been set. func (o *StatisticsAttributes) HasSlaTarget() bool { - if o != nil && o.SlaTarget != nil { + if o != nil && !isNil(o.SlaTarget) { return true } @@ -171,7 +170,7 @@ func (o *StatisticsAttributes) SetSlaTarget(v float64) { // GetSlaTargetTotalTime returns the SlaTargetTotalTime field value if set, zero value otherwise. func (o *StatisticsAttributes) GetSlaTargetTotalTime() float64 { - if o == nil || o.SlaTargetTotalTime == nil { + if o == nil || isNil(o.SlaTargetTotalTime) { var ret float64 return ret } @@ -181,15 +180,15 @@ func (o *StatisticsAttributes) GetSlaTargetTotalTime() float64 { // GetSlaTargetTotalTimeOk returns a tuple with the SlaTargetTotalTime field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *StatisticsAttributes) GetSlaTargetTotalTimeOk() (*float64, bool) { - if o == nil || o.SlaTargetTotalTime == nil { - return nil, false + if o == nil || isNil(o.SlaTargetTotalTime) { + return nil, false } return o.SlaTargetTotalTime, true } // HasSlaTargetTotalTime returns a boolean if a field has been set. func (o *StatisticsAttributes) HasSlaTargetTotalTime() bool { - if o != nil && o.SlaTargetTotalTime != nil { + if o != nil && !isNil(o.SlaTargetTotalTime) { return true } @@ -203,7 +202,7 @@ func (o *StatisticsAttributes) SetSlaTargetTotalTime(v float64) { // GetOperatorResponseTarget returns the OperatorResponseTarget field value if set, zero value otherwise. func (o *StatisticsAttributes) GetOperatorResponseTarget() float64 { - if o == nil || o.OperatorResponseTarget == nil { + if o == nil || isNil(o.OperatorResponseTarget) { var ret float64 return ret } @@ -213,15 +212,15 @@ func (o *StatisticsAttributes) GetOperatorResponseTarget() float64 { // GetOperatorResponseTargetOk returns a tuple with the OperatorResponseTarget field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *StatisticsAttributes) GetOperatorResponseTargetOk() (*float64, bool) { - if o == nil || o.OperatorResponseTarget == nil { - return nil, false + if o == nil || isNil(o.OperatorResponseTarget) { + return nil, false } return o.OperatorResponseTarget, true } // HasOperatorResponseTarget returns a boolean if a field has been set. func (o *StatisticsAttributes) HasOperatorResponseTarget() bool { - if o != nil && o.OperatorResponseTarget != nil { + if o != nil && !isNil(o.OperatorResponseTarget) { return true } @@ -235,7 +234,7 @@ func (o *StatisticsAttributes) SetOperatorResponseTarget(v float64) { // GetOperatorResponseTime returns the OperatorResponseTime field value if set, zero value otherwise. func (o *StatisticsAttributes) GetOperatorResponseTime() float64 { - if o == nil || o.OperatorResponseTime == nil { + if o == nil || isNil(o.OperatorResponseTime) { var ret float64 return ret } @@ -245,15 +244,15 @@ func (o *StatisticsAttributes) GetOperatorResponseTime() float64 { // GetOperatorResponseTimeOk returns a tuple with the OperatorResponseTime field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *StatisticsAttributes) GetOperatorResponseTimeOk() (*float64, bool) { - if o == nil || o.OperatorResponseTime == nil { - return nil, false + if o == nil || isNil(o.OperatorResponseTime) { + return nil, false } return o.OperatorResponseTime, true } // HasOperatorResponseTime returns a boolean if a field has been set. func (o *StatisticsAttributes) HasOperatorResponseTime() bool { - if o != nil && o.OperatorResponseTime != nil { + if o != nil && !isNil(o.OperatorResponseTime) { return true } @@ -267,7 +266,7 @@ func (o *StatisticsAttributes) SetOperatorResponseTime(v float64) { // GetDowntimePercentage returns the DowntimePercentage field value if set, zero value otherwise. func (o *StatisticsAttributes) GetDowntimePercentage() float64 { - if o == nil || o.DowntimePercentage == nil { + if o == nil || isNil(o.DowntimePercentage) { var ret float64 return ret } @@ -277,15 +276,15 @@ func (o *StatisticsAttributes) GetDowntimePercentage() float64 { // GetDowntimePercentageOk returns a tuple with the DowntimePercentage field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *StatisticsAttributes) GetDowntimePercentageOk() (*float64, bool) { - if o == nil || o.DowntimePercentage == nil { - return nil, false + if o == nil || isNil(o.DowntimePercentage) { + return nil, false } return o.DowntimePercentage, true } // HasDowntimePercentage returns a boolean if a field has been set. func (o *StatisticsAttributes) HasDowntimePercentage() bool { - if o != nil && o.DowntimePercentage != nil { + if o != nil && !isNil(o.DowntimePercentage) { return true } @@ -299,7 +298,7 @@ func (o *StatisticsAttributes) SetDowntimePercentage(v float64) { // GetUptimePercentage returns the UptimePercentage field value if set, zero value otherwise. func (o *StatisticsAttributes) GetUptimePercentage() float64 { - if o == nil || o.UptimePercentage == nil { + if o == nil || isNil(o.UptimePercentage) { var ret float64 return ret } @@ -309,15 +308,15 @@ func (o *StatisticsAttributes) GetUptimePercentage() float64 { // GetUptimePercentageOk returns a tuple with the UptimePercentage field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *StatisticsAttributes) GetUptimePercentageOk() (*float64, bool) { - if o == nil || o.UptimePercentage == nil { - return nil, false + if o == nil || isNil(o.UptimePercentage) { + return nil, false } return o.UptimePercentage, true } // HasUptimePercentage returns a boolean if a field has been set. func (o *StatisticsAttributes) HasUptimePercentage() bool { - if o != nil && o.UptimePercentage != nil { + if o != nil && !isNil(o.UptimePercentage) { return true } @@ -331,7 +330,7 @@ func (o *StatisticsAttributes) SetUptimePercentage(v float64) { // GetChecks returns the Checks field value if set, zero value otherwise. func (o *StatisticsAttributes) GetChecks() int64 { - if o == nil || o.Checks == nil { + if o == nil || isNil(o.Checks) { var ret int64 return ret } @@ -341,15 +340,15 @@ func (o *StatisticsAttributes) GetChecks() int64 { // GetChecksOk returns a tuple with the Checks field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *StatisticsAttributes) GetChecksOk() (*int64, bool) { - if o == nil || o.Checks == nil { - return nil, false + if o == nil || isNil(o.Checks) { + return nil, false } return o.Checks, true } // HasChecks returns a boolean if a field has been set. func (o *StatisticsAttributes) HasChecks() bool { - if o != nil && o.Checks != nil { + if o != nil && !isNil(o.Checks) { return true } @@ -363,7 +362,7 @@ func (o *StatisticsAttributes) SetChecks(v int64) { // GetConfirmedErrors returns the ConfirmedErrors field value if set, zero value otherwise. func (o *StatisticsAttributes) GetConfirmedErrors() int32 { - if o == nil || o.ConfirmedErrors == nil { + if o == nil || isNil(o.ConfirmedErrors) { var ret int32 return ret } @@ -373,15 +372,15 @@ func (o *StatisticsAttributes) GetConfirmedErrors() int32 { // GetConfirmedErrorsOk returns a tuple with the ConfirmedErrors field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *StatisticsAttributes) GetConfirmedErrorsOk() (*int32, bool) { - if o == nil || o.ConfirmedErrors == nil { - return nil, false + if o == nil || isNil(o.ConfirmedErrors) { + return nil, false } return o.ConfirmedErrors, true } // HasConfirmedErrors returns a boolean if a field has been set. func (o *StatisticsAttributes) HasConfirmedErrors() bool { - if o != nil && o.ConfirmedErrors != nil { + if o != nil && !isNil(o.ConfirmedErrors) { return true } @@ -395,7 +394,7 @@ func (o *StatisticsAttributes) SetConfirmedErrors(v int32) { // GetUnconfirmedErrors returns the UnconfirmedErrors field value if set, zero value otherwise. func (o *StatisticsAttributes) GetUnconfirmedErrors() int32 { - if o == nil || o.UnconfirmedErrors == nil { + if o == nil || isNil(o.UnconfirmedErrors) { var ret int32 return ret } @@ -405,15 +404,15 @@ func (o *StatisticsAttributes) GetUnconfirmedErrors() int32 { // GetUnconfirmedErrorsOk returns a tuple with the UnconfirmedErrors field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *StatisticsAttributes) GetUnconfirmedErrorsOk() (*int32, bool) { - if o == nil || o.UnconfirmedErrors == nil { - return nil, false + if o == nil || isNil(o.UnconfirmedErrors) { + return nil, false } return o.UnconfirmedErrors, true } // HasUnconfirmedErrors returns a boolean if a field has been set. func (o *StatisticsAttributes) HasUnconfirmedErrors() bool { - if o != nil && o.UnconfirmedErrors != nil { + if o != nil && !isNil(o.UnconfirmedErrors) { return true } @@ -427,7 +426,7 @@ func (o *StatisticsAttributes) SetUnconfirmedErrors(v int32) { // GetUptime returns the Uptime field value if set, zero value otherwise. func (o *StatisticsAttributes) GetUptime() int64 { - if o == nil || o.Uptime == nil { + if o == nil || isNil(o.Uptime) { var ret int64 return ret } @@ -437,15 +436,15 @@ func (o *StatisticsAttributes) GetUptime() int64 { // GetUptimeOk returns a tuple with the Uptime field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *StatisticsAttributes) GetUptimeOk() (*int64, bool) { - if o == nil || o.Uptime == nil { - return nil, false + if o == nil || isNil(o.Uptime) { + return nil, false } return o.Uptime, true } // HasUptime returns a boolean if a field has been set. func (o *StatisticsAttributes) HasUptime() bool { - if o != nil && o.Uptime != nil { + if o != nil && !isNil(o.Uptime) { return true } @@ -459,7 +458,7 @@ func (o *StatisticsAttributes) SetUptime(v int64) { // GetDowntime returns the Downtime field value if set, zero value otherwise. func (o *StatisticsAttributes) GetDowntime() int64 { - if o == nil || o.Downtime == nil { + if o == nil || isNil(o.Downtime) { var ret int64 return ret } @@ -469,15 +468,15 @@ func (o *StatisticsAttributes) GetDowntime() int64 { // GetDowntimeOk returns a tuple with the Downtime field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *StatisticsAttributes) GetDowntimeOk() (*int64, bool) { - if o == nil || o.Downtime == nil { - return nil, false + if o == nil || isNil(o.Downtime) { + return nil, false } return o.Downtime, true } // HasDowntime returns a boolean if a field has been set. func (o *StatisticsAttributes) HasDowntime() bool { - if o != nil && o.Downtime != nil { + if o != nil && !isNil(o.Downtime) { return true } @@ -491,7 +490,7 @@ func (o *StatisticsAttributes) SetDowntime(v int64) { // GetTotalTime returns the TotalTime field value if set, zero value otherwise. func (o *StatisticsAttributes) GetTotalTime() float32 { - if o == nil || o.TotalTime == nil { + if o == nil || isNil(o.TotalTime) { var ret float32 return ret } @@ -501,15 +500,15 @@ func (o *StatisticsAttributes) GetTotalTime() float32 { // GetTotalTimeOk returns a tuple with the TotalTime field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *StatisticsAttributes) GetTotalTimeOk() (*float32, bool) { - if o == nil || o.TotalTime == nil { - return nil, false + if o == nil || isNil(o.TotalTime) { + return nil, false } return o.TotalTime, true } // HasTotalTime returns a boolean if a field has been set. func (o *StatisticsAttributes) HasTotalTime() bool { - if o != nil && o.TotalTime != nil { + if o != nil && !isNil(o.TotalTime) { return true } @@ -523,7 +522,7 @@ func (o *StatisticsAttributes) SetTotalTime(v float32) { // GetResolveTime returns the ResolveTime field value if set, zero value otherwise. func (o *StatisticsAttributes) GetResolveTime() float32 { - if o == nil || o.ResolveTime == nil { + if o == nil || isNil(o.ResolveTime) { var ret float32 return ret } @@ -533,15 +532,15 @@ func (o *StatisticsAttributes) GetResolveTime() float32 { // GetResolveTimeOk returns a tuple with the ResolveTime field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *StatisticsAttributes) GetResolveTimeOk() (*float32, bool) { - if o == nil || o.ResolveTime == nil { - return nil, false + if o == nil || isNil(o.ResolveTime) { + return nil, false } return o.ResolveTime, true } // HasResolveTime returns a boolean if a field has been set. func (o *StatisticsAttributes) HasResolveTime() bool { - if o != nil && o.ResolveTime != nil { + if o != nil && !isNil(o.ResolveTime) { return true } @@ -555,7 +554,7 @@ func (o *StatisticsAttributes) SetResolveTime(v float32) { // GetConnectionTime returns the ConnectionTime field value if set, zero value otherwise. func (o *StatisticsAttributes) GetConnectionTime() float32 { - if o == nil || o.ConnectionTime == nil { + if o == nil || isNil(o.ConnectionTime) { var ret float32 return ret } @@ -565,15 +564,15 @@ func (o *StatisticsAttributes) GetConnectionTime() float32 { // GetConnectionTimeOk returns a tuple with the ConnectionTime field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *StatisticsAttributes) GetConnectionTimeOk() (*float32, bool) { - if o == nil || o.ConnectionTime == nil { - return nil, false + if o == nil || isNil(o.ConnectionTime) { + return nil, false } return o.ConnectionTime, true } // HasConnectionTime returns a boolean if a field has been set. func (o *StatisticsAttributes) HasConnectionTime() bool { - if o != nil && o.ConnectionTime != nil { + if o != nil && !isNil(o.ConnectionTime) { return true } @@ -587,7 +586,7 @@ func (o *StatisticsAttributes) SetConnectionTime(v float32) { // GetDownloadTime returns the DownloadTime field value if set, zero value otherwise. func (o *StatisticsAttributes) GetDownloadTime() float32 { - if o == nil || o.DownloadTime == nil { + if o == nil || isNil(o.DownloadTime) { var ret float32 return ret } @@ -597,15 +596,15 @@ func (o *StatisticsAttributes) GetDownloadTime() float32 { // GetDownloadTimeOk returns a tuple with the DownloadTime field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *StatisticsAttributes) GetDownloadTimeOk() (*float32, bool) { - if o == nil || o.DownloadTime == nil { - return nil, false + if o == nil || isNil(o.DownloadTime) { + return nil, false } return o.DownloadTime, true } // HasDownloadTime returns a boolean if a field has been set. func (o *StatisticsAttributes) HasDownloadTime() bool { - if o != nil && o.DownloadTime != nil { + if o != nil && !isNil(o.DownloadTime) { return true } @@ -619,7 +618,7 @@ func (o *StatisticsAttributes) SetDownloadTime(v float32) { // GetTotalBytes returns the TotalBytes field value if set, zero value otherwise. func (o *StatisticsAttributes) GetTotalBytes() int64 { - if o == nil || o.TotalBytes == nil { + if o == nil || isNil(o.TotalBytes) { var ret int64 return ret } @@ -629,15 +628,15 @@ func (o *StatisticsAttributes) GetTotalBytes() int64 { // GetTotalBytesOk returns a tuple with the TotalBytes field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *StatisticsAttributes) GetTotalBytesOk() (*int64, bool) { - if o == nil || o.TotalBytes == nil { - return nil, false + if o == nil || isNil(o.TotalBytes) { + return nil, false } return o.TotalBytes, true } // HasTotalBytes returns a boolean if a field has been set. func (o *StatisticsAttributes) HasTotalBytes() bool { - if o != nil && o.TotalBytes != nil { + if o != nil && !isNil(o.TotalBytes) { return true } @@ -657,55 +656,55 @@ func (o StatisticsAttributes) MarshalJSON() ([]byte, error) { if true { toSerialize["EndDateTime"] = o.EndDateTime } - if o.Alerts != nil { + if !isNil(o.Alerts) { toSerialize["Alerts"] = o.Alerts } - if o.SlaTarget != nil { + if !isNil(o.SlaTarget) { toSerialize["SlaTarget"] = o.SlaTarget } - if o.SlaTargetTotalTime != nil { + if !isNil(o.SlaTargetTotalTime) { toSerialize["SlaTargetTotalTime"] = o.SlaTargetTotalTime } - if o.OperatorResponseTarget != nil { + if !isNil(o.OperatorResponseTarget) { toSerialize["OperatorResponseTarget"] = o.OperatorResponseTarget } - if o.OperatorResponseTime != nil { + if !isNil(o.OperatorResponseTime) { toSerialize["OperatorResponseTime"] = o.OperatorResponseTime } - if o.DowntimePercentage != nil { + if !isNil(o.DowntimePercentage) { toSerialize["DowntimePercentage"] = o.DowntimePercentage } - if o.UptimePercentage != nil { + if !isNil(o.UptimePercentage) { toSerialize["UptimePercentage"] = o.UptimePercentage } - if o.Checks != nil { + if !isNil(o.Checks) { toSerialize["Checks"] = o.Checks } - if o.ConfirmedErrors != nil { + if !isNil(o.ConfirmedErrors) { toSerialize["ConfirmedErrors"] = o.ConfirmedErrors } - if o.UnconfirmedErrors != nil { + if !isNil(o.UnconfirmedErrors) { toSerialize["UnconfirmedErrors"] = o.UnconfirmedErrors } - if o.Uptime != nil { + if !isNil(o.Uptime) { toSerialize["Uptime"] = o.Uptime } - if o.Downtime != nil { + if !isNil(o.Downtime) { toSerialize["Downtime"] = o.Downtime } - if o.TotalTime != nil { + if !isNil(o.TotalTime) { toSerialize["TotalTime"] = o.TotalTime } - if o.ResolveTime != nil { + if !isNil(o.ResolveTime) { toSerialize["ResolveTime"] = o.ResolveTime } - if o.ConnectionTime != nil { + if !isNil(o.ConnectionTime) { toSerialize["ConnectionTime"] = o.ConnectionTime } - if o.DownloadTime != nil { + if !isNil(o.DownloadTime) { toSerialize["DownloadTime"] = o.DownloadTime } - if o.TotalBytes != nil { + if !isNil(o.TotalBytes) { toSerialize["TotalBytes"] = o.TotalBytes } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_statistics_response.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_statistics_response.go index 4ab70e80..928de157 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_statistics_response.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_statistics_response.go @@ -16,10 +16,12 @@ import ( // StatisticsResponse struct for StatisticsResponse type StatisticsResponse struct { - Data *[]Statistics `json:"Data,omitempty"` - Links *LinksData `json:"Links,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` - Meta *MetaData `json:"Meta,omitempty"` + // The resposne data/monitor checks + Data []Statistics `json:"Data,omitempty"` + Links *StatisticsResponseLinks `json:"Links,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + Meta *StatisticsResponseMeta `json:"Meta,omitempty"` } // NewStatisticsResponse instantiates a new StatisticsResponse object @@ -41,25 +43,25 @@ func NewStatisticsResponseWithDefaults() *StatisticsResponse { // GetData returns the Data field value if set, zero value otherwise. func (o *StatisticsResponse) GetData() []Statistics { - if o == nil || o.Data == nil { + if o == nil || isNil(o.Data) { var ret []Statistics return ret } - return *o.Data + return o.Data } // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *StatisticsResponse) GetDataOk() (*[]Statistics, bool) { - if o == nil || o.Data == nil { - return nil, false +func (o *StatisticsResponse) GetDataOk() ([]Statistics, bool) { + if o == nil || isNil(o.Data) { + return nil, false } return o.Data, true } // HasData returns a boolean if a field has been set. func (o *StatisticsResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && !isNil(o.Data) { return true } @@ -68,13 +70,13 @@ func (o *StatisticsResponse) HasData() bool { // SetData gets a reference to the given []Statistics and assigns it to the Data field. func (o *StatisticsResponse) SetData(v []Statistics) { - o.Data = &v + o.Data = v } // GetLinks returns the Links field value if set, zero value otherwise. -func (o *StatisticsResponse) GetLinks() LinksData { - if o == nil || o.Links == nil { - var ret LinksData +func (o *StatisticsResponse) GetLinks() StatisticsResponseLinks { + if o == nil || isNil(o.Links) { + var ret StatisticsResponseLinks return ret } return *o.Links @@ -82,48 +84,48 @@ func (o *StatisticsResponse) GetLinks() LinksData { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *StatisticsResponse) GetLinksOk() (*LinksData, bool) { - if o == nil || o.Links == nil { - return nil, false +func (o *StatisticsResponse) GetLinksOk() (*StatisticsResponseLinks, bool) { + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *StatisticsResponse) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } return false } -// SetLinks gets a reference to the given LinksData and assigns it to the Links field. -func (o *StatisticsResponse) SetLinks(v LinksData) { +// SetLinks gets a reference to the given StatisticsResponseLinks and assigns it to the Links field. +func (o *StatisticsResponse) SetLinks(v StatisticsResponseLinks) { o.Links = &v } // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *StatisticsResponse) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *StatisticsResponse) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *StatisticsResponse) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *StatisticsResponse) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -132,13 +134,13 @@ func (o *StatisticsResponse) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *StatisticsResponse) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetMeta returns the Meta field value if set, zero value otherwise. -func (o *StatisticsResponse) GetMeta() MetaData { - if o == nil || o.Meta == nil { - var ret MetaData +func (o *StatisticsResponse) GetMeta() StatisticsResponseMeta { + if o == nil || isNil(o.Meta) { + var ret StatisticsResponseMeta return ret } return *o.Meta @@ -146,39 +148,39 @@ func (o *StatisticsResponse) GetMeta() MetaData { // GetMetaOk returns a tuple with the Meta field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *StatisticsResponse) GetMetaOk() (*MetaData, bool) { - if o == nil || o.Meta == nil { - return nil, false +func (o *StatisticsResponse) GetMetaOk() (*StatisticsResponseMeta, bool) { + if o == nil || isNil(o.Meta) { + return nil, false } return o.Meta, true } // HasMeta returns a boolean if a field has been set. func (o *StatisticsResponse) HasMeta() bool { - if o != nil && o.Meta != nil { + if o != nil && !isNil(o.Meta) { return true } return false } -// SetMeta gets a reference to the given MetaData and assigns it to the Meta field. -func (o *StatisticsResponse) SetMeta(v MetaData) { +// SetMeta gets a reference to the given StatisticsResponseMeta and assigns it to the Meta field. +func (o *StatisticsResponse) SetMeta(v StatisticsResponseMeta) { o.Meta = &v } func (o StatisticsResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Data != nil { + if !isNil(o.Data) { toSerialize["Data"] = o.Data } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Meta != nil { + if !isNil(o.Meta) { toSerialize["Meta"] = o.Meta } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_statistics_response_links.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_statistics_response_links.go new file mode 100644 index 00000000..dfe4fbbe --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_statistics_response_links.go @@ -0,0 +1,153 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// StatisticsResponseLinks Links with reference to self and next data set +type StatisticsResponseLinks struct { + // Url for next data set + Next *string `json:"Next,omitempty"` + // Url for this data set (data might get updated, depending on your parameters) + Self *string `json:"Self,omitempty"` +} + +// NewStatisticsResponseLinks instantiates a new StatisticsResponseLinks object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStatisticsResponseLinks() *StatisticsResponseLinks { + this := StatisticsResponseLinks{} + return &this +} + +// NewStatisticsResponseLinksWithDefaults instantiates a new StatisticsResponseLinks object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStatisticsResponseLinksWithDefaults() *StatisticsResponseLinks { + this := StatisticsResponseLinks{} + return &this +} + +// GetNext returns the Next field value if set, zero value otherwise. +func (o *StatisticsResponseLinks) GetNext() string { + if o == nil || isNil(o.Next) { + var ret string + return ret + } + return *o.Next +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StatisticsResponseLinks) GetNextOk() (*string, bool) { + if o == nil || isNil(o.Next) { + return nil, false + } + return o.Next, true +} + +// HasNext returns a boolean if a field has been set. +func (o *StatisticsResponseLinks) HasNext() bool { + if o != nil && !isNil(o.Next) { + return true + } + + return false +} + +// SetNext gets a reference to the given string and assigns it to the Next field. +func (o *StatisticsResponseLinks) SetNext(v string) { + o.Next = &v +} + +// GetSelf returns the Self field value if set, zero value otherwise. +func (o *StatisticsResponseLinks) GetSelf() string { + if o == nil || isNil(o.Self) { + var ret string + return ret + } + return *o.Self +} + +// GetSelfOk returns a tuple with the Self field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StatisticsResponseLinks) GetSelfOk() (*string, bool) { + if o == nil || isNil(o.Self) { + return nil, false + } + return o.Self, true +} + +// HasSelf returns a boolean if a field has been set. +func (o *StatisticsResponseLinks) HasSelf() bool { + if o != nil && !isNil(o.Self) { + return true + } + + return false +} + +// SetSelf gets a reference to the given string and assigns it to the Self field. +func (o *StatisticsResponseLinks) SetSelf(v string) { + o.Self = &v +} + +func (o StatisticsResponseLinks) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Next) { + toSerialize["Next"] = o.Next + } + if !isNil(o.Self) { + toSerialize["Self"] = o.Self + } + return json.Marshal(toSerialize) +} + +type NullableStatisticsResponseLinks struct { + value *StatisticsResponseLinks + isSet bool +} + +func (v NullableStatisticsResponseLinks) Get() *StatisticsResponseLinks { + return v.value +} + +func (v *NullableStatisticsResponseLinks) Set(val *StatisticsResponseLinks) { + v.value = val + v.isSet = true +} + +func (v NullableStatisticsResponseLinks) IsSet() bool { + return v.isSet +} + +func (v *NullableStatisticsResponseLinks) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatisticsResponseLinks(val *StatisticsResponseLinks) *NullableStatisticsResponseLinks { + return &NullableStatisticsResponseLinks{value: val, isSet: true} +} + +func (v NullableStatisticsResponseLinks) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatisticsResponseLinks) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_statistics_response_meta.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_statistics_response_meta.go new file mode 100644 index 00000000..f5e20ede --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_statistics_response_meta.go @@ -0,0 +1,151 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// StatisticsResponseMeta Meta data +type StatisticsResponseMeta struct { + Timestamp map[string]interface{} `json:"Timestamp,omitempty"` + Period *PeriodMetaData `json:"Period,omitempty"` +} + +// NewStatisticsResponseMeta instantiates a new StatisticsResponseMeta object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStatisticsResponseMeta() *StatisticsResponseMeta { + this := StatisticsResponseMeta{} + return &this +} + +// NewStatisticsResponseMetaWithDefaults instantiates a new StatisticsResponseMeta object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStatisticsResponseMetaWithDefaults() *StatisticsResponseMeta { + this := StatisticsResponseMeta{} + return &this +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *StatisticsResponseMeta) GetTimestamp() map[string]interface{} { + if o == nil || isNil(o.Timestamp) { + var ret map[string]interface{} + return ret + } + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StatisticsResponseMeta) GetTimestampOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.Timestamp) { + return map[string]interface{}{}, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *StatisticsResponseMeta) HasTimestamp() bool { + if o != nil && !isNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given map[string]interface{} and assigns it to the Timestamp field. +func (o *StatisticsResponseMeta) SetTimestamp(v map[string]interface{}) { + o.Timestamp = v +} + +// GetPeriod returns the Period field value if set, zero value otherwise. +func (o *StatisticsResponseMeta) GetPeriod() PeriodMetaData { + if o == nil || isNil(o.Period) { + var ret PeriodMetaData + return ret + } + return *o.Period +} + +// GetPeriodOk returns a tuple with the Period field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StatisticsResponseMeta) GetPeriodOk() (*PeriodMetaData, bool) { + if o == nil || isNil(o.Period) { + return nil, false + } + return o.Period, true +} + +// HasPeriod returns a boolean if a field has been set. +func (o *StatisticsResponseMeta) HasPeriod() bool { + if o != nil && !isNil(o.Period) { + return true + } + + return false +} + +// SetPeriod gets a reference to the given PeriodMetaData and assigns it to the Period field. +func (o *StatisticsResponseMeta) SetPeriod(v PeriodMetaData) { + o.Period = &v +} + +func (o StatisticsResponseMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Timestamp) { + toSerialize["Timestamp"] = o.Timestamp + } + if !isNil(o.Period) { + toSerialize["Period"] = o.Period + } + return json.Marshal(toSerialize) +} + +type NullableStatisticsResponseMeta struct { + value *StatisticsResponseMeta + isSet bool +} + +func (v NullableStatisticsResponseMeta) Get() *StatisticsResponseMeta { + return v.value +} + +func (v *NullableStatisticsResponseMeta) Set(val *StatisticsResponseMeta) { + v.value = val + v.isSet = true +} + +func (v NullableStatisticsResponseMeta) IsSet() bool { + return v.isSet +} + +func (v *NullableStatisticsResponseMeta) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatisticsResponseMeta(val *StatisticsResponseMeta) *NullableStatisticsResponseMeta { + return &NullableStatisticsResponseMeta{value: val, isSet: true} +} + +func (v NullableStatisticsResponseMeta) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatisticsResponseMeta) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_step_timing_info.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_step_timing_info.go index a48a9f78..e73bd9c3 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_step_timing_info.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_step_timing_info.go @@ -12,17 +12,16 @@ package uptrends import ( "encoding/json" - "time" ) // StepTimingInfo struct for StepTimingInfo type StepTimingInfo struct { Description *string `json:"Description,omitempty"` - StartUtc time.Time `json:"StartUtc"` - EndUtc time.Time `json:"EndUtc"` + StartUtc map[string]interface{} `json:"StartUtc"` + EndUtc map[string]interface{} `json:"EndUtc"` ElapsedMilliseconds int64 `json:"ElapsedMilliseconds"` DelayMilliseconds int64 `json:"DelayMilliseconds"` - SubTimingInfos *[]StepTimingInfo `json:"SubTimingInfos,omitempty"` + SubTimingInfos []StepTimingInfo `json:"SubTimingInfos,omitempty"` // If true, this TimingInfo should be counted as part of the sum of its siblings. If false, the TimingInfo should be discarded (e.g. for PreDelays we don't want to count). IsValid bool `json:"IsValid"` } @@ -31,7 +30,7 @@ type StepTimingInfo struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewStepTimingInfo(startUtc time.Time, endUtc time.Time, elapsedMilliseconds int64, delayMilliseconds int64, isValid bool) *StepTimingInfo { +func NewStepTimingInfo(startUtc map[string]interface{}, endUtc map[string]interface{}, elapsedMilliseconds int64, delayMilliseconds int64, isValid bool) *StepTimingInfo { this := StepTimingInfo{} this.StartUtc = startUtc this.EndUtc = endUtc @@ -51,7 +50,7 @@ func NewStepTimingInfoWithDefaults() *StepTimingInfo { // GetDescription returns the Description field value if set, zero value otherwise. func (o *StepTimingInfo) GetDescription() string { - if o == nil || o.Description == nil { + if o == nil || isNil(o.Description) { var ret string return ret } @@ -61,15 +60,15 @@ func (o *StepTimingInfo) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *StepTimingInfo) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { - return nil, false + if o == nil || isNil(o.Description) { + return nil, false } return o.Description, true } // HasDescription returns a boolean if a field has been set. func (o *StepTimingInfo) HasDescription() bool { - if o != nil && o.Description != nil { + if o != nil && !isNil(o.Description) { return true } @@ -82,9 +81,9 @@ func (o *StepTimingInfo) SetDescription(v string) { } // GetStartUtc returns the StartUtc field value -func (o *StepTimingInfo) GetStartUtc() time.Time { +func (o *StepTimingInfo) GetStartUtc() map[string]interface{} { if o == nil { - var ret time.Time + var ret map[string]interface{} return ret } @@ -93,22 +92,22 @@ func (o *StepTimingInfo) GetStartUtc() time.Time { // GetStartUtcOk returns a tuple with the StartUtc field value // and a boolean to check if the value has been set. -func (o *StepTimingInfo) GetStartUtcOk() (*time.Time, bool) { - if o == nil { - return nil, false +func (o *StepTimingInfo) GetStartUtcOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false } - return &o.StartUtc, true + return o.StartUtc, true } // SetStartUtc sets field value -func (o *StepTimingInfo) SetStartUtc(v time.Time) { +func (o *StepTimingInfo) SetStartUtc(v map[string]interface{}) { o.StartUtc = v } // GetEndUtc returns the EndUtc field value -func (o *StepTimingInfo) GetEndUtc() time.Time { +func (o *StepTimingInfo) GetEndUtc() map[string]interface{} { if o == nil { - var ret time.Time + var ret map[string]interface{} return ret } @@ -117,15 +116,15 @@ func (o *StepTimingInfo) GetEndUtc() time.Time { // GetEndUtcOk returns a tuple with the EndUtc field value // and a boolean to check if the value has been set. -func (o *StepTimingInfo) GetEndUtcOk() (*time.Time, bool) { - if o == nil { - return nil, false +func (o *StepTimingInfo) GetEndUtcOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false } - return &o.EndUtc, true + return o.EndUtc, true } // SetEndUtc sets field value -func (o *StepTimingInfo) SetEndUtc(v time.Time) { +func (o *StepTimingInfo) SetEndUtc(v map[string]interface{}) { o.EndUtc = v } @@ -142,8 +141,8 @@ func (o *StepTimingInfo) GetElapsedMilliseconds() int64 { // GetElapsedMillisecondsOk returns a tuple with the ElapsedMilliseconds field value // and a boolean to check if the value has been set. func (o *StepTimingInfo) GetElapsedMillisecondsOk() (*int64, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.ElapsedMilliseconds, true } @@ -166,8 +165,8 @@ func (o *StepTimingInfo) GetDelayMilliseconds() int64 { // GetDelayMillisecondsOk returns a tuple with the DelayMilliseconds field value // and a boolean to check if the value has been set. func (o *StepTimingInfo) GetDelayMillisecondsOk() (*int64, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.DelayMilliseconds, true } @@ -179,25 +178,25 @@ func (o *StepTimingInfo) SetDelayMilliseconds(v int64) { // GetSubTimingInfos returns the SubTimingInfos field value if set, zero value otherwise. func (o *StepTimingInfo) GetSubTimingInfos() []StepTimingInfo { - if o == nil || o.SubTimingInfos == nil { + if o == nil || isNil(o.SubTimingInfos) { var ret []StepTimingInfo return ret } - return *o.SubTimingInfos + return o.SubTimingInfos } // GetSubTimingInfosOk returns a tuple with the SubTimingInfos field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *StepTimingInfo) GetSubTimingInfosOk() (*[]StepTimingInfo, bool) { - if o == nil || o.SubTimingInfos == nil { - return nil, false +func (o *StepTimingInfo) GetSubTimingInfosOk() ([]StepTimingInfo, bool) { + if o == nil || isNil(o.SubTimingInfos) { + return nil, false } return o.SubTimingInfos, true } // HasSubTimingInfos returns a boolean if a field has been set. func (o *StepTimingInfo) HasSubTimingInfos() bool { - if o != nil && o.SubTimingInfos != nil { + if o != nil && !isNil(o.SubTimingInfos) { return true } @@ -206,7 +205,7 @@ func (o *StepTimingInfo) HasSubTimingInfos() bool { // SetSubTimingInfos gets a reference to the given []StepTimingInfo and assigns it to the SubTimingInfos field. func (o *StepTimingInfo) SetSubTimingInfos(v []StepTimingInfo) { - o.SubTimingInfos = &v + o.SubTimingInfos = v } // GetIsValid returns the IsValid field value @@ -222,8 +221,8 @@ func (o *StepTimingInfo) GetIsValid() bool { // GetIsValidOk returns a tuple with the IsValid field value // and a boolean to check if the value has been set. func (o *StepTimingInfo) GetIsValidOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.IsValid, true } @@ -235,7 +234,7 @@ func (o *StepTimingInfo) SetIsValid(v bool) { func (o StepTimingInfo) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Description != nil { + if !isNil(o.Description) { toSerialize["Description"] = o.Description } if true { @@ -250,7 +249,7 @@ func (o StepTimingInfo) MarshalJSON() ([]byte, error) { if true { toSerialize["DelayMilliseconds"] = o.DelayMilliseconds } - if o.SubTimingInfos != nil { + if !isNil(o.SubTimingInfos) { toSerialize["SubTimingInfos"] = o.SubTimingInfos } if true { diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_sub_step_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_sub_step_type.go index 45248530..87c0062f 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_sub_step_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_sub_step_type.go @@ -33,7 +33,8 @@ const ( SUBSTEPTYPE_SWITCH_TO_TAB SubStepType = "SwitchToTab" ) -var allowedSubStepTypeEnumValues = []SubStepType{ +// All allowed values of SubStepType enum +var AllowedSubStepTypeEnumValues = []SubStepType{ "Navigate", "Click", "Set", @@ -54,7 +55,7 @@ func (v *SubStepType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := SubStepType(value) - for _, existing := range allowedSubStepTypeEnumValues { + for _, existing := range AllowedSubStepTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -71,13 +72,13 @@ func NewSubStepTypeFromValue(v string) (*SubStepType, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for SubStepType: valid values are %v", v, allowedSubStepTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for SubStepType: valid values are %v", v, AllowedSubStepTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v SubStepType) IsValid() bool { - for _, existing := range allowedSubStepTypeEnumValues { + for _, existing := range AllowedSubStepTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_throttling_options.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_throttling_options.go index 2585a083..c484a7ce 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_throttling_options.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_throttling_options.go @@ -42,7 +42,7 @@ func NewThrottlingOptionsWithDefaults() *ThrottlingOptions { // GetThrottlingType returns the ThrottlingType field value if set, zero value otherwise. func (o *ThrottlingOptions) GetThrottlingType() ThrottlingType { - if o == nil || o.ThrottlingType == nil { + if o == nil || isNil(o.ThrottlingType) { var ret ThrottlingType return ret } @@ -52,15 +52,15 @@ func (o *ThrottlingOptions) GetThrottlingType() ThrottlingType { // GetThrottlingTypeOk returns a tuple with the ThrottlingType field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ThrottlingOptions) GetThrottlingTypeOk() (*ThrottlingType, bool) { - if o == nil || o.ThrottlingType == nil { - return nil, false + if o == nil || isNil(o.ThrottlingType) { + return nil, false } return o.ThrottlingType, true } // HasThrottlingType returns a boolean if a field has been set. func (o *ThrottlingOptions) HasThrottlingType() bool { - if o != nil && o.ThrottlingType != nil { + if o != nil && !isNil(o.ThrottlingType) { return true } @@ -74,7 +74,7 @@ func (o *ThrottlingOptions) SetThrottlingType(v ThrottlingType) { // GetThrottlingValue returns the ThrottlingValue field value if set, zero value otherwise. func (o *ThrottlingOptions) GetThrottlingValue() ThrottlingValue { - if o == nil || o.ThrottlingValue == nil { + if o == nil || isNil(o.ThrottlingValue) { var ret ThrottlingValue return ret } @@ -84,15 +84,15 @@ func (o *ThrottlingOptions) GetThrottlingValue() ThrottlingValue { // GetThrottlingValueOk returns a tuple with the ThrottlingValue field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ThrottlingOptions) GetThrottlingValueOk() (*ThrottlingValue, bool) { - if o == nil || o.ThrottlingValue == nil { - return nil, false + if o == nil || isNil(o.ThrottlingValue) { + return nil, false } return o.ThrottlingValue, true } // HasThrottlingValue returns a boolean if a field has been set. func (o *ThrottlingOptions) HasThrottlingValue() bool { - if o != nil && o.ThrottlingValue != nil { + if o != nil && !isNil(o.ThrottlingValue) { return true } @@ -106,7 +106,7 @@ func (o *ThrottlingOptions) SetThrottlingValue(v ThrottlingValue) { // GetThrottlingSpeedUp returns the ThrottlingSpeedUp field value if set, zero value otherwise. func (o *ThrottlingOptions) GetThrottlingSpeedUp() int32 { - if o == nil || o.ThrottlingSpeedUp == nil { + if o == nil || isNil(o.ThrottlingSpeedUp) { var ret int32 return ret } @@ -116,15 +116,15 @@ func (o *ThrottlingOptions) GetThrottlingSpeedUp() int32 { // GetThrottlingSpeedUpOk returns a tuple with the ThrottlingSpeedUp field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ThrottlingOptions) GetThrottlingSpeedUpOk() (*int32, bool) { - if o == nil || o.ThrottlingSpeedUp == nil { - return nil, false + if o == nil || isNil(o.ThrottlingSpeedUp) { + return nil, false } return o.ThrottlingSpeedUp, true } // HasThrottlingSpeedUp returns a boolean if a field has been set. func (o *ThrottlingOptions) HasThrottlingSpeedUp() bool { - if o != nil && o.ThrottlingSpeedUp != nil { + if o != nil && !isNil(o.ThrottlingSpeedUp) { return true } @@ -138,7 +138,7 @@ func (o *ThrottlingOptions) SetThrottlingSpeedUp(v int32) { // GetThrottlingSpeedDown returns the ThrottlingSpeedDown field value if set, zero value otherwise. func (o *ThrottlingOptions) GetThrottlingSpeedDown() int32 { - if o == nil || o.ThrottlingSpeedDown == nil { + if o == nil || isNil(o.ThrottlingSpeedDown) { var ret int32 return ret } @@ -148,15 +148,15 @@ func (o *ThrottlingOptions) GetThrottlingSpeedDown() int32 { // GetThrottlingSpeedDownOk returns a tuple with the ThrottlingSpeedDown field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ThrottlingOptions) GetThrottlingSpeedDownOk() (*int32, bool) { - if o == nil || o.ThrottlingSpeedDown == nil { - return nil, false + if o == nil || isNil(o.ThrottlingSpeedDown) { + return nil, false } return o.ThrottlingSpeedDown, true } // HasThrottlingSpeedDown returns a boolean if a field has been set. func (o *ThrottlingOptions) HasThrottlingSpeedDown() bool { - if o != nil && o.ThrottlingSpeedDown != nil { + if o != nil && !isNil(o.ThrottlingSpeedDown) { return true } @@ -170,7 +170,7 @@ func (o *ThrottlingOptions) SetThrottlingSpeedDown(v int32) { // GetThrottlingLatency returns the ThrottlingLatency field value if set, zero value otherwise. func (o *ThrottlingOptions) GetThrottlingLatency() int32 { - if o == nil || o.ThrottlingLatency == nil { + if o == nil || isNil(o.ThrottlingLatency) { var ret int32 return ret } @@ -180,15 +180,15 @@ func (o *ThrottlingOptions) GetThrottlingLatency() int32 { // GetThrottlingLatencyOk returns a tuple with the ThrottlingLatency field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ThrottlingOptions) GetThrottlingLatencyOk() (*int32, bool) { - if o == nil || o.ThrottlingLatency == nil { - return nil, false + if o == nil || isNil(o.ThrottlingLatency) { + return nil, false } return o.ThrottlingLatency, true } // HasThrottlingLatency returns a boolean if a field has been set. func (o *ThrottlingOptions) HasThrottlingLatency() bool { - if o != nil && o.ThrottlingLatency != nil { + if o != nil && !isNil(o.ThrottlingLatency) { return true } @@ -202,19 +202,19 @@ func (o *ThrottlingOptions) SetThrottlingLatency(v int32) { func (o ThrottlingOptions) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.ThrottlingType != nil { + if !isNil(o.ThrottlingType) { toSerialize["ThrottlingType"] = o.ThrottlingType } - if o.ThrottlingValue != nil { + if !isNil(o.ThrottlingValue) { toSerialize["ThrottlingValue"] = o.ThrottlingValue } - if o.ThrottlingSpeedUp != nil { + if !isNil(o.ThrottlingSpeedUp) { toSerialize["ThrottlingSpeedUp"] = o.ThrottlingSpeedUp } - if o.ThrottlingSpeedDown != nil { + if !isNil(o.ThrottlingSpeedDown) { toSerialize["ThrottlingSpeedDown"] = o.ThrottlingSpeedDown } - if o.ThrottlingLatency != nil { + if !isNil(o.ThrottlingLatency) { toSerialize["ThrottlingLatency"] = o.ThrottlingLatency } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_throttling_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_throttling_type.go index 437dd673..ed07ef4a 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_throttling_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_throttling_type.go @@ -25,7 +25,8 @@ const ( THROTTLINGTYPE_SIMULATED ThrottlingType = "Simulated" ) -var allowedThrottlingTypeEnumValues = []ThrottlingType{ +// All allowed values of ThrottlingType enum +var AllowedThrottlingTypeEnumValues = []ThrottlingType{ "Inactive", "Browser", "Simulated", @@ -38,7 +39,7 @@ func (v *ThrottlingType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := ThrottlingType(value) - for _, existing := range allowedThrottlingTypeEnumValues { + for _, existing := range AllowedThrottlingTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -55,13 +56,13 @@ func NewThrottlingTypeFromValue(v string) (*ThrottlingType, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for ThrottlingType: valid values are %v", v, allowedThrottlingTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for ThrottlingType: valid values are %v", v, AllowedThrottlingTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v ThrottlingType) IsValid() bool { - for _, existing := range allowedThrottlingTypeEnumValues { + for _, existing := range AllowedThrottlingTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_throttling_value.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_throttling_value.go index 3ee83d94..d359935b 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_throttling_value.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_throttling_value.go @@ -28,7 +28,8 @@ const ( THROTTLINGVALUE__4_G ThrottlingValue = "4G" ) -var allowedThrottlingValueEnumValues = []ThrottlingValue{ +// All allowed values of ThrottlingValue enum +var AllowedThrottlingValueEnumValues = []ThrottlingValue{ "Adsl", "Fiber", "Cable", @@ -44,7 +45,7 @@ func (v *ThrottlingValue) UnmarshalJSON(src []byte) error { return err } enumTypeValue := ThrottlingValue(value) - for _, existing := range allowedThrottlingValueEnumValues { + for _, existing := range AllowedThrottlingValueEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -61,13 +62,13 @@ func NewThrottlingValueFromValue(v string) (*ThrottlingValue, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for ThrottlingValue: valid values are %v", v, allowedThrottlingValueEnumValues) + return nil, fmt.Errorf("invalid value '%v' for ThrottlingValue: valid values are %v", v, AllowedThrottlingValueEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v ThrottlingValue) IsValid() bool { - for _, existing := range allowedThrottlingValueEnumValues { + for _, existing := range AllowedThrottlingValueEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_timezone.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_timezone.go index 55d2ccb9..08e2cc1a 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_timezone.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_timezone.go @@ -26,6 +26,10 @@ type Timezone struct { HasDaylightSaving bool `json:"HasDaylightSaving"` // The time offset for Daylight Saving Time in minutes DaylightSavingOffset *int32 `json:"DaylightSavingOffset,omitempty"` + // The Daylight Saving start date/time + DaylightSavingStart map[string]interface{} `json:"DaylightSavingStart,omitempty"` + // The Daylight Saving end date/time + DaylightSavingEnd map[string]interface{} `json:"DaylightSavingEnd,omitempty"` } // NewTimezone instantiates a new Timezone object @@ -61,8 +65,8 @@ func (o *Timezone) GetTimezoneId() int32 { // GetTimezoneIdOk returns a tuple with the TimezoneId field value // and a boolean to check if the value has been set. func (o *Timezone) GetTimezoneIdOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.TimezoneId, true } @@ -74,7 +78,7 @@ func (o *Timezone) SetTimezoneId(v int32) { // GetDescription returns the Description field value if set, zero value otherwise. func (o *Timezone) GetDescription() string { - if o == nil || o.Description == nil { + if o == nil || isNil(o.Description) { var ret string return ret } @@ -84,15 +88,15 @@ func (o *Timezone) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Timezone) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { - return nil, false + if o == nil || isNil(o.Description) { + return nil, false } return o.Description, true } // HasDescription returns a boolean if a field has been set. func (o *Timezone) HasDescription() bool { - if o != nil && o.Description != nil { + if o != nil && !isNil(o.Description) { return true } @@ -117,8 +121,8 @@ func (o *Timezone) GetOffsetFromUtc() int32 { // GetOffsetFromUtcOk returns a tuple with the OffsetFromUtc field value // and a boolean to check if the value has been set. func (o *Timezone) GetOffsetFromUtcOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.OffsetFromUtc, true } @@ -141,8 +145,8 @@ func (o *Timezone) GetHasDaylightSaving() bool { // GetHasDaylightSavingOk returns a tuple with the HasDaylightSaving field value // and a boolean to check if the value has been set. func (o *Timezone) GetHasDaylightSavingOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.HasDaylightSaving, true } @@ -154,7 +158,7 @@ func (o *Timezone) SetHasDaylightSaving(v bool) { // GetDaylightSavingOffset returns the DaylightSavingOffset field value if set, zero value otherwise. func (o *Timezone) GetDaylightSavingOffset() int32 { - if o == nil || o.DaylightSavingOffset == nil { + if o == nil || isNil(o.DaylightSavingOffset) { var ret int32 return ret } @@ -164,15 +168,15 @@ func (o *Timezone) GetDaylightSavingOffset() int32 { // GetDaylightSavingOffsetOk returns a tuple with the DaylightSavingOffset field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Timezone) GetDaylightSavingOffsetOk() (*int32, bool) { - if o == nil || o.DaylightSavingOffset == nil { - return nil, false + if o == nil || isNil(o.DaylightSavingOffset) { + return nil, false } return o.DaylightSavingOffset, true } // HasDaylightSavingOffset returns a boolean if a field has been set. func (o *Timezone) HasDaylightSavingOffset() bool { - if o != nil && o.DaylightSavingOffset != nil { + if o != nil && !isNil(o.DaylightSavingOffset) { return true } @@ -184,12 +188,76 @@ func (o *Timezone) SetDaylightSavingOffset(v int32) { o.DaylightSavingOffset = &v } +// GetDaylightSavingStart returns the DaylightSavingStart field value if set, zero value otherwise. +func (o *Timezone) GetDaylightSavingStart() map[string]interface{} { + if o == nil || isNil(o.DaylightSavingStart) { + var ret map[string]interface{} + return ret + } + return o.DaylightSavingStart +} + +// GetDaylightSavingStartOk returns a tuple with the DaylightSavingStart field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Timezone) GetDaylightSavingStartOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.DaylightSavingStart) { + return map[string]interface{}{}, false + } + return o.DaylightSavingStart, true +} + +// HasDaylightSavingStart returns a boolean if a field has been set. +func (o *Timezone) HasDaylightSavingStart() bool { + if o != nil && !isNil(o.DaylightSavingStart) { + return true + } + + return false +} + +// SetDaylightSavingStart gets a reference to the given map[string]interface{} and assigns it to the DaylightSavingStart field. +func (o *Timezone) SetDaylightSavingStart(v map[string]interface{}) { + o.DaylightSavingStart = v +} + +// GetDaylightSavingEnd returns the DaylightSavingEnd field value if set, zero value otherwise. +func (o *Timezone) GetDaylightSavingEnd() map[string]interface{} { + if o == nil || isNil(o.DaylightSavingEnd) { + var ret map[string]interface{} + return ret + } + return o.DaylightSavingEnd +} + +// GetDaylightSavingEndOk returns a tuple with the DaylightSavingEnd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Timezone) GetDaylightSavingEndOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.DaylightSavingEnd) { + return map[string]interface{}{}, false + } + return o.DaylightSavingEnd, true +} + +// HasDaylightSavingEnd returns a boolean if a field has been set. +func (o *Timezone) HasDaylightSavingEnd() bool { + if o != nil && !isNil(o.DaylightSavingEnd) { + return true + } + + return false +} + +// SetDaylightSavingEnd gets a reference to the given map[string]interface{} and assigns it to the DaylightSavingEnd field. +func (o *Timezone) SetDaylightSavingEnd(v map[string]interface{}) { + o.DaylightSavingEnd = v +} + func (o Timezone) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if true { toSerialize["TimezoneId"] = o.TimezoneId } - if o.Description != nil { + if !isNil(o.Description) { toSerialize["Description"] = o.Description } if true { @@ -198,9 +266,15 @@ func (o Timezone) MarshalJSON() ([]byte, error) { if true { toSerialize["HasDaylightSaving"] = o.HasDaylightSaving } - if o.DaylightSavingOffset != nil { + if !isNil(o.DaylightSavingOffset) { toSerialize["DaylightSavingOffset"] = o.DaylightSavingOffset } + if !isNil(o.DaylightSavingStart) { + toSerialize["DaylightSavingStart"] = o.DaylightSavingStart + } + if !isNil(o.DaylightSavingEnd) { + toSerialize["DaylightSavingEnd"] = o.DaylightSavingEnd + } return json.Marshal(toSerialize) } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_tls_version.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_tls_version.go index b5418e77..cd3aa74d 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_tls_version.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_tls_version.go @@ -29,7 +29,8 @@ const ( TLSVERSION_TLS12_TLS11_TLS10_WITH_FALLBACK TlsVersion = "Tls12_Tls11_Tls10_WithFallback" ) -var allowedTlsVersionEnumValues = []TlsVersion{ +// All allowed values of TlsVersion enum +var AllowedTlsVersionEnumValues = []TlsVersion{ "Tls12", "Tls11", "Tls10", @@ -46,7 +47,7 @@ func (v *TlsVersion) UnmarshalJSON(src []byte) error { return err } enumTypeValue := TlsVersion(value) - for _, existing := range allowedTlsVersionEnumValues { + for _, existing := range AllowedTlsVersionEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -63,13 +64,13 @@ func NewTlsVersionFromValue(v string) (*TlsVersion, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for TlsVersion: valid values are %v", v, allowedTlsVersionEnumValues) + return nil, fmt.Errorf("invalid value '%v' for TlsVersion: valid values are %v", v, AllowedTlsVersionEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v TlsVersion) IsValid() bool { - for _, existing := range allowedTlsVersionEnumValues { + for _, existing := range AllowedTlsVersionEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_attributes.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_attributes.go index feccb612..a6b61b18 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_attributes.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_attributes.go @@ -17,7 +17,7 @@ import ( // TransactionAttributes struct for TransactionAttributes type TransactionAttributes struct { // Results of the transaction steps - StepResults *[]TransactionStepOResourceObject `json:"StepResults,omitempty"` + StepResults []TransactionStepOResourceObject `json:"StepResults,omitempty"` // The HTML code returned in case of errors ResponseBody *string `json:"ResponseBody,omitempty"` } @@ -41,25 +41,25 @@ func NewTransactionAttributesWithDefaults() *TransactionAttributes { // GetStepResults returns the StepResults field value if set, zero value otherwise. func (o *TransactionAttributes) GetStepResults() []TransactionStepOResourceObject { - if o == nil || o.StepResults == nil { + if o == nil || isNil(o.StepResults) { var ret []TransactionStepOResourceObject return ret } - return *o.StepResults + return o.StepResults } // GetStepResultsOk returns a tuple with the StepResults field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TransactionAttributes) GetStepResultsOk() (*[]TransactionStepOResourceObject, bool) { - if o == nil || o.StepResults == nil { - return nil, false +func (o *TransactionAttributes) GetStepResultsOk() ([]TransactionStepOResourceObject, bool) { + if o == nil || isNil(o.StepResults) { + return nil, false } return o.StepResults, true } // HasStepResults returns a boolean if a field has been set. func (o *TransactionAttributes) HasStepResults() bool { - if o != nil && o.StepResults != nil { + if o != nil && !isNil(o.StepResults) { return true } @@ -68,12 +68,12 @@ func (o *TransactionAttributes) HasStepResults() bool { // SetStepResults gets a reference to the given []TransactionStepOResourceObject and assigns it to the StepResults field. func (o *TransactionAttributes) SetStepResults(v []TransactionStepOResourceObject) { - o.StepResults = &v + o.StepResults = v } // GetResponseBody returns the ResponseBody field value if set, zero value otherwise. func (o *TransactionAttributes) GetResponseBody() string { - if o == nil || o.ResponseBody == nil { + if o == nil || isNil(o.ResponseBody) { var ret string return ret } @@ -83,15 +83,15 @@ func (o *TransactionAttributes) GetResponseBody() string { // GetResponseBodyOk returns a tuple with the ResponseBody field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TransactionAttributes) GetResponseBodyOk() (*string, bool) { - if o == nil || o.ResponseBody == nil { - return nil, false + if o == nil || isNil(o.ResponseBody) { + return nil, false } return o.ResponseBody, true } // HasResponseBody returns a boolean if a field has been set. func (o *TransactionAttributes) HasResponseBody() bool { - if o != nil && o.ResponseBody != nil { + if o != nil && !isNil(o.ResponseBody) { return true } @@ -105,10 +105,10 @@ func (o *TransactionAttributes) SetResponseBody(v string) { func (o TransactionAttributes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.StepResults != nil { + if !isNil(o.StepResults) { toSerialize["StepResults"] = o.StepResults } - if o.ResponseBody != nil { + if !isNil(o.ResponseBody) { toSerialize["ResponseBody"] = o.ResponseBody } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_check_details.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_check_details.go index 278a09f9..f5950dbd 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_check_details.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_check_details.go @@ -16,10 +16,14 @@ import ( // TransactionCheckDetails struct for TransactionCheckDetails type TransactionCheckDetails struct { - Attributes *TransactionAttributes `json:"Attributes,omitempty"` + Attributes *TransactionCheckDetailsAttributes `json:"Attributes,omitempty"` + // Identifier Id int64 `json:"Id"` + // Object type Type *string `json:"Type,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + // Links related to the object Links *map[string]string `json:"Links,omitempty"` } @@ -42,9 +46,9 @@ func NewTransactionCheckDetailsWithDefaults() *TransactionCheckDetails { } // GetAttributes returns the Attributes field value if set, zero value otherwise. -func (o *TransactionCheckDetails) GetAttributes() TransactionAttributes { - if o == nil || o.Attributes == nil { - var ret TransactionAttributes +func (o *TransactionCheckDetails) GetAttributes() TransactionCheckDetailsAttributes { + if o == nil || isNil(o.Attributes) { + var ret TransactionCheckDetailsAttributes return ret } return *o.Attributes @@ -52,24 +56,24 @@ func (o *TransactionCheckDetails) GetAttributes() TransactionAttributes { // GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TransactionCheckDetails) GetAttributesOk() (*TransactionAttributes, bool) { - if o == nil || o.Attributes == nil { - return nil, false +func (o *TransactionCheckDetails) GetAttributesOk() (*TransactionCheckDetailsAttributes, bool) { + if o == nil || isNil(o.Attributes) { + return nil, false } return o.Attributes, true } // HasAttributes returns a boolean if a field has been set. func (o *TransactionCheckDetails) HasAttributes() bool { - if o != nil && o.Attributes != nil { + if o != nil && !isNil(o.Attributes) { return true } return false } -// SetAttributes gets a reference to the given TransactionAttributes and assigns it to the Attributes field. -func (o *TransactionCheckDetails) SetAttributes(v TransactionAttributes) { +// SetAttributes gets a reference to the given TransactionCheckDetailsAttributes and assigns it to the Attributes field. +func (o *TransactionCheckDetails) SetAttributes(v TransactionCheckDetailsAttributes) { o.Attributes = &v } @@ -86,8 +90,8 @@ func (o *TransactionCheckDetails) GetId() int64 { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *TransactionCheckDetails) GetIdOk() (*int64, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Id, true } @@ -99,7 +103,7 @@ func (o *TransactionCheckDetails) SetId(v int64) { // GetType returns the Type field value if set, zero value otherwise. func (o *TransactionCheckDetails) GetType() string { - if o == nil || o.Type == nil { + if o == nil || isNil(o.Type) { var ret string return ret } @@ -109,15 +113,15 @@ func (o *TransactionCheckDetails) GetType() string { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TransactionCheckDetails) GetTypeOk() (*string, bool) { - if o == nil || o.Type == nil { - return nil, false + if o == nil || isNil(o.Type) { + return nil, false } return o.Type, true } // HasType returns a boolean if a field has been set. func (o *TransactionCheckDetails) HasType() bool { - if o != nil && o.Type != nil { + if o != nil && !isNil(o.Type) { return true } @@ -131,25 +135,25 @@ func (o *TransactionCheckDetails) SetType(v string) { // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *TransactionCheckDetails) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TransactionCheckDetails) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *TransactionCheckDetails) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *TransactionCheckDetails) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -158,12 +162,12 @@ func (o *TransactionCheckDetails) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *TransactionCheckDetails) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetLinks returns the Links field value if set, zero value otherwise. func (o *TransactionCheckDetails) GetLinks() map[string]string { - if o == nil || o.Links == nil { + if o == nil || isNil(o.Links) { var ret map[string]string return ret } @@ -173,15 +177,15 @@ func (o *TransactionCheckDetails) GetLinks() map[string]string { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TransactionCheckDetails) GetLinksOk() (*map[string]string, bool) { - if o == nil || o.Links == nil { - return nil, false + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *TransactionCheckDetails) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } @@ -195,19 +199,19 @@ func (o *TransactionCheckDetails) SetLinks(v map[string]string) { func (o TransactionCheckDetails) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Attributes != nil { + if !isNil(o.Attributes) { toSerialize["Attributes"] = o.Attributes } if true { toSerialize["Id"] = o.Id } - if o.Type != nil { + if !isNil(o.Type) { toSerialize["Type"] = o.Type } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_check_details_attributes.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_check_details_attributes.go new file mode 100644 index 00000000..ac907a7a --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_check_details_attributes.go @@ -0,0 +1,153 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// TransactionCheckDetailsAttributes Object attributes +type TransactionCheckDetailsAttributes struct { + // Results of the transaction steps + StepResults []TransactionStepOResourceObject `json:"StepResults,omitempty"` + // The HTML code returned in case of errors + ResponseBody *string `json:"ResponseBody,omitempty"` +} + +// NewTransactionCheckDetailsAttributes instantiates a new TransactionCheckDetailsAttributes object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransactionCheckDetailsAttributes() *TransactionCheckDetailsAttributes { + this := TransactionCheckDetailsAttributes{} + return &this +} + +// NewTransactionCheckDetailsAttributesWithDefaults instantiates a new TransactionCheckDetailsAttributes object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactionCheckDetailsAttributesWithDefaults() *TransactionCheckDetailsAttributes { + this := TransactionCheckDetailsAttributes{} + return &this +} + +// GetStepResults returns the StepResults field value if set, zero value otherwise. +func (o *TransactionCheckDetailsAttributes) GetStepResults() []TransactionStepOResourceObject { + if o == nil || isNil(o.StepResults) { + var ret []TransactionStepOResourceObject + return ret + } + return o.StepResults +} + +// GetStepResultsOk returns a tuple with the StepResults field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionCheckDetailsAttributes) GetStepResultsOk() ([]TransactionStepOResourceObject, bool) { + if o == nil || isNil(o.StepResults) { + return nil, false + } + return o.StepResults, true +} + +// HasStepResults returns a boolean if a field has been set. +func (o *TransactionCheckDetailsAttributes) HasStepResults() bool { + if o != nil && !isNil(o.StepResults) { + return true + } + + return false +} + +// SetStepResults gets a reference to the given []TransactionStepOResourceObject and assigns it to the StepResults field. +func (o *TransactionCheckDetailsAttributes) SetStepResults(v []TransactionStepOResourceObject) { + o.StepResults = v +} + +// GetResponseBody returns the ResponseBody field value if set, zero value otherwise. +func (o *TransactionCheckDetailsAttributes) GetResponseBody() string { + if o == nil || isNil(o.ResponseBody) { + var ret string + return ret + } + return *o.ResponseBody +} + +// GetResponseBodyOk returns a tuple with the ResponseBody field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionCheckDetailsAttributes) GetResponseBodyOk() (*string, bool) { + if o == nil || isNil(o.ResponseBody) { + return nil, false + } + return o.ResponseBody, true +} + +// HasResponseBody returns a boolean if a field has been set. +func (o *TransactionCheckDetailsAttributes) HasResponseBody() bool { + if o != nil && !isNil(o.ResponseBody) { + return true + } + + return false +} + +// SetResponseBody gets a reference to the given string and assigns it to the ResponseBody field. +func (o *TransactionCheckDetailsAttributes) SetResponseBody(v string) { + o.ResponseBody = &v +} + +func (o TransactionCheckDetailsAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.StepResults) { + toSerialize["StepResults"] = o.StepResults + } + if !isNil(o.ResponseBody) { + toSerialize["ResponseBody"] = o.ResponseBody + } + return json.Marshal(toSerialize) +} + +type NullableTransactionCheckDetailsAttributes struct { + value *TransactionCheckDetailsAttributes + isSet bool +} + +func (v NullableTransactionCheckDetailsAttributes) Get() *TransactionCheckDetailsAttributes { + return v.value +} + +func (v *NullableTransactionCheckDetailsAttributes) Set(val *TransactionCheckDetailsAttributes) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionCheckDetailsAttributes) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionCheckDetailsAttributes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionCheckDetailsAttributes(val *TransactionCheckDetailsAttributes) *NullableTransactionCheckDetailsAttributes { + return &NullableTransactionCheckDetailsAttributes{value: val, isSet: true} +} + +func (v NullableTransactionCheckDetailsAttributes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionCheckDetailsAttributes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_details_response.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_details_response.go index a9dbd8c0..0889fa90 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_details_response.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_details_response.go @@ -16,10 +16,11 @@ import ( // TransactionDetailsResponse struct for TransactionDetailsResponse type TransactionDetailsResponse struct { - Data *TransactionCheckDetails `json:"Data,omitempty"` - Links *LinksData `json:"Links,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` - Meta *MetaData `json:"Meta,omitempty"` + Data *TransactionDetailsResponseData `json:"Data,omitempty"` + Links *StatisticsResponseLinks `json:"Links,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + Meta *StatisticsResponseMeta `json:"Meta,omitempty"` } // NewTransactionDetailsResponse instantiates a new TransactionDetailsResponse object @@ -40,9 +41,9 @@ func NewTransactionDetailsResponseWithDefaults() *TransactionDetailsResponse { } // GetData returns the Data field value if set, zero value otherwise. -func (o *TransactionDetailsResponse) GetData() TransactionCheckDetails { - if o == nil || o.Data == nil { - var ret TransactionCheckDetails +func (o *TransactionDetailsResponse) GetData() TransactionDetailsResponseData { + if o == nil || isNil(o.Data) { + var ret TransactionDetailsResponseData return ret } return *o.Data @@ -50,31 +51,31 @@ func (o *TransactionDetailsResponse) GetData() TransactionCheckDetails { // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TransactionDetailsResponse) GetDataOk() (*TransactionCheckDetails, bool) { - if o == nil || o.Data == nil { - return nil, false +func (o *TransactionDetailsResponse) GetDataOk() (*TransactionDetailsResponseData, bool) { + if o == nil || isNil(o.Data) { + return nil, false } return o.Data, true } // HasData returns a boolean if a field has been set. func (o *TransactionDetailsResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && !isNil(o.Data) { return true } return false } -// SetData gets a reference to the given TransactionCheckDetails and assigns it to the Data field. -func (o *TransactionDetailsResponse) SetData(v TransactionCheckDetails) { +// SetData gets a reference to the given TransactionDetailsResponseData and assigns it to the Data field. +func (o *TransactionDetailsResponse) SetData(v TransactionDetailsResponseData) { o.Data = &v } // GetLinks returns the Links field value if set, zero value otherwise. -func (o *TransactionDetailsResponse) GetLinks() LinksData { - if o == nil || o.Links == nil { - var ret LinksData +func (o *TransactionDetailsResponse) GetLinks() StatisticsResponseLinks { + if o == nil || isNil(o.Links) { + var ret StatisticsResponseLinks return ret } return *o.Links @@ -82,48 +83,48 @@ func (o *TransactionDetailsResponse) GetLinks() LinksData { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TransactionDetailsResponse) GetLinksOk() (*LinksData, bool) { - if o == nil || o.Links == nil { - return nil, false +func (o *TransactionDetailsResponse) GetLinksOk() (*StatisticsResponseLinks, bool) { + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *TransactionDetailsResponse) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } return false } -// SetLinks gets a reference to the given LinksData and assigns it to the Links field. -func (o *TransactionDetailsResponse) SetLinks(v LinksData) { +// SetLinks gets a reference to the given StatisticsResponseLinks and assigns it to the Links field. +func (o *TransactionDetailsResponse) SetLinks(v StatisticsResponseLinks) { o.Links = &v } // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *TransactionDetailsResponse) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TransactionDetailsResponse) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *TransactionDetailsResponse) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *TransactionDetailsResponse) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -132,13 +133,13 @@ func (o *TransactionDetailsResponse) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *TransactionDetailsResponse) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetMeta returns the Meta field value if set, zero value otherwise. -func (o *TransactionDetailsResponse) GetMeta() MetaData { - if o == nil || o.Meta == nil { - var ret MetaData +func (o *TransactionDetailsResponse) GetMeta() StatisticsResponseMeta { + if o == nil || isNil(o.Meta) { + var ret StatisticsResponseMeta return ret } return *o.Meta @@ -146,39 +147,39 @@ func (o *TransactionDetailsResponse) GetMeta() MetaData { // GetMetaOk returns a tuple with the Meta field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TransactionDetailsResponse) GetMetaOk() (*MetaData, bool) { - if o == nil || o.Meta == nil { - return nil, false +func (o *TransactionDetailsResponse) GetMetaOk() (*StatisticsResponseMeta, bool) { + if o == nil || isNil(o.Meta) { + return nil, false } return o.Meta, true } // HasMeta returns a boolean if a field has been set. func (o *TransactionDetailsResponse) HasMeta() bool { - if o != nil && o.Meta != nil { + if o != nil && !isNil(o.Meta) { return true } return false } -// SetMeta gets a reference to the given MetaData and assigns it to the Meta field. -func (o *TransactionDetailsResponse) SetMeta(v MetaData) { +// SetMeta gets a reference to the given StatisticsResponseMeta and assigns it to the Meta field. +func (o *TransactionDetailsResponse) SetMeta(v StatisticsResponseMeta) { o.Meta = &v } func (o TransactionDetailsResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Data != nil { + if !isNil(o.Data) { toSerialize["Data"] = o.Data } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Meta != nil { + if !isNil(o.Meta) { toSerialize["Meta"] = o.Meta } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_details_response_data.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_details_response_data.go new file mode 100644 index 00000000..5a21d292 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_details_response_data.go @@ -0,0 +1,256 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// TransactionDetailsResponseData The resposne data/monitor checks +type TransactionDetailsResponseData struct { + Attributes *TransactionCheckDetailsAttributes `json:"Attributes,omitempty"` + // Identifier + Id int64 `json:"Id"` + // Object type + Type *string `json:"Type,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + // Links related to the object + Links *map[string]string `json:"Links,omitempty"` +} + +// NewTransactionDetailsResponseData instantiates a new TransactionDetailsResponseData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransactionDetailsResponseData(id int64) *TransactionDetailsResponseData { + this := TransactionDetailsResponseData{} + this.Id = id + return &this +} + +// NewTransactionDetailsResponseDataWithDefaults instantiates a new TransactionDetailsResponseData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactionDetailsResponseDataWithDefaults() *TransactionDetailsResponseData { + this := TransactionDetailsResponseData{} + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *TransactionDetailsResponseData) GetAttributes() TransactionCheckDetailsAttributes { + if o == nil || isNil(o.Attributes) { + var ret TransactionCheckDetailsAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionDetailsResponseData) GetAttributesOk() (*TransactionCheckDetailsAttributes, bool) { + if o == nil || isNil(o.Attributes) { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *TransactionDetailsResponseData) HasAttributes() bool { + if o != nil && !isNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given TransactionCheckDetailsAttributes and assigns it to the Attributes field. +func (o *TransactionDetailsResponseData) SetAttributes(v TransactionCheckDetailsAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value +func (o *TransactionDetailsResponseData) GetId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *TransactionDetailsResponseData) GetIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *TransactionDetailsResponseData) SetId(v int64) { + o.Id = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *TransactionDetailsResponseData) GetType() string { + if o == nil || isNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionDetailsResponseData) GetTypeOk() (*string, bool) { + if o == nil || isNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *TransactionDetailsResponseData) HasType() bool { + if o != nil && !isNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *TransactionDetailsResponseData) SetType(v string) { + o.Type = &v +} + +// GetRelationships returns the Relationships field value if set, zero value otherwise. +func (o *TransactionDetailsResponseData) GetRelationships() []RelationObject { + if o == nil || isNil(o.Relationships) { + var ret []RelationObject + return ret + } + return o.Relationships +} + +// GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionDetailsResponseData) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false + } + return o.Relationships, true +} + +// HasRelationships returns a boolean if a field has been set. +func (o *TransactionDetailsResponseData) HasRelationships() bool { + if o != nil && !isNil(o.Relationships) { + return true + } + + return false +} + +// SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. +func (o *TransactionDetailsResponseData) SetRelationships(v []RelationObject) { + o.Relationships = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *TransactionDetailsResponseData) GetLinks() map[string]string { + if o == nil || isNil(o.Links) { + var ret map[string]string + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionDetailsResponseData) GetLinksOk() (*map[string]string, bool) { + if o == nil || isNil(o.Links) { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *TransactionDetailsResponseData) HasLinks() bool { + if o != nil && !isNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given map[string]string and assigns it to the Links field. +func (o *TransactionDetailsResponseData) SetLinks(v map[string]string) { + o.Links = &v +} + +func (o TransactionDetailsResponseData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Attributes) { + toSerialize["Attributes"] = o.Attributes + } + if true { + toSerialize["Id"] = o.Id + } + if !isNil(o.Type) { + toSerialize["Type"] = o.Type + } + if !isNil(o.Relationships) { + toSerialize["Relationships"] = o.Relationships + } + if !isNil(o.Links) { + toSerialize["Links"] = o.Links + } + return json.Marshal(toSerialize) +} + +type NullableTransactionDetailsResponseData struct { + value *TransactionDetailsResponseData + isSet bool +} + +func (v NullableTransactionDetailsResponseData) Get() *TransactionDetailsResponseData { + return v.value +} + +func (v *NullableTransactionDetailsResponseData) Set(val *TransactionDetailsResponseData) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionDetailsResponseData) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionDetailsResponseData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionDetailsResponseData(val *TransactionDetailsResponseData) *NullableTransactionDetailsResponseData { + return &NullableTransactionDetailsResponseData{value: val, isSet: true} +} + +func (v NullableTransactionDetailsResponseData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionDetailsResponseData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_step.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_step.go index d989d8ad..d2456ca4 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_step.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_step.go @@ -23,7 +23,7 @@ type TransactionStep struct { // Number of milliseconds it took for this step to succeed TotalTime float64 `json:"TotalTime"` // Text representation of the step element results - Elements *[]string `json:"Elements,omitempty"` + Elements []string `json:"Elements,omitempty"` // Did this step result in an error? HasError bool `json:"HasError"` } @@ -61,8 +61,8 @@ func (o *TransactionStep) GetStepNumber() int32 { // GetStepNumberOk returns a tuple with the StepNumber field value // and a boolean to check if the value has been set. func (o *TransactionStep) GetStepNumberOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.StepNumber, true } @@ -74,7 +74,7 @@ func (o *TransactionStep) SetStepNumber(v int32) { // GetStepName returns the StepName field value if set, zero value otherwise. func (o *TransactionStep) GetStepName() string { - if o == nil || o.StepName == nil { + if o == nil || isNil(o.StepName) { var ret string return ret } @@ -84,15 +84,15 @@ func (o *TransactionStep) GetStepName() string { // GetStepNameOk returns a tuple with the StepName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TransactionStep) GetStepNameOk() (*string, bool) { - if o == nil || o.StepName == nil { - return nil, false + if o == nil || isNil(o.StepName) { + return nil, false } return o.StepName, true } // HasStepName returns a boolean if a field has been set. func (o *TransactionStep) HasStepName() bool { - if o != nil && o.StepName != nil { + if o != nil && !isNil(o.StepName) { return true } @@ -117,8 +117,8 @@ func (o *TransactionStep) GetTotalTime() float64 { // GetTotalTimeOk returns a tuple with the TotalTime field value // and a boolean to check if the value has been set. func (o *TransactionStep) GetTotalTimeOk() (*float64, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.TotalTime, true } @@ -130,25 +130,25 @@ func (o *TransactionStep) SetTotalTime(v float64) { // GetElements returns the Elements field value if set, zero value otherwise. func (o *TransactionStep) GetElements() []string { - if o == nil || o.Elements == nil { + if o == nil || isNil(o.Elements) { var ret []string return ret } - return *o.Elements + return o.Elements } // GetElementsOk returns a tuple with the Elements field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TransactionStep) GetElementsOk() (*[]string, bool) { - if o == nil || o.Elements == nil { - return nil, false +func (o *TransactionStep) GetElementsOk() ([]string, bool) { + if o == nil || isNil(o.Elements) { + return nil, false } return o.Elements, true } // HasElements returns a boolean if a field has been set. func (o *TransactionStep) HasElements() bool { - if o != nil && o.Elements != nil { + if o != nil && !isNil(o.Elements) { return true } @@ -157,7 +157,7 @@ func (o *TransactionStep) HasElements() bool { // SetElements gets a reference to the given []string and assigns it to the Elements field. func (o *TransactionStep) SetElements(v []string) { - o.Elements = &v + o.Elements = v } // GetHasError returns the HasError field value @@ -173,8 +173,8 @@ func (o *TransactionStep) GetHasError() bool { // GetHasErrorOk returns a tuple with the HasError field value // and a boolean to check if the value has been set. func (o *TransactionStep) GetHasErrorOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.HasError, true } @@ -189,13 +189,13 @@ func (o TransactionStep) MarshalJSON() ([]byte, error) { if true { toSerialize["StepNumber"] = o.StepNumber } - if o.StepName != nil { + if !isNil(o.StepName) { toSerialize["StepName"] = o.StepName } if true { toSerialize["TotalTime"] = o.TotalTime } - if o.Elements != nil { + if !isNil(o.Elements) { toSerialize["Elements"] = o.Elements } if true { diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_step2.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_step2.go index 786c2cfc..ed384ba3 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_step2.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_step2.go @@ -19,7 +19,7 @@ type TransactionStep2 struct { Name *string `json:"Name,omitempty"` HasScreenshot bool `json:"HasScreenshot"` HasWaterfall bool `json:"HasWaterfall"` - SubSteps *[]TransactionSubStep `json:"SubSteps,omitempty"` + SubSteps []TransactionSubStep `json:"SubSteps,omitempty"` } // NewTransactionStep2 instantiates a new TransactionStep2 object @@ -43,7 +43,7 @@ func NewTransactionStep2WithDefaults() *TransactionStep2 { // GetName returns the Name field value if set, zero value otherwise. func (o *TransactionStep2) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -53,15 +53,15 @@ func (o *TransactionStep2) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TransactionStep2) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *TransactionStep2) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -86,8 +86,8 @@ func (o *TransactionStep2) GetHasScreenshot() bool { // GetHasScreenshotOk returns a tuple with the HasScreenshot field value // and a boolean to check if the value has been set. func (o *TransactionStep2) GetHasScreenshotOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.HasScreenshot, true } @@ -110,8 +110,8 @@ func (o *TransactionStep2) GetHasWaterfall() bool { // GetHasWaterfallOk returns a tuple with the HasWaterfall field value // and a boolean to check if the value has been set. func (o *TransactionStep2) GetHasWaterfallOk() (*bool, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.HasWaterfall, true } @@ -123,25 +123,25 @@ func (o *TransactionStep2) SetHasWaterfall(v bool) { // GetSubSteps returns the SubSteps field value if set, zero value otherwise. func (o *TransactionStep2) GetSubSteps() []TransactionSubStep { - if o == nil || o.SubSteps == nil { + if o == nil || isNil(o.SubSteps) { var ret []TransactionSubStep return ret } - return *o.SubSteps + return o.SubSteps } // GetSubStepsOk returns a tuple with the SubSteps field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TransactionStep2) GetSubStepsOk() (*[]TransactionSubStep, bool) { - if o == nil || o.SubSteps == nil { - return nil, false +func (o *TransactionStep2) GetSubStepsOk() ([]TransactionSubStep, bool) { + if o == nil || isNil(o.SubSteps) { + return nil, false } return o.SubSteps, true } // HasSubSteps returns a boolean if a field has been set. func (o *TransactionStep2) HasSubSteps() bool { - if o != nil && o.SubSteps != nil { + if o != nil && !isNil(o.SubSteps) { return true } @@ -150,12 +150,12 @@ func (o *TransactionStep2) HasSubSteps() bool { // SetSubSteps gets a reference to the given []TransactionSubStep and assigns it to the SubSteps field. func (o *TransactionStep2) SetSubSteps(v []TransactionSubStep) { - o.SubSteps = &v + o.SubSteps = v } func (o TransactionStep2) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !isNil(o.Name) { toSerialize["Name"] = o.Name } if true { @@ -164,7 +164,7 @@ func (o TransactionStep2) MarshalJSON() ([]byte, error) { if true { toSerialize["HasWaterfall"] = o.HasWaterfall } - if o.SubSteps != nil { + if !isNil(o.SubSteps) { toSerialize["SubSteps"] = o.SubSteps } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_step_definition.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_step_definition.go index 03143043..818fc824 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_step_definition.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_step_definition.go @@ -16,7 +16,7 @@ import ( // TransactionStepDefinition struct for TransactionStepDefinition type TransactionStepDefinition struct { - Steps *[]TransactionStep2 `json:"Steps,omitempty"` + Steps []TransactionStep2 `json:"Steps,omitempty"` } // NewTransactionStepDefinition instantiates a new TransactionStepDefinition object @@ -38,25 +38,25 @@ func NewTransactionStepDefinitionWithDefaults() *TransactionStepDefinition { // GetSteps returns the Steps field value if set, zero value otherwise. func (o *TransactionStepDefinition) GetSteps() []TransactionStep2 { - if o == nil || o.Steps == nil { + if o == nil || isNil(o.Steps) { var ret []TransactionStep2 return ret } - return *o.Steps + return o.Steps } // GetStepsOk returns a tuple with the Steps field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TransactionStepDefinition) GetStepsOk() (*[]TransactionStep2, bool) { - if o == nil || o.Steps == nil { - return nil, false +func (o *TransactionStepDefinition) GetStepsOk() ([]TransactionStep2, bool) { + if o == nil || isNil(o.Steps) { + return nil, false } return o.Steps, true } // HasSteps returns a boolean if a field has been set. func (o *TransactionStepDefinition) HasSteps() bool { - if o != nil && o.Steps != nil { + if o != nil && !isNil(o.Steps) { return true } @@ -65,12 +65,12 @@ func (o *TransactionStepDefinition) HasSteps() bool { // SetSteps gets a reference to the given []TransactionStep2 and assigns it to the Steps field. func (o *TransactionStepDefinition) SetSteps(v []TransactionStep2) { - o.Steps = &v + o.Steps = v } func (o TransactionStepDefinition) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Steps != nil { + if !isNil(o.Steps) { toSerialize["Steps"] = o.Steps } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_step_o_resource_object.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_step_o_resource_object.go index 87d634bd..c83b4acc 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_step_o_resource_object.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_step_o_resource_object.go @@ -16,10 +16,14 @@ import ( // TransactionStepOResourceObject struct for TransactionStepOResourceObject type TransactionStepOResourceObject struct { - Attributes *TransactionStep `json:"Attributes,omitempty"` + Attributes *TransactionStepOResourceObjectAttributes `json:"Attributes,omitempty"` + // Identifier Id int32 `json:"Id"` + // Object type Type *string `json:"Type,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + // Links related to the object Links *map[string]string `json:"Links,omitempty"` } @@ -42,9 +46,9 @@ func NewTransactionStepOResourceObjectWithDefaults() *TransactionStepOResourceOb } // GetAttributes returns the Attributes field value if set, zero value otherwise. -func (o *TransactionStepOResourceObject) GetAttributes() TransactionStep { - if o == nil || o.Attributes == nil { - var ret TransactionStep +func (o *TransactionStepOResourceObject) GetAttributes() TransactionStepOResourceObjectAttributes { + if o == nil || isNil(o.Attributes) { + var ret TransactionStepOResourceObjectAttributes return ret } return *o.Attributes @@ -52,24 +56,24 @@ func (o *TransactionStepOResourceObject) GetAttributes() TransactionStep { // GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TransactionStepOResourceObject) GetAttributesOk() (*TransactionStep, bool) { - if o == nil || o.Attributes == nil { - return nil, false +func (o *TransactionStepOResourceObject) GetAttributesOk() (*TransactionStepOResourceObjectAttributes, bool) { + if o == nil || isNil(o.Attributes) { + return nil, false } return o.Attributes, true } // HasAttributes returns a boolean if a field has been set. func (o *TransactionStepOResourceObject) HasAttributes() bool { - if o != nil && o.Attributes != nil { + if o != nil && !isNil(o.Attributes) { return true } return false } -// SetAttributes gets a reference to the given TransactionStep and assigns it to the Attributes field. -func (o *TransactionStepOResourceObject) SetAttributes(v TransactionStep) { +// SetAttributes gets a reference to the given TransactionStepOResourceObjectAttributes and assigns it to the Attributes field. +func (o *TransactionStepOResourceObject) SetAttributes(v TransactionStepOResourceObjectAttributes) { o.Attributes = &v } @@ -86,8 +90,8 @@ func (o *TransactionStepOResourceObject) GetId() int32 { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *TransactionStepOResourceObject) GetIdOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Id, true } @@ -99,7 +103,7 @@ func (o *TransactionStepOResourceObject) SetId(v int32) { // GetType returns the Type field value if set, zero value otherwise. func (o *TransactionStepOResourceObject) GetType() string { - if o == nil || o.Type == nil { + if o == nil || isNil(o.Type) { var ret string return ret } @@ -109,15 +113,15 @@ func (o *TransactionStepOResourceObject) GetType() string { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TransactionStepOResourceObject) GetTypeOk() (*string, bool) { - if o == nil || o.Type == nil { - return nil, false + if o == nil || isNil(o.Type) { + return nil, false } return o.Type, true } // HasType returns a boolean if a field has been set. func (o *TransactionStepOResourceObject) HasType() bool { - if o != nil && o.Type != nil { + if o != nil && !isNil(o.Type) { return true } @@ -131,25 +135,25 @@ func (o *TransactionStepOResourceObject) SetType(v string) { // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *TransactionStepOResourceObject) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TransactionStepOResourceObject) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *TransactionStepOResourceObject) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *TransactionStepOResourceObject) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -158,12 +162,12 @@ func (o *TransactionStepOResourceObject) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *TransactionStepOResourceObject) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetLinks returns the Links field value if set, zero value otherwise. func (o *TransactionStepOResourceObject) GetLinks() map[string]string { - if o == nil || o.Links == nil { + if o == nil || isNil(o.Links) { var ret map[string]string return ret } @@ -173,15 +177,15 @@ func (o *TransactionStepOResourceObject) GetLinks() map[string]string { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TransactionStepOResourceObject) GetLinksOk() (*map[string]string, bool) { - if o == nil || o.Links == nil { - return nil, false + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *TransactionStepOResourceObject) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } @@ -195,19 +199,19 @@ func (o *TransactionStepOResourceObject) SetLinks(v map[string]string) { func (o TransactionStepOResourceObject) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Attributes != nil { + if !isNil(o.Attributes) { toSerialize["Attributes"] = o.Attributes } if true { toSerialize["Id"] = o.Id } - if o.Type != nil { + if !isNil(o.Type) { toSerialize["Type"] = o.Type } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_step_o_resource_object_attributes.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_step_o_resource_object_attributes.go new file mode 100644 index 00000000..cfa14f7c --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_step_o_resource_object_attributes.go @@ -0,0 +1,243 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// TransactionStepOResourceObjectAttributes Object attributes +type TransactionStepOResourceObjectAttributes struct { + // Step (index) number + StepNumber int32 `json:"StepNumber"` + // The name of the step + StepName *string `json:"StepName,omitempty"` + // Number of milliseconds it took for this step to succeed + TotalTime float64 `json:"TotalTime"` + // Text representation of the step element results + Elements []string `json:"Elements,omitempty"` + // Did this step result in an error? + HasError bool `json:"HasError"` +} + +// NewTransactionStepOResourceObjectAttributes instantiates a new TransactionStepOResourceObjectAttributes object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransactionStepOResourceObjectAttributes(stepNumber int32, totalTime float64, hasError bool) *TransactionStepOResourceObjectAttributes { + this := TransactionStepOResourceObjectAttributes{} + this.StepNumber = stepNumber + this.TotalTime = totalTime + this.HasError = hasError + return &this +} + +// NewTransactionStepOResourceObjectAttributesWithDefaults instantiates a new TransactionStepOResourceObjectAttributes object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactionStepOResourceObjectAttributesWithDefaults() *TransactionStepOResourceObjectAttributes { + this := TransactionStepOResourceObjectAttributes{} + return &this +} + +// GetStepNumber returns the StepNumber field value +func (o *TransactionStepOResourceObjectAttributes) GetStepNumber() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.StepNumber +} + +// GetStepNumberOk returns a tuple with the StepNumber field value +// and a boolean to check if the value has been set. +func (o *TransactionStepOResourceObjectAttributes) GetStepNumberOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.StepNumber, true +} + +// SetStepNumber sets field value +func (o *TransactionStepOResourceObjectAttributes) SetStepNumber(v int32) { + o.StepNumber = v +} + +// GetStepName returns the StepName field value if set, zero value otherwise. +func (o *TransactionStepOResourceObjectAttributes) GetStepName() string { + if o == nil || isNil(o.StepName) { + var ret string + return ret + } + return *o.StepName +} + +// GetStepNameOk returns a tuple with the StepName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionStepOResourceObjectAttributes) GetStepNameOk() (*string, bool) { + if o == nil || isNil(o.StepName) { + return nil, false + } + return o.StepName, true +} + +// HasStepName returns a boolean if a field has been set. +func (o *TransactionStepOResourceObjectAttributes) HasStepName() bool { + if o != nil && !isNil(o.StepName) { + return true + } + + return false +} + +// SetStepName gets a reference to the given string and assigns it to the StepName field. +func (o *TransactionStepOResourceObjectAttributes) SetStepName(v string) { + o.StepName = &v +} + +// GetTotalTime returns the TotalTime field value +func (o *TransactionStepOResourceObjectAttributes) GetTotalTime() float64 { + if o == nil { + var ret float64 + return ret + } + + return o.TotalTime +} + +// GetTotalTimeOk returns a tuple with the TotalTime field value +// and a boolean to check if the value has been set. +func (o *TransactionStepOResourceObjectAttributes) GetTotalTimeOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.TotalTime, true +} + +// SetTotalTime sets field value +func (o *TransactionStepOResourceObjectAttributes) SetTotalTime(v float64) { + o.TotalTime = v +} + +// GetElements returns the Elements field value if set, zero value otherwise. +func (o *TransactionStepOResourceObjectAttributes) GetElements() []string { + if o == nil || isNil(o.Elements) { + var ret []string + return ret + } + return o.Elements +} + +// GetElementsOk returns a tuple with the Elements field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionStepOResourceObjectAttributes) GetElementsOk() ([]string, bool) { + if o == nil || isNil(o.Elements) { + return nil, false + } + return o.Elements, true +} + +// HasElements returns a boolean if a field has been set. +func (o *TransactionStepOResourceObjectAttributes) HasElements() bool { + if o != nil && !isNil(o.Elements) { + return true + } + + return false +} + +// SetElements gets a reference to the given []string and assigns it to the Elements field. +func (o *TransactionStepOResourceObjectAttributes) SetElements(v []string) { + o.Elements = v +} + +// GetHasError returns the HasError field value +func (o *TransactionStepOResourceObjectAttributes) GetHasError() bool { + if o == nil { + var ret bool + return ret + } + + return o.HasError +} + +// GetHasErrorOk returns a tuple with the HasError field value +// and a boolean to check if the value has been set. +func (o *TransactionStepOResourceObjectAttributes) GetHasErrorOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.HasError, true +} + +// SetHasError sets field value +func (o *TransactionStepOResourceObjectAttributes) SetHasError(v bool) { + o.HasError = v +} + +func (o TransactionStepOResourceObjectAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["StepNumber"] = o.StepNumber + } + if !isNil(o.StepName) { + toSerialize["StepName"] = o.StepName + } + if true { + toSerialize["TotalTime"] = o.TotalTime + } + if !isNil(o.Elements) { + toSerialize["Elements"] = o.Elements + } + if true { + toSerialize["HasError"] = o.HasError + } + return json.Marshal(toSerialize) +} + +type NullableTransactionStepOResourceObjectAttributes struct { + value *TransactionStepOResourceObjectAttributes + isSet bool +} + +func (v NullableTransactionStepOResourceObjectAttributes) Get() *TransactionStepOResourceObjectAttributes { + return v.value +} + +func (v *NullableTransactionStepOResourceObjectAttributes) Set(val *TransactionStepOResourceObjectAttributes) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionStepOResourceObjectAttributes) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionStepOResourceObjectAttributes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionStepOResourceObjectAttributes(val *TransactionStepOResourceObjectAttributes) *NullableTransactionStepOResourceObjectAttributes { + return &NullableTransactionStepOResourceObjectAttributes{value: val, isSet: true} +} + +func (v NullableTransactionStepOResourceObjectAttributes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionStepOResourceObjectAttributes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_sub_step.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_sub_step.go index 8b91c8ee..20ca391e 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_sub_step.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_transaction_sub_step.go @@ -42,7 +42,7 @@ func NewTransactionSubStepWithDefaults() *TransactionSubStep { // GetName returns the Name field value if set, zero value otherwise. func (o *TransactionSubStep) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -52,15 +52,15 @@ func (o *TransactionSubStep) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TransactionSubStep) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *TransactionSubStep) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -85,8 +85,8 @@ func (o *TransactionSubStep) GetType() SubStepType { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *TransactionSubStep) GetTypeOk() (*SubStepType, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Type, true } @@ -98,7 +98,7 @@ func (o *TransactionSubStep) SetType(v SubStepType) { // GetUrl returns the Url field value if set, zero value otherwise. func (o *TransactionSubStep) GetUrl() string { - if o == nil || o.Url == nil { + if o == nil || isNil(o.Url) { var ret string return ret } @@ -108,15 +108,15 @@ func (o *TransactionSubStep) GetUrl() string { // GetUrlOk returns a tuple with the Url field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TransactionSubStep) GetUrlOk() (*string, bool) { - if o == nil || o.Url == nil { - return nil, false + if o == nil || isNil(o.Url) { + return nil, false } return o.Url, true } // HasUrl returns a boolean if a field has been set. func (o *TransactionSubStep) HasUrl() bool { - if o != nil && o.Url != nil { + if o != nil && !isNil(o.Url) { return true } @@ -130,7 +130,7 @@ func (o *TransactionSubStep) SetUrl(v string) { // GetSetValue returns the SetValue field value if set, zero value otherwise. func (o *TransactionSubStep) GetSetValue() string { - if o == nil || o.SetValue == nil { + if o == nil || isNil(o.SetValue) { var ret string return ret } @@ -140,15 +140,15 @@ func (o *TransactionSubStep) GetSetValue() string { // GetSetValueOk returns a tuple with the SetValue field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TransactionSubStep) GetSetValueOk() (*string, bool) { - if o == nil || o.SetValue == nil { - return nil, false + if o == nil || isNil(o.SetValue) { + return nil, false } return o.SetValue, true } // HasSetValue returns a boolean if a field has been set. func (o *TransactionSubStep) HasSetValue() bool { - if o != nil && o.SetValue != nil { + if o != nil && !isNil(o.SetValue) { return true } @@ -162,16 +162,16 @@ func (o *TransactionSubStep) SetSetValue(v string) { func (o TransactionSubStep) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !isNil(o.Name) { toSerialize["Name"] = o.Name } if true { toSerialize["Type"] = o.Type } - if o.Url != nil { + if !isNil(o.Url) { toSerialize["Url"] = o.Url } - if o.SetValue != nil { + if !isNil(o.SetValue) { toSerialize["SetValue"] = o.SetValue } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_user_defined_function.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_user_defined_function.go index 1f8db2e5..8ff1bc6a 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_user_defined_function.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_user_defined_function.go @@ -18,21 +18,24 @@ import ( type UserDefinedFunction struct { Name *string `json:"Name,omitempty"` Type UserDefinedFunctionType `json:"Type"` - Mappings *[]UserDefinedFunctionMapping `json:"Mappings,omitempty"` + Mappings []UserDefinedFunctionMapping `json:"Mappings,omitempty"` Regex *string `json:"Regex,omitempty"` // This property is not supported yet JwtSigningKey *string `json:"JwtSigningKey,omitempty"` // This property is not supported yet JwtAlgorithm *JwtAlgorithm `json:"JwtAlgorithm,omitempty"` + HashKey *string `json:"HashKey,omitempty"` + HashAlgorithm EngineHashAlgorithm `json:"HashAlgorithm"` } // NewUserDefinedFunction instantiates a new UserDefinedFunction object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewUserDefinedFunction(type_ UserDefinedFunctionType) *UserDefinedFunction { +func NewUserDefinedFunction(type_ UserDefinedFunctionType, hashAlgorithm EngineHashAlgorithm) *UserDefinedFunction { this := UserDefinedFunction{} this.Type = type_ + this.HashAlgorithm = hashAlgorithm return &this } @@ -46,7 +49,7 @@ func NewUserDefinedFunctionWithDefaults() *UserDefinedFunction { // GetName returns the Name field value if set, zero value otherwise. func (o *UserDefinedFunction) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -56,15 +59,15 @@ func (o *UserDefinedFunction) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UserDefinedFunction) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *UserDefinedFunction) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -89,8 +92,8 @@ func (o *UserDefinedFunction) GetType() UserDefinedFunctionType { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *UserDefinedFunction) GetTypeOk() (*UserDefinedFunctionType, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Type, true } @@ -102,25 +105,25 @@ func (o *UserDefinedFunction) SetType(v UserDefinedFunctionType) { // GetMappings returns the Mappings field value if set, zero value otherwise. func (o *UserDefinedFunction) GetMappings() []UserDefinedFunctionMapping { - if o == nil || o.Mappings == nil { + if o == nil || isNil(o.Mappings) { var ret []UserDefinedFunctionMapping return ret } - return *o.Mappings + return o.Mappings } // GetMappingsOk returns a tuple with the Mappings field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UserDefinedFunction) GetMappingsOk() (*[]UserDefinedFunctionMapping, bool) { - if o == nil || o.Mappings == nil { - return nil, false +func (o *UserDefinedFunction) GetMappingsOk() ([]UserDefinedFunctionMapping, bool) { + if o == nil || isNil(o.Mappings) { + return nil, false } return o.Mappings, true } // HasMappings returns a boolean if a field has been set. func (o *UserDefinedFunction) HasMappings() bool { - if o != nil && o.Mappings != nil { + if o != nil && !isNil(o.Mappings) { return true } @@ -129,12 +132,12 @@ func (o *UserDefinedFunction) HasMappings() bool { // SetMappings gets a reference to the given []UserDefinedFunctionMapping and assigns it to the Mappings field. func (o *UserDefinedFunction) SetMappings(v []UserDefinedFunctionMapping) { - o.Mappings = &v + o.Mappings = v } // GetRegex returns the Regex field value if set, zero value otherwise. func (o *UserDefinedFunction) GetRegex() string { - if o == nil || o.Regex == nil { + if o == nil || isNil(o.Regex) { var ret string return ret } @@ -144,15 +147,15 @@ func (o *UserDefinedFunction) GetRegex() string { // GetRegexOk returns a tuple with the Regex field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UserDefinedFunction) GetRegexOk() (*string, bool) { - if o == nil || o.Regex == nil { - return nil, false + if o == nil || isNil(o.Regex) { + return nil, false } return o.Regex, true } // HasRegex returns a boolean if a field has been set. func (o *UserDefinedFunction) HasRegex() bool { - if o != nil && o.Regex != nil { + if o != nil && !isNil(o.Regex) { return true } @@ -166,7 +169,7 @@ func (o *UserDefinedFunction) SetRegex(v string) { // GetJwtSigningKey returns the JwtSigningKey field value if set, zero value otherwise. func (o *UserDefinedFunction) GetJwtSigningKey() string { - if o == nil || o.JwtSigningKey == nil { + if o == nil || isNil(o.JwtSigningKey) { var ret string return ret } @@ -176,15 +179,15 @@ func (o *UserDefinedFunction) GetJwtSigningKey() string { // GetJwtSigningKeyOk returns a tuple with the JwtSigningKey field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UserDefinedFunction) GetJwtSigningKeyOk() (*string, bool) { - if o == nil || o.JwtSigningKey == nil { - return nil, false + if o == nil || isNil(o.JwtSigningKey) { + return nil, false } return o.JwtSigningKey, true } // HasJwtSigningKey returns a boolean if a field has been set. func (o *UserDefinedFunction) HasJwtSigningKey() bool { - if o != nil && o.JwtSigningKey != nil { + if o != nil && !isNil(o.JwtSigningKey) { return true } @@ -198,7 +201,7 @@ func (o *UserDefinedFunction) SetJwtSigningKey(v string) { // GetJwtAlgorithm returns the JwtAlgorithm field value if set, zero value otherwise. func (o *UserDefinedFunction) GetJwtAlgorithm() JwtAlgorithm { - if o == nil || o.JwtAlgorithm == nil { + if o == nil || isNil(o.JwtAlgorithm) { var ret JwtAlgorithm return ret } @@ -208,15 +211,15 @@ func (o *UserDefinedFunction) GetJwtAlgorithm() JwtAlgorithm { // GetJwtAlgorithmOk returns a tuple with the JwtAlgorithm field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UserDefinedFunction) GetJwtAlgorithmOk() (*JwtAlgorithm, bool) { - if o == nil || o.JwtAlgorithm == nil { - return nil, false + if o == nil || isNil(o.JwtAlgorithm) { + return nil, false } return o.JwtAlgorithm, true } // HasJwtAlgorithm returns a boolean if a field has been set. func (o *UserDefinedFunction) HasJwtAlgorithm() bool { - if o != nil && o.JwtAlgorithm != nil { + if o != nil && !isNil(o.JwtAlgorithm) { return true } @@ -228,26 +231,88 @@ func (o *UserDefinedFunction) SetJwtAlgorithm(v JwtAlgorithm) { o.JwtAlgorithm = &v } +// GetHashKey returns the HashKey field value if set, zero value otherwise. +func (o *UserDefinedFunction) GetHashKey() string { + if o == nil || isNil(o.HashKey) { + var ret string + return ret + } + return *o.HashKey +} + +// GetHashKeyOk returns a tuple with the HashKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserDefinedFunction) GetHashKeyOk() (*string, bool) { + if o == nil || isNil(o.HashKey) { + return nil, false + } + return o.HashKey, true +} + +// HasHashKey returns a boolean if a field has been set. +func (o *UserDefinedFunction) HasHashKey() bool { + if o != nil && !isNil(o.HashKey) { + return true + } + + return false +} + +// SetHashKey gets a reference to the given string and assigns it to the HashKey field. +func (o *UserDefinedFunction) SetHashKey(v string) { + o.HashKey = &v +} + +// GetHashAlgorithm returns the HashAlgorithm field value +func (o *UserDefinedFunction) GetHashAlgorithm() EngineHashAlgorithm { + if o == nil { + var ret EngineHashAlgorithm + return ret + } + + return o.HashAlgorithm +} + +// GetHashAlgorithmOk returns a tuple with the HashAlgorithm field value +// and a boolean to check if the value has been set. +func (o *UserDefinedFunction) GetHashAlgorithmOk() (*EngineHashAlgorithm, bool) { + if o == nil { + return nil, false + } + return &o.HashAlgorithm, true +} + +// SetHashAlgorithm sets field value +func (o *UserDefinedFunction) SetHashAlgorithm(v EngineHashAlgorithm) { + o.HashAlgorithm = v +} + func (o UserDefinedFunction) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !isNil(o.Name) { toSerialize["Name"] = o.Name } if true { toSerialize["Type"] = o.Type } - if o.Mappings != nil { + if !isNil(o.Mappings) { toSerialize["Mappings"] = o.Mappings } - if o.Regex != nil { + if !isNil(o.Regex) { toSerialize["Regex"] = o.Regex } - if o.JwtSigningKey != nil { + if !isNil(o.JwtSigningKey) { toSerialize["JwtSigningKey"] = o.JwtSigningKey } - if o.JwtAlgorithm != nil { + if !isNil(o.JwtAlgorithm) { toSerialize["JwtAlgorithm"] = o.JwtAlgorithm } + if !isNil(o.HashKey) { + toSerialize["HashKey"] = o.HashKey + } + if true { + toSerialize["HashAlgorithm"] = o.HashAlgorithm + } return json.Marshal(toSerialize) } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_user_defined_function_mapping.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_user_defined_function_mapping.go index d2b15501..65f63d98 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_user_defined_function_mapping.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_user_defined_function_mapping.go @@ -39,7 +39,7 @@ func NewUserDefinedFunctionMappingWithDefaults() *UserDefinedFunctionMapping { // GetKey returns the Key field value if set, zero value otherwise. func (o *UserDefinedFunctionMapping) GetKey() string { - if o == nil || o.Key == nil { + if o == nil || isNil(o.Key) { var ret string return ret } @@ -49,15 +49,15 @@ func (o *UserDefinedFunctionMapping) GetKey() string { // GetKeyOk returns a tuple with the Key field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UserDefinedFunctionMapping) GetKeyOk() (*string, bool) { - if o == nil || o.Key == nil { - return nil, false + if o == nil || isNil(o.Key) { + return nil, false } return o.Key, true } // HasKey returns a boolean if a field has been set. func (o *UserDefinedFunctionMapping) HasKey() bool { - if o != nil && o.Key != nil { + if o != nil && !isNil(o.Key) { return true } @@ -71,7 +71,7 @@ func (o *UserDefinedFunctionMapping) SetKey(v string) { // GetValue returns the Value field value if set, zero value otherwise. func (o *UserDefinedFunctionMapping) GetValue() string { - if o == nil || o.Value == nil { + if o == nil || isNil(o.Value) { var ret string return ret } @@ -81,15 +81,15 @@ func (o *UserDefinedFunctionMapping) GetValue() string { // GetValueOk returns a tuple with the Value field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UserDefinedFunctionMapping) GetValueOk() (*string, bool) { - if o == nil || o.Value == nil { - return nil, false + if o == nil || isNil(o.Value) { + return nil, false } return o.Value, true } // HasValue returns a boolean if a field has been set. func (o *UserDefinedFunctionMapping) HasValue() bool { - if o != nil && o.Value != nil { + if o != nil && !isNil(o.Value) { return true } @@ -103,10 +103,10 @@ func (o *UserDefinedFunctionMapping) SetValue(v string) { func (o UserDefinedFunctionMapping) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Key != nil { + if !isNil(o.Key) { toSerialize["Key"] = o.Key } - if o.Value != nil { + if !isNil(o.Value) { toSerialize["Value"] = o.Value } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_user_defined_function_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_user_defined_function_type.go index b3288b86..832fc07b 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_user_defined_function_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_user_defined_function_type.go @@ -24,13 +24,16 @@ const ( USERDEFINEDFUNCTIONTYPE_REGEX UserDefinedFunctionType = "Regex" USERDEFINEDFUNCTIONTYPE_JWT_ENCODE UserDefinedFunctionType = "JwtEncode" USERDEFINEDFUNCTIONTYPE_JWT_DECODE UserDefinedFunctionType = "JwtDecode" + USERDEFINEDFUNCTIONTYPE_HASH UserDefinedFunctionType = "Hash" ) -var allowedUserDefinedFunctionTypeEnumValues = []UserDefinedFunctionType{ +// All allowed values of UserDefinedFunctionType enum +var AllowedUserDefinedFunctionTypeEnumValues = []UserDefinedFunctionType{ "Mapping", "Regex", "JwtEncode", "JwtDecode", + "Hash", } func (v *UserDefinedFunctionType) UnmarshalJSON(src []byte) error { @@ -40,7 +43,7 @@ func (v *UserDefinedFunctionType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := UserDefinedFunctionType(value) - for _, existing := range allowedUserDefinedFunctionTypeEnumValues { + for _, existing := range AllowedUserDefinedFunctionTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -57,13 +60,13 @@ func NewUserDefinedFunctionTypeFromValue(v string) (*UserDefinedFunctionType, er if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for UserDefinedFunctionType: valid values are %v", v, allowedUserDefinedFunctionTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for UserDefinedFunctionType: valid values are %v", v, AllowedUserDefinedFunctionTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v UserDefinedFunctionType) IsValid() bool { - for _, existing := range allowedUserDefinedFunctionTypeEnumValues { + for _, existing := range AllowedUserDefinedFunctionTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_item.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_item.go index 614e094b..999d0a92 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_item.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_item.go @@ -34,10 +34,9 @@ type VaultItem struct { UserName *string `json:"UserName,omitempty"` // The password associated with a credentialset Password *string `json:"Password,omitempty"` - // The certificate archive that is stored in this vault item, if applicable - CertificateArchive *CertificateArchive `json:"CertificateArchive,omitempty"` - // The file info that is stored in this vault item, if applicable - FileInfo *FileInfo `json:"FileInfo,omitempty"` + CertificateArchive *VaultItemCertificateArchive `json:"CertificateArchive,omitempty"` + FileInfo *VaultItemFileInfo `json:"FileInfo,omitempty"` + OneTimePasswordInfo *VaultItemOneTimePasswordInfo `json:"OneTimePasswordInfo,omitempty"` } // NewVaultItem instantiates a new VaultItem object @@ -59,7 +58,7 @@ func NewVaultItemWithDefaults() *VaultItem { // GetVaultItemGuid returns the VaultItemGuid field value if set, zero value otherwise. func (o *VaultItem) GetVaultItemGuid() string { - if o == nil || o.VaultItemGuid == nil { + if o == nil || isNil(o.VaultItemGuid) { var ret string return ret } @@ -69,15 +68,15 @@ func (o *VaultItem) GetVaultItemGuid() string { // GetVaultItemGuidOk returns a tuple with the VaultItemGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VaultItem) GetVaultItemGuidOk() (*string, bool) { - if o == nil || o.VaultItemGuid == nil { - return nil, false + if o == nil || isNil(o.VaultItemGuid) { + return nil, false } return o.VaultItemGuid, true } // HasVaultItemGuid returns a boolean if a field has been set. func (o *VaultItem) HasVaultItemGuid() bool { - if o != nil && o.VaultItemGuid != nil { + if o != nil && !isNil(o.VaultItemGuid) { return true } @@ -91,7 +90,7 @@ func (o *VaultItem) SetVaultItemGuid(v string) { // GetHash returns the Hash field value if set, zero value otherwise. func (o *VaultItem) GetHash() string { - if o == nil || o.Hash == nil { + if o == nil || isNil(o.Hash) { var ret string return ret } @@ -101,15 +100,15 @@ func (o *VaultItem) GetHash() string { // GetHashOk returns a tuple with the Hash field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VaultItem) GetHashOk() (*string, bool) { - if o == nil || o.Hash == nil { - return nil, false + if o == nil || isNil(o.Hash) { + return nil, false } return o.Hash, true } // HasHash returns a boolean if a field has been set. func (o *VaultItem) HasHash() bool { - if o != nil && o.Hash != nil { + if o != nil && !isNil(o.Hash) { return true } @@ -123,7 +122,7 @@ func (o *VaultItem) SetHash(v string) { // GetName returns the Name field value if set, zero value otherwise. func (o *VaultItem) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -133,15 +132,15 @@ func (o *VaultItem) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VaultItem) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *VaultItem) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -155,7 +154,7 @@ func (o *VaultItem) SetName(v string) { // GetValue returns the Value field value if set, zero value otherwise. func (o *VaultItem) GetValue() string { - if o == nil || o.Value == nil { + if o == nil || isNil(o.Value) { var ret string return ret } @@ -165,15 +164,15 @@ func (o *VaultItem) GetValue() string { // GetValueOk returns a tuple with the Value field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VaultItem) GetValueOk() (*string, bool) { - if o == nil || o.Value == nil { - return nil, false + if o == nil || isNil(o.Value) { + return nil, false } return o.Value, true } // HasValue returns a boolean if a field has been set. func (o *VaultItem) HasValue() bool { - if o != nil && o.Value != nil { + if o != nil && !isNil(o.Value) { return true } @@ -187,7 +186,7 @@ func (o *VaultItem) SetValue(v string) { // GetVaultSectionGuid returns the VaultSectionGuid field value if set, zero value otherwise. func (o *VaultItem) GetVaultSectionGuid() string { - if o == nil || o.VaultSectionGuid == nil { + if o == nil || isNil(o.VaultSectionGuid) { var ret string return ret } @@ -197,15 +196,15 @@ func (o *VaultItem) GetVaultSectionGuid() string { // GetVaultSectionGuidOk returns a tuple with the VaultSectionGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VaultItem) GetVaultSectionGuidOk() (*string, bool) { - if o == nil || o.VaultSectionGuid == nil { - return nil, false + if o == nil || isNil(o.VaultSectionGuid) { + return nil, false } return o.VaultSectionGuid, true } // HasVaultSectionGuid returns a boolean if a field has been set. func (o *VaultItem) HasVaultSectionGuid() bool { - if o != nil && o.VaultSectionGuid != nil { + if o != nil && !isNil(o.VaultSectionGuid) { return true } @@ -219,7 +218,7 @@ func (o *VaultItem) SetVaultSectionGuid(v string) { // GetVaultItemType returns the VaultItemType field value if set, zero value otherwise. func (o *VaultItem) GetVaultItemType() VaultItemTypes { - if o == nil || o.VaultItemType == nil { + if o == nil || isNil(o.VaultItemType) { var ret VaultItemTypes return ret } @@ -229,15 +228,15 @@ func (o *VaultItem) GetVaultItemType() VaultItemTypes { // GetVaultItemTypeOk returns a tuple with the VaultItemType field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VaultItem) GetVaultItemTypeOk() (*VaultItemTypes, bool) { - if o == nil || o.VaultItemType == nil { - return nil, false + if o == nil || isNil(o.VaultItemType) { + return nil, false } return o.VaultItemType, true } // HasVaultItemType returns a boolean if a field has been set. func (o *VaultItem) HasVaultItemType() bool { - if o != nil && o.VaultItemType != nil { + if o != nil && !isNil(o.VaultItemType) { return true } @@ -251,7 +250,7 @@ func (o *VaultItem) SetVaultItemType(v VaultItemTypes) { // GetNotes returns the Notes field value if set, zero value otherwise. func (o *VaultItem) GetNotes() string { - if o == nil || o.Notes == nil { + if o == nil || isNil(o.Notes) { var ret string return ret } @@ -261,15 +260,15 @@ func (o *VaultItem) GetNotes() string { // GetNotesOk returns a tuple with the Notes field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VaultItem) GetNotesOk() (*string, bool) { - if o == nil || o.Notes == nil { - return nil, false + if o == nil || isNil(o.Notes) { + return nil, false } return o.Notes, true } // HasNotes returns a boolean if a field has been set. func (o *VaultItem) HasNotes() bool { - if o != nil && o.Notes != nil { + if o != nil && !isNil(o.Notes) { return true } @@ -283,7 +282,7 @@ func (o *VaultItem) SetNotes(v string) { // GetUserName returns the UserName field value if set, zero value otherwise. func (o *VaultItem) GetUserName() string { - if o == nil || o.UserName == nil { + if o == nil || isNil(o.UserName) { var ret string return ret } @@ -293,15 +292,15 @@ func (o *VaultItem) GetUserName() string { // GetUserNameOk returns a tuple with the UserName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VaultItem) GetUserNameOk() (*string, bool) { - if o == nil || o.UserName == nil { - return nil, false + if o == nil || isNil(o.UserName) { + return nil, false } return o.UserName, true } // HasUserName returns a boolean if a field has been set. func (o *VaultItem) HasUserName() bool { - if o != nil && o.UserName != nil { + if o != nil && !isNil(o.UserName) { return true } @@ -315,7 +314,7 @@ func (o *VaultItem) SetUserName(v string) { // GetPassword returns the Password field value if set, zero value otherwise. func (o *VaultItem) GetPassword() string { - if o == nil || o.Password == nil { + if o == nil || isNil(o.Password) { var ret string return ret } @@ -325,15 +324,15 @@ func (o *VaultItem) GetPassword() string { // GetPasswordOk returns a tuple with the Password field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VaultItem) GetPasswordOk() (*string, bool) { - if o == nil || o.Password == nil { - return nil, false + if o == nil || isNil(o.Password) { + return nil, false } return o.Password, true } // HasPassword returns a boolean if a field has been set. func (o *VaultItem) HasPassword() bool { - if o != nil && o.Password != nil { + if o != nil && !isNil(o.Password) { return true } @@ -346,9 +345,9 @@ func (o *VaultItem) SetPassword(v string) { } // GetCertificateArchive returns the CertificateArchive field value if set, zero value otherwise. -func (o *VaultItem) GetCertificateArchive() CertificateArchive { - if o == nil || o.CertificateArchive == nil { - var ret CertificateArchive +func (o *VaultItem) GetCertificateArchive() VaultItemCertificateArchive { + if o == nil || isNil(o.CertificateArchive) { + var ret VaultItemCertificateArchive return ret } return *o.CertificateArchive @@ -356,31 +355,31 @@ func (o *VaultItem) GetCertificateArchive() CertificateArchive { // GetCertificateArchiveOk returns a tuple with the CertificateArchive field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *VaultItem) GetCertificateArchiveOk() (*CertificateArchive, bool) { - if o == nil || o.CertificateArchive == nil { - return nil, false +func (o *VaultItem) GetCertificateArchiveOk() (*VaultItemCertificateArchive, bool) { + if o == nil || isNil(o.CertificateArchive) { + return nil, false } return o.CertificateArchive, true } // HasCertificateArchive returns a boolean if a field has been set. func (o *VaultItem) HasCertificateArchive() bool { - if o != nil && o.CertificateArchive != nil { + if o != nil && !isNil(o.CertificateArchive) { return true } return false } -// SetCertificateArchive gets a reference to the given CertificateArchive and assigns it to the CertificateArchive field. -func (o *VaultItem) SetCertificateArchive(v CertificateArchive) { +// SetCertificateArchive gets a reference to the given VaultItemCertificateArchive and assigns it to the CertificateArchive field. +func (o *VaultItem) SetCertificateArchive(v VaultItemCertificateArchive) { o.CertificateArchive = &v } // GetFileInfo returns the FileInfo field value if set, zero value otherwise. -func (o *VaultItem) GetFileInfo() FileInfo { - if o == nil || o.FileInfo == nil { - var ret FileInfo +func (o *VaultItem) GetFileInfo() VaultItemFileInfo { + if o == nil || isNil(o.FileInfo) { + var ret VaultItemFileInfo return ret } return *o.FileInfo @@ -388,62 +387,97 @@ func (o *VaultItem) GetFileInfo() FileInfo { // GetFileInfoOk returns a tuple with the FileInfo field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *VaultItem) GetFileInfoOk() (*FileInfo, bool) { - if o == nil || o.FileInfo == nil { - return nil, false +func (o *VaultItem) GetFileInfoOk() (*VaultItemFileInfo, bool) { + if o == nil || isNil(o.FileInfo) { + return nil, false } return o.FileInfo, true } // HasFileInfo returns a boolean if a field has been set. func (o *VaultItem) HasFileInfo() bool { - if o != nil && o.FileInfo != nil { + if o != nil && !isNil(o.FileInfo) { return true } return false } -// SetFileInfo gets a reference to the given FileInfo and assigns it to the FileInfo field. -func (o *VaultItem) SetFileInfo(v FileInfo) { +// SetFileInfo gets a reference to the given VaultItemFileInfo and assigns it to the FileInfo field. +func (o *VaultItem) SetFileInfo(v VaultItemFileInfo) { o.FileInfo = &v } +// GetOneTimePasswordInfo returns the OneTimePasswordInfo field value if set, zero value otherwise. +func (o *VaultItem) GetOneTimePasswordInfo() VaultItemOneTimePasswordInfo { + if o == nil || isNil(o.OneTimePasswordInfo) { + var ret VaultItemOneTimePasswordInfo + return ret + } + return *o.OneTimePasswordInfo +} + +// GetOneTimePasswordInfoOk returns a tuple with the OneTimePasswordInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VaultItem) GetOneTimePasswordInfoOk() (*VaultItemOneTimePasswordInfo, bool) { + if o == nil || isNil(o.OneTimePasswordInfo) { + return nil, false + } + return o.OneTimePasswordInfo, true +} + +// HasOneTimePasswordInfo returns a boolean if a field has been set. +func (o *VaultItem) HasOneTimePasswordInfo() bool { + if o != nil && !isNil(o.OneTimePasswordInfo) { + return true + } + + return false +} + +// SetOneTimePasswordInfo gets a reference to the given VaultItemOneTimePasswordInfo and assigns it to the OneTimePasswordInfo field. +func (o *VaultItem) SetOneTimePasswordInfo(v VaultItemOneTimePasswordInfo) { + o.OneTimePasswordInfo = &v +} + func (o VaultItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.VaultItemGuid != nil { + if !isNil(o.VaultItemGuid) { toSerialize["VaultItemGuid"] = o.VaultItemGuid } - if o.Hash != nil { + if !isNil(o.Hash) { toSerialize["Hash"] = o.Hash } - if o.Name != nil { + if !isNil(o.Name) { toSerialize["Name"] = o.Name } - if o.Value != nil { + if !isNil(o.Value) { toSerialize["Value"] = o.Value } - if o.VaultSectionGuid != nil { + if !isNil(o.VaultSectionGuid) { toSerialize["VaultSectionGuid"] = o.VaultSectionGuid } - if o.VaultItemType != nil { + if !isNil(o.VaultItemType) { toSerialize["VaultItemType"] = o.VaultItemType } - if o.Notes != nil { + if !isNil(o.Notes) { toSerialize["Notes"] = o.Notes } - if o.UserName != nil { + if !isNil(o.UserName) { toSerialize["UserName"] = o.UserName } - if o.Password != nil { + if !isNil(o.Password) { toSerialize["Password"] = o.Password } - if o.CertificateArchive != nil { + if !isNil(o.CertificateArchive) { toSerialize["CertificateArchive"] = o.CertificateArchive } - if o.FileInfo != nil { + if !isNil(o.FileInfo) { toSerialize["FileInfo"] = o.FileInfo } + if !isNil(o.OneTimePasswordInfo) { + toSerialize["OneTimePasswordInfo"] = o.OneTimePasswordInfo + } return json.Marshal(toSerialize) } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_item_certificate_archive.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_item_certificate_archive.go new file mode 100644 index 00000000..bd692005 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_item_certificate_archive.go @@ -0,0 +1,250 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// VaultItemCertificateArchive The certificate archive that is stored in this vault item, if applicable +type VaultItemCertificateArchive struct { + // The issuer of this certificate + Issuer *string `json:"Issuer,omitempty"` + // The start date of this certificate + NotBefore map[string]interface{} `json:"NotBefore"` + // The certificate expiry date + NotAfter map[string]interface{} `json:"NotAfter"` + // Used to specify a new or changed password. The value will be encrypted when stored, and will not be displayed when a CertificateArchive is retrieved. + Password *string `json:"Password,omitempty"` + // Used to specify the certificate content as a base64 string. The value will be encrypted when stored, and will not be displayed when a CertificateArchive is retrieved. + ArchiveData *string `json:"ArchiveData,omitempty"` +} + +// NewVaultItemCertificateArchive instantiates a new VaultItemCertificateArchive object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVaultItemCertificateArchive(notBefore map[string]interface{}, notAfter map[string]interface{}) *VaultItemCertificateArchive { + this := VaultItemCertificateArchive{} + this.NotBefore = notBefore + this.NotAfter = notAfter + return &this +} + +// NewVaultItemCertificateArchiveWithDefaults instantiates a new VaultItemCertificateArchive object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVaultItemCertificateArchiveWithDefaults() *VaultItemCertificateArchive { + this := VaultItemCertificateArchive{} + return &this +} + +// GetIssuer returns the Issuer field value if set, zero value otherwise. +func (o *VaultItemCertificateArchive) GetIssuer() string { + if o == nil || isNil(o.Issuer) { + var ret string + return ret + } + return *o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VaultItemCertificateArchive) GetIssuerOk() (*string, bool) { + if o == nil || isNil(o.Issuer) { + return nil, false + } + return o.Issuer, true +} + +// HasIssuer returns a boolean if a field has been set. +func (o *VaultItemCertificateArchive) HasIssuer() bool { + if o != nil && !isNil(o.Issuer) { + return true + } + + return false +} + +// SetIssuer gets a reference to the given string and assigns it to the Issuer field. +func (o *VaultItemCertificateArchive) SetIssuer(v string) { + o.Issuer = &v +} + +// GetNotBefore returns the NotBefore field value +func (o *VaultItemCertificateArchive) GetNotBefore() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.NotBefore +} + +// GetNotBeforeOk returns a tuple with the NotBefore field value +// and a boolean to check if the value has been set. +func (o *VaultItemCertificateArchive) GetNotBeforeOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.NotBefore, true +} + +// SetNotBefore sets field value +func (o *VaultItemCertificateArchive) SetNotBefore(v map[string]interface{}) { + o.NotBefore = v +} + +// GetNotAfter returns the NotAfter field value +func (o *VaultItemCertificateArchive) GetNotAfter() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.NotAfter +} + +// GetNotAfterOk returns a tuple with the NotAfter field value +// and a boolean to check if the value has been set. +func (o *VaultItemCertificateArchive) GetNotAfterOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.NotAfter, true +} + +// SetNotAfter sets field value +func (o *VaultItemCertificateArchive) SetNotAfter(v map[string]interface{}) { + o.NotAfter = v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *VaultItemCertificateArchive) GetPassword() string { + if o == nil || isNil(o.Password) { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VaultItemCertificateArchive) GetPasswordOk() (*string, bool) { + if o == nil || isNil(o.Password) { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *VaultItemCertificateArchive) HasPassword() bool { + if o != nil && !isNil(o.Password) { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *VaultItemCertificateArchive) SetPassword(v string) { + o.Password = &v +} + +// GetArchiveData returns the ArchiveData field value if set, zero value otherwise. +func (o *VaultItemCertificateArchive) GetArchiveData() string { + if o == nil || isNil(o.ArchiveData) { + var ret string + return ret + } + return *o.ArchiveData +} + +// GetArchiveDataOk returns a tuple with the ArchiveData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VaultItemCertificateArchive) GetArchiveDataOk() (*string, bool) { + if o == nil || isNil(o.ArchiveData) { + return nil, false + } + return o.ArchiveData, true +} + +// HasArchiveData returns a boolean if a field has been set. +func (o *VaultItemCertificateArchive) HasArchiveData() bool { + if o != nil && !isNil(o.ArchiveData) { + return true + } + + return false +} + +// SetArchiveData gets a reference to the given string and assigns it to the ArchiveData field. +func (o *VaultItemCertificateArchive) SetArchiveData(v string) { + o.ArchiveData = &v +} + +func (o VaultItemCertificateArchive) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Issuer) { + toSerialize["Issuer"] = o.Issuer + } + if true { + toSerialize["NotBefore"] = o.NotBefore + } + if true { + toSerialize["NotAfter"] = o.NotAfter + } + if !isNil(o.Password) { + toSerialize["Password"] = o.Password + } + if !isNil(o.ArchiveData) { + toSerialize["ArchiveData"] = o.ArchiveData + } + return json.Marshal(toSerialize) +} + +type NullableVaultItemCertificateArchive struct { + value *VaultItemCertificateArchive + isSet bool +} + +func (v NullableVaultItemCertificateArchive) Get() *VaultItemCertificateArchive { + return v.value +} + +func (v *NullableVaultItemCertificateArchive) Set(val *VaultItemCertificateArchive) { + v.value = val + v.isSet = true +} + +func (v NullableVaultItemCertificateArchive) IsSet() bool { + return v.isSet +} + +func (v *NullableVaultItemCertificateArchive) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVaultItemCertificateArchive(val *VaultItemCertificateArchive) *NullableVaultItemCertificateArchive { + return &NullableVaultItemCertificateArchive{value: val, isSet: true} +} + +func (v NullableVaultItemCertificateArchive) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVaultItemCertificateArchive) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_item_file_info.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_item_file_info.go new file mode 100644 index 00000000..bdfe0618 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_item_file_info.go @@ -0,0 +1,182 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// VaultItemFileInfo The file info that is stored in this vault item, if applicable +type VaultItemFileInfo struct { + Data *string `json:"Data,omitempty"` + // Name of the uploaded file. + Name *string `json:"Name,omitempty"` + // Size of the uploaded file. + Size int32 `json:"Size"` +} + +// NewVaultItemFileInfo instantiates a new VaultItemFileInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVaultItemFileInfo(size int32) *VaultItemFileInfo { + this := VaultItemFileInfo{} + this.Size = size + return &this +} + +// NewVaultItemFileInfoWithDefaults instantiates a new VaultItemFileInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVaultItemFileInfoWithDefaults() *VaultItemFileInfo { + this := VaultItemFileInfo{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *VaultItemFileInfo) GetData() string { + if o == nil || isNil(o.Data) { + var ret string + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VaultItemFileInfo) GetDataOk() (*string, bool) { + if o == nil || isNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *VaultItemFileInfo) HasData() bool { + if o != nil && !isNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given string and assigns it to the Data field. +func (o *VaultItemFileInfo) SetData(v string) { + o.Data = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *VaultItemFileInfo) GetName() string { + if o == nil || isNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VaultItemFileInfo) GetNameOk() (*string, bool) { + if o == nil || isNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *VaultItemFileInfo) HasName() bool { + if o != nil && !isNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *VaultItemFileInfo) SetName(v string) { + o.Name = &v +} + +// GetSize returns the Size field value +func (o *VaultItemFileInfo) GetSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *VaultItemFileInfo) GetSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *VaultItemFileInfo) SetSize(v int32) { + o.Size = v +} + +func (o VaultItemFileInfo) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Data) { + toSerialize["Data"] = o.Data + } + if !isNil(o.Name) { + toSerialize["Name"] = o.Name + } + if true { + toSerialize["Size"] = o.Size + } + return json.Marshal(toSerialize) +} + +type NullableVaultItemFileInfo struct { + value *VaultItemFileInfo + isSet bool +} + +func (v NullableVaultItemFileInfo) Get() *VaultItemFileInfo { + return v.value +} + +func (v *NullableVaultItemFileInfo) Set(val *VaultItemFileInfo) { + v.value = val + v.isSet = true +} + +func (v NullableVaultItemFileInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableVaultItemFileInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVaultItemFileInfo(val *VaultItemFileInfo) *NullableVaultItemFileInfo { + return &NullableVaultItemFileInfo{value: val, isSet: true} +} + +func (v NullableVaultItemFileInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVaultItemFileInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_item_one_time_password_info.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_item_one_time_password_info.go new file mode 100644 index 00000000..444ecd4c --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_item_one_time_password_info.go @@ -0,0 +1,202 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// VaultItemOneTimePasswordInfo The one-time password info that is stored in this vault item, if applicable +type VaultItemOneTimePasswordInfo struct { + Secret *string `json:"Secret,omitempty"` + Digits int32 `json:"Digits"` + Period int32 `json:"Period"` + HashAlgorithm HashAlgorithm `json:"HashAlgorithm"` +} + +// NewVaultItemOneTimePasswordInfo instantiates a new VaultItemOneTimePasswordInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVaultItemOneTimePasswordInfo(digits int32, period int32, hashAlgorithm HashAlgorithm) *VaultItemOneTimePasswordInfo { + this := VaultItemOneTimePasswordInfo{} + this.Digits = digits + this.Period = period + this.HashAlgorithm = hashAlgorithm + return &this +} + +// NewVaultItemOneTimePasswordInfoWithDefaults instantiates a new VaultItemOneTimePasswordInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVaultItemOneTimePasswordInfoWithDefaults() *VaultItemOneTimePasswordInfo { + this := VaultItemOneTimePasswordInfo{} + return &this +} + +// GetSecret returns the Secret field value if set, zero value otherwise. +func (o *VaultItemOneTimePasswordInfo) GetSecret() string { + if o == nil || isNil(o.Secret) { + var ret string + return ret + } + return *o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VaultItemOneTimePasswordInfo) GetSecretOk() (*string, bool) { + if o == nil || isNil(o.Secret) { + return nil, false + } + return o.Secret, true +} + +// HasSecret returns a boolean if a field has been set. +func (o *VaultItemOneTimePasswordInfo) HasSecret() bool { + if o != nil && !isNil(o.Secret) { + return true + } + + return false +} + +// SetSecret gets a reference to the given string and assigns it to the Secret field. +func (o *VaultItemOneTimePasswordInfo) SetSecret(v string) { + o.Secret = &v +} + +// GetDigits returns the Digits field value +func (o *VaultItemOneTimePasswordInfo) GetDigits() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Digits +} + +// GetDigitsOk returns a tuple with the Digits field value +// and a boolean to check if the value has been set. +func (o *VaultItemOneTimePasswordInfo) GetDigitsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Digits, true +} + +// SetDigits sets field value +func (o *VaultItemOneTimePasswordInfo) SetDigits(v int32) { + o.Digits = v +} + +// GetPeriod returns the Period field value +func (o *VaultItemOneTimePasswordInfo) GetPeriod() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Period +} + +// GetPeriodOk returns a tuple with the Period field value +// and a boolean to check if the value has been set. +func (o *VaultItemOneTimePasswordInfo) GetPeriodOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Period, true +} + +// SetPeriod sets field value +func (o *VaultItemOneTimePasswordInfo) SetPeriod(v int32) { + o.Period = v +} + +// GetHashAlgorithm returns the HashAlgorithm field value +func (o *VaultItemOneTimePasswordInfo) GetHashAlgorithm() HashAlgorithm { + if o == nil { + var ret HashAlgorithm + return ret + } + + return o.HashAlgorithm +} + +// GetHashAlgorithmOk returns a tuple with the HashAlgorithm field value +// and a boolean to check if the value has been set. +func (o *VaultItemOneTimePasswordInfo) GetHashAlgorithmOk() (*HashAlgorithm, bool) { + if o == nil { + return nil, false + } + return &o.HashAlgorithm, true +} + +// SetHashAlgorithm sets field value +func (o *VaultItemOneTimePasswordInfo) SetHashAlgorithm(v HashAlgorithm) { + o.HashAlgorithm = v +} + +func (o VaultItemOneTimePasswordInfo) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Secret) { + toSerialize["Secret"] = o.Secret + } + if true { + toSerialize["Digits"] = o.Digits + } + if true { + toSerialize["Period"] = o.Period + } + if true { + toSerialize["HashAlgorithm"] = o.HashAlgorithm + } + return json.Marshal(toSerialize) +} + +type NullableVaultItemOneTimePasswordInfo struct { + value *VaultItemOneTimePasswordInfo + isSet bool +} + +func (v NullableVaultItemOneTimePasswordInfo) Get() *VaultItemOneTimePasswordInfo { + return v.value +} + +func (v *NullableVaultItemOneTimePasswordInfo) Set(val *VaultItemOneTimePasswordInfo) { + v.value = val + v.isSet = true +} + +func (v NullableVaultItemOneTimePasswordInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableVaultItemOneTimePasswordInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVaultItemOneTimePasswordInfo(val *VaultItemOneTimePasswordInfo) *NullableVaultItemOneTimePasswordInfo { + return &NullableVaultItemOneTimePasswordInfo{value: val, isSet: true} +} + +func (v NullableVaultItemOneTimePasswordInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVaultItemOneTimePasswordInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_item_types.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_item_types.go index 7738c497..a90841b0 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_item_types.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_item_types.go @@ -24,13 +24,16 @@ const ( VAULTITEMTYPES_CERTIFICATE VaultItemTypes = "Certificate" VAULTITEMTYPES_CERTIFICATE_ARCHIVE VaultItemTypes = "CertificateArchive" VAULTITEMTYPES_FILE VaultItemTypes = "File" + VAULTITEMTYPES_ONE_TIME_PASSWORD VaultItemTypes = "OneTimePassword" ) -var allowedVaultItemTypesEnumValues = []VaultItemTypes{ +// All allowed values of VaultItemTypes enum +var AllowedVaultItemTypesEnumValues = []VaultItemTypes{ "CredentialSet", "Certificate", "CertificateArchive", "File", + "OneTimePassword", } func (v *VaultItemTypes) UnmarshalJSON(src []byte) error { @@ -40,7 +43,7 @@ func (v *VaultItemTypes) UnmarshalJSON(src []byte) error { return err } enumTypeValue := VaultItemTypes(value) - for _, existing := range allowedVaultItemTypesEnumValues { + for _, existing := range AllowedVaultItemTypesEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -57,13 +60,13 @@ func NewVaultItemTypesFromValue(v string) (*VaultItemTypes, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for VaultItemTypes: valid values are %v", v, allowedVaultItemTypesEnumValues) + return nil, fmt.Errorf("invalid value '%v' for VaultItemTypes: valid values are %v", v, AllowedVaultItemTypesEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v VaultItemTypes) IsValid() bool { - for _, existing := range allowedVaultItemTypesEnumValues { + for _, existing := range AllowedVaultItemTypesEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_section.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_section.go index 830aa01b..81f9c74c 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_section.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_section.go @@ -53,8 +53,8 @@ func (o *VaultSection) GetVaultSectionGuid() string { // GetVaultSectionGuidOk returns a tuple with the VaultSectionGuid field value // and a boolean to check if the value has been set. func (o *VaultSection) GetVaultSectionGuidOk() (*string, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.VaultSectionGuid, true } @@ -66,7 +66,7 @@ func (o *VaultSection) SetVaultSectionGuid(v string) { // GetName returns the Name field value if set, zero value otherwise. func (o *VaultSection) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -76,15 +76,15 @@ func (o *VaultSection) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VaultSection) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *VaultSection) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -101,7 +101,7 @@ func (o VaultSection) MarshalJSON() ([]byte, error) { if true { toSerialize["VaultSectionGuid"] = o.VaultSectionGuid } - if o.Name != nil { + if !isNil(o.Name) { toSerialize["Name"] = o.Name } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_section_authorization.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_section_authorization.go index 8217bc5f..09ccd5c5 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_section_authorization.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_section_authorization.go @@ -16,9 +16,13 @@ import ( // VaultSectionAuthorization struct for VaultSectionAuthorization type VaultSectionAuthorization struct { + // The unique ID of this authorization AuthorizationId *string `json:"AuthorizationId,omitempty"` + // The authorization type AuthorizationType VaultSectionAuthorizationType `json:"AuthorizationType"` + // The GUID of the operator (NULL if this authorization is for an operator group) OperatorGuid *string `json:"OperatorGuid,omitempty"` + // The GUID of the operator group (NULL if this authorization is for an operator) OperatorGroupGuid *string `json:"OperatorGroupGuid,omitempty"` } @@ -42,7 +46,7 @@ func NewVaultSectionAuthorizationWithDefaults() *VaultSectionAuthorization { // GetAuthorizationId returns the AuthorizationId field value if set, zero value otherwise. func (o *VaultSectionAuthorization) GetAuthorizationId() string { - if o == nil || o.AuthorizationId == nil { + if o == nil || isNil(o.AuthorizationId) { var ret string return ret } @@ -52,15 +56,15 @@ func (o *VaultSectionAuthorization) GetAuthorizationId() string { // GetAuthorizationIdOk returns a tuple with the AuthorizationId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VaultSectionAuthorization) GetAuthorizationIdOk() (*string, bool) { - if o == nil || o.AuthorizationId == nil { - return nil, false + if o == nil || isNil(o.AuthorizationId) { + return nil, false } return o.AuthorizationId, true } // HasAuthorizationId returns a boolean if a field has been set. func (o *VaultSectionAuthorization) HasAuthorizationId() bool { - if o != nil && o.AuthorizationId != nil { + if o != nil && !isNil(o.AuthorizationId) { return true } @@ -85,8 +89,8 @@ func (o *VaultSectionAuthorization) GetAuthorizationType() VaultSectionAuthoriza // GetAuthorizationTypeOk returns a tuple with the AuthorizationType field value // and a boolean to check if the value has been set. func (o *VaultSectionAuthorization) GetAuthorizationTypeOk() (*VaultSectionAuthorizationType, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.AuthorizationType, true } @@ -98,7 +102,7 @@ func (o *VaultSectionAuthorization) SetAuthorizationType(v VaultSectionAuthoriza // GetOperatorGuid returns the OperatorGuid field value if set, zero value otherwise. func (o *VaultSectionAuthorization) GetOperatorGuid() string { - if o == nil || o.OperatorGuid == nil { + if o == nil || isNil(o.OperatorGuid) { var ret string return ret } @@ -108,15 +112,15 @@ func (o *VaultSectionAuthorization) GetOperatorGuid() string { // GetOperatorGuidOk returns a tuple with the OperatorGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VaultSectionAuthorization) GetOperatorGuidOk() (*string, bool) { - if o == nil || o.OperatorGuid == nil { - return nil, false + if o == nil || isNil(o.OperatorGuid) { + return nil, false } return o.OperatorGuid, true } // HasOperatorGuid returns a boolean if a field has been set. func (o *VaultSectionAuthorization) HasOperatorGuid() bool { - if o != nil && o.OperatorGuid != nil { + if o != nil && !isNil(o.OperatorGuid) { return true } @@ -130,7 +134,7 @@ func (o *VaultSectionAuthorization) SetOperatorGuid(v string) { // GetOperatorGroupGuid returns the OperatorGroupGuid field value if set, zero value otherwise. func (o *VaultSectionAuthorization) GetOperatorGroupGuid() string { - if o == nil || o.OperatorGroupGuid == nil { + if o == nil || isNil(o.OperatorGroupGuid) { var ret string return ret } @@ -140,15 +144,15 @@ func (o *VaultSectionAuthorization) GetOperatorGroupGuid() string { // GetOperatorGroupGuidOk returns a tuple with the OperatorGroupGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VaultSectionAuthorization) GetOperatorGroupGuidOk() (*string, bool) { - if o == nil || o.OperatorGroupGuid == nil { - return nil, false + if o == nil || isNil(o.OperatorGroupGuid) { + return nil, false } return o.OperatorGroupGuid, true } // HasOperatorGroupGuid returns a boolean if a field has been set. func (o *VaultSectionAuthorization) HasOperatorGroupGuid() bool { - if o != nil && o.OperatorGroupGuid != nil { + if o != nil && !isNil(o.OperatorGroupGuid) { return true } @@ -162,16 +166,16 @@ func (o *VaultSectionAuthorization) SetOperatorGroupGuid(v string) { func (o VaultSectionAuthorization) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.AuthorizationId != nil { + if !isNil(o.AuthorizationId) { toSerialize["AuthorizationId"] = o.AuthorizationId } if true { toSerialize["AuthorizationType"] = o.AuthorizationType } - if o.OperatorGuid != nil { + if !isNil(o.OperatorGuid) { toSerialize["OperatorGuid"] = o.OperatorGuid } - if o.OperatorGroupGuid != nil { + if !isNil(o.OperatorGroupGuid) { toSerialize["OperatorGroupGuid"] = o.OperatorGroupGuid } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_section_authorization_type.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_section_authorization_type.go index ac01f47c..e1186c3c 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_section_authorization_type.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_vault_section_authorization_type.go @@ -24,7 +24,8 @@ const ( VAULTSECTIONAUTHORIZATIONTYPE_CHANGE_VAULT_SECTION VaultSectionAuthorizationType = "ChangeVaultSection" ) -var allowedVaultSectionAuthorizationTypeEnumValues = []VaultSectionAuthorizationType{ +// All allowed values of VaultSectionAuthorizationType enum +var AllowedVaultSectionAuthorizationTypeEnumValues = []VaultSectionAuthorizationType{ "ViewVaultSection", "ChangeVaultSection", } @@ -36,7 +37,7 @@ func (v *VaultSectionAuthorizationType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := VaultSectionAuthorizationType(value) - for _, existing := range allowedVaultSectionAuthorizationTypeEnumValues { + for _, existing := range AllowedVaultSectionAuthorizationTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -53,13 +54,13 @@ func NewVaultSectionAuthorizationTypeFromValue(v string) (*VaultSectionAuthoriza if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for VaultSectionAuthorizationType: valid values are %v", v, allowedVaultSectionAuthorizationTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for VaultSectionAuthorizationType: valid values are %v", v, AllowedVaultSectionAuthorizationTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v VaultSectionAuthorizationType) IsValid() bool { - for _, existing := range allowedVaultSectionAuthorizationTypeEnumValues { + for _, existing := range AllowedVaultSectionAuthorizationTypeEnumValues { if existing == v { return true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_w3_c_navigation_timing.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_w3_c_navigation_timing.go index 3232fa9b..9cbe7b54 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_w3_c_navigation_timing.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_w3_c_navigation_timing.go @@ -18,7 +18,7 @@ import ( type W3CNavigationTiming struct { // Equal to the requestStart as defined by the W3C. It is a timestamp indicating when the browser starts requesting the resource from the webserver after the DNS lookup and TCP connection. RequestStart int32 `json:"RequestStart"` - // Equal to the difference between requestStart and responseStart as defined by the W3C. In short, it's the time between when the first request was sent from browser to server, and when the first bytes of the following response were received by the browser. + // Equal to the difference between navigationStart and responseStart as defined by the W3C. In short, it's the time between when the first request was sent from browser to server, and when the first bytes of the following response were received by the browser. TimeToFirstByte int32 `json:"TimeToFirstByte"` // Equal to domInteractive as defined by W3C. It is a timestamp, indicating the document readiness is set to 'interactive', to indicate that the browser has stopped parsing the page and the user can start interacting with it. Resources such as scripts, images, stylesheets, or frames may still be loading. DomInteractive int32 `json:"DomInteractive"` @@ -63,8 +63,8 @@ func (o *W3CNavigationTiming) GetRequestStart() int32 { // GetRequestStartOk returns a tuple with the RequestStart field value // and a boolean to check if the value has been set. func (o *W3CNavigationTiming) GetRequestStartOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.RequestStart, true } @@ -87,8 +87,8 @@ func (o *W3CNavigationTiming) GetTimeToFirstByte() int32 { // GetTimeToFirstByteOk returns a tuple with the TimeToFirstByte field value // and a boolean to check if the value has been set. func (o *W3CNavigationTiming) GetTimeToFirstByteOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.TimeToFirstByte, true } @@ -111,8 +111,8 @@ func (o *W3CNavigationTiming) GetDomInteractive() int32 { // GetDomInteractiveOk returns a tuple with the DomInteractive field value // and a boolean to check if the value has been set. func (o *W3CNavigationTiming) GetDomInteractiveOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.DomInteractive, true } @@ -135,8 +135,8 @@ func (o *W3CNavigationTiming) GetDomComplete() int32 { // GetDomCompleteOk returns a tuple with the DomComplete field value // and a boolean to check if the value has been set. func (o *W3CNavigationTiming) GetDomCompleteOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.DomComplete, true } @@ -159,8 +159,8 @@ func (o *W3CNavigationTiming) GetLoadEvent() int32 { // GetLoadEventOk returns a tuple with the LoadEvent field value // and a boolean to check if the value has been set. func (o *W3CNavigationTiming) GetLoadEventOk() (*int32, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.LoadEvent, true } diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_waterfall_info.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_waterfall_info.go index 03350ef3..54f2c7d5 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_waterfall_info.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_waterfall_info.go @@ -16,14 +16,12 @@ import ( // WaterfallInfo struct for WaterfallInfo type WaterfallInfo struct { - // Metrics for describing the load cycle of the entire web page. Includes CoreWebVitals and other related metrics. - PageLoadMetrics *PageLoadMetrics `json:"PageLoadMetrics,omitempty"` - // W3C Navigation Timing metrics - W3CNavigationTiming *W3CNavigationTiming `json:"W3CNavigationTiming,omitempty"` + PageLoadMetrics *WaterfallInfoPageLoadMetrics `json:"PageLoadMetrics,omitempty"` + W3CNavigationTiming *WaterfallInfoW3CNavigationTiming `json:"W3CNavigationTiming,omitempty"` // Elements in the waterfall - Elements *[]PageElement `json:"Elements,omitempty"` + Elements []PageElement `json:"Elements,omitempty"` // List of domain groups used in the waterfall elements - DomainGroupNames *[]string `json:"DomainGroupNames,omitempty"` + DomainGroupNames []string `json:"DomainGroupNames,omitempty"` } // NewWaterfallInfo instantiates a new WaterfallInfo object @@ -44,9 +42,9 @@ func NewWaterfallInfoWithDefaults() *WaterfallInfo { } // GetPageLoadMetrics returns the PageLoadMetrics field value if set, zero value otherwise. -func (o *WaterfallInfo) GetPageLoadMetrics() PageLoadMetrics { - if o == nil || o.PageLoadMetrics == nil { - var ret PageLoadMetrics +func (o *WaterfallInfo) GetPageLoadMetrics() WaterfallInfoPageLoadMetrics { + if o == nil || isNil(o.PageLoadMetrics) { + var ret WaterfallInfoPageLoadMetrics return ret } return *o.PageLoadMetrics @@ -54,31 +52,31 @@ func (o *WaterfallInfo) GetPageLoadMetrics() PageLoadMetrics { // GetPageLoadMetricsOk returns a tuple with the PageLoadMetrics field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *WaterfallInfo) GetPageLoadMetricsOk() (*PageLoadMetrics, bool) { - if o == nil || o.PageLoadMetrics == nil { - return nil, false +func (o *WaterfallInfo) GetPageLoadMetricsOk() (*WaterfallInfoPageLoadMetrics, bool) { + if o == nil || isNil(o.PageLoadMetrics) { + return nil, false } return o.PageLoadMetrics, true } // HasPageLoadMetrics returns a boolean if a field has been set. func (o *WaterfallInfo) HasPageLoadMetrics() bool { - if o != nil && o.PageLoadMetrics != nil { + if o != nil && !isNil(o.PageLoadMetrics) { return true } return false } -// SetPageLoadMetrics gets a reference to the given PageLoadMetrics and assigns it to the PageLoadMetrics field. -func (o *WaterfallInfo) SetPageLoadMetrics(v PageLoadMetrics) { +// SetPageLoadMetrics gets a reference to the given WaterfallInfoPageLoadMetrics and assigns it to the PageLoadMetrics field. +func (o *WaterfallInfo) SetPageLoadMetrics(v WaterfallInfoPageLoadMetrics) { o.PageLoadMetrics = &v } // GetW3CNavigationTiming returns the W3CNavigationTiming field value if set, zero value otherwise. -func (o *WaterfallInfo) GetW3CNavigationTiming() W3CNavigationTiming { - if o == nil || o.W3CNavigationTiming == nil { - var ret W3CNavigationTiming +func (o *WaterfallInfo) GetW3CNavigationTiming() WaterfallInfoW3CNavigationTiming { + if o == nil || isNil(o.W3CNavigationTiming) { + var ret WaterfallInfoW3CNavigationTiming return ret } return *o.W3CNavigationTiming @@ -86,48 +84,48 @@ func (o *WaterfallInfo) GetW3CNavigationTiming() W3CNavigationTiming { // GetW3CNavigationTimingOk returns a tuple with the W3CNavigationTiming field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *WaterfallInfo) GetW3CNavigationTimingOk() (*W3CNavigationTiming, bool) { - if o == nil || o.W3CNavigationTiming == nil { - return nil, false +func (o *WaterfallInfo) GetW3CNavigationTimingOk() (*WaterfallInfoW3CNavigationTiming, bool) { + if o == nil || isNil(o.W3CNavigationTiming) { + return nil, false } return o.W3CNavigationTiming, true } // HasW3CNavigationTiming returns a boolean if a field has been set. func (o *WaterfallInfo) HasW3CNavigationTiming() bool { - if o != nil && o.W3CNavigationTiming != nil { + if o != nil && !isNil(o.W3CNavigationTiming) { return true } return false } -// SetW3CNavigationTiming gets a reference to the given W3CNavigationTiming and assigns it to the W3CNavigationTiming field. -func (o *WaterfallInfo) SetW3CNavigationTiming(v W3CNavigationTiming) { +// SetW3CNavigationTiming gets a reference to the given WaterfallInfoW3CNavigationTiming and assigns it to the W3CNavigationTiming field. +func (o *WaterfallInfo) SetW3CNavigationTiming(v WaterfallInfoW3CNavigationTiming) { o.W3CNavigationTiming = &v } // GetElements returns the Elements field value if set, zero value otherwise. func (o *WaterfallInfo) GetElements() []PageElement { - if o == nil || o.Elements == nil { + if o == nil || isNil(o.Elements) { var ret []PageElement return ret } - return *o.Elements + return o.Elements } // GetElementsOk returns a tuple with the Elements field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *WaterfallInfo) GetElementsOk() (*[]PageElement, bool) { - if o == nil || o.Elements == nil { - return nil, false +func (o *WaterfallInfo) GetElementsOk() ([]PageElement, bool) { + if o == nil || isNil(o.Elements) { + return nil, false } return o.Elements, true } // HasElements returns a boolean if a field has been set. func (o *WaterfallInfo) HasElements() bool { - if o != nil && o.Elements != nil { + if o != nil && !isNil(o.Elements) { return true } @@ -136,30 +134,30 @@ func (o *WaterfallInfo) HasElements() bool { // SetElements gets a reference to the given []PageElement and assigns it to the Elements field. func (o *WaterfallInfo) SetElements(v []PageElement) { - o.Elements = &v + o.Elements = v } // GetDomainGroupNames returns the DomainGroupNames field value if set, zero value otherwise. func (o *WaterfallInfo) GetDomainGroupNames() []string { - if o == nil || o.DomainGroupNames == nil { + if o == nil || isNil(o.DomainGroupNames) { var ret []string return ret } - return *o.DomainGroupNames + return o.DomainGroupNames } // GetDomainGroupNamesOk returns a tuple with the DomainGroupNames field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *WaterfallInfo) GetDomainGroupNamesOk() (*[]string, bool) { - if o == nil || o.DomainGroupNames == nil { - return nil, false +func (o *WaterfallInfo) GetDomainGroupNamesOk() ([]string, bool) { + if o == nil || isNil(o.DomainGroupNames) { + return nil, false } return o.DomainGroupNames, true } // HasDomainGroupNames returns a boolean if a field has been set. func (o *WaterfallInfo) HasDomainGroupNames() bool { - if o != nil && o.DomainGroupNames != nil { + if o != nil && !isNil(o.DomainGroupNames) { return true } @@ -168,21 +166,21 @@ func (o *WaterfallInfo) HasDomainGroupNames() bool { // SetDomainGroupNames gets a reference to the given []string and assigns it to the DomainGroupNames field. func (o *WaterfallInfo) SetDomainGroupNames(v []string) { - o.DomainGroupNames = &v + o.DomainGroupNames = v } func (o WaterfallInfo) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.PageLoadMetrics != nil { + if !isNil(o.PageLoadMetrics) { toSerialize["PageLoadMetrics"] = o.PageLoadMetrics } - if o.W3CNavigationTiming != nil { + if !isNil(o.W3CNavigationTiming) { toSerialize["W3CNavigationTiming"] = o.W3CNavigationTiming } - if o.Elements != nil { + if !isNil(o.Elements) { toSerialize["Elements"] = o.Elements } - if o.DomainGroupNames != nil { + if !isNil(o.DomainGroupNames) { toSerialize["DomainGroupNames"] = o.DomainGroupNames } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_waterfall_info_page_load_metrics.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_waterfall_info_page_load_metrics.go new file mode 100644 index 00000000..850d303c --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_waterfall_info_page_load_metrics.go @@ -0,0 +1,264 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// WaterfallInfoPageLoadMetrics Metrics for describing the load cycle of the entire web page. Includes CoreWebVitals and other related metrics. +type WaterfallInfoPageLoadMetrics struct { + // Measures the sum total of all individual layout shift scores for every unexpected layout shift that occurs during the entire lifespan of the page. A score lower than 0.1 is considered a good score. Between 0.1 and 0.25 could use some improvement. 0.25 or higher is a poor score. https://web.dev/cls/?utm_source=devtools In case the data was inconclusive null is returned. + CumulativeLayoutShift *float32 `json:"CumulativeLayoutShift,omitempty"` + // Measures the time from when the page starts loading to when any of the page's content is rendered on screen. A score lower than 1000ms is considered a good score. https://web.dev/fcp/ In case the data was inconclusive null is returned. + FirstContentfulPaint *int32 `json:"FirstContentfulPaint,omitempty"` + // The render timestamp of the largest image or text block visible within the viewport. A score lower than 2500ms is good. Between 2500ms and 4000ms needs improvement. 4000ms or higher is poor https://web.dev/lcp/ In case the data was inconclusive null is returned. + LargestContentfulPaint *int32 `json:"LargestContentfulPaint,omitempty"` + // The Total Blocking Time (TBT) metric measures the total amount of time between First Contentful Paint (FCP) and Time to Interactive (TTI) where the main thread was blocked for long enough to prevent input responsiveness. https://web.dev/tbt/ In case the data was inconclusive null is returned. + TotalBlockingTime *int32 `json:"TotalBlockingTime,omitempty"` + // TTI measures how long it takes a page to become fully interactive. https://web.dev/interactive/ In case the data was inconclusive null is returned. + TimeToInteractive *int32 `json:"TimeToInteractive,omitempty"` +} + +// NewWaterfallInfoPageLoadMetrics instantiates a new WaterfallInfoPageLoadMetrics object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWaterfallInfoPageLoadMetrics() *WaterfallInfoPageLoadMetrics { + this := WaterfallInfoPageLoadMetrics{} + return &this +} + +// NewWaterfallInfoPageLoadMetricsWithDefaults instantiates a new WaterfallInfoPageLoadMetrics object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWaterfallInfoPageLoadMetricsWithDefaults() *WaterfallInfoPageLoadMetrics { + this := WaterfallInfoPageLoadMetrics{} + return &this +} + +// GetCumulativeLayoutShift returns the CumulativeLayoutShift field value if set, zero value otherwise. +func (o *WaterfallInfoPageLoadMetrics) GetCumulativeLayoutShift() float32 { + if o == nil || isNil(o.CumulativeLayoutShift) { + var ret float32 + return ret + } + return *o.CumulativeLayoutShift +} + +// GetCumulativeLayoutShiftOk returns a tuple with the CumulativeLayoutShift field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WaterfallInfoPageLoadMetrics) GetCumulativeLayoutShiftOk() (*float32, bool) { + if o == nil || isNil(o.CumulativeLayoutShift) { + return nil, false + } + return o.CumulativeLayoutShift, true +} + +// HasCumulativeLayoutShift returns a boolean if a field has been set. +func (o *WaterfallInfoPageLoadMetrics) HasCumulativeLayoutShift() bool { + if o != nil && !isNil(o.CumulativeLayoutShift) { + return true + } + + return false +} + +// SetCumulativeLayoutShift gets a reference to the given float32 and assigns it to the CumulativeLayoutShift field. +func (o *WaterfallInfoPageLoadMetrics) SetCumulativeLayoutShift(v float32) { + o.CumulativeLayoutShift = &v +} + +// GetFirstContentfulPaint returns the FirstContentfulPaint field value if set, zero value otherwise. +func (o *WaterfallInfoPageLoadMetrics) GetFirstContentfulPaint() int32 { + if o == nil || isNil(o.FirstContentfulPaint) { + var ret int32 + return ret + } + return *o.FirstContentfulPaint +} + +// GetFirstContentfulPaintOk returns a tuple with the FirstContentfulPaint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WaterfallInfoPageLoadMetrics) GetFirstContentfulPaintOk() (*int32, bool) { + if o == nil || isNil(o.FirstContentfulPaint) { + return nil, false + } + return o.FirstContentfulPaint, true +} + +// HasFirstContentfulPaint returns a boolean if a field has been set. +func (o *WaterfallInfoPageLoadMetrics) HasFirstContentfulPaint() bool { + if o != nil && !isNil(o.FirstContentfulPaint) { + return true + } + + return false +} + +// SetFirstContentfulPaint gets a reference to the given int32 and assigns it to the FirstContentfulPaint field. +func (o *WaterfallInfoPageLoadMetrics) SetFirstContentfulPaint(v int32) { + o.FirstContentfulPaint = &v +} + +// GetLargestContentfulPaint returns the LargestContentfulPaint field value if set, zero value otherwise. +func (o *WaterfallInfoPageLoadMetrics) GetLargestContentfulPaint() int32 { + if o == nil || isNil(o.LargestContentfulPaint) { + var ret int32 + return ret + } + return *o.LargestContentfulPaint +} + +// GetLargestContentfulPaintOk returns a tuple with the LargestContentfulPaint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WaterfallInfoPageLoadMetrics) GetLargestContentfulPaintOk() (*int32, bool) { + if o == nil || isNil(o.LargestContentfulPaint) { + return nil, false + } + return o.LargestContentfulPaint, true +} + +// HasLargestContentfulPaint returns a boolean if a field has been set. +func (o *WaterfallInfoPageLoadMetrics) HasLargestContentfulPaint() bool { + if o != nil && !isNil(o.LargestContentfulPaint) { + return true + } + + return false +} + +// SetLargestContentfulPaint gets a reference to the given int32 and assigns it to the LargestContentfulPaint field. +func (o *WaterfallInfoPageLoadMetrics) SetLargestContentfulPaint(v int32) { + o.LargestContentfulPaint = &v +} + +// GetTotalBlockingTime returns the TotalBlockingTime field value if set, zero value otherwise. +func (o *WaterfallInfoPageLoadMetrics) GetTotalBlockingTime() int32 { + if o == nil || isNil(o.TotalBlockingTime) { + var ret int32 + return ret + } + return *o.TotalBlockingTime +} + +// GetTotalBlockingTimeOk returns a tuple with the TotalBlockingTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WaterfallInfoPageLoadMetrics) GetTotalBlockingTimeOk() (*int32, bool) { + if o == nil || isNil(o.TotalBlockingTime) { + return nil, false + } + return o.TotalBlockingTime, true +} + +// HasTotalBlockingTime returns a boolean if a field has been set. +func (o *WaterfallInfoPageLoadMetrics) HasTotalBlockingTime() bool { + if o != nil && !isNil(o.TotalBlockingTime) { + return true + } + + return false +} + +// SetTotalBlockingTime gets a reference to the given int32 and assigns it to the TotalBlockingTime field. +func (o *WaterfallInfoPageLoadMetrics) SetTotalBlockingTime(v int32) { + o.TotalBlockingTime = &v +} + +// GetTimeToInteractive returns the TimeToInteractive field value if set, zero value otherwise. +func (o *WaterfallInfoPageLoadMetrics) GetTimeToInteractive() int32 { + if o == nil || isNil(o.TimeToInteractive) { + var ret int32 + return ret + } + return *o.TimeToInteractive +} + +// GetTimeToInteractiveOk returns a tuple with the TimeToInteractive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WaterfallInfoPageLoadMetrics) GetTimeToInteractiveOk() (*int32, bool) { + if o == nil || isNil(o.TimeToInteractive) { + return nil, false + } + return o.TimeToInteractive, true +} + +// HasTimeToInteractive returns a boolean if a field has been set. +func (o *WaterfallInfoPageLoadMetrics) HasTimeToInteractive() bool { + if o != nil && !isNil(o.TimeToInteractive) { + return true + } + + return false +} + +// SetTimeToInteractive gets a reference to the given int32 and assigns it to the TimeToInteractive field. +func (o *WaterfallInfoPageLoadMetrics) SetTimeToInteractive(v int32) { + o.TimeToInteractive = &v +} + +func (o WaterfallInfoPageLoadMetrics) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.CumulativeLayoutShift) { + toSerialize["CumulativeLayoutShift"] = o.CumulativeLayoutShift + } + if !isNil(o.FirstContentfulPaint) { + toSerialize["FirstContentfulPaint"] = o.FirstContentfulPaint + } + if !isNil(o.LargestContentfulPaint) { + toSerialize["LargestContentfulPaint"] = o.LargestContentfulPaint + } + if !isNil(o.TotalBlockingTime) { + toSerialize["TotalBlockingTime"] = o.TotalBlockingTime + } + if !isNil(o.TimeToInteractive) { + toSerialize["TimeToInteractive"] = o.TimeToInteractive + } + return json.Marshal(toSerialize) +} + +type NullableWaterfallInfoPageLoadMetrics struct { + value *WaterfallInfoPageLoadMetrics + isSet bool +} + +func (v NullableWaterfallInfoPageLoadMetrics) Get() *WaterfallInfoPageLoadMetrics { + return v.value +} + +func (v *NullableWaterfallInfoPageLoadMetrics) Set(val *WaterfallInfoPageLoadMetrics) { + v.value = val + v.isSet = true +} + +func (v NullableWaterfallInfoPageLoadMetrics) IsSet() bool { + return v.isSet +} + +func (v *NullableWaterfallInfoPageLoadMetrics) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWaterfallInfoPageLoadMetrics(val *WaterfallInfoPageLoadMetrics) *NullableWaterfallInfoPageLoadMetrics { + return &NullableWaterfallInfoPageLoadMetrics{value: val, isSet: true} +} + +func (v NullableWaterfallInfoPageLoadMetrics) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWaterfallInfoPageLoadMetrics) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_waterfall_info_w3_c_navigation_timing.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_waterfall_info_w3_c_navigation_timing.go new file mode 100644 index 00000000..a4a5b033 --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_waterfall_info_w3_c_navigation_timing.go @@ -0,0 +1,229 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// WaterfallInfoW3CNavigationTiming W3C Navigation Timing metrics +type WaterfallInfoW3CNavigationTiming struct { + // Equal to the requestStart as defined by the W3C. It is a timestamp indicating when the browser starts requesting the resource from the webserver after the DNS lookup and TCP connection. + RequestStart int32 `json:"RequestStart"` + // Equal to the difference between navigationStart and responseStart as defined by the W3C. In short, it's the time between when the first request was sent from browser to server, and when the first bytes of the following response were received by the browser. + TimeToFirstByte int32 `json:"TimeToFirstByte"` + // Equal to domInteractive as defined by W3C. It is a timestamp, indicating the document readiness is set to 'interactive', to indicate that the browser has stopped parsing the page and the user can start interacting with it. Resources such as scripts, images, stylesheets, or frames may still be loading. + DomInteractive int32 `json:"DomInteractive"` + // Equal to the domComplete as defined by W3C. It is a timestamp, indicating when the main document has been parsed, the DOM has been fully loaded, and the page readiness is set to 'complete'. + DomComplete int32 `json:"DomComplete"` + // Equal to loadEventEnd as defined by W3C. It is a timestamp, indicating when the load event of the current document has completed, including all dependent resources such as stylesheets and images. + LoadEvent int32 `json:"LoadEvent"` +} + +// NewWaterfallInfoW3CNavigationTiming instantiates a new WaterfallInfoW3CNavigationTiming object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWaterfallInfoW3CNavigationTiming(requestStart int32, timeToFirstByte int32, domInteractive int32, domComplete int32, loadEvent int32) *WaterfallInfoW3CNavigationTiming { + this := WaterfallInfoW3CNavigationTiming{} + this.RequestStart = requestStart + this.TimeToFirstByte = timeToFirstByte + this.DomInteractive = domInteractive + this.DomComplete = domComplete + this.LoadEvent = loadEvent + return &this +} + +// NewWaterfallInfoW3CNavigationTimingWithDefaults instantiates a new WaterfallInfoW3CNavigationTiming object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWaterfallInfoW3CNavigationTimingWithDefaults() *WaterfallInfoW3CNavigationTiming { + this := WaterfallInfoW3CNavigationTiming{} + return &this +} + +// GetRequestStart returns the RequestStart field value +func (o *WaterfallInfoW3CNavigationTiming) GetRequestStart() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.RequestStart +} + +// GetRequestStartOk returns a tuple with the RequestStart field value +// and a boolean to check if the value has been set. +func (o *WaterfallInfoW3CNavigationTiming) GetRequestStartOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RequestStart, true +} + +// SetRequestStart sets field value +func (o *WaterfallInfoW3CNavigationTiming) SetRequestStart(v int32) { + o.RequestStart = v +} + +// GetTimeToFirstByte returns the TimeToFirstByte field value +func (o *WaterfallInfoW3CNavigationTiming) GetTimeToFirstByte() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.TimeToFirstByte +} + +// GetTimeToFirstByteOk returns a tuple with the TimeToFirstByte field value +// and a boolean to check if the value has been set. +func (o *WaterfallInfoW3CNavigationTiming) GetTimeToFirstByteOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TimeToFirstByte, true +} + +// SetTimeToFirstByte sets field value +func (o *WaterfallInfoW3CNavigationTiming) SetTimeToFirstByte(v int32) { + o.TimeToFirstByte = v +} + +// GetDomInteractive returns the DomInteractive field value +func (o *WaterfallInfoW3CNavigationTiming) GetDomInteractive() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DomInteractive +} + +// GetDomInteractiveOk returns a tuple with the DomInteractive field value +// and a boolean to check if the value has been set. +func (o *WaterfallInfoW3CNavigationTiming) GetDomInteractiveOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DomInteractive, true +} + +// SetDomInteractive sets field value +func (o *WaterfallInfoW3CNavigationTiming) SetDomInteractive(v int32) { + o.DomInteractive = v +} + +// GetDomComplete returns the DomComplete field value +func (o *WaterfallInfoW3CNavigationTiming) GetDomComplete() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DomComplete +} + +// GetDomCompleteOk returns a tuple with the DomComplete field value +// and a boolean to check if the value has been set. +func (o *WaterfallInfoW3CNavigationTiming) GetDomCompleteOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DomComplete, true +} + +// SetDomComplete sets field value +func (o *WaterfallInfoW3CNavigationTiming) SetDomComplete(v int32) { + o.DomComplete = v +} + +// GetLoadEvent returns the LoadEvent field value +func (o *WaterfallInfoW3CNavigationTiming) GetLoadEvent() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.LoadEvent +} + +// GetLoadEventOk returns a tuple with the LoadEvent field value +// and a boolean to check if the value has been set. +func (o *WaterfallInfoW3CNavigationTiming) GetLoadEventOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.LoadEvent, true +} + +// SetLoadEvent sets field value +func (o *WaterfallInfoW3CNavigationTiming) SetLoadEvent(v int32) { + o.LoadEvent = v +} + +func (o WaterfallInfoW3CNavigationTiming) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["RequestStart"] = o.RequestStart + } + if true { + toSerialize["TimeToFirstByte"] = o.TimeToFirstByte + } + if true { + toSerialize["DomInteractive"] = o.DomInteractive + } + if true { + toSerialize["DomComplete"] = o.DomComplete + } + if true { + toSerialize["LoadEvent"] = o.LoadEvent + } + return json.Marshal(toSerialize) +} + +type NullableWaterfallInfoW3CNavigationTiming struct { + value *WaterfallInfoW3CNavigationTiming + isSet bool +} + +func (v NullableWaterfallInfoW3CNavigationTiming) Get() *WaterfallInfoW3CNavigationTiming { + return v.value +} + +func (v *NullableWaterfallInfoW3CNavigationTiming) Set(val *WaterfallInfoW3CNavigationTiming) { + v.value = val + v.isSet = true +} + +func (v NullableWaterfallInfoW3CNavigationTiming) IsSet() bool { + return v.isSet +} + +func (v *NullableWaterfallInfoW3CNavigationTiming) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWaterfallInfoW3CNavigationTiming(val *WaterfallInfoW3CNavigationTiming) *NullableWaterfallInfoW3CNavigationTiming { + return &NullableWaterfallInfoW3CNavigationTiming{value: val, isSet: true} +} + +func (v NullableWaterfallInfoW3CNavigationTiming) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWaterfallInfoW3CNavigationTiming) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_waterfall_response.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_waterfall_response.go index 74abe6a2..620322c2 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/model_waterfall_response.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_waterfall_response.go @@ -16,10 +16,14 @@ import ( // WaterfallResponse struct for WaterfallResponse type WaterfallResponse struct { - Attributes *WaterfallInfo `json:"Attributes,omitempty"` + Attributes *WaterfallResponseAttributes `json:"Attributes,omitempty"` + // Identifier Id int64 `json:"Id"` + // Object type Type *string `json:"Type,omitempty"` - Relationships *[]RelationObject `json:"Relationships,omitempty"` + // Relationships of the object + Relationships []RelationObject `json:"Relationships,omitempty"` + // Links related to the object Links *map[string]string `json:"Links,omitempty"` } @@ -42,9 +46,9 @@ func NewWaterfallResponseWithDefaults() *WaterfallResponse { } // GetAttributes returns the Attributes field value if set, zero value otherwise. -func (o *WaterfallResponse) GetAttributes() WaterfallInfo { - if o == nil || o.Attributes == nil { - var ret WaterfallInfo +func (o *WaterfallResponse) GetAttributes() WaterfallResponseAttributes { + if o == nil || isNil(o.Attributes) { + var ret WaterfallResponseAttributes return ret } return *o.Attributes @@ -52,24 +56,24 @@ func (o *WaterfallResponse) GetAttributes() WaterfallInfo { // GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *WaterfallResponse) GetAttributesOk() (*WaterfallInfo, bool) { - if o == nil || o.Attributes == nil { - return nil, false +func (o *WaterfallResponse) GetAttributesOk() (*WaterfallResponseAttributes, bool) { + if o == nil || isNil(o.Attributes) { + return nil, false } return o.Attributes, true } // HasAttributes returns a boolean if a field has been set. func (o *WaterfallResponse) HasAttributes() bool { - if o != nil && o.Attributes != nil { + if o != nil && !isNil(o.Attributes) { return true } return false } -// SetAttributes gets a reference to the given WaterfallInfo and assigns it to the Attributes field. -func (o *WaterfallResponse) SetAttributes(v WaterfallInfo) { +// SetAttributes gets a reference to the given WaterfallResponseAttributes and assigns it to the Attributes field. +func (o *WaterfallResponse) SetAttributes(v WaterfallResponseAttributes) { o.Attributes = &v } @@ -86,8 +90,8 @@ func (o *WaterfallResponse) GetId() int64 { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *WaterfallResponse) GetIdOk() (*int64, bool) { - if o == nil { - return nil, false + if o == nil { + return nil, false } return &o.Id, true } @@ -99,7 +103,7 @@ func (o *WaterfallResponse) SetId(v int64) { // GetType returns the Type field value if set, zero value otherwise. func (o *WaterfallResponse) GetType() string { - if o == nil || o.Type == nil { + if o == nil || isNil(o.Type) { var ret string return ret } @@ -109,15 +113,15 @@ func (o *WaterfallResponse) GetType() string { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *WaterfallResponse) GetTypeOk() (*string, bool) { - if o == nil || o.Type == nil { - return nil, false + if o == nil || isNil(o.Type) { + return nil, false } return o.Type, true } // HasType returns a boolean if a field has been set. func (o *WaterfallResponse) HasType() bool { - if o != nil && o.Type != nil { + if o != nil && !isNil(o.Type) { return true } @@ -131,25 +135,25 @@ func (o *WaterfallResponse) SetType(v string) { // GetRelationships returns the Relationships field value if set, zero value otherwise. func (o *WaterfallResponse) GetRelationships() []RelationObject { - if o == nil || o.Relationships == nil { + if o == nil || isNil(o.Relationships) { var ret []RelationObject return ret } - return *o.Relationships + return o.Relationships } // GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *WaterfallResponse) GetRelationshipsOk() (*[]RelationObject, bool) { - if o == nil || o.Relationships == nil { - return nil, false +func (o *WaterfallResponse) GetRelationshipsOk() ([]RelationObject, bool) { + if o == nil || isNil(o.Relationships) { + return nil, false } return o.Relationships, true } // HasRelationships returns a boolean if a field has been set. func (o *WaterfallResponse) HasRelationships() bool { - if o != nil && o.Relationships != nil { + if o != nil && !isNil(o.Relationships) { return true } @@ -158,12 +162,12 @@ func (o *WaterfallResponse) HasRelationships() bool { // SetRelationships gets a reference to the given []RelationObject and assigns it to the Relationships field. func (o *WaterfallResponse) SetRelationships(v []RelationObject) { - o.Relationships = &v + o.Relationships = v } // GetLinks returns the Links field value if set, zero value otherwise. func (o *WaterfallResponse) GetLinks() map[string]string { - if o == nil || o.Links == nil { + if o == nil || isNil(o.Links) { var ret map[string]string return ret } @@ -173,15 +177,15 @@ func (o *WaterfallResponse) GetLinks() map[string]string { // GetLinksOk returns a tuple with the Links field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *WaterfallResponse) GetLinksOk() (*map[string]string, bool) { - if o == nil || o.Links == nil { - return nil, false + if o == nil || isNil(o.Links) { + return nil, false } return o.Links, true } // HasLinks returns a boolean if a field has been set. func (o *WaterfallResponse) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !isNil(o.Links) { return true } @@ -195,19 +199,19 @@ func (o *WaterfallResponse) SetLinks(v map[string]string) { func (o WaterfallResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Attributes != nil { + if !isNil(o.Attributes) { toSerialize["Attributes"] = o.Attributes } if true { toSerialize["Id"] = o.Id } - if o.Type != nil { + if !isNil(o.Type) { toSerialize["Type"] = o.Type } - if o.Relationships != nil { + if !isNil(o.Relationships) { toSerialize["Relationships"] = o.Relationships } - if o.Links != nil { + if !isNil(o.Links) { toSerialize["Links"] = o.Links } return json.Marshal(toSerialize) diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/model_waterfall_response_attributes.go b/vendor/github.com/wasfree/uptrends-go-sdk/model_waterfall_response_attributes.go new file mode 100644 index 00000000..d3643c1e --- /dev/null +++ b/vendor/github.com/wasfree/uptrends-go-sdk/model_waterfall_response_attributes.go @@ -0,0 +1,225 @@ +/* +Uptrends API v4 + +This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit https://www.uptrends.com/api. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package uptrends + +import ( + "encoding/json" +) + +// WaterfallResponseAttributes Object attributes +type WaterfallResponseAttributes struct { + PageLoadMetrics *WaterfallInfoPageLoadMetrics `json:"PageLoadMetrics,omitempty"` + W3CNavigationTiming *WaterfallInfoW3CNavigationTiming `json:"W3CNavigationTiming,omitempty"` + // Elements in the waterfall + Elements []PageElement `json:"Elements,omitempty"` + // List of domain groups used in the waterfall elements + DomainGroupNames []string `json:"DomainGroupNames,omitempty"` +} + +// NewWaterfallResponseAttributes instantiates a new WaterfallResponseAttributes object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWaterfallResponseAttributes() *WaterfallResponseAttributes { + this := WaterfallResponseAttributes{} + return &this +} + +// NewWaterfallResponseAttributesWithDefaults instantiates a new WaterfallResponseAttributes object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWaterfallResponseAttributesWithDefaults() *WaterfallResponseAttributes { + this := WaterfallResponseAttributes{} + return &this +} + +// GetPageLoadMetrics returns the PageLoadMetrics field value if set, zero value otherwise. +func (o *WaterfallResponseAttributes) GetPageLoadMetrics() WaterfallInfoPageLoadMetrics { + if o == nil || isNil(o.PageLoadMetrics) { + var ret WaterfallInfoPageLoadMetrics + return ret + } + return *o.PageLoadMetrics +} + +// GetPageLoadMetricsOk returns a tuple with the PageLoadMetrics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WaterfallResponseAttributes) GetPageLoadMetricsOk() (*WaterfallInfoPageLoadMetrics, bool) { + if o == nil || isNil(o.PageLoadMetrics) { + return nil, false + } + return o.PageLoadMetrics, true +} + +// HasPageLoadMetrics returns a boolean if a field has been set. +func (o *WaterfallResponseAttributes) HasPageLoadMetrics() bool { + if o != nil && !isNil(o.PageLoadMetrics) { + return true + } + + return false +} + +// SetPageLoadMetrics gets a reference to the given WaterfallInfoPageLoadMetrics and assigns it to the PageLoadMetrics field. +func (o *WaterfallResponseAttributes) SetPageLoadMetrics(v WaterfallInfoPageLoadMetrics) { + o.PageLoadMetrics = &v +} + +// GetW3CNavigationTiming returns the W3CNavigationTiming field value if set, zero value otherwise. +func (o *WaterfallResponseAttributes) GetW3CNavigationTiming() WaterfallInfoW3CNavigationTiming { + if o == nil || isNil(o.W3CNavigationTiming) { + var ret WaterfallInfoW3CNavigationTiming + return ret + } + return *o.W3CNavigationTiming +} + +// GetW3CNavigationTimingOk returns a tuple with the W3CNavigationTiming field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WaterfallResponseAttributes) GetW3CNavigationTimingOk() (*WaterfallInfoW3CNavigationTiming, bool) { + if o == nil || isNil(o.W3CNavigationTiming) { + return nil, false + } + return o.W3CNavigationTiming, true +} + +// HasW3CNavigationTiming returns a boolean if a field has been set. +func (o *WaterfallResponseAttributes) HasW3CNavigationTiming() bool { + if o != nil && !isNil(o.W3CNavigationTiming) { + return true + } + + return false +} + +// SetW3CNavigationTiming gets a reference to the given WaterfallInfoW3CNavigationTiming and assigns it to the W3CNavigationTiming field. +func (o *WaterfallResponseAttributes) SetW3CNavigationTiming(v WaterfallInfoW3CNavigationTiming) { + o.W3CNavigationTiming = &v +} + +// GetElements returns the Elements field value if set, zero value otherwise. +func (o *WaterfallResponseAttributes) GetElements() []PageElement { + if o == nil || isNil(o.Elements) { + var ret []PageElement + return ret + } + return o.Elements +} + +// GetElementsOk returns a tuple with the Elements field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WaterfallResponseAttributes) GetElementsOk() ([]PageElement, bool) { + if o == nil || isNil(o.Elements) { + return nil, false + } + return o.Elements, true +} + +// HasElements returns a boolean if a field has been set. +func (o *WaterfallResponseAttributes) HasElements() bool { + if o != nil && !isNil(o.Elements) { + return true + } + + return false +} + +// SetElements gets a reference to the given []PageElement and assigns it to the Elements field. +func (o *WaterfallResponseAttributes) SetElements(v []PageElement) { + o.Elements = v +} + +// GetDomainGroupNames returns the DomainGroupNames field value if set, zero value otherwise. +func (o *WaterfallResponseAttributes) GetDomainGroupNames() []string { + if o == nil || isNil(o.DomainGroupNames) { + var ret []string + return ret + } + return o.DomainGroupNames +} + +// GetDomainGroupNamesOk returns a tuple with the DomainGroupNames field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WaterfallResponseAttributes) GetDomainGroupNamesOk() ([]string, bool) { + if o == nil || isNil(o.DomainGroupNames) { + return nil, false + } + return o.DomainGroupNames, true +} + +// HasDomainGroupNames returns a boolean if a field has been set. +func (o *WaterfallResponseAttributes) HasDomainGroupNames() bool { + if o != nil && !isNil(o.DomainGroupNames) { + return true + } + + return false +} + +// SetDomainGroupNames gets a reference to the given []string and assigns it to the DomainGroupNames field. +func (o *WaterfallResponseAttributes) SetDomainGroupNames(v []string) { + o.DomainGroupNames = v +} + +func (o WaterfallResponseAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.PageLoadMetrics) { + toSerialize["PageLoadMetrics"] = o.PageLoadMetrics + } + if !isNil(o.W3CNavigationTiming) { + toSerialize["W3CNavigationTiming"] = o.W3CNavigationTiming + } + if !isNil(o.Elements) { + toSerialize["Elements"] = o.Elements + } + if !isNil(o.DomainGroupNames) { + toSerialize["DomainGroupNames"] = o.DomainGroupNames + } + return json.Marshal(toSerialize) +} + +type NullableWaterfallResponseAttributes struct { + value *WaterfallResponseAttributes + isSet bool +} + +func (v NullableWaterfallResponseAttributes) Get() *WaterfallResponseAttributes { + return v.value +} + +func (v *NullableWaterfallResponseAttributes) Set(val *WaterfallResponseAttributes) { + v.value = val + v.isSet = true +} + +func (v NullableWaterfallResponseAttributes) IsSet() bool { + return v.isSet +} + +func (v *NullableWaterfallResponseAttributes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWaterfallResponseAttributes(val *WaterfallResponseAttributes) *NullableWaterfallResponseAttributes { + return &NullableWaterfallResponseAttributes{value: val, isSet: true} +} + +func (v NullableWaterfallResponseAttributes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWaterfallResponseAttributes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/wasfree/uptrends-go-sdk/utils.go b/vendor/github.com/wasfree/uptrends-go-sdk/utils.go index 54f43caf..8c85a1ed 100644 --- a/vendor/github.com/wasfree/uptrends-go-sdk/utils.go +++ b/vendor/github.com/wasfree/uptrends-go-sdk/utils.go @@ -12,6 +12,7 @@ package uptrends import ( "encoding/json" + "reflect" "time" ) @@ -326,3 +327,17 @@ func (v *NullableTime) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + +// isNil checks if an input is nil +func isNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} \ No newline at end of file diff --git a/vendor/golang.org/x/crypto/bcrypt/bcrypt.go b/vendor/golang.org/x/crypto/bcrypt/bcrypt.go index aeb73f81..addf56b4 100644 --- a/vendor/golang.org/x/crypto/bcrypt/bcrypt.go +++ b/vendor/golang.org/x/crypto/bcrypt/bcrypt.go @@ -50,7 +50,7 @@ func (ih InvalidHashPrefixError) Error() string { type InvalidCostError int func (ic InvalidCostError) Error() string { - return fmt.Sprintf("crypto/bcrypt: cost %d is outside allowed range (%d,%d)", int(ic), int(MinCost), int(MaxCost)) + return fmt.Sprintf("crypto/bcrypt: cost %d is outside allowed range (%d,%d)", int(ic), MinCost, MaxCost) } const ( diff --git a/vendor/golang.org/x/crypto/cast5/cast5.go b/vendor/golang.org/x/crypto/cast5/cast5.go index ddcbeb6f..425e8eec 100644 --- a/vendor/golang.org/x/crypto/cast5/cast5.go +++ b/vendor/golang.org/x/crypto/cast5/cast5.go @@ -13,7 +13,10 @@ // golang.org/x/crypto/chacha20poly1305). package cast5 // import "golang.org/x/crypto/cast5" -import "errors" +import ( + "errors" + "math/bits" +) const BlockSize = 8 const KeySize = 16 @@ -241,19 +244,19 @@ func (c *Cipher) keySchedule(in []byte) { // These are the three 'f' functions. See RFC 2144, section 2.2. func f1(d, m uint32, r uint8) uint32 { t := m + d - I := (t << r) | (t >> (32 - r)) + I := bits.RotateLeft32(t, int(r)) return ((sBox[0][I>>24] ^ sBox[1][(I>>16)&0xff]) - sBox[2][(I>>8)&0xff]) + sBox[3][I&0xff] } func f2(d, m uint32, r uint8) uint32 { t := m ^ d - I := (t << r) | (t >> (32 - r)) + I := bits.RotateLeft32(t, int(r)) return ((sBox[0][I>>24] - sBox[1][(I>>16)&0xff]) + sBox[2][(I>>8)&0xff]) ^ sBox[3][I&0xff] } func f3(d, m uint32, r uint8) uint32 { t := m - d - I := (t << r) | (t >> (32 - r)) + I := bits.RotateLeft32(t, int(r)) return ((sBox[0][I>>24] + sBox[1][(I>>16)&0xff]) ^ sBox[2][(I>>8)&0xff]) - sBox[3][I&0xff] } diff --git a/vendor/golang.org/x/crypto/openpgp/armor/armor.go b/vendor/golang.org/x/crypto/openpgp/armor/armor.go index be342ad4..8907183e 100644 --- a/vendor/golang.org/x/crypto/openpgp/armor/armor.go +++ b/vendor/golang.org/x/crypto/openpgp/armor/armor.go @@ -156,7 +156,7 @@ func (r *openpgpReader) Read(p []byte) (n int, err error) { n, err = r.b64Reader.Read(p) r.currentCRC = crc24(r.currentCRC, p[:n]) - if err == io.EOF && r.lReader.crcSet && r.lReader.crc != uint32(r.currentCRC&crc24Mask) { + if err == io.EOF && r.lReader.crcSet && r.lReader.crc != r.currentCRC&crc24Mask { return 0, ArmorCorrupt } diff --git a/vendor/golang.org/x/crypto/ssh/common.go b/vendor/golang.org/x/crypto/ssh/common.go index 7a5ff2d2..c7964275 100644 --- a/vendor/golang.org/x/crypto/ssh/common.go +++ b/vendor/golang.org/x/crypto/ssh/common.go @@ -10,6 +10,7 @@ import ( "fmt" "io" "math" + "strings" "sync" _ "crypto/sha1" @@ -118,6 +119,20 @@ func algorithmsForKeyFormat(keyFormat string) []string { } } +// supportedPubKeyAuthAlgos specifies the supported client public key +// authentication algorithms. Note that this doesn't include certificate types +// since those use the underlying algorithm. This list is sent to the client if +// it supports the server-sig-algs extension. Order is irrelevant. +var supportedPubKeyAuthAlgos = []string{ + KeyAlgoED25519, + KeyAlgoSKED25519, KeyAlgoSKECDSA256, + KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521, + KeyAlgoRSASHA256, KeyAlgoRSASHA512, KeyAlgoRSA, + KeyAlgoDSA, +} + +var supportedPubKeyAuthAlgosList = strings.Join(supportedPubKeyAuthAlgos, ",") + // unexpectedMessageError results when the SSH message that we received didn't // match what we wanted. func unexpectedMessageError(expected, got uint8) error { diff --git a/vendor/golang.org/x/crypto/ssh/handshake.go b/vendor/golang.org/x/crypto/ssh/handshake.go index 653dc4d2..2b84c357 100644 --- a/vendor/golang.org/x/crypto/ssh/handshake.go +++ b/vendor/golang.org/x/crypto/ssh/handshake.go @@ -615,7 +615,8 @@ func (t *handshakeTransport) enterKeyExchange(otherInitPacket []byte) error { return err } - if t.sessionID == nil { + firstKeyExchange := t.sessionID == nil + if firstKeyExchange { t.sessionID = result.H } result.SessionID = t.sessionID @@ -626,6 +627,24 @@ func (t *handshakeTransport) enterKeyExchange(otherInitPacket []byte) error { if err = t.conn.writePacket([]byte{msgNewKeys}); err != nil { return err } + + // On the server side, after the first SSH_MSG_NEWKEYS, send a SSH_MSG_EXT_INFO + // message with the server-sig-algs extension if the client supports it. See + // RFC 8308, Sections 2.4 and 3.1. + if !isClient && firstKeyExchange && contains(clientInit.KexAlgos, "ext-info-c") { + extInfo := &extInfoMsg{ + NumExtensions: 1, + Payload: make([]byte, 0, 4+15+4+len(supportedPubKeyAuthAlgosList)), + } + extInfo.Payload = appendInt(extInfo.Payload, len("server-sig-algs")) + extInfo.Payload = append(extInfo.Payload, "server-sig-algs"...) + extInfo.Payload = appendInt(extInfo.Payload, len(supportedPubKeyAuthAlgosList)) + extInfo.Payload = append(extInfo.Payload, supportedPubKeyAuthAlgosList...) + if err := t.conn.writePacket(Marshal(extInfo)); err != nil { + return err + } + } + if packet, err := t.conn.readPacket(); err != nil { return err } else if packet[0] != msgNewKeys { diff --git a/vendor/golang.org/x/crypto/ssh/messages.go b/vendor/golang.org/x/crypto/ssh/messages.go index 19bc67c4..922032d9 100644 --- a/vendor/golang.org/x/crypto/ssh/messages.go +++ b/vendor/golang.org/x/crypto/ssh/messages.go @@ -68,7 +68,7 @@ type kexInitMsg struct { // See RFC 4253, section 8. -// Diffie-Helman +// Diffie-Hellman const msgKexDHInit = 30 type kexDHInitMsg struct { diff --git a/vendor/golang.org/x/crypto/ssh/server.go b/vendor/golang.org/x/crypto/ssh/server.go index 2260b20a..9e387029 100644 --- a/vendor/golang.org/x/crypto/ssh/server.go +++ b/vendor/golang.org/x/crypto/ssh/server.go @@ -291,15 +291,6 @@ func (s *connection) serverHandshake(config *ServerConfig) (*Permissions, error) return perms, err } -func isAcceptableAlgo(algo string) bool { - switch algo { - case KeyAlgoRSA, KeyAlgoRSASHA256, KeyAlgoRSASHA512, KeyAlgoDSA, KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521, KeyAlgoSKECDSA256, KeyAlgoED25519, KeyAlgoSKED25519, - CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoSKECDSA256v01, CertAlgoED25519v01, CertAlgoSKED25519v01: - return true - } - return false -} - func checkSourceAddress(addr net.Addr, sourceAddrs string) error { if addr == nil { return errors.New("ssh: no address known for client, but source-address match required") @@ -514,7 +505,7 @@ userAuthLoop: return nil, parseError(msgUserAuthRequest) } algo := string(algoBytes) - if !isAcceptableAlgo(algo) { + if !contains(supportedPubKeyAuthAlgos, underlyingAlgo(algo)) { authErr = fmt.Errorf("ssh: algorithm %q not accepted", algo) break } @@ -572,7 +563,7 @@ userAuthLoop: // algorithm name that corresponds to algo with // sig.Format. This is usually the same, but // for certs, the names differ. - if !isAcceptableAlgo(sig.Format) { + if !contains(supportedPubKeyAuthAlgos, sig.Format) { authErr = fmt.Errorf("ssh: algorithm %q not accepted", sig.Format) break } diff --git a/vendor/golang.org/x/text/unicode/bidi/trieval.go b/vendor/golang.org/x/text/unicode/bidi/trieval.go index 4c459c4b..6a796e22 100644 --- a/vendor/golang.org/x/text/unicode/bidi/trieval.go +++ b/vendor/golang.org/x/text/unicode/bidi/trieval.go @@ -37,18 +37,6 @@ const ( unknownClass = ^Class(0) ) -var controlToClass = map[rune]Class{ - 0x202D: LRO, // LeftToRightOverride, - 0x202E: RLO, // RightToLeftOverride, - 0x202A: LRE, // LeftToRightEmbedding, - 0x202B: RLE, // RightToLeftEmbedding, - 0x202C: PDF, // PopDirectionalFormat, - 0x2066: LRI, // LeftToRightIsolate, - 0x2067: RLI, // RightToLeftIsolate, - 0x2068: FSI, // FirstStrongIsolate, - 0x2069: PDI, // PopDirectionalIsolate, -} - // A trie entry has the following bits: // 7..5 XOR mask for brackets // 4 1: Bracket open, 0: Bracket close diff --git a/vendor/google.golang.org/grpc/attributes/attributes.go b/vendor/google.golang.org/grpc/attributes/attributes.go index ae13ddac..02f5dc53 100644 --- a/vendor/google.golang.org/grpc/attributes/attributes.go +++ b/vendor/google.golang.org/grpc/attributes/attributes.go @@ -19,7 +19,7 @@ // Package attributes defines a generic key/value store used in various gRPC // components. // -// Experimental +// # Experimental // // Notice: This package is EXPERIMENTAL and may be changed or removed in a // later release. diff --git a/vendor/google.golang.org/grpc/backoff.go b/vendor/google.golang.org/grpc/backoff.go index 542594f5..29475e31 100644 --- a/vendor/google.golang.org/grpc/backoff.go +++ b/vendor/google.golang.org/grpc/backoff.go @@ -48,7 +48,7 @@ type BackoffConfig struct { // here for more details: // https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. diff --git a/vendor/google.golang.org/grpc/balancer/balancer.go b/vendor/google.golang.org/grpc/balancer/balancer.go index f4f9408f..392b21fb 100644 --- a/vendor/google.golang.org/grpc/balancer/balancer.go +++ b/vendor/google.golang.org/grpc/balancer/balancer.go @@ -110,6 +110,11 @@ type SubConn interface { UpdateAddresses([]resolver.Address) // Connect starts the connecting for this SubConn. Connect() + // GetOrBuildProducer returns a reference to the existing Producer for this + // ProducerBuilder in this SubConn, or, if one does not currently exist, + // creates a new one and returns it. Returns a close function which must + // be called when the Producer is no longer needed. + GetOrBuildProducer(ProducerBuilder) (p Producer, close func()) } // NewSubConnOptions contains options to create new SubConn. @@ -371,3 +376,21 @@ type ClientConnState struct { // ErrBadResolverState may be returned by UpdateClientConnState to indicate a // problem with the provided name resolver data. var ErrBadResolverState = errors.New("bad resolver state") + +// A ProducerBuilder is a simple constructor for a Producer. It is used by the +// SubConn to create producers when needed. +type ProducerBuilder interface { + // Build creates a Producer. The first parameter is always a + // grpc.ClientConnInterface (a type to allow creating RPCs/streams on the + // associated SubConn), but is declared as interface{} to avoid a + // dependency cycle. Should also return a close function that will be + // called when all references to the Producer have been given up. + Build(grpcClientConnInterface interface{}) (p Producer, close func()) +} + +// A Producer is a type shared among potentially many consumers. It is +// associated with a SubConn, and an implementation will typically contain +// other methods to provide additional functionality, e.g. configuration or +// subscription registration. +type Producer interface { +} diff --git a/vendor/google.golang.org/grpc/balancer/base/balancer.go b/vendor/google.golang.org/grpc/balancer/base/balancer.go index e8dfc828..3929c26d 100644 --- a/vendor/google.golang.org/grpc/balancer/base/balancer.go +++ b/vendor/google.golang.org/grpc/balancer/base/balancer.go @@ -157,8 +157,8 @@ func (b *baseBalancer) mergeErrors() error { // regeneratePicker takes a snapshot of the balancer, and generates a picker // from it. The picker is -// - errPicker if the balancer is in TransientFailure, -// - built by the pickerBuilder with all READY SubConns otherwise. +// - errPicker if the balancer is in TransientFailure, +// - built by the pickerBuilder with all READY SubConns otherwise. func (b *baseBalancer) regeneratePicker() { if b.state == connectivity.TransientFailure { b.picker = NewErrPicker(b.mergeErrors()) diff --git a/vendor/google.golang.org/grpc/balancer/conn_state_evaluator.go b/vendor/google.golang.org/grpc/balancer/conn_state_evaluator.go index a87b6809..c3341358 100644 --- a/vendor/google.golang.org/grpc/balancer/conn_state_evaluator.go +++ b/vendor/google.golang.org/grpc/balancer/conn_state_evaluator.go @@ -34,10 +34,10 @@ type ConnectivityStateEvaluator struct { // RecordTransition records state change happening in subConn and based on that // it evaluates what aggregated state should be. // -// - If at least one SubConn in Ready, the aggregated state is Ready; -// - Else if at least one SubConn in Connecting, the aggregated state is Connecting; -// - Else if at least one SubConn is Idle, the aggregated state is Idle; -// - Else if at least one SubConn is TransientFailure (or there are no SubConns), the aggregated state is Transient Failure. +// - If at least one SubConn in Ready, the aggregated state is Ready; +// - Else if at least one SubConn in Connecting, the aggregated state is Connecting; +// - Else if at least one SubConn is Idle, the aggregated state is Idle; +// - Else if at least one SubConn is TransientFailure (or there are no SubConns), the aggregated state is Transient Failure. // // Shutdown is not considered. func (cse *ConnectivityStateEvaluator) RecordTransition(oldState, newState connectivity.State) connectivity.State { @@ -55,7 +55,11 @@ func (cse *ConnectivityStateEvaluator) RecordTransition(oldState, newState conne cse.numIdle += updateVal } } + return cse.CurrentState() +} +// CurrentState returns the current aggregate conn state by evaluating the counters +func (cse *ConnectivityStateEvaluator) CurrentState() connectivity.State { // Evaluate. if cse.numReady > 0 { return connectivity.Ready diff --git a/vendor/google.golang.org/grpc/balancer_conn_wrappers.go b/vendor/google.golang.org/grpc/balancer_conn_wrappers.go index b1c23eaa..0359956d 100644 --- a/vendor/google.golang.org/grpc/balancer_conn_wrappers.go +++ b/vendor/google.golang.org/grpc/balancer_conn_wrappers.go @@ -19,17 +19,20 @@ package grpc import ( + "context" "fmt" "strings" "sync" "google.golang.org/grpc/balancer" + "google.golang.org/grpc/codes" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/internal/balancer/gracefulswitch" "google.golang.org/grpc/internal/buffer" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/resolver" + "google.golang.org/grpc/status" ) // ccBalancerWrapper sits between the ClientConn and the Balancer. @@ -305,7 +308,7 @@ func (ccb *ccBalancerWrapper) NewSubConn(addrs []resolver.Address, opts balancer channelz.Warningf(logger, ccb.cc.channelzID, "acBalancerWrapper: NewSubConn: failed to newAddrConn: %v", err) return nil, err } - acbw := &acBalancerWrapper{ac: ac} + acbw := &acBalancerWrapper{ac: ac, producers: make(map[balancer.ProducerBuilder]*refCountedProducer)} acbw.ac.mu.Lock() ac.acbw = acbw acbw.ac.mu.Unlock() @@ -359,8 +362,9 @@ func (ccb *ccBalancerWrapper) Target() string { // acBalancerWrapper is a wrapper on top of ac for balancers. // It implements balancer.SubConn interface. type acBalancerWrapper struct { - mu sync.Mutex - ac *addrConn + mu sync.Mutex + ac *addrConn + producers map[balancer.ProducerBuilder]*refCountedProducer } func (acbw *acBalancerWrapper) UpdateAddresses(addrs []resolver.Address) { @@ -414,3 +418,64 @@ func (acbw *acBalancerWrapper) getAddrConn() *addrConn { defer acbw.mu.Unlock() return acbw.ac } + +var errSubConnNotReady = status.Error(codes.Unavailable, "SubConn not currently connected") + +// NewStream begins a streaming RPC on the addrConn. If the addrConn is not +// ready, returns errSubConnNotReady. +func (acbw *acBalancerWrapper) NewStream(ctx context.Context, desc *StreamDesc, method string, opts ...CallOption) (ClientStream, error) { + transport := acbw.ac.getReadyTransport() + if transport == nil { + return nil, errSubConnNotReady + } + return newNonRetryClientStream(ctx, desc, method, transport, acbw.ac, opts...) +} + +// Invoke performs a unary RPC. If the addrConn is not ready, returns +// errSubConnNotReady. +func (acbw *acBalancerWrapper) Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...CallOption) error { + cs, err := acbw.NewStream(ctx, unaryStreamDesc, method, opts...) + if err != nil { + return err + } + if err := cs.SendMsg(args); err != nil { + return err + } + return cs.RecvMsg(reply) +} + +type refCountedProducer struct { + producer balancer.Producer + refs int // number of current refs to the producer + close func() // underlying producer's close function +} + +func (acbw *acBalancerWrapper) GetOrBuildProducer(pb balancer.ProducerBuilder) (balancer.Producer, func()) { + acbw.mu.Lock() + defer acbw.mu.Unlock() + + // Look up existing producer from this builder. + pData := acbw.producers[pb] + if pData == nil { + // Not found; create a new one and add it to the producers map. + p, close := pb.Build(acbw) + pData = &refCountedProducer{producer: p, close: close} + acbw.producers[pb] = pData + } + // Account for this new reference. + pData.refs++ + + // Return a cleanup function wrapped in a OnceFunc to remove this reference + // and delete the refCountedProducer from the map if the total reference + // count goes to zero. + unref := func() { + acbw.mu.Lock() + pData.refs-- + if pData.refs == 0 { + defer pData.close() // Run outside the acbw mutex + delete(acbw.producers, pb) + } + acbw.mu.Unlock() + } + return pData.producer, grpcsync.OnceFunc(unref) +} diff --git a/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go b/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go index ed75290c..64a232f2 100644 --- a/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go +++ b/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go @@ -261,6 +261,7 @@ type GrpcLogEntry struct { // according to the type of the log entry. // // Types that are assignable to Payload: + // // *GrpcLogEntry_ClientHeader // *GrpcLogEntry_ServerHeader // *GrpcLogEntry_Message @@ -694,12 +695,12 @@ func (x *Message) GetData() []byte { // Header keys added by gRPC are omitted. To be more specific, // implementations will not log the following entries, and this is // not to be treated as a truncation: -// - entries handled by grpc that are not user visible, such as those -// that begin with 'grpc-' (with exception of grpc-trace-bin) -// or keys like 'lb-token' -// - transport specific entries, including but not limited to: -// ':path', ':authority', 'content-encoding', 'user-agent', 'te', etc -// - entries added for call credentials +// - entries handled by grpc that are not user visible, such as those +// that begin with 'grpc-' (with exception of grpc-trace-bin) +// or keys like 'lb-token' +// - transport specific entries, including but not limited to: +// ':path', ':authority', 'content-encoding', 'user-agent', 'te', etc +// - entries added for call credentials // // Implementations must always log grpc-trace-bin if it is present. // Practically speaking it will only be visible on server side because diff --git a/vendor/google.golang.org/grpc/channelz/channelz.go b/vendor/google.golang.org/grpc/channelz/channelz.go index a220c47c..32b7fa57 100644 --- a/vendor/google.golang.org/grpc/channelz/channelz.go +++ b/vendor/google.golang.org/grpc/channelz/channelz.go @@ -23,7 +23,7 @@ // https://github.com/grpc/proposal/blob/master/A14-channelz.md, is provided by // the `internal/channelz` package. // -// Experimental +// # Experimental // // Notice: All APIs in this package are experimental and may be removed in a // later release. diff --git a/vendor/google.golang.org/grpc/clientconn.go b/vendor/google.golang.org/grpc/clientconn.go index 779b03bc..422639c7 100644 --- a/vendor/google.golang.org/grpc/clientconn.go +++ b/vendor/google.golang.org/grpc/clientconn.go @@ -503,7 +503,7 @@ type ClientConn struct { // WaitForStateChange waits until the connectivity.State of ClientConn changes from sourceState or // ctx expires. A true value is returned in former case and false in latter. // -// Experimental +// # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. @@ -522,7 +522,7 @@ func (cc *ClientConn) WaitForStateChange(ctx context.Context, sourceState connec // GetState returns the connectivity.State of ClientConn. // -// Experimental +// # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a later // release. @@ -534,7 +534,7 @@ func (cc *ClientConn) GetState() connectivity.State { // the channel is idle. Does not wait for the connection attempts to begin // before returning. // -// Experimental +// # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a later // release. @@ -761,7 +761,7 @@ func (cc *ClientConn) channelzMetric() *channelz.ChannelInternalMetric { // Target returns the target string of the ClientConn. // -// Experimental +// # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. @@ -831,9 +831,9 @@ func equalAddresses(a, b []resolver.Address) bool { // // If ac is Ready, it checks whether current connected address of ac is in the // new addrs list. -// - If true, it updates ac.addrs and returns true. The ac will keep using -// the existing connection. -// - If false, it does nothing and returns false. +// - If true, it updates ac.addrs and returns true. The ac will keep using +// the existing connection. +// - If false, it does nothing and returns false. func (ac *addrConn) tryUpdateAddrs(addrs []resolver.Address) bool { ac.mu.Lock() defer ac.mu.Unlock() @@ -998,7 +998,7 @@ func (cc *ClientConn) resolveNow(o resolver.ResolveNowOptions) { // However, if a previously unavailable network becomes available, this may be // used to trigger an immediate reconnect. // -// Experimental +// # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. @@ -1228,38 +1228,33 @@ func (ac *addrConn) tryAllAddrs(addrs []resolver.Address, connectDeadline time.T // address was not successfully connected, or updates ac appropriately with the // new transport. func (ac *addrConn) createTransport(addr resolver.Address, copts transport.ConnectOptions, connectDeadline time.Time) error { - // TODO: Delete prefaceReceived and move the logic to wait for it into the - // transport. - prefaceReceived := grpcsync.NewEvent() - connClosed := grpcsync.NewEvent() - addr.ServerName = ac.cc.getServerName(addr) hctx, hcancel := context.WithCancel(ac.ctx) - hcStarted := false // protected by ac.mu - onClose := func() { + onClose := grpcsync.OnceFunc(func() { ac.mu.Lock() defer ac.mu.Unlock() - defer connClosed.Fire() - defer hcancel() - if !hcStarted || hctx.Err() != nil { - // We didn't start the health check or set the state to READY, so - // no need to do anything else here. - // - // OR, we have already cancelled the health check context, meaning - // we have already called onClose once for this transport. In this - // case it would be dangerous to clear the transport and update the - // state, since there may be a new transport in this addrConn. + if ac.state == connectivity.Shutdown { + // Already shut down. tearDown() already cleared the transport and + // canceled hctx via ac.ctx, and we expected this connection to be + // closed, so do nothing here. + return + } + hcancel() + if ac.transport == nil { + // We're still connecting to this address, which could error. Do + // not update the connectivity state or resolve; these will happen + // at the end of the tryAllAddrs connection loop in the event of an + // error. return } ac.transport = nil - // Refresh the name resolver + // Refresh the name resolver on any connection loss. ac.cc.resolveNow(resolver.ResolveNowOptions{}) - if ac.state != connectivity.Shutdown { - ac.updateConnectivityState(connectivity.Idle, nil) - } - } - + // Always go idle and wait for the LB policy to initiate a new + // connection attempt. + ac.updateConnectivityState(connectivity.Idle, nil) + }) onGoAway := func(r transport.GoAwayReason) { ac.mu.Lock() ac.adjustParams(r) @@ -1271,7 +1266,7 @@ func (ac *addrConn) createTransport(addr resolver.Address, copts transport.Conne defer cancel() copts.ChannelzParentID = ac.channelzID - newTr, err := transport.NewClientTransport(connectCtx, ac.cc.ctx, addr, copts, func() { prefaceReceived.Fire() }, onGoAway, onClose) + newTr, err := transport.NewClientTransport(connectCtx, ac.cc.ctx, addr, copts, onGoAway, onClose) if err != nil { // newTr is either nil, or closed. hcancel() @@ -1279,60 +1274,34 @@ func (ac *addrConn) createTransport(addr resolver.Address, copts transport.Conne return err } - select { - case <-connectCtx.Done(): - // We didn't get the preface in time. + ac.mu.Lock() + defer ac.mu.Unlock() + if ac.state == connectivity.Shutdown { + // This can happen if the subConn was removed while in `Connecting` + // state. tearDown() would have set the state to `Shutdown`, but + // would not have closed the transport since ac.transport would not + // have been set at that point. + // + // We run this in a goroutine because newTr.Close() calls onClose() + // inline, which requires locking ac.mu. + // // The error we pass to Close() is immaterial since there are no open // streams at this point, so no trailers with error details will be sent // out. We just need to pass a non-nil error. - newTr.Close(transport.ErrConnClosing) - if connectCtx.Err() == context.DeadlineExceeded { - err := errors.New("failed to receive server preface within timeout") - channelz.Warningf(logger, ac.channelzID, "grpc: addrConn.createTransport failed to connect to %s: %v", addr, err) - return err - } + go newTr.Close(transport.ErrConnClosing) return nil - case <-prefaceReceived.Done(): - // We got the preface - huzzah! things are good. - ac.mu.Lock() - defer ac.mu.Unlock() - if connClosed.HasFired() { - // onClose called first; go idle but do nothing else. - if ac.state != connectivity.Shutdown { - ac.updateConnectivityState(connectivity.Idle, nil) - } - return nil - } - if ac.state == connectivity.Shutdown { - // This can happen if the subConn was removed while in `Connecting` - // state. tearDown() would have set the state to `Shutdown`, but - // would not have closed the transport since ac.transport would not - // been set at that point. - // - // We run this in a goroutine because newTr.Close() calls onClose() - // inline, which requires locking ac.mu. - // - // The error we pass to Close() is immaterial since there are no open - // streams at this point, so no trailers with error details will be sent - // out. We just need to pass a non-nil error. - go newTr.Close(transport.ErrConnClosing) - return nil - } - ac.curAddr = addr - ac.transport = newTr - hcStarted = true - ac.startHealthCheck(hctx) // Will set state to READY if appropriate. + } + if hctx.Err() != nil { + // onClose was already called for this connection, but the connection + // was successfully established first. Consider it a success and set + // the new state to Idle. + ac.updateConnectivityState(connectivity.Idle, nil) return nil - case <-connClosed.Done(): - // The transport has already closed. If we received the preface, too, - // this is not an error. - select { - case <-prefaceReceived.Done(): - return nil - default: - return errors.New("connection closed before server preface received") - } } + ac.curAddr = addr + ac.transport = newTr + ac.startHealthCheck(hctx) // Will set state to READY if appropriate. + return nil } // startHealthCheck starts the health checking stream (RPC) to watch the health @@ -1583,7 +1552,7 @@ func (cc *ClientConn) parseTargetAndFindResolver() (resolver.Builder, error) { channelz.Infof(logger, cc.channelzID, "dial target %q parse failed: %v", cc.target, err) } else { channelz.Infof(logger, cc.channelzID, "parsed dial target is: %+v", parsedTarget) - rb = cc.getResolver(parsedTarget.Scheme) + rb = cc.getResolver(parsedTarget.URL.Scheme) if rb != nil { cc.parsedTarget = parsedTarget return rb, nil @@ -1604,9 +1573,9 @@ func (cc *ClientConn) parseTargetAndFindResolver() (resolver.Builder, error) { return nil, err } channelz.Infof(logger, cc.channelzID, "parsed dial target is: %+v", parsedTarget) - rb = cc.getResolver(parsedTarget.Scheme) + rb = cc.getResolver(parsedTarget.URL.Scheme) if rb == nil { - return nil, fmt.Errorf("could not get resolver for default scheme: %q", parsedTarget.Scheme) + return nil, fmt.Errorf("could not get resolver for default scheme: %q", parsedTarget.URL.Scheme) } cc.parsedTarget = parsedTarget return rb, nil diff --git a/vendor/google.golang.org/grpc/credentials/credentials.go b/vendor/google.golang.org/grpc/credentials/credentials.go index 96ff1877..5feac3aa 100644 --- a/vendor/google.golang.org/grpc/credentials/credentials.go +++ b/vendor/google.golang.org/grpc/credentials/credentials.go @@ -36,16 +36,16 @@ import ( // PerRPCCredentials defines the common interface for the credentials which need to // attach security information to every RPC (e.g., oauth2). type PerRPCCredentials interface { - // GetRequestMetadata gets the current request metadata, refreshing - // tokens if required. This should be called by the transport layer on - // each request, and the data should be populated in headers or other - // context. If a status code is returned, it will be used as the status - // for the RPC. uri is the URI of the entry point for the request. - // When supported by the underlying implementation, ctx can be used for - // timeout and cancellation. Additionally, RequestInfo data will be - // available via ctx to this call. - // TODO(zhaoq): Define the set of the qualified keys instead of leaving - // it as an arbitrary string. + // GetRequestMetadata gets the current request metadata, refreshing tokens + // if required. This should be called by the transport layer on each + // request, and the data should be populated in headers or other + // context. If a status code is returned, it will be used as the status for + // the RPC (restricted to an allowable set of codes as defined by gRFC + // A54). uri is the URI of the entry point for the request. When supported + // by the underlying implementation, ctx can be used for timeout and + // cancellation. Additionally, RequestInfo data will be available via ctx + // to this call. TODO(zhaoq): Define the set of the qualified keys instead + // of leaving it as an arbitrary string. GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) // RequireTransportSecurity indicates whether the credentials requires // transport security. diff --git a/vendor/google.golang.org/grpc/credentials/tls.go b/vendor/google.golang.org/grpc/credentials/tls.go index 784822d0..ce2bbc10 100644 --- a/vendor/google.golang.org/grpc/credentials/tls.go +++ b/vendor/google.golang.org/grpc/credentials/tls.go @@ -195,7 +195,7 @@ func NewServerTLSFromFile(certFile, keyFile string) (TransportCredentials, error // TLSChannelzSecurityValue defines the struct that TLS protocol should return // from GetSecurityValue(), containing security info like cipher and certificate used. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. diff --git a/vendor/google.golang.org/grpc/encoding/encoding.go b/vendor/google.golang.org/grpc/encoding/encoding.go index 18e530fc..711763d5 100644 --- a/vendor/google.golang.org/grpc/encoding/encoding.go +++ b/vendor/google.golang.org/grpc/encoding/encoding.go @@ -19,7 +19,7 @@ // Package encoding defines the interface for the compressor and codec, and // functions to register and retrieve compressors and codecs. // -// Experimental +// # Experimental // // Notice: This package is EXPERIMENTAL and may be changed or removed in a // later release. @@ -28,6 +28,8 @@ package encoding import ( "io" "strings" + + "google.golang.org/grpc/internal/grpcutil" ) // Identity specifies the optional encoding for uncompressed streams. @@ -73,6 +75,7 @@ var registeredCompressor = make(map[string]Compressor) // registered with the same name, the one registered last will take effect. func RegisterCompressor(c Compressor) { registeredCompressor[c.Name()] = c + grpcutil.RegisteredCompressorNames = append(grpcutil.RegisteredCompressorNames, c.Name()) } // GetCompressor returns Compressor for the given compressor name. diff --git a/vendor/google.golang.org/grpc/grpclog/loggerv2.go b/vendor/google.golang.org/grpc/grpclog/loggerv2.go index 7c1f6640..b5560b47 100644 --- a/vendor/google.golang.org/grpc/grpclog/loggerv2.go +++ b/vendor/google.golang.org/grpc/grpclog/loggerv2.go @@ -242,7 +242,7 @@ func (g *loggerT) V(l int) bool { // DepthLoggerV2, the below functions will be called with the appropriate stack // depth set for trivial functions the logger may ignore. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. diff --git a/vendor/google.golang.org/grpc/internal/binarylog/env_config.go b/vendor/google.golang.org/grpc/internal/binarylog/env_config.go index c5579e65..f9e80e27 100644 --- a/vendor/google.golang.org/grpc/internal/binarylog/env_config.go +++ b/vendor/google.golang.org/grpc/internal/binarylog/env_config.go @@ -30,15 +30,15 @@ import ( // to build a new logger and assign it to binarylog.Logger. // // Example filter config strings: -// - "" Nothing will be logged -// - "*" All headers and messages will be fully logged. -// - "*{h}" Only headers will be logged. -// - "*{m:256}" Only the first 256 bytes of each message will be logged. -// - "Foo/*" Logs every method in service Foo -// - "Foo/*,-Foo/Bar" Logs every method in service Foo except method /Foo/Bar -// - "Foo/*,Foo/Bar{m:256}" Logs the first 256 bytes of each message in method -// /Foo/Bar, logs all headers and messages in every other method in service -// Foo. +// - "" Nothing will be logged +// - "*" All headers and messages will be fully logged. +// - "*{h}" Only headers will be logged. +// - "*{m:256}" Only the first 256 bytes of each message will be logged. +// - "Foo/*" Logs every method in service Foo +// - "Foo/*,-Foo/Bar" Logs every method in service Foo except method /Foo/Bar +// - "Foo/*,Foo/Bar{m:256}" Logs the first 256 bytes of each message in method +// /Foo/Bar, logs all headers and messages in every other method in service +// Foo. // // If two configs exist for one certain method or service, the one specified // later overrides the previous config. diff --git a/vendor/google.golang.org/grpc/internal/channelz/types.go b/vendor/google.golang.org/grpc/internal/channelz/types.go index ad0ce4da..7b2f350e 100644 --- a/vendor/google.golang.org/grpc/internal/channelz/types.go +++ b/vendor/google.golang.org/grpc/internal/channelz/types.go @@ -273,10 +273,10 @@ func (c *channel) deleteSelfFromMap() (delete bool) { // deleteSelfIfReady tries to delete the channel itself from the channelz database. // The delete process includes two steps: -// 1. delete the channel from the entry relation tree, i.e. delete the channel reference from its -// parent's child list. -// 2. delete the channel from the map, i.e. delete the channel entirely from channelz. Lookup by id -// will return entry not found error. +// 1. delete the channel from the entry relation tree, i.e. delete the channel reference from its +// parent's child list. +// 2. delete the channel from the map, i.e. delete the channel entirely from channelz. Lookup by id +// will return entry not found error. func (c *channel) deleteSelfIfReady() { if !c.deleteSelfFromTree() { return @@ -381,10 +381,10 @@ func (sc *subChannel) deleteSelfFromMap() (delete bool) { // deleteSelfIfReady tries to delete the subchannel itself from the channelz database. // The delete process includes two steps: -// 1. delete the subchannel from the entry relation tree, i.e. delete the subchannel reference from -// its parent's child list. -// 2. delete the subchannel from the map, i.e. delete the subchannel entirely from channelz. Lookup -// by id will return entry not found error. +// 1. delete the subchannel from the entry relation tree, i.e. delete the subchannel reference from +// its parent's child list. +// 2. delete the subchannel from the map, i.e. delete the subchannel entirely from channelz. Lookup +// by id will return entry not found error. func (sc *subChannel) deleteSelfIfReady() { if !sc.deleteSelfFromTree() { return diff --git a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go index 6f027254..7edd196b 100644 --- a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go +++ b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go @@ -25,11 +25,15 @@ import ( ) const ( - prefix = "GRPC_GO_" - txtErrIgnoreStr = prefix + "IGNORE_TXT_ERRORS" + prefix = "GRPC_GO_" + txtErrIgnoreStr = prefix + "IGNORE_TXT_ERRORS" + advertiseCompressorsStr = prefix + "ADVERTISE_COMPRESSORS" ) var ( // TXTErrIgnore is set if TXT errors should be ignored ("GRPC_GO_IGNORE_TXT_ERRORS" is not "false"). TXTErrIgnore = !strings.EqualFold(os.Getenv(txtErrIgnoreStr), "false") + // AdvertiseCompressors is set if registered compressor should be advertised + // ("GRPC_GO_ADVERTISE_COMPRESSORS" is not "false"). + AdvertiseCompressors = !strings.EqualFold(os.Getenv(advertiseCompressorsStr), "false") ) diff --git a/vendor/google.golang.org/grpc/internal/grpclog/grpclog.go b/vendor/google.golang.org/grpc/internal/grpclog/grpclog.go index 30a3b425..b68e26a3 100644 --- a/vendor/google.golang.org/grpc/internal/grpclog/grpclog.go +++ b/vendor/google.golang.org/grpc/internal/grpclog/grpclog.go @@ -110,7 +110,7 @@ type LoggerV2 interface { // This is a copy of the DepthLoggerV2 defined in the external grpclog package. // It is defined here to avoid a circular dependency. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. diff --git a/vendor/google.golang.org/grpc/internal/grpcsync/oncefunc.go b/vendor/google.golang.org/grpc/internal/grpcsync/oncefunc.go new file mode 100644 index 00000000..6635f7bc --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/grpcsync/oncefunc.go @@ -0,0 +1,32 @@ +/* + * + * Copyright 2022 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpcsync + +import ( + "sync" +) + +// OnceFunc returns a function wrapping f which ensures f is only executed +// once even if the returned function is executed multiple times. +func OnceFunc(f func()) func() { + var once sync.Once + return func() { + once.Do(f) + } +} diff --git a/vendor/google.golang.org/grpc/internal/grpcutil/compressor.go b/vendor/google.golang.org/grpc/internal/grpcutil/compressor.go new file mode 100644 index 00000000..9f409096 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/grpcutil/compressor.go @@ -0,0 +1,47 @@ +/* + * + * Copyright 2022 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpcutil + +import ( + "strings" + + "google.golang.org/grpc/internal/envconfig" +) + +// RegisteredCompressorNames holds names of the registered compressors. +var RegisteredCompressorNames []string + +// IsCompressorNameRegistered returns true when name is available in registry. +func IsCompressorNameRegistered(name string) bool { + for _, compressor := range RegisteredCompressorNames { + if compressor == name { + return true + } + } + return false +} + +// RegisteredCompressors returns a string of registered compressor names +// separated by comma. +func RegisteredCompressors() string { + if !envconfig.AdvertiseCompressors { + return "" + } + return strings.Join(RegisteredCompressorNames, ",") +} diff --git a/vendor/google.golang.org/grpc/internal/grpcutil/method.go b/vendor/google.golang.org/grpc/internal/grpcutil/method.go index e9c4af64..ec62b477 100644 --- a/vendor/google.golang.org/grpc/internal/grpcutil/method.go +++ b/vendor/google.golang.org/grpc/internal/grpcutil/method.go @@ -25,7 +25,6 @@ import ( // ParseMethod splits service and method from the input. It expects format // "/service/method". -// func ParseMethod(methodName string) (service, method string, _ error) { if !strings.HasPrefix(methodName, "/") { return "", "", errors.New("invalid method name: should start with /") diff --git a/vendor/google.golang.org/grpc/internal/serviceconfig/serviceconfig.go b/vendor/google.golang.org/grpc/internal/serviceconfig/serviceconfig.go index badbdbf5..51e733e4 100644 --- a/vendor/google.golang.org/grpc/internal/serviceconfig/serviceconfig.go +++ b/vendor/google.golang.org/grpc/internal/serviceconfig/serviceconfig.go @@ -67,10 +67,10 @@ func (bc *BalancerConfig) MarshalJSON() ([]byte, error) { // ServiceConfig contains a list of loadBalancingConfigs, each with a name and // config. This method iterates through that list in order, and stops at the // first policy that is supported. -// - If the config for the first supported policy is invalid, the whole service -// config is invalid. -// - If the list doesn't contain any supported policy, the whole service config -// is invalid. +// - If the config for the first supported policy is invalid, the whole service +// config is invalid. +// - If the list doesn't contain any supported policy, the whole service config +// is invalid. func (bc *BalancerConfig) UnmarshalJSON(b []byte) error { var ir intermediateBalancerConfig err := json.Unmarshal(b, &ir) diff --git a/vendor/google.golang.org/grpc/internal/status/status.go b/vendor/google.golang.org/grpc/internal/status/status.go index e5c6513e..b0ead4f5 100644 --- a/vendor/google.golang.org/grpc/internal/status/status.go +++ b/vendor/google.golang.org/grpc/internal/status/status.go @@ -164,3 +164,13 @@ func (e *Error) Is(target error) bool { } return proto.Equal(e.s.s, tse.s.s) } + +// IsRestrictedControlPlaneCode returns whether the status includes a code +// restricted for control plane usage as defined by gRFC A54. +func IsRestrictedControlPlaneCode(s *Status) bool { + switch s.Code() { + case codes.InvalidArgument, codes.NotFound, codes.AlreadyExists, codes.FailedPrecondition, codes.Aborted, codes.OutOfRange, codes.DataLoss: + return true + } + return false +} diff --git a/vendor/google.golang.org/grpc/internal/transport/handler_server.go b/vendor/google.golang.org/grpc/internal/transport/handler_server.go index 09012092..fb272235 100644 --- a/vendor/google.golang.org/grpc/internal/transport/handler_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/handler_server.go @@ -442,10 +442,10 @@ func (ht *serverHandlerTransport) Drain() { // mapRecvMsgError returns the non-nil err into the appropriate // error value as expected by callers of *grpc.parser.recvMsg. // In particular, in can only be: -// * io.EOF -// * io.ErrUnexpectedEOF -// * of type transport.ConnectionError -// * an error from the status package +// - io.EOF +// - io.ErrUnexpectedEOF +// - of type transport.ConnectionError +// - an error from the status package func mapRecvMsgError(err error) error { if err == io.EOF || err == io.ErrUnexpectedEOF { return err diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_client.go b/vendor/google.golang.org/grpc/internal/transport/http2_client.go index 5c2f35b2..d518b07e 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_client.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_client.go @@ -38,8 +38,10 @@ import ( "google.golang.org/grpc/credentials" "google.golang.org/grpc/internal/channelz" icredentials "google.golang.org/grpc/internal/credentials" + "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/internal/grpcutil" imetadata "google.golang.org/grpc/internal/metadata" + istatus "google.golang.org/grpc/internal/status" "google.golang.org/grpc/internal/syscall" "google.golang.org/grpc/internal/transport/networktype" "google.golang.org/grpc/keepalive" @@ -99,16 +101,13 @@ type http2Client struct { maxSendHeaderListSize *uint32 bdpEst *bdpEstimator - // onPrefaceReceipt is a callback that client transport calls upon - // receiving server preface to signal that a succefull HTTP2 - // connection was established. - onPrefaceReceipt func() maxConcurrentStreams uint32 streamQuota int64 streamsQuotaAvailable chan struct{} waitingStreams uint32 nextID uint32 + registeredCompressors string // Do not access controlBuf with mu held. mu sync.Mutex // guard the following variables @@ -194,7 +193,7 @@ func isTemporary(err error) bool { // newHTTP2Client constructs a connected ClientTransport to addr based on HTTP2 // and starts to receive messages on it. Non-nil error returns if construction // fails. -func newHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts ConnectOptions, onPrefaceReceipt func(), onGoAway func(GoAwayReason), onClose func()) (_ *http2Client, err error) { +func newHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts ConnectOptions, onGoAway func(GoAwayReason), onClose func()) (_ *http2Client, err error) { scheme := "http" ctx, cancel := context.WithCancel(ctx) defer func() { @@ -216,12 +215,35 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts } return nil, connectionErrorf(true, err, "transport: Error while dialing %v", err) } + // Any further errors will close the underlying connection defer func(conn net.Conn) { if err != nil { conn.Close() } }(conn) + + // The following defer and goroutine monitor the connectCtx for cancelation + // and deadline. On context expiration, the connection is hard closed and + // this function will naturally fail as a result. Otherwise, the defer + // waits for the goroutine to exit to prevent the context from being + // monitored (and to prevent the connection from ever being closed) after + // returning from this function. + ctxMonitorDone := grpcsync.NewEvent() + newClientCtx, newClientDone := context.WithCancel(connectCtx) + defer func() { + newClientDone() // Awaken the goroutine below if connectCtx hasn't expired. + <-ctxMonitorDone.Done() // Wait for the goroutine below to exit. + }() + go func(conn net.Conn) { + defer ctxMonitorDone.Fire() // Signal this goroutine has exited. + <-newClientCtx.Done() // Block until connectCtx expires or the defer above executes. + if connectCtx.Err() != nil { + // connectCtx expired before exiting the function. Hard close the connection. + conn.Close() + } + }(conn) + kp := opts.KeepaliveParams // Validate keepalive parameters. if kp.Time == 0 { @@ -253,15 +275,7 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts } } if transportCreds != nil { - rawConn := conn - // Pull the deadline from the connectCtx, which will be used for - // timeouts in the authentication protocol handshake. Can ignore the - // boolean as the deadline will return the zero value, which will make - // the conn not timeout on I/O operations. - deadline, _ := connectCtx.Deadline() - rawConn.SetDeadline(deadline) - conn, authInfo, err = transportCreds.ClientHandshake(connectCtx, addr.ServerName, rawConn) - rawConn.SetDeadline(time.Time{}) + conn, authInfo, err = transportCreds.ClientHandshake(connectCtx, addr.ServerName, conn) if err != nil { return nil, connectionErrorf(isTemporary(err), err, "transport: authentication handshake failed: %v", err) } @@ -299,6 +313,7 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts ctxDone: ctx.Done(), // Cache Done chan. cancel: cancel, userAgent: opts.UserAgent, + registeredCompressors: grpcutil.RegisteredCompressors(), conn: conn, remoteAddr: conn.RemoteAddr(), localAddr: conn.LocalAddr(), @@ -315,16 +330,15 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts kp: kp, statsHandlers: opts.StatsHandlers, initialWindowSize: initialWindowSize, - onPrefaceReceipt: onPrefaceReceipt, nextID: 1, maxConcurrentStreams: defaultMaxStreamsClient, streamQuota: defaultMaxStreamsClient, streamsQuotaAvailable: make(chan struct{}, 1), czData: new(channelzData), onGoAway: onGoAway, - onClose: onClose, keepaliveEnabled: keepaliveEnabled, bufferPool: newBufferPool(), + onClose: onClose, } // Add peer information to the http2client context. t.ctx = peer.NewContext(t.ctx, t.getPeer()) @@ -363,21 +377,32 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts t.kpDormancyCond = sync.NewCond(&t.mu) go t.keepalive() } - // Start the reader goroutine for incoming message. Each transport has - // a dedicated goroutine which reads HTTP2 frame from network. Then it - // dispatches the frame to the corresponding stream entity. - go t.reader() + + // Start the reader goroutine for incoming messages. Each transport has a + // dedicated goroutine which reads HTTP2 frames from the network. Then it + // dispatches the frame to the corresponding stream entity. When the + // server preface is received, readerErrCh is closed. If an error occurs + // first, an error is pushed to the channel. This must be checked before + // returning from this function. + readerErrCh := make(chan error, 1) + go t.reader(readerErrCh) + defer func() { + if err == nil { + err = <-readerErrCh + } + if err != nil { + t.Close(err) + } + }() // Send connection preface to server. n, err := t.conn.Write(clientPreface) if err != nil { err = connectionErrorf(true, err, "transport: failed to write client preface: %v", err) - t.Close(err) return nil, err } if n != len(clientPreface) { err = connectionErrorf(true, nil, "transport: preface mismatch, wrote %d bytes; want %d", n, len(clientPreface)) - t.Close(err) return nil, err } var ss []http2.Setting @@ -397,14 +422,12 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts err = t.framer.fr.WriteSettings(ss...) if err != nil { err = connectionErrorf(true, err, "transport: failed to write initial settings frame: %v", err) - t.Close(err) return nil, err } // Adjust the connection flow control window if needed. if delta := uint32(icwz - defaultWindowSize); delta > 0 { if err := t.framer.fr.WriteWindowUpdate(0, delta); err != nil { err = connectionErrorf(true, err, "transport: failed to write window update: %v", err) - t.Close(err) return nil, err } } @@ -507,9 +530,22 @@ func (t *http2Client) createHeaderFields(ctx context.Context, callHdr *CallHdr) headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-previous-rpc-attempts", Value: strconv.Itoa(callHdr.PreviousAttempts)}) } + registeredCompressors := t.registeredCompressors if callHdr.SendCompress != "" { headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-encoding", Value: callHdr.SendCompress}) - headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-accept-encoding", Value: callHdr.SendCompress}) + // Include the outgoing compressor name when compressor is not registered + // via encoding.RegisterCompressor. This is possible when client uses + // WithCompressor dial option. + if !grpcutil.IsCompressorNameRegistered(callHdr.SendCompress) { + if registeredCompressors != "" { + registeredCompressors += "," + } + registeredCompressors += callHdr.SendCompress + } + } + + if registeredCompressors != "" { + headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-accept-encoding", Value: registeredCompressors}) } if dl, ok := ctx.Deadline(); ok { // Send out timeout regardless its value. The server can detect timeout context by itself. @@ -589,7 +625,11 @@ func (t *http2Client) getTrAuthData(ctx context.Context, audience string) (map[s for _, c := range t.perRPCCreds { data, err := c.GetRequestMetadata(ctx, audience) if err != nil { - if _, ok := status.FromError(err); ok { + if st, ok := status.FromError(err); ok { + // Restrict the code to the list allowed by gRFC A54. + if istatus.IsRestrictedControlPlaneCode(st) { + err = status.Errorf(codes.Internal, "transport: received per-RPC creds error with illegal status: %v", err) + } return nil, err } @@ -618,7 +658,14 @@ func (t *http2Client) getCallAuthData(ctx context.Context, audience string, call } data, err := callCreds.GetRequestMetadata(ctx, audience) if err != nil { - return nil, status.Errorf(codes.Internal, "transport: %v", err) + if st, ok := status.FromError(err); ok { + // Restrict the code to the list allowed by gRFC A54. + if istatus.IsRestrictedControlPlaneCode(st) { + err = status.Errorf(codes.Internal, "transport: received per-RPC creds error with illegal status: %v", err) + } + return nil, err + } + return nil, status.Errorf(codes.Internal, "transport: per-RPC creds failed due to error: %v", err) } callAuthData = make(map[string]string, len(data)) for k, v := range data { @@ -634,13 +681,13 @@ func (t *http2Client) getCallAuthData(ctx context.Context, audience string, call // NewStream errors result in transparent retry, as they mean nothing went onto // the wire. However, there are two notable exceptions: // -// 1. If the stream headers violate the max header list size allowed by the -// server. It's possible this could succeed on another transport, even if -// it's unlikely, but do not transparently retry. -// 2. If the credentials errored when requesting their headers. In this case, -// it's possible a retry can fix the problem, but indefinitely transparently -// retrying is not appropriate as it is likely the credentials, if they can -// eventually succeed, would need I/O to do so. +// 1. If the stream headers violate the max header list size allowed by the +// server. It's possible this could succeed on another transport, even if +// it's unlikely, but do not transparently retry. +// 2. If the credentials errored when requesting their headers. In this case, +// it's possible a retry can fix the problem, but indefinitely transparently +// retrying is not appropriate as it is likely the credentials, if they can +// eventually succeed, would need I/O to do so. type NewStreamError struct { Err error @@ -880,19 +927,15 @@ func (t *http2Client) closeStream(s *Stream, err error, rst bool, rstCode http2. // Close kicks off the shutdown process of the transport. This should be called // only once on a transport. Once it is called, the transport should not be // accessed any more. -// -// This method blocks until the addrConn that initiated this transport is -// re-connected. This happens because t.onClose() begins reconnect logic at the -// addrConn level and blocks until the addrConn is successfully connected. func (t *http2Client) Close(err error) { t.mu.Lock() - // Make sure we only Close once. + // Make sure we only close once. if t.state == closing { t.mu.Unlock() return } - // Call t.onClose before setting the state to closing to prevent the client - // from attempting to create new streams ASAP. + // Call t.onClose ASAP to prevent the client from attempting to create new + // streams. t.onClose() t.state = closing streams := t.activeStreams @@ -1482,33 +1525,35 @@ func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) { t.closeStream(s, io.EOF, rst, http2.ErrCodeNo, statusGen, mdata, true) } -// reader runs as a separate goroutine in charge of reading data from network -// connection. -// -// TODO(zhaoq): currently one reader per transport. Investigate whether this is -// optimal. -// TODO(zhaoq): Check the validity of the incoming frame sequence. -func (t *http2Client) reader() { - defer close(t.readerDone) - // Check the validity of server preface. +// readServerPreface reads and handles the initial settings frame from the +// server. +func (t *http2Client) readServerPreface() error { frame, err := t.framer.fr.ReadFrame() if err != nil { - err = connectionErrorf(true, err, "error reading server preface: %v", err) - t.Close(err) // this kicks off resetTransport, so must be last before return - return - } - t.conn.SetReadDeadline(time.Time{}) // reset deadline once we get the settings frame (we didn't time out, yay!) - if t.keepaliveEnabled { - atomic.StoreInt64(&t.lastRead, time.Now().UnixNano()) + return connectionErrorf(true, err, "error reading server preface: %v", err) } sf, ok := frame.(*http2.SettingsFrame) if !ok { - // this kicks off resetTransport, so must be last before return - t.Close(connectionErrorf(true, nil, "initial http2 frame from server is not a settings frame: %T", frame)) - return + return connectionErrorf(true, nil, "initial http2 frame from server is not a settings frame: %T", frame) } - t.onPrefaceReceipt() t.handleSettings(sf, true) + return nil +} + +// reader verifies the server preface and reads all subsequent data from +// network connection. If the server preface is not read successfully, an +// error is pushed to errCh; otherwise errCh is closed with no error. +func (t *http2Client) reader(errCh chan<- error) { + defer close(t.readerDone) + + if err := t.readServerPreface(); err != nil { + errCh <- err + return + } + close(errCh) + if t.keepaliveEnabled { + atomic.StoreInt64(&t.lastRead, time.Now().UnixNano()) + } // loop to keep reading incoming messages on this transport. for { diff --git a/vendor/google.golang.org/grpc/internal/transport/transport.go b/vendor/google.golang.org/grpc/internal/transport/transport.go index 6c3ba851..2e615ee2 100644 --- a/vendor/google.golang.org/grpc/internal/transport/transport.go +++ b/vendor/google.golang.org/grpc/internal/transport/transport.go @@ -43,6 +43,10 @@ import ( "google.golang.org/grpc/tap" ) +// ErrNoHeaders is used as a signal that a trailers only response was received, +// and is not a real error. +var ErrNoHeaders = errors.New("stream has no headers") + const logLevel = 2 type bufferPool struct { @@ -366,9 +370,15 @@ func (s *Stream) Header() (metadata.MD, error) { return s.header.Copy(), nil } s.waitOnHeader() + if !s.headerValid { return nil, s.status.Err() } + + if s.noHeaders { + return nil, ErrNoHeaders + } + return s.header.Copy(), nil } @@ -573,8 +583,8 @@ type ConnectOptions struct { // NewClientTransport establishes the transport with the required ConnectOptions // and returns it to the caller. -func NewClientTransport(connectCtx, ctx context.Context, addr resolver.Address, opts ConnectOptions, onPrefaceReceipt func(), onGoAway func(GoAwayReason), onClose func()) (ClientTransport, error) { - return newHTTP2Client(connectCtx, ctx, addr, opts, onPrefaceReceipt, onGoAway, onClose) +func NewClientTransport(connectCtx, ctx context.Context, addr resolver.Address, opts ConnectOptions, onGoAway func(GoAwayReason), onClose func()) (ClientTransport, error) { + return newHTTP2Client(connectCtx, ctx, addr, opts, onGoAway, onClose) } // Options provides additional hints and information for message diff --git a/vendor/google.golang.org/grpc/metadata/metadata.go b/vendor/google.golang.org/grpc/metadata/metadata.go index 98d62e06..fb4a88f5 100644 --- a/vendor/google.golang.org/grpc/metadata/metadata.go +++ b/vendor/google.golang.org/grpc/metadata/metadata.go @@ -41,10 +41,11 @@ type MD map[string][]string // New creates an MD from a given key-value map. // // Only the following ASCII characters are allowed in keys: -// - digits: 0-9 -// - uppercase letters: A-Z (normalized to lower) -// - lowercase letters: a-z -// - special characters: -_. +// - digits: 0-9 +// - uppercase letters: A-Z (normalized to lower) +// - lowercase letters: a-z +// - special characters: -_. +// // Uppercase letters are automatically converted to lowercase. // // Keys beginning with "grpc-" are reserved for grpc-internal use only and may @@ -62,10 +63,11 @@ func New(m map[string]string) MD { // Pairs panics if len(kv) is odd. // // Only the following ASCII characters are allowed in keys: -// - digits: 0-9 -// - uppercase letters: A-Z (normalized to lower) -// - lowercase letters: a-z -// - special characters: -_. +// - digits: 0-9 +// - uppercase letters: A-Z (normalized to lower) +// - lowercase letters: a-z +// - special characters: -_. +// // Uppercase letters are automatically converted to lowercase. // // Keys beginning with "grpc-" are reserved for grpc-internal use only and may @@ -196,7 +198,7 @@ func FromIncomingContext(ctx context.Context) (MD, bool) { // ValueFromIncomingContext returns the metadata value corresponding to the metadata // key from the incoming metadata if it exists. Key must be lower-case. // -// Experimental +// # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. diff --git a/vendor/google.golang.org/grpc/picker_wrapper.go b/vendor/google.golang.org/grpc/picker_wrapper.go index 843633c9..a5d5516e 100644 --- a/vendor/google.golang.org/grpc/picker_wrapper.go +++ b/vendor/google.golang.org/grpc/picker_wrapper.go @@ -26,6 +26,7 @@ import ( "google.golang.org/grpc/balancer" "google.golang.org/grpc/codes" "google.golang.org/grpc/internal/channelz" + istatus "google.golang.org/grpc/internal/status" "google.golang.org/grpc/internal/transport" "google.golang.org/grpc/status" ) @@ -129,8 +130,12 @@ func (pw *pickerWrapper) pick(ctx context.Context, failfast bool, info balancer. if err == balancer.ErrNoSubConnAvailable { continue } - if _, ok := status.FromError(err); ok { + if st, ok := status.FromError(err); ok { // Status error: end the RPC unconditionally with this status. + // First restrict the code to the list allowed by gRFC A54. + if istatus.IsRestrictedControlPlaneCode(st) { + err = status.Errorf(codes.Internal, "received picker error with illegal status: %v", err) + } return nil, nil, dropError{error: err} } // For all other errors, wait for ready RPCs should block and other diff --git a/vendor/google.golang.org/grpc/preloader.go b/vendor/google.golang.org/grpc/preloader.go index 0a1e975a..cd455478 100644 --- a/vendor/google.golang.org/grpc/preloader.go +++ b/vendor/google.golang.org/grpc/preloader.go @@ -25,7 +25,7 @@ import ( // PreparedMsg is responsible for creating a Marshalled and Compressed object. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. diff --git a/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.pb.go b/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.pb.go index 1f859f76..c22f9a52 100644 --- a/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.pb.go +++ b/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.pb.go @@ -53,6 +53,7 @@ type ServerReflectionRequest struct { // defined field and then handles them using corresponding methods. // // Types that are assignable to MessageRequest: + // // *ServerReflectionRequest_FileByFilename // *ServerReflectionRequest_FileContainingSymbol // *ServerReflectionRequest_FileContainingExtension @@ -263,6 +264,7 @@ type ServerReflectionResponse struct { // message_request in the request. // // Types that are assignable to MessageResponse: + // // *ServerReflectionResponse_FileDescriptorResponse // *ServerReflectionResponse_AllExtensionNumbersResponse // *ServerReflectionResponse_ListServicesResponse diff --git a/vendor/google.golang.org/grpc/reflection/serverreflection.go b/vendor/google.golang.org/grpc/reflection/serverreflection.go index 81344abd..0b41783a 100644 --- a/vendor/google.golang.org/grpc/reflection/serverreflection.go +++ b/vendor/google.golang.org/grpc/reflection/serverreflection.go @@ -23,6 +23,7 @@ The service implemented is defined in: https://github.com/grpc/grpc/blob/master/src/proto/grpc/reflection/v1alpha/reflection.proto. To register server reflection on a gRPC server: + import "google.golang.org/grpc/reflection" s := grpc.NewServer() @@ -32,7 +33,6 @@ To register server reflection on a gRPC server: reflection.Register(s) s.Serve(lis) - */ package reflection // import "google.golang.org/grpc/reflection" @@ -74,7 +74,7 @@ func Register(s GRPCServer) { // for a custom implementation to return zero values for the // grpc.ServiceInfo values in the map. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. @@ -85,7 +85,7 @@ type ServiceInfoProvider interface { // ExtensionResolver is the interface used to query details about extensions. // This interface is satisfied by protoregistry.GlobalTypes. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. @@ -96,7 +96,7 @@ type ExtensionResolver interface { // ServerOptions represents the options used to construct a reflection server. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. @@ -120,7 +120,7 @@ type ServerOptions struct { // This can be used to customize behavior of the reflection service. Most usages // should prefer to use Register instead. // -// Experimental +// # Experimental // // Notice: This function is EXPERIMENTAL and may be changed or removed in a // later release. diff --git a/vendor/google.golang.org/grpc/resolver/resolver.go b/vendor/google.golang.org/grpc/resolver/resolver.go index ca2e35a3..967cbc73 100644 --- a/vendor/google.golang.org/grpc/resolver/resolver.go +++ b/vendor/google.golang.org/grpc/resolver/resolver.go @@ -96,7 +96,7 @@ const ( // Address represents a server the client connects to. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. @@ -236,12 +236,12 @@ type ClientConn interface { // // Examples: // -// - "dns://some_authority/foo.bar" -// Target{Scheme: "dns", Authority: "some_authority", Endpoint: "foo.bar"} -// - "foo.bar" -// Target{Scheme: resolver.GetDefaultScheme(), Endpoint: "foo.bar"} -// - "unknown_scheme://authority/endpoint" -// Target{Scheme: resolver.GetDefaultScheme(), Endpoint: "unknown_scheme://authority/endpoint"} +// - "dns://some_authority/foo.bar" +// Target{Scheme: "dns", Authority: "some_authority", Endpoint: "foo.bar"} +// - "foo.bar" +// Target{Scheme: resolver.GetDefaultScheme(), Endpoint: "foo.bar"} +// - "unknown_scheme://authority/endpoint" +// Target{Scheme: resolver.GetDefaultScheme(), Endpoint: "unknown_scheme://authority/endpoint"} type Target struct { // Deprecated: use URL.Scheme instead. Scheme string diff --git a/vendor/google.golang.org/grpc/rpc_util.go b/vendor/google.golang.org/grpc/rpc_util.go index 5d407b00..934fc1aa 100644 --- a/vendor/google.golang.org/grpc/rpc_util.go +++ b/vendor/google.golang.org/grpc/rpc_util.go @@ -198,7 +198,7 @@ func Header(md *metadata.MD) CallOption { // HeaderCallOption is a CallOption for collecting response header metadata. // The metadata field will be populated *after* the RPC completes. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. @@ -220,7 +220,7 @@ func Trailer(md *metadata.MD) CallOption { // TrailerCallOption is a CallOption for collecting response trailer metadata. // The metadata field will be populated *after* the RPC completes. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. @@ -242,7 +242,7 @@ func Peer(p *peer.Peer) CallOption { // PeerCallOption is a CallOption for collecting the identity of the remote // peer. The peer field will be populated *after* the RPC completes. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. @@ -282,7 +282,7 @@ func FailFast(failFast bool) CallOption { // FailFastCallOption is a CallOption for indicating whether an RPC should fail // fast or not. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. @@ -305,7 +305,7 @@ func MaxCallRecvMsgSize(bytes int) CallOption { // MaxRecvMsgSizeCallOption is a CallOption that indicates the maximum message // size in bytes the client can receive. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. @@ -328,7 +328,7 @@ func MaxCallSendMsgSize(bytes int) CallOption { // MaxSendMsgSizeCallOption is a CallOption that indicates the maximum message // size in bytes the client can send. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. @@ -351,7 +351,7 @@ func PerRPCCredentials(creds credentials.PerRPCCredentials) CallOption { // PerRPCCredsCallOption is a CallOption that indicates the per-RPC // credentials to use for the call. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. @@ -369,7 +369,7 @@ func (o PerRPCCredsCallOption) after(c *callInfo, attempt *csAttempt) {} // sending the request. If WithCompressor is also set, UseCompressor has // higher priority. // -// Experimental +// # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. @@ -379,7 +379,7 @@ func UseCompressor(name string) CallOption { // CompressorCallOption is a CallOption that indicates the compressor to use. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. @@ -416,7 +416,7 @@ func CallContentSubtype(contentSubtype string) CallOption { // ContentSubtypeCallOption is a CallOption that indicates the content-subtype // used for marshaling messages. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. @@ -444,7 +444,7 @@ func (o ContentSubtypeCallOption) after(c *callInfo, attempt *csAttempt) {} // This function is provided for advanced users; prefer to use only // CallContentSubtype to select a registered codec instead. // -// Experimental +// # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. @@ -455,7 +455,7 @@ func ForceCodec(codec encoding.Codec) CallOption { // ForceCodecCallOption is a CallOption that indicates the codec used for // marshaling messages. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. @@ -480,7 +480,7 @@ func CallCustomCodec(codec Codec) CallOption { // CustomCodecCallOption is a CallOption that indicates the codec used for // marshaling messages. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. @@ -497,7 +497,7 @@ func (o CustomCodecCallOption) after(c *callInfo, attempt *csAttempt) {} // MaxRetryRPCBufferSize returns a CallOption that limits the amount of memory // used for buffering this RPC's requests for retry purposes. // -// Experimental +// # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. @@ -508,7 +508,7 @@ func MaxRetryRPCBufferSize(bytes int) CallOption { // MaxRetryRPCBufferSizeCallOption is a CallOption indicating the amount of // memory to be used for caching this RPC for retry purposes. // -// Experimental +// # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. @@ -548,10 +548,11 @@ type parser struct { // format. The caller owns the returned msg memory. // // If there is an error, possible values are: -// * io.EOF, when no messages remain -// * io.ErrUnexpectedEOF -// * of type transport.ConnectionError -// * an error from the status package +// - io.EOF, when no messages remain +// - io.ErrUnexpectedEOF +// - of type transport.ConnectionError +// - an error from the status package +// // No other error values or types must be returned, which also means // that the underlying io.Reader must not return an incompatible // error. diff --git a/vendor/google.golang.org/grpc/serviceconfig/serviceconfig.go b/vendor/google.golang.org/grpc/serviceconfig/serviceconfig.go index 73a2f926..35e7a20a 100644 --- a/vendor/google.golang.org/grpc/serviceconfig/serviceconfig.go +++ b/vendor/google.golang.org/grpc/serviceconfig/serviceconfig.go @@ -19,7 +19,7 @@ // Package serviceconfig defines types and methods for operating on gRPC // service configs. // -// Experimental +// # Experimental // // Notice: This package is EXPERIMENTAL and may be changed or removed in a // later release. diff --git a/vendor/google.golang.org/grpc/status/status.go b/vendor/google.golang.org/grpc/status/status.go index 6d163b6e..623be39f 100644 --- a/vendor/google.golang.org/grpc/status/status.go +++ b/vendor/google.golang.org/grpc/status/status.go @@ -76,14 +76,14 @@ func FromProto(s *spb.Status) *Status { // FromError returns a Status representation of err. // -// - If err was produced by this package or implements the method `GRPCStatus() -// *Status`, the appropriate Status is returned. +// - If err was produced by this package or implements the method `GRPCStatus() +// *Status`, the appropriate Status is returned. // -// - If err is nil, a Status is returned with codes.OK and no message. +// - If err is nil, a Status is returned with codes.OK and no message. // -// - Otherwise, err is an error not compatible with this package. In this -// case, a Status is returned with codes.Unknown and err's Error() message, -// and ok is false. +// - Otherwise, err is an error not compatible with this package. In this +// case, a Status is returned with codes.Unknown and err's Error() message, +// and ok is false. func FromError(err error) (s *Status, ok bool) { if err == nil { return nil, true diff --git a/vendor/google.golang.org/grpc/stream.go b/vendor/google.golang.org/grpc/stream.go index 0c16cfb2..960c3e33 100644 --- a/vendor/google.golang.org/grpc/stream.go +++ b/vendor/google.golang.org/grpc/stream.go @@ -39,6 +39,7 @@ import ( imetadata "google.golang.org/grpc/internal/metadata" iresolver "google.golang.org/grpc/internal/resolver" "google.golang.org/grpc/internal/serviceconfig" + istatus "google.golang.org/grpc/internal/status" "google.golang.org/grpc/internal/transport" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" @@ -195,6 +196,13 @@ func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth rpcInfo := iresolver.RPCInfo{Context: ctx, Method: method} rpcConfig, err := cc.safeConfigSelector.SelectConfig(rpcInfo) if err != nil { + if st, ok := status.FromError(err); ok { + // Restrict the code to the list allowed by gRFC A54. + if istatus.IsRestrictedControlPlaneCode(st) { + err = status.Errorf(codes.Internal, "config selector returned illegal status: %v", err) + } + return nil, err + } return nil, toRPCErr(err) } @@ -744,17 +752,25 @@ func (cs *clientStream) withRetry(op func(a *csAttempt) error, onSuccess func()) func (cs *clientStream) Header() (metadata.MD, error) { var m metadata.MD + noHeader := false err := cs.withRetry(func(a *csAttempt) error { var err error m, err = a.s.Header() + if err == transport.ErrNoHeaders { + noHeader = true + return nil + } return toRPCErr(err) }, cs.commitAttemptLocked) + if err != nil { cs.finish(err) return nil, err } - if len(cs.binlogs) != 0 && !cs.serverHeaderBinlogged { - // Only log if binary log is on and header has not been logged. + + if len(cs.binlogs) != 0 && !cs.serverHeaderBinlogged && !noHeader { + // Only log if binary log is on and header has not been logged, and + // there is actually headers to log. logEntry := &binarylog.ServerHeader{ OnClientSide: true, Header: m, diff --git a/vendor/google.golang.org/grpc/tap/tap.go b/vendor/google.golang.org/grpc/tap/tap.go index dbf34e6b..bfa5dfa4 100644 --- a/vendor/google.golang.org/grpc/tap/tap.go +++ b/vendor/google.golang.org/grpc/tap/tap.go @@ -19,7 +19,7 @@ // Package tap defines the function handles which are executed on the transport // layer of gRPC-Go and related information. // -// Experimental +// # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go index d472ca64..2198e709 100644 --- a/vendor/google.golang.org/grpc/version.go +++ b/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.50.1" +const Version = "1.51.0" diff --git a/vendor/google.golang.org/grpc/vet.sh b/vendor/google.golang.org/grpc/vet.sh index c3fc8253..bd8e0cdb 100644 --- a/vendor/google.golang.org/grpc/vet.sh +++ b/vendor/google.golang.org/grpc/vet.sh @@ -67,7 +67,9 @@ elif [[ "$#" -ne 0 ]]; then fi # - Ensure all source files contain a copyright message. -not git grep -L "\(Copyright [0-9]\{4,\} gRPC authors\)\|DO NOT EDIT" -- '*.go' +# (Done in two parts because Darwin "git grep" has broken support for compound +# exclusion matches.) +(grep -L "DO NOT EDIT" $(git grep -L "\(Copyright [0-9]\{4,\} gRPC authors\)" -- '*.go') || true) | fail_on_output # - Make sure all tests in grpc and grpc/test use leakcheck via Teardown. not grep 'func Test[^(]' *_test.go @@ -81,7 +83,7 @@ not git grep -l 'x/net/context' -- "*.go" git grep -l '"math/rand"' -- "*.go" 2>&1 | not grep -v '^examples\|^stress\|grpcrand\|^benchmark\|wrr_test' # - Do not call grpclog directly. Use grpclog.Component instead. -git grep -l 'grpclog.I\|grpclog.W\|grpclog.E\|grpclog.F\|grpclog.V' -- "*.go" | not grep -v '^grpclog/component.go\|^internal/grpctest/tlogger_test.go' +git grep -l -e 'grpclog.I' --or -e 'grpclog.W' --or -e 'grpclog.E' --or -e 'grpclog.F' --or -e 'grpclog.V' -- "*.go" | not grep -v '^grpclog/component.go\|^internal/grpctest/tlogger_test.go' # - Ensure all ptypes proto packages are renamed when importing. not git grep "\(import \|^\s*\)\"github.com/golang/protobuf/ptypes/" -- "*.go" diff --git a/vendor/modules.txt b/vendor/modules.txt index 61965c75..326904a7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,10 +1,10 @@ # github.com/Masterminds/goutils v1.1.1 ## explicit github.com/Masterminds/goutils -# github.com/Masterminds/semver/v3 v3.1.1 -## explicit; go 1.12 +# github.com/Masterminds/semver/v3 v3.2.0 +## explicit; go 1.18 github.com/Masterminds/semver/v3 -# github.com/Masterminds/sprig/v3 v3.2.2 +# github.com/Masterminds/sprig/v3 v3.2.3 ## explicit; go 1.13 github.com/Masterminds/sprig/v3 # github.com/agext/levenshtein v1.2.3 @@ -96,7 +96,7 @@ github.com/hashicorp/hc-install/internal/version github.com/hashicorp/hc-install/product github.com/hashicorp/hc-install/releases github.com/hashicorp/hc-install/src -# github.com/hashicorp/hcl/v2 v2.14.1 +# github.com/hashicorp/hcl/v2 v2.15.0 ## explicit; go 1.18 github.com/hashicorp/hcl/v2 github.com/hashicorp/hcl/v2/ext/customdecode @@ -119,7 +119,7 @@ github.com/hashicorp/terraform-plugin-docs/internal/mdplain github.com/hashicorp/terraform-plugin-docs/internal/provider github.com/hashicorp/terraform-plugin-docs/internal/tmplfuncs github.com/hashicorp/terraform-plugin-docs/schemamd -# github.com/hashicorp/terraform-plugin-go v0.14.1 +# github.com/hashicorp/terraform-plugin-go v0.14.2 ## explicit; go 1.18 github.com/hashicorp/terraform-plugin-go/internal/logging github.com/hashicorp/terraform-plugin-go/tfprotov5 @@ -144,7 +144,7 @@ github.com/hashicorp/terraform-plugin-log/internal/hclogutils github.com/hashicorp/terraform-plugin-log/internal/logging github.com/hashicorp/terraform-plugin-log/tflog github.com/hashicorp/terraform-plugin-log/tfsdklog -# github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0 +# github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1 ## explicit; go 1.18 github.com/hashicorp/terraform-plugin-sdk/v2/diag github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest @@ -165,7 +165,7 @@ github.com/hashicorp/terraform-plugin-sdk/v2/internal/tfdiags github.com/hashicorp/terraform-plugin-sdk/v2/meta github.com/hashicorp/terraform-plugin-sdk/v2/plugin github.com/hashicorp/terraform-plugin-sdk/v2/terraform -# github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c +# github.com/hashicorp/terraform-registry-address v0.1.0 ## explicit; go 1.14 github.com/hashicorp/terraform-registry-address # github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 @@ -174,7 +174,7 @@ github.com/hashicorp/terraform-svchost # github.com/hashicorp/yamux v0.1.1 ## explicit; go 1.15 github.com/hashicorp/yamux -# github.com/huandu/xstrings v1.3.3 +# github.com/huandu/xstrings v1.4.0 ## explicit; go 1.12 github.com/huandu/xstrings # github.com/imdario/mergo v0.3.13 @@ -224,6 +224,8 @@ github.com/shopspring/decimal # github.com/spf13/cast v1.5.0 ## explicit; go 1.18 github.com/spf13/cast +# github.com/stretchr/objx v0.5.0 +## explicit; go 1.12 # github.com/stretchr/testify v1.8.1 ## explicit; go 1.13 github.com/stretchr/testify/assert @@ -240,7 +242,7 @@ github.com/vmihailenco/msgpack/v4/codes github.com/vmihailenco/tagparser github.com/vmihailenco/tagparser/internal github.com/vmihailenco/tagparser/internal/parser -# github.com/wasfree/uptrends-go-sdk v1.1.0 +# github.com/wasfree/uptrends-go-sdk v1.2.0 ## explicit; go 1.17 github.com/wasfree/uptrends-go-sdk # github.com/zclconf/go-cty v1.12.1 @@ -252,7 +254,7 @@ github.com/zclconf/go-cty/cty/function/stdlib github.com/zclconf/go-cty/cty/gocty github.com/zclconf/go-cty/cty/json github.com/zclconf/go-cty/cty/set -# golang.org/x/crypto v0.1.0 +# golang.org/x/crypto v0.3.0 ## explicit; go 1.17 golang.org/x/crypto/bcrypt golang.org/x/crypto/blowfish @@ -283,15 +285,15 @@ golang.org/x/net/http2/hpack golang.org/x/net/idna golang.org/x/net/internal/timeseries golang.org/x/net/trace -# golang.org/x/oauth2 v0.1.0 +# golang.org/x/oauth2 v0.2.0 ## explicit; go 1.17 golang.org/x/oauth2 golang.org/x/oauth2/internal -# golang.org/x/sys v0.2.0 +# golang.org/x/sys v0.3.0 ## explicit; go 1.17 golang.org/x/sys/cpu golang.org/x/sys/unix -# golang.org/x/text v0.4.0 +# golang.org/x/text v0.5.0 ## explicit; go 1.17 golang.org/x/text/cases golang.org/x/text/internal @@ -318,10 +320,10 @@ google.golang.org/appengine/internal/modules google.golang.org/appengine/internal/remote_api google.golang.org/appengine/internal/urlfetch google.golang.org/appengine/urlfetch -# google.golang.org/genproto v0.0.0-20221109142239-94d6d90a7d66 +# google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd ## explicit; go 1.19 google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.50.1 +# google.golang.org/grpc v1.51.0 ## explicit; go 1.17 google.golang.org/grpc google.golang.org/grpc/attributes