diff --git a/README.md b/README.md index 0a4ff5b..c8aea59 100644 --- a/README.md +++ b/README.md @@ -38,16 +38,15 @@ import ( "context" "fmt" - jcapiv2 "github.com/TheJumpCloud/jcapi-go/v2" + jcapiv2 "github.com/TheJumpCloud/jcapi-go/jcapiv2" + "github.com/antihax/optional" ) func main() { apiKey := "YOUR_API_KEY" + XOrgId := "YOUR_ORG_ID" userGroupID := "YOUR_GROUP_ID" - contentType := "application/json" - accept := "application/json" - // Instantiate the API client client := jcapiv2.NewAPIClient(jcapiv2.NewConfiguration()) @@ -57,7 +56,7 @@ func main() { }) // Make an API call to retrieve a specific user group by ID - userGroup, res, err := client.UserGroupsApi.GroupsUserGet(auth, userGroupID, contentType, accept, nil) + userGroup, res, err := client.UserGroupsApi.GroupsUserGet(auth, userGroupID, &jcapiv2.UserGroupsApiGroupsUserGetOpts{XOrgId: optional.NewString(XOrgId)}) if err != nil { fmt.Printf("Error retrieving user group %s: %s - response = %+v\n", userGroupID, err, res) } else { diff --git a/hello-world/go.mod b/hello-world/go.mod new file mode 100644 index 0000000..ee073b6 --- /dev/null +++ b/hello-world/go.mod @@ -0,0 +1,3 @@ +module github.com/TheJumpCloud/jcapi-go/hello-world + +go 1.18 diff --git a/hello-world/go.work b/hello-world/go.work new file mode 100644 index 0000000..9fd2066 --- /dev/null +++ b/hello-world/go.work @@ -0,0 +1,6 @@ +go 1.18 + +use ( + . + ../jcapiv2 +) diff --git a/hello-world/main.go b/hello-world/main.go new file mode 100644 index 0000000..bedc454 --- /dev/null +++ b/hello-world/main.go @@ -0,0 +1,31 @@ +package main + +import ( + "context" + "fmt" + + jcapiv2 "github.com/TheJumpCloud/jcapi-go/jcapiv2" + "github.com/antihax/optional" +) + +func main() { + apiKey := "YOUR_API_KEY" + XOrgId := "YOUR_ORG_ID" + userGroupID := "YOUR_GROUP_ID" + + // Instantiate the API client + client := jcapiv2.NewAPIClient(jcapiv2.NewConfiguration()) + + // Set up the API key via context + auth := context.WithValue(context.TODO(), jcapiv2.ContextAPIKey, jcapiv2.APIKey{ + Key: apiKey, + }) + + // Make an API call to retrieve a specific user group by ID + userGroup, res, err := client.UserGroupsApi.GroupsUserGet(auth, userGroupID, &jcapiv2.UserGroupsApiGroupsUserGetOpts{XOrgId: optional.NewString(XOrgId)}) + if err != nil { + fmt.Printf("Error retrieving user group %s: %s - response = %+v\n", userGroupID, err, res) + } else { + fmt.Printf("Details for User group %s: %+v\n", userGroupID, userGroup) + } +} diff --git a/hello-world/notes.md b/hello-world/notes.md new file mode 100644 index 0000000..4811baa --- /dev/null +++ b/hello-world/notes.md @@ -0,0 +1,27 @@ + +# Setup "hello-world" project + +1. Created directory `hello-world` +2. `cd hello-world` +3. Created file `go.work` to point module to local version of SDK +4. Created file `main.go` and populated with example from main [README.md](https://github.com/TheJumpCloud/jcapi-go/tree/latest) +5. Created "go.mod" file by running `go mod init github.com/TheJumpCloud/jcapi-go/hello-world` +6. Ran `go mod tidy` as prompt suggests +7. Run `go run main.go` to execute program + +# SDK fixes + +1. `cd jcapiv2` +2. Run `go mod init github.com/TheJumpCloud/jcapi-go/jcapiv2` +3. Run `go mod tidy` +4. Run `cd ../hello-world; go run main.go;` but found errors + 1. Error: `undefined: os` to fix I opened each file, saved it, and let linting do its magic + 1. `../jcapi-go/jcapiv2/api_logos.go` + 2. `../jcapi-go/jcapiv2/api_managed_service_provider.go` + 3. `../jcapi-go/jcapiv2/api_providers.go` +5. Made some fixes in the example `../hello-world/main.go` +6. It worked! `Details for User group 635ac16209b40b00016188f1: {Attributes:0xc000189ef0 Description: Email: Id:635ac16209b40b00016188f1 MemberQuery: MemberQueryExemptions:[] MemberSuggestionsNotify:false MembershipAutomated:false Name:PesterTest_UserGroup SuggestionCounts: Type_:user_group}` + +# Misc. + +The VSCode linter still is reporting a lot of errors that probably need to be fixed. diff --git a/jcapiv2/api_logos.go b/jcapiv2/api_logos.go index a72c6db..4154603 100644 --- a/jcapiv2/api_logos.go +++ b/jcapiv2/api_logos.go @@ -1,8 +1,7 @@ - /* * JumpCloud API * - * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) * * API version: 2.0 * Contact: support@jumpcloud.com @@ -12,11 +11,12 @@ package jcapiv2 import ( "context" + "fmt" "io/ioutil" "net/http" "net/url" + "os" "strings" - "fmt" ) // Linger please @@ -25,6 +25,7 @@ var ( ) type LogosApiService service + /* LogosApiService Get the logo associated with the specified id Return the logo image associated with the specified id @@ -34,10 +35,10 @@ Return the logo image associated with the specified id */ func (a *LogosApiService) LogosGet(ctx context.Context, id string) (*os.File, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue *os.File ) @@ -84,46 +85,46 @@ func (a *LogosApiService) LogosGet(ctx context.Context, id string) (*os.File, *h if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v *os.File - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } diff --git a/jcapiv2/api_managed_service_provider.go b/jcapiv2/api_managed_service_provider.go index 557061d..49baa1f 100644 --- a/jcapiv2/api_managed_service_provider.go +++ b/jcapiv2/api_managed_service_provider.go @@ -1,8 +1,7 @@ - /* * JumpCloud API * - * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) * * API version: 2.0 * Contact: support@jumpcloud.com @@ -12,11 +11,13 @@ package jcapiv2 import ( "context" + "fmt" "io/ioutil" "net/http" "net/url" + "os" "strings" - "fmt" + "github.com/antihax/optional" ) @@ -26,26 +27,27 @@ var ( ) type ManagedServiceProviderApiService service + /* ManagedServiceProviderApiService Allow Adminstrator access to an Organization. This endpoint allows you to grant Administrator access to an Organization. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param id * @param optional nil or *ManagedServiceProviderApiAdministratorOrganizationsCreateByAdministratorOpts - Optional Parameters: - * @param "Body" (optional.Interface of AdministratorOrganizationLinkReq) - + * @param "Body" (optional.Interface of AdministratorOrganizationLinkReq) - @return AdministratorOrganizationLink */ type ManagedServiceProviderApiAdministratorOrganizationsCreateByAdministratorOpts struct { - Body optional.Interface + Body optional.Interface } func (a *ManagedServiceProviderApiService) AdministratorOrganizationsCreateByAdministrator(ctx context.Context, id string, localVarOptionals *ManagedServiceProviderApiAdministratorOrganizationsCreateByAdministratorOpts) (AdministratorOrganizationLink, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue AdministratorOrganizationLink ) @@ -76,8 +78,8 @@ func (a *ManagedServiceProviderApiService) AdministratorOrganizationsCreateByAdm } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - - localVarOptionalBody:= localVarOptionals.Body.Value() + + localVarOptionalBody := localVarOptionals.Body.Value() localVarPostBody = &localVarOptionalBody } if ctx != nil { @@ -90,7 +92,7 @@ func (a *ManagedServiceProviderApiService) AdministratorOrganizationsCreateByAdm key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -111,82 +113,83 @@ func (a *ManagedServiceProviderApiService) AdministratorOrganizationsCreateByAdm if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 201 { var v AdministratorOrganizationLink - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ManagedServiceProviderApiService List the association links between an Administrator and Organizations. This endpoint returns the association links between an Administrator and Organizations. @@ -199,16 +202,16 @@ This endpoint returns the association links between an Administrator and Organiz */ type ManagedServiceProviderApiAdministratorOrganizationsListByAdministratorOpts struct { - Limit optional.Int32 - Skip optional.Int32 + Limit optional.Int32 + Skip optional.Int32 } func (a *ManagedServiceProviderApiService) AdministratorOrganizationsListByAdministrator(ctx context.Context, id string, localVarOptionals *ManagedServiceProviderApiAdministratorOrganizationsListByAdministratorOpts) ([]AdministratorOrganizationLink, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue []AdministratorOrganizationLink ) @@ -253,7 +256,7 @@ func (a *ManagedServiceProviderApiService) AdministratorOrganizationsListByAdmin key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -274,82 +277,83 @@ func (a *ManagedServiceProviderApiService) AdministratorOrganizationsListByAdmin if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v []AdministratorOrganizationLink - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ManagedServiceProviderApiService List the association links between an Organization and Administrators. This endpoint returns the association links between an Organization and Administrators. @@ -362,16 +366,16 @@ This endpoint returns the association links between an Organization and Administ */ type ManagedServiceProviderApiAdministratorOrganizationsListByOrganizationOpts struct { - Limit optional.Int32 - Skip optional.Int32 + Limit optional.Int32 + Skip optional.Int32 } func (a *ManagedServiceProviderApiService) AdministratorOrganizationsListByOrganization(ctx context.Context, id string, localVarOptionals *ManagedServiceProviderApiAdministratorOrganizationsListByOrganizationOpts) ([]AdministratorOrganizationLink, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue []AdministratorOrganizationLink ) @@ -416,7 +420,7 @@ func (a *ManagedServiceProviderApiService) AdministratorOrganizationsListByOrgan key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -437,82 +441,83 @@ func (a *ManagedServiceProviderApiService) AdministratorOrganizationsListByOrgan if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v []AdministratorOrganizationLink - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ManagedServiceProviderApiService Remove association between an Administrator and an Organization. This endpoint removes the association link between an Administrator and an Organization. @@ -527,7 +532,6 @@ func (a *ManagedServiceProviderApiService) AdministratorOrganizationsRemoveByAdm localVarPostBody interface{} localVarFileName string localVarFileBytes []byte - ) // create path and map variables @@ -566,7 +570,7 @@ func (a *ManagedServiceProviderApiService) AdministratorOrganizationsRemoveByAdm key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -585,67 +589,67 @@ func (a *ManagedServiceProviderApiService) AdministratorOrganizationsRemoveByAdm return localVarHttpResponse, err } - if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr } return localVarHttpResponse, newErr } return localVarHttpResponse, nil } + /* ManagedServiceProviderApiService Update Provider Organization This endpoint updates a provider's organization @@ -653,20 +657,20 @@ This endpoint updates a provider's organization * @param providerId * @param id * @param optional nil or *ManagedServiceProviderApiProviderOrganizationsUpdateOrgOpts - Optional Parameters: - * @param "Body" (optional.Interface of Organization) - + * @param "Body" (optional.Interface of Organization) - @return Organization */ type ManagedServiceProviderApiProviderOrganizationsUpdateOrgOpts struct { - Body optional.Interface + Body optional.Interface } func (a *ManagedServiceProviderApiService) ProviderOrganizationsUpdateOrg(ctx context.Context, providerId string, id string, localVarOptionals *ManagedServiceProviderApiProviderOrganizationsUpdateOrgOpts) (Organization, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue Organization ) @@ -698,8 +702,8 @@ func (a *ManagedServiceProviderApiService) ProviderOrganizationsUpdateOrg(ctx co } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - - localVarOptionalBody:= localVarOptionals.Body.Value() + + localVarOptionalBody := localVarOptionals.Body.Value() localVarPostBody = &localVarOptionalBody } if ctx != nil { @@ -712,7 +716,7 @@ func (a *ManagedServiceProviderApiService) ProviderOrganizationsUpdateOrg(ctx co key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -733,52 +737,53 @@ func (a *ManagedServiceProviderApiService) ProviderOrganizationsUpdateOrg(ctx co if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v Organization - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ManagedServiceProviderApiService Retrieve Provider This endpoint returns details about a provider * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param providerId * @param optional nil or *ManagedServiceProviderApiProvidersGetProviderOpts - Optional Parameters: - * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. @return Provider */ type ManagedServiceProviderApiProvidersGetProviderOpts struct { - Fields optional.Interface + Fields optional.Interface } func (a *ManagedServiceProviderApiService) ProvidersGetProvider(ctx context.Context, providerId string, localVarOptionals *ManagedServiceProviderApiProvidersGetProviderOpts) (Provider, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue Provider ) @@ -820,7 +825,7 @@ func (a *ManagedServiceProviderApiService) ProvidersGetProvider(ctx context.Cont key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -841,110 +846,111 @@ func (a *ManagedServiceProviderApiService) ProvidersGetProvider(ctx context.Cont if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v Provider - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ManagedServiceProviderApiService List Provider Administrators This endpoint returns a list of the Administrators associated with the Provider. You must be associated with the provider to use this route. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param providerId * @param optional nil or *ManagedServiceProviderApiProvidersListAdministratorsOpts - Optional Parameters: - * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. * @param "Skip" (optional.Int32) - The offset into the records to return. - * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. @return InlineResponse20012 */ type ManagedServiceProviderApiProvidersListAdministratorsOpts struct { - Fields optional.Interface - Filter optional.Interface - Limit optional.Int32 - Skip optional.Int32 - Sort optional.Interface + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface } func (a *ManagedServiceProviderApiService) ProvidersListAdministrators(ctx context.Context, providerId string, localVarOptionals *ManagedServiceProviderApiProvidersListAdministratorsOpts) (InlineResponse20012, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue InlineResponse20012 ) @@ -998,7 +1004,7 @@ func (a *ManagedServiceProviderApiService) ProvidersListAdministrators(ctx conte key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -1019,70 +1025,71 @@ func (a *ManagedServiceProviderApiService) ProvidersListAdministrators(ctx conte if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v InlineResponse20012 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v InlineResponse400 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ManagedServiceProviderApiService List Provider Organizations This endpoint returns a list of the Organizations associated with the Provider. You must be associated with the provider to use this route. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param providerId * @param optional nil or *ManagedServiceProviderApiProvidersListOrganizationsOpts - Optional Parameters: - * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. * @param "Skip" (optional.Int32) - The offset into the records to return. - * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. @return InlineResponse20013 */ type ManagedServiceProviderApiProvidersListOrganizationsOpts struct { - Fields optional.Interface - Filter optional.Interface - Limit optional.Int32 - Skip optional.Int32 - Sort optional.Interface + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface } func (a *ManagedServiceProviderApiService) ProvidersListOrganizations(ctx context.Context, providerId string, localVarOptionals *ManagedServiceProviderApiProvidersListOrganizationsOpts) (InlineResponse20013, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue InlineResponse20013 ) @@ -1136,7 +1143,7 @@ func (a *ManagedServiceProviderApiService) ProvidersListOrganizations(ctx contex key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -1157,102 +1164,103 @@ func (a *ManagedServiceProviderApiService) ProvidersListOrganizations(ctx contex if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v InlineResponse20013 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ManagedServiceProviderApiService Create a new Provider Administrator This endpoint allows you to create a provider administrator. You must be associated with the provider to use this route. You must provide either `role` or `roleName`. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param providerId * @param optional nil or *ManagedServiceProviderApiProvidersPostAdminsOpts - Optional Parameters: - * @param "Body" (optional.Interface of ProviderAdminReq) - + * @param "Body" (optional.Interface of ProviderAdminReq) - @return Administrator */ type ManagedServiceProviderApiProvidersPostAdminsOpts struct { - Body optional.Interface + Body optional.Interface } func (a *ManagedServiceProviderApiService) ProvidersPostAdmins(ctx context.Context, providerId string, localVarOptionals *ManagedServiceProviderApiProvidersPostAdminsOpts) (Administrator, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue Administrator ) @@ -1283,8 +1291,8 @@ func (a *ManagedServiceProviderApiService) ProvidersPostAdmins(ctx context.Conte } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - - localVarOptionalBody:= localVarOptionals.Body.Value() + + localVarOptionalBody := localVarOptionals.Body.Value() localVarPostBody = &localVarOptionalBody } if ctx != nil { @@ -1297,7 +1305,7 @@ func (a *ManagedServiceProviderApiService) ProvidersPostAdmins(ctx context.Conte key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -1318,42 +1326,43 @@ func (a *ManagedServiceProviderApiService) ProvidersPostAdmins(ctx context.Conte if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v Administrator - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v InlineResponse400 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ManagedServiceProviderApiService Download a provider's invoice. Retrieves an invoice for this provider. You must be associated to the provider to use this endpoint. @@ -1364,10 +1373,10 @@ Retrieves an invoice for this provider. You must be associated to the provider t */ func (a *ManagedServiceProviderApiService) ProvidersRetrieveInvoice(ctx context.Context, providerId string, iD string) (*os.File, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue *os.File ) @@ -1407,7 +1416,7 @@ func (a *ManagedServiceProviderApiService) ProvidersRetrieveInvoice(ctx context. key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -1428,82 +1437,83 @@ func (a *ManagedServiceProviderApiService) ProvidersRetrieveInvoice(ctx context. if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v *os.File - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ManagedServiceProviderApiService List a provider's invoices. Retrieves a list of invoices for this provider. You must be associated to the provider to use this endpoint. @@ -1511,23 +1521,23 @@ Retrieves a list of invoices for this provider. You must be associated to the pr * @param providerId * @param optional nil or *ManagedServiceProviderApiProvidersRetrieveInvoicesOpts - Optional Parameters: * @param "Skip" (optional.Int32) - The offset into the records to return. - * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. @return ProviderInvoiceResponse */ type ManagedServiceProviderApiProvidersRetrieveInvoicesOpts struct { - Skip optional.Int32 - Sort optional.Interface - Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + Limit optional.Int32 } func (a *ManagedServiceProviderApiService) ProvidersRetrieveInvoices(ctx context.Context, providerId string, localVarOptionals *ManagedServiceProviderApiProvidersRetrieveInvoicesOpts) (ProviderInvoiceResponse, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue ProviderInvoiceResponse ) @@ -1575,7 +1585,7 @@ func (a *ManagedServiceProviderApiService) ProvidersRetrieveInvoices(ctx context key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -1596,76 +1606,76 @@ func (a *ManagedServiceProviderApiService) ProvidersRetrieveInvoices(ctx context if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v ProviderInvoiceResponse - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } diff --git a/jcapiv2/api_providers.go b/jcapiv2/api_providers.go index c911682..b672b6e 100644 --- a/jcapiv2/api_providers.go +++ b/jcapiv2/api_providers.go @@ -1,8 +1,7 @@ - /* * JumpCloud API * - * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) * * API version: 2.0 * Contact: support@jumpcloud.com @@ -12,11 +11,13 @@ package jcapiv2 import ( "context" + "fmt" "io/ioutil" "net/http" "net/url" + "os" "strings" - "fmt" + "github.com/antihax/optional" ) @@ -26,26 +27,27 @@ var ( ) type ProvidersApiService service + /* ProvidersApiService Creates a new Autotask integration for the provider Creates a new Autotask integration for the provider. You must be associated with the provider to use this route. A 422 Unprocessable Entity response means the server failed to validate with Autotask. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param providerId * @param optional nil or *ProvidersApiAutotaskCreateConfigurationOpts - Optional Parameters: - * @param "Body" (optional.Interface of AutotaskIntegrationReq) - + * @param "Body" (optional.Interface of AutotaskIntegrationReq) - @return InlineResponse201 */ type ProvidersApiAutotaskCreateConfigurationOpts struct { - Body optional.Interface + Body optional.Interface } func (a *ProvidersApiService) AutotaskCreateConfiguration(ctx context.Context, providerId string, localVarOptionals *ProvidersApiAutotaskCreateConfigurationOpts) (InlineResponse201, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue InlineResponse201 ) @@ -76,8 +78,8 @@ func (a *ProvidersApiService) AutotaskCreateConfiguration(ctx context.Context, p } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - - localVarOptionalBody:= localVarOptionals.Body.Value() + + localVarOptionalBody := localVarOptionals.Body.Value() localVarPostBody = &localVarOptionalBody } if ctx != nil { @@ -90,7 +92,7 @@ func (a *ProvidersApiService) AutotaskCreateConfiguration(ctx context.Context, p key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -111,102 +113,103 @@ func (a *ProvidersApiService) AutotaskCreateConfiguration(ctx context.Context, p if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 201 { var v InlineResponse201 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 409 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 422 { var v interface{} - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Delete Autotask Integration Removes a Autotask integration. @@ -220,7 +223,6 @@ func (a *ProvidersApiService) AutotaskDeleteConfiguration(ctx context.Context, u localVarPostBody interface{} localVarFileName string localVarFileBytes []byte - ) // create path and map variables @@ -258,7 +260,7 @@ func (a *ProvidersApiService) AutotaskDeleteConfiguration(ctx context.Context, u key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -277,67 +279,67 @@ func (a *ProvidersApiService) AutotaskDeleteConfiguration(ctx context.Context, u return localVarHttpResponse, err } - if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr } return localVarHttpResponse, newErr } return localVarHttpResponse, nil } + /* ProvidersApiService Retrieve Autotask Integration Configuration Retrieves configuration for given Autotask integration id. You must be associated to the provider the integration is tied to in order to use this api. @@ -347,10 +349,10 @@ Retrieves configuration for given Autotask integration id. You must be associate */ func (a *ProvidersApiService) AutotaskGetConfiguration(ctx context.Context, uUID string) (AutotaskIntegration, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue AutotaskIntegration ) @@ -389,7 +391,7 @@ func (a *ProvidersApiService) AutotaskGetConfiguration(ctx context.Context, uUID key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -410,102 +412,103 @@ func (a *ProvidersApiService) AutotaskGetConfiguration(ctx context.Context, uUID if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v AutotaskIntegration - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Create, edit, and/or delete Autotask Mappings Create, edit, and/or delete mappings between Jumpcloud organizations and Autotask companies/contracts/services. You must be associated to the same provider as the Autotask integration to use this api. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uUID * @param optional nil or *ProvidersApiAutotaskPatchMappingsOpts - Optional Parameters: - * @param "Body" (optional.Interface of AutotaskMappingRequest) - + * @param "Body" (optional.Interface of AutotaskMappingRequest) - @return AutotaskMappingResponse */ type ProvidersApiAutotaskPatchMappingsOpts struct { - Body optional.Interface + Body optional.Interface } func (a *ProvidersApiService) AutotaskPatchMappings(ctx context.Context, uUID string, localVarOptionals *ProvidersApiAutotaskPatchMappingsOpts) (AutotaskMappingResponse, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue AutotaskMappingResponse ) @@ -536,8 +539,8 @@ func (a *ProvidersApiService) AutotaskPatchMappings(ctx context.Context, uUID st } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - - localVarOptionalBody:= localVarOptionals.Body.Value() + + localVarOptionalBody := localVarOptionals.Body.Value() localVarPostBody = &localVarOptionalBody } if ctx != nil { @@ -550,7 +553,7 @@ func (a *ProvidersApiService) AutotaskPatchMappings(ctx context.Context, uUID st key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -571,102 +574,103 @@ func (a *ProvidersApiService) AutotaskPatchMappings(ctx context.Context, uUID st if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 204 { var v AutotaskMappingResponse - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Create, edit, and/or delete Autotask Integration settings Create, edit, and/or delete Autotask settings. You must be associated to the same provider as the Autotask integration to use this endpoint. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uUID * @param optional nil or *ProvidersApiAutotaskPatchSettingsOpts - Optional Parameters: - * @param "Body" (optional.Interface of AutotaskSettingsPatchReq) - + * @param "Body" (optional.Interface of AutotaskSettingsPatchReq) - @return AutotaskSettings */ type ProvidersApiAutotaskPatchSettingsOpts struct { - Body optional.Interface + Body optional.Interface } func (a *ProvidersApiService) AutotaskPatchSettings(ctx context.Context, uUID string, localVarOptionals *ProvidersApiAutotaskPatchSettingsOpts) (AutotaskSettings, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue AutotaskSettings ) @@ -697,8 +701,8 @@ func (a *ProvidersApiService) AutotaskPatchSettings(ctx context.Context, uUID st } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - - localVarOptionalBody:= localVarOptionals.Body.Value() + + localVarOptionalBody := localVarOptionals.Body.Value() localVarPostBody = &localVarOptionalBody } if ctx != nil { @@ -711,7 +715,7 @@ func (a *ProvidersApiService) AutotaskPatchSettings(ctx context.Context, uUID st key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -732,82 +736,83 @@ func (a *ProvidersApiService) AutotaskPatchSettings(ctx context.Context, uUID st if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v AutotaskSettings - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Get all Autotask ticketing alert configuration options for a provider Get all Autotask ticketing alert configuration options for a provider. @@ -817,10 +822,10 @@ Get all Autotask ticketing alert configuration options for a provider. */ func (a *ProvidersApiService) AutotaskRetrieveAllAlertConfigurationOptions(ctx context.Context, providerId string) (AutotaskTicketingAlertConfigurationOptions, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue AutotaskTicketingAlertConfigurationOptions ) @@ -859,7 +864,7 @@ func (a *ProvidersApiService) AutotaskRetrieveAllAlertConfigurationOptions(ctx c key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -880,82 +885,83 @@ func (a *ProvidersApiService) AutotaskRetrieveAllAlertConfigurationOptions(ctx c if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v AutotaskTicketingAlertConfigurationOptions - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Get all Autotask ticketing alert configurations for a provider Get all Autotask ticketing alert configurations for a provider. @@ -965,10 +971,10 @@ Get all Autotask ticketing alert configurations for a provider. */ func (a *ProvidersApiService) AutotaskRetrieveAllAlertConfigurations(ctx context.Context, providerId string) (AutotaskTicketingAlertConfigurationList, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue AutotaskTicketingAlertConfigurationList ) @@ -1007,7 +1013,7 @@ func (a *ProvidersApiService) AutotaskRetrieveAllAlertConfigurations(ctx context key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -1028,110 +1034,111 @@ func (a *ProvidersApiService) AutotaskRetrieveAllAlertConfigurations(ctx context if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v AutotaskTicketingAlertConfigurationList - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Retrieve Autotask Companies Retrieves a list of Autotask companies for the given Autotask id. You must be associated to the same provider as the Autotask integration to use this endpoint. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uUID * @param optional nil or *ProvidersApiAutotaskRetrieveCompaniesOpts - Optional Parameters: - * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. * @param "Skip" (optional.Int32) - The offset into the records to return. - * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. @return AutotaskCompanyResp */ type ProvidersApiAutotaskRetrieveCompaniesOpts struct { - Fields optional.Interface - Filter optional.Interface - Limit optional.Int32 - Skip optional.Int32 - Sort optional.Interface + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface } func (a *ProvidersApiService) AutotaskRetrieveCompanies(ctx context.Context, uUID string, localVarOptionals *ProvidersApiAutotaskRetrieveCompaniesOpts) (AutotaskCompanyResp, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue AutotaskCompanyResp ) @@ -1185,7 +1192,7 @@ func (a *ProvidersApiService) AutotaskRetrieveCompanies(ctx context.Context, uUI key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -1206,82 +1213,83 @@ func (a *ProvidersApiService) AutotaskRetrieveCompanies(ctx context.Context, uUI if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v AutotaskCompanyResp - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Retrieve Autotask Company Types Retrieves a list of user defined company types from Autotask for the given Autotask id. @@ -1291,10 +1299,10 @@ Retrieves a list of user defined company types from Autotask for the given Autot */ func (a *ProvidersApiService) AutotaskRetrieveCompanyTypes(ctx context.Context, uUID string) (AutotaskCompanyTypeResp, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue AutotaskCompanyTypeResp ) @@ -1333,7 +1341,7 @@ func (a *ProvidersApiService) AutotaskRetrieveCompanyTypes(ctx context.Context, key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -1354,110 +1362,111 @@ func (a *ProvidersApiService) AutotaskRetrieveCompanyTypes(ctx context.Context, if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v AutotaskCompanyTypeResp - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Retrieve Autotask Contracts Retrieves a list of Autotask contracts for the given Autotask integration id. You must be associated to the same provider as the Autotask integration to use this endpoint. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uUID * @param optional nil or *ProvidersApiAutotaskRetrieveContractsOpts - Optional Parameters: - * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. * @param "Skip" (optional.Int32) - The offset into the records to return. - * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. @return InlineResponse2003 */ type ProvidersApiAutotaskRetrieveContractsOpts struct { - Fields optional.Interface - Filter optional.Interface - Limit optional.Int32 - Skip optional.Int32 - Sort optional.Interface + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface } func (a *ProvidersApiService) AutotaskRetrieveContracts(ctx context.Context, uUID string, localVarOptionals *ProvidersApiAutotaskRetrieveContractsOpts) (InlineResponse2003, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue InlineResponse2003 ) @@ -1511,7 +1520,7 @@ func (a *ProvidersApiService) AutotaskRetrieveContracts(ctx context.Context, uUI key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -1532,82 +1541,83 @@ func (a *ProvidersApiService) AutotaskRetrieveContracts(ctx context.Context, uUI if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v InlineResponse2003 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Retrieve Autotask Contract Fields Retrieves a list of Autotask contract fields for the given Autotask integration id. You must be associated to the same provider as the Autotask integration to use this endpoint. @@ -1617,10 +1627,10 @@ Retrieves a list of Autotask contract fields for the given Autotask integration */ func (a *ProvidersApiService) AutotaskRetrieveContractsFields(ctx context.Context, uUID string) (InlineResponse2004, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue InlineResponse2004 ) @@ -1659,7 +1669,7 @@ func (a *ProvidersApiService) AutotaskRetrieveContractsFields(ctx context.Contex key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -1680,110 +1690,111 @@ func (a *ProvidersApiService) AutotaskRetrieveContractsFields(ctx context.Contex if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v InlineResponse2004 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Retrieve Autotask mappings Retrieves the list of mappings for this Autotask integration. You must be associated to the same provider as the Autotask integration to use this api. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uUID * @param optional nil or *ProvidersApiAutotaskRetrieveMappingsOpts - Optional Parameters: - * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. * @param "Skip" (optional.Int32) - The offset into the records to return. - * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. @return InlineResponse2006 */ type ProvidersApiAutotaskRetrieveMappingsOpts struct { - Fields optional.Interface - Filter optional.Interface - Limit optional.Int32 - Skip optional.Int32 - Sort optional.Interface + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface } func (a *ProvidersApiService) AutotaskRetrieveMappings(ctx context.Context, uUID string, localVarOptionals *ProvidersApiAutotaskRetrieveMappingsOpts) (InlineResponse2006, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue InlineResponse2006 ) @@ -1837,7 +1848,7 @@ func (a *ProvidersApiService) AutotaskRetrieveMappings(ctx context.Context, uUID key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -1858,110 +1869,111 @@ func (a *ProvidersApiService) AutotaskRetrieveMappings(ctx context.Context, uUID if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v InlineResponse2006 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Retrieve Autotask Contract Services Retrieves a list of Autotask contract services for the given Autotask integration id. You must be associated to the same provider as the Autotask integration to use this endpoint. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uUID * @param optional nil or *ProvidersApiAutotaskRetrieveServicesOpts - Optional Parameters: - * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. * @param "Skip" (optional.Int32) - The offset into the records to return. - * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. @return InlineResponse2005 */ type ProvidersApiAutotaskRetrieveServicesOpts struct { - Fields optional.Interface - Filter optional.Interface - Limit optional.Int32 - Skip optional.Int32 - Sort optional.Interface + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface } func (a *ProvidersApiService) AutotaskRetrieveServices(ctx context.Context, uUID string, localVarOptionals *ProvidersApiAutotaskRetrieveServicesOpts) (InlineResponse2005, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue InlineResponse2005 ) @@ -2015,7 +2027,7 @@ func (a *ProvidersApiService) AutotaskRetrieveServices(ctx context.Context, uUID key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -2036,82 +2048,83 @@ func (a *ProvidersApiService) AutotaskRetrieveServices(ctx context.Context, uUID if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v InlineResponse2005 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Retrieve Autotask Integration settings Retrieve the Autotask integration settings. You must be associated to the same provider as the Autotask integration to use this endpoint. @@ -2121,10 +2134,10 @@ Retrieve the Autotask integration settings. You must be associated to the same p */ func (a *ProvidersApiService) AutotaskRetrieveSettings(ctx context.Context, uUID string) (AutotaskSettings, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue AutotaskSettings ) @@ -2163,7 +2176,7 @@ func (a *ProvidersApiService) AutotaskRetrieveSettings(ctx context.Context, uUID key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -2184,82 +2197,83 @@ func (a *ProvidersApiService) AutotaskRetrieveSettings(ctx context.Context, uUID if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v AutotaskSettings - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Update an Autotask ticketing alert's configuration Update an Autotask ticketing alert's configuration @@ -2267,20 +2281,20 @@ Update an Autotask ticketing alert's configuration * @param providerId * @param alertUUID * @param optional nil or *ProvidersApiAutotaskUpdateAlertConfigurationOpts - Optional Parameters: - * @param "Body" (optional.Interface of AutotaskTicketingAlertConfigurationRequest) - + * @param "Body" (optional.Interface of AutotaskTicketingAlertConfigurationRequest) - @return AutotaskTicketingAlertConfiguration */ type ProvidersApiAutotaskUpdateAlertConfigurationOpts struct { - Body optional.Interface + Body optional.Interface } func (a *ProvidersApiService) AutotaskUpdateAlertConfiguration(ctx context.Context, providerId string, alertUUID string, localVarOptionals *ProvidersApiAutotaskUpdateAlertConfigurationOpts) (AutotaskTicketingAlertConfiguration, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue AutotaskTicketingAlertConfiguration ) @@ -2312,8 +2326,8 @@ func (a *ProvidersApiService) AutotaskUpdateAlertConfiguration(ctx context.Conte } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - - localVarOptionalBody:= localVarOptionals.Body.Value() + + localVarOptionalBody := localVarOptionals.Body.Value() localVarPostBody = &localVarOptionalBody } if ctx != nil { @@ -2326,7 +2340,7 @@ func (a *ProvidersApiService) AutotaskUpdateAlertConfiguration(ctx context.Conte key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -2347,102 +2361,103 @@ func (a *ProvidersApiService) AutotaskUpdateAlertConfiguration(ctx context.Conte if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v AutotaskTicketingAlertConfiguration - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Update Autotask Integration configuration Update the Autotask integration configuration. A 422 Unprocessable Entity response means the server failed to validate with Autotask. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uUID * @param optional nil or *ProvidersApiAutotaskUpdateConfigurationOpts - Optional Parameters: - * @param "Body" (optional.Interface of AutotaskIntegrationPatchReq) - + * @param "Body" (optional.Interface of AutotaskIntegrationPatchReq) - @return AutotaskIntegration */ type ProvidersApiAutotaskUpdateConfigurationOpts struct { - Body optional.Interface + Body optional.Interface } func (a *ProvidersApiService) AutotaskUpdateConfiguration(ctx context.Context, uUID string, localVarOptionals *ProvidersApiAutotaskUpdateConfigurationOpts) (AutotaskIntegration, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue AutotaskIntegration ) @@ -2473,8 +2488,8 @@ func (a *ProvidersApiService) AutotaskUpdateConfiguration(ctx context.Context, u } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - - localVarOptionalBody:= localVarOptionals.Body.Value() + + localVarOptionalBody := localVarOptionals.Body.Value() localVarPostBody = &localVarOptionalBody } if ctx != nil { @@ -2487,7 +2502,7 @@ func (a *ProvidersApiService) AutotaskUpdateConfiguration(ctx context.Context, u key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -2508,112 +2523,113 @@ func (a *ProvidersApiService) AutotaskUpdateConfiguration(ctx context.Context, u if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v AutotaskIntegration - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 422 { var v interface{} - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Creates a new ConnectWise integration for the provider Creates a new ConnectWise integration for the provider. You must be associated with the provider to use this route. A 422 Unprocessable Entity response means the server failed to validate with ConnectWise. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param providerId * @param optional nil or *ProvidersApiConnectwiseCreateConfigurationOpts - Optional Parameters: - * @param "Body" (optional.Interface of ConnectwiseIntegrationReq) - + * @param "Body" (optional.Interface of ConnectwiseIntegrationReq) - @return InlineResponse201 */ type ProvidersApiConnectwiseCreateConfigurationOpts struct { - Body optional.Interface + Body optional.Interface } func (a *ProvidersApiService) ConnectwiseCreateConfiguration(ctx context.Context, providerId string, localVarOptionals *ProvidersApiConnectwiseCreateConfigurationOpts) (InlineResponse201, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue InlineResponse201 ) @@ -2644,8 +2660,8 @@ func (a *ProvidersApiService) ConnectwiseCreateConfiguration(ctx context.Context } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - - localVarOptionalBody:= localVarOptionals.Body.Value() + + localVarOptionalBody := localVarOptionals.Body.Value() localVarPostBody = &localVarOptionalBody } if ctx != nil { @@ -2658,7 +2674,7 @@ func (a *ProvidersApiService) ConnectwiseCreateConfiguration(ctx context.Context key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -2679,102 +2695,103 @@ func (a *ProvidersApiService) ConnectwiseCreateConfiguration(ctx context.Context if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 201 { var v InlineResponse201 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 409 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 422 { var v interface{} - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Delete ConnectWise Integration Removes a ConnectWise integration. @@ -2788,7 +2805,6 @@ func (a *ProvidersApiService) ConnectwiseDeleteConfiguration(ctx context.Context localVarPostBody interface{} localVarFileName string localVarFileBytes []byte - ) // create path and map variables @@ -2826,7 +2842,7 @@ func (a *ProvidersApiService) ConnectwiseDeleteConfiguration(ctx context.Context key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -2845,67 +2861,67 @@ func (a *ProvidersApiService) ConnectwiseDeleteConfiguration(ctx context.Context return localVarHttpResponse, err } - if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr } return localVarHttpResponse, newErr } return localVarHttpResponse, nil } + /* ProvidersApiService Retrieve ConnectWise Integration Configuration Retrieves configuration for given ConnectWise integration id. You must be associated to the provider the integration is tied to in order to use this api. @@ -2915,10 +2931,10 @@ Retrieves configuration for given ConnectWise integration id. You must be associ */ func (a *ProvidersApiService) ConnectwiseGetConfiguration(ctx context.Context, uUID string) (ConnectwiseIntegration, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue ConnectwiseIntegration ) @@ -2957,7 +2973,7 @@ func (a *ProvidersApiService) ConnectwiseGetConfiguration(ctx context.Context, u key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -2978,102 +2994,103 @@ func (a *ProvidersApiService) ConnectwiseGetConfiguration(ctx context.Context, u if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v ConnectwiseIntegration - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Create, edit, and/or delete ConnectWise Mappings Create, edit, and/or delete mappings between Jumpcloud organizations and ConnectWise companies/agreements/additions. You must be associated to the same provider as the ConnectWise integration to use this api. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uUID * @param optional nil or *ProvidersApiConnectwisePatchMappingsOpts - Optional Parameters: - * @param "Body" (optional.Interface of ConnectWiseMappingRequest) - + * @param "Body" (optional.Interface of ConnectWiseMappingRequest) - @return ConnectWiseMappingRequest */ type ProvidersApiConnectwisePatchMappingsOpts struct { - Body optional.Interface + Body optional.Interface } func (a *ProvidersApiService) ConnectwisePatchMappings(ctx context.Context, uUID string, localVarOptionals *ProvidersApiConnectwisePatchMappingsOpts) (ConnectWiseMappingRequest, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue ConnectWiseMappingRequest ) @@ -3104,8 +3121,8 @@ func (a *ProvidersApiService) ConnectwisePatchMappings(ctx context.Context, uUID } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - - localVarOptionalBody:= localVarOptionals.Body.Value() + + localVarOptionalBody := localVarOptionals.Body.Value() localVarPostBody = &localVarOptionalBody } if ctx != nil { @@ -3118,7 +3135,7 @@ func (a *ProvidersApiService) ConnectwisePatchMappings(ctx context.Context, uUID key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -3139,102 +3156,103 @@ func (a *ProvidersApiService) ConnectwisePatchMappings(ctx context.Context, uUID if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 204 { var v ConnectWiseMappingRequest - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Create, edit, and/or delete ConnectWise Integration settings Create, edit, and/or delete ConnectWiseIntegration settings. You must be associated to the same provider as the ConnectWise integration to use this endpoint. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uUID * @param optional nil or *ProvidersApiConnectwisePatchSettingsOpts - Optional Parameters: - * @param "Body" (optional.Interface of ConnectWiseSettingsPatchReq) - + * @param "Body" (optional.Interface of ConnectWiseSettingsPatchReq) - @return ConnectWiseSettings */ type ProvidersApiConnectwisePatchSettingsOpts struct { - Body optional.Interface + Body optional.Interface } func (a *ProvidersApiService) ConnectwisePatchSettings(ctx context.Context, uUID string, localVarOptionals *ProvidersApiConnectwisePatchSettingsOpts) (ConnectWiseSettings, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue ConnectWiseSettings ) @@ -3265,8 +3283,8 @@ func (a *ProvidersApiService) ConnectwisePatchSettings(ctx context.Context, uUID } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - - localVarOptionalBody:= localVarOptionals.Body.Value() + + localVarOptionalBody := localVarOptionals.Body.Value() localVarPostBody = &localVarOptionalBody } if ctx != nil { @@ -3279,7 +3297,7 @@ func (a *ProvidersApiService) ConnectwisePatchSettings(ctx context.Context, uUID key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -3300,82 +3318,83 @@ func (a *ProvidersApiService) ConnectwisePatchSettings(ctx context.Context, uUID if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v ConnectWiseSettings - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Retrieve ConnectWise Additions Retrieves a list of ConnectWise additions for the given ConnectWise id and Agreement id. You must be associated to the same provider as the ConnectWise integration to use this endpoint. @@ -3383,28 +3402,28 @@ Retrieves a list of ConnectWise additions for the given ConnectWise id and Agree * @param uUID * @param agreementID * @param optional nil or *ProvidersApiConnectwiseRetrieveAdditionsOpts - Optional Parameters: - * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. * @param "Skip" (optional.Int32) - The offset into the records to return. - * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. @return InlineResponse2008 */ type ProvidersApiConnectwiseRetrieveAdditionsOpts struct { - Fields optional.Interface - Filter optional.Interface - Limit optional.Int32 - Skip optional.Int32 - Sort optional.Interface + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface } func (a *ProvidersApiService) ConnectwiseRetrieveAdditions(ctx context.Context, uUID string, agreementID string, localVarOptionals *ProvidersApiConnectwiseRetrieveAdditionsOpts) (InlineResponse2008, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue InlineResponse2008 ) @@ -3459,7 +3478,7 @@ func (a *ProvidersApiService) ConnectwiseRetrieveAdditions(ctx context.Context, key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -3480,110 +3499,111 @@ func (a *ProvidersApiService) ConnectwiseRetrieveAdditions(ctx context.Context, if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v InlineResponse2008 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Retrieve ConnectWise Agreements Retrieves a list of ConnectWise agreements for the given ConnectWise id. You must be associated to the same provider as the ConnectWise integration to use this endpoint. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uUID * @param optional nil or *ProvidersApiConnectwiseRetrieveAgreementsOpts - Optional Parameters: - * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. * @param "Skip" (optional.Int32) - The offset into the records to return. - * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. @return InlineResponse2007 */ type ProvidersApiConnectwiseRetrieveAgreementsOpts struct { - Fields optional.Interface - Filter optional.Interface - Limit optional.Int32 - Skip optional.Int32 - Sort optional.Interface + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface } func (a *ProvidersApiService) ConnectwiseRetrieveAgreements(ctx context.Context, uUID string, localVarOptionals *ProvidersApiConnectwiseRetrieveAgreementsOpts) (InlineResponse2007, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue InlineResponse2007 ) @@ -3637,7 +3657,7 @@ func (a *ProvidersApiService) ConnectwiseRetrieveAgreements(ctx context.Context, key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -3658,82 +3678,83 @@ func (a *ProvidersApiService) ConnectwiseRetrieveAgreements(ctx context.Context, if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v InlineResponse2007 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Get all ConnectWise ticketing alert configuration options for a provider Get all ConnectWise ticketing alert configuration options for a provider. @@ -3743,10 +3764,10 @@ Get all ConnectWise ticketing alert configuration options for a provider. */ func (a *ProvidersApiService) ConnectwiseRetrieveAllAlertConfigurationOptions(ctx context.Context, providerId string) (ConnectWiseTicketingAlertConfigurationOptions, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue ConnectWiseTicketingAlertConfigurationOptions ) @@ -3785,7 +3806,7 @@ func (a *ProvidersApiService) ConnectwiseRetrieveAllAlertConfigurationOptions(ct key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -3806,82 +3827,83 @@ func (a *ProvidersApiService) ConnectwiseRetrieveAllAlertConfigurationOptions(ct if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v ConnectWiseTicketingAlertConfigurationOptions - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Get all ConnectWise ticketing alert configurations for a provider Get all ConnectWise ticketing alert configurations for a provider. @@ -3891,10 +3913,10 @@ Get all ConnectWise ticketing alert configurations for a provider. */ func (a *ProvidersApiService) ConnectwiseRetrieveAllAlertConfigurations(ctx context.Context, providerId string) (ConnectWiseTicketingAlertConfigurationList, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue ConnectWiseTicketingAlertConfigurationList ) @@ -3933,7 +3955,7 @@ func (a *ProvidersApiService) ConnectwiseRetrieveAllAlertConfigurations(ctx cont key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -3954,110 +3976,111 @@ func (a *ProvidersApiService) ConnectwiseRetrieveAllAlertConfigurations(ctx cont if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v ConnectWiseTicketingAlertConfigurationList - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Retrieve ConnectWise Companies Retrieves a list of ConnectWise companies for the given ConnectWise id. You must be associated to the same provider as the ConnectWise integration to use this endpoint. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uUID * @param optional nil or *ProvidersApiConnectwiseRetrieveCompaniesOpts - Optional Parameters: - * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. * @param "Skip" (optional.Int32) - The offset into the records to return. - * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. @return ConnectwiseCompanyResp */ type ProvidersApiConnectwiseRetrieveCompaniesOpts struct { - Fields optional.Interface - Filter optional.Interface - Limit optional.Int32 - Skip optional.Int32 - Sort optional.Interface + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface } func (a *ProvidersApiService) ConnectwiseRetrieveCompanies(ctx context.Context, uUID string, localVarOptionals *ProvidersApiConnectwiseRetrieveCompaniesOpts) (ConnectwiseCompanyResp, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue ConnectwiseCompanyResp ) @@ -4111,7 +4134,7 @@ func (a *ProvidersApiService) ConnectwiseRetrieveCompanies(ctx context.Context, key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -4132,82 +4155,83 @@ func (a *ProvidersApiService) ConnectwiseRetrieveCompanies(ctx context.Context, if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v ConnectwiseCompanyResp - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Retrieve ConnectWise Company Types Retrieves a list of user defined company types from ConnectWise for the given ConnectWise id. @@ -4217,10 +4241,10 @@ Retrieves a list of user defined company types from ConnectWise for the given Co */ func (a *ProvidersApiService) ConnectwiseRetrieveCompanyTypes(ctx context.Context, uUID string) (ConnectwiseCompanyTypeResp, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue ConnectwiseCompanyTypeResp ) @@ -4259,7 +4283,7 @@ func (a *ProvidersApiService) ConnectwiseRetrieveCompanyTypes(ctx context.Contex key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -4280,110 +4304,111 @@ func (a *ProvidersApiService) ConnectwiseRetrieveCompanyTypes(ctx context.Contex if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v ConnectwiseCompanyTypeResp - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Retrieve ConnectWise mappings Retrieves the list of mappings for this ConnectWise integration. You must be associated to the same provider as the ConnectWise integration to use this api. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uUID * @param optional nil or *ProvidersApiConnectwiseRetrieveMappingsOpts - Optional Parameters: - * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. * @param "Skip" (optional.Int32) - The offset into the records to return. - * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. @return InlineResponse2009 */ type ProvidersApiConnectwiseRetrieveMappingsOpts struct { - Fields optional.Interface - Filter optional.Interface - Limit optional.Int32 - Skip optional.Int32 - Sort optional.Interface + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface } func (a *ProvidersApiService) ConnectwiseRetrieveMappings(ctx context.Context, uUID string, localVarOptionals *ProvidersApiConnectwiseRetrieveMappingsOpts) (InlineResponse2009, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue InlineResponse2009 ) @@ -4437,7 +4462,7 @@ func (a *ProvidersApiService) ConnectwiseRetrieveMappings(ctx context.Context, u key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -4458,82 +4483,83 @@ func (a *ProvidersApiService) ConnectwiseRetrieveMappings(ctx context.Context, u if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v InlineResponse2009 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Retrieve ConnectWise Integration settings Retrieve the ConnectWise integration settings. You must be associated to the same provider as the ConnectWise integration to use this endpoint. @@ -4543,10 +4569,10 @@ Retrieve the ConnectWise integration settings. You must be associated to the sam */ func (a *ProvidersApiService) ConnectwiseRetrieveSettings(ctx context.Context, uUID string) (ConnectWiseSettings, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue ConnectWiseSettings ) @@ -4585,7 +4611,7 @@ func (a *ProvidersApiService) ConnectwiseRetrieveSettings(ctx context.Context, u key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -4606,82 +4632,83 @@ func (a *ProvidersApiService) ConnectwiseRetrieveSettings(ctx context.Context, u if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v ConnectWiseSettings - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Update a ConnectWise ticketing alert's configuration Update a ConnectWise ticketing alert's configuration. @@ -4689,20 +4716,20 @@ Update a ConnectWise ticketing alert's configuration. * @param providerId * @param alertUUID * @param optional nil or *ProvidersApiConnectwiseUpdateAlertConfigurationOpts - Optional Parameters: - * @param "Body" (optional.Interface of ConnectWiseTicketingAlertConfigurationRequest) - + * @param "Body" (optional.Interface of ConnectWiseTicketingAlertConfigurationRequest) - @return ConnectWiseTicketingAlertConfiguration */ type ProvidersApiConnectwiseUpdateAlertConfigurationOpts struct { - Body optional.Interface + Body optional.Interface } func (a *ProvidersApiService) ConnectwiseUpdateAlertConfiguration(ctx context.Context, providerId string, alertUUID string, localVarOptionals *ProvidersApiConnectwiseUpdateAlertConfigurationOpts) (ConnectWiseTicketingAlertConfiguration, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue ConnectWiseTicketingAlertConfiguration ) @@ -4734,8 +4761,8 @@ func (a *ProvidersApiService) ConnectwiseUpdateAlertConfiguration(ctx context.Co } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - - localVarOptionalBody:= localVarOptionals.Body.Value() + + localVarOptionalBody := localVarOptionals.Body.Value() localVarPostBody = &localVarOptionalBody } if ctx != nil { @@ -4748,7 +4775,7 @@ func (a *ProvidersApiService) ConnectwiseUpdateAlertConfiguration(ctx context.Co key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -4769,102 +4796,103 @@ func (a *ProvidersApiService) ConnectwiseUpdateAlertConfiguration(ctx context.Co if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v ConnectWiseTicketingAlertConfiguration - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Update ConnectWise Integration configuration Update the ConnectWise integration configuration. A 422 Unprocessable Entity response means the server failed to validate with ConnectWise. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uUID * @param optional nil or *ProvidersApiConnectwiseUpdateConfigurationOpts - Optional Parameters: - * @param "Body" (optional.Interface of ConnectwiseIntegrationPatchReq) - + * @param "Body" (optional.Interface of ConnectwiseIntegrationPatchReq) - @return ConnectwiseIntegration */ type ProvidersApiConnectwiseUpdateConfigurationOpts struct { - Body optional.Interface + Body optional.Interface } func (a *ProvidersApiService) ConnectwiseUpdateConfiguration(ctx context.Context, uUID string, localVarOptionals *ProvidersApiConnectwiseUpdateConfigurationOpts) (ConnectwiseIntegration, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue ConnectwiseIntegration ) @@ -4895,8 +4923,8 @@ func (a *ProvidersApiService) ConnectwiseUpdateConfiguration(ctx context.Context } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - - localVarOptionalBody:= localVarOptionals.Body.Value() + + localVarOptionalBody := localVarOptionals.Body.Value() localVarPostBody = &localVarOptionalBody } if ctx != nil { @@ -4909,7 +4937,7 @@ func (a *ProvidersApiService) ConnectwiseUpdateConfiguration(ctx context.Context key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -4930,92 +4958,93 @@ func (a *ProvidersApiService) ConnectwiseUpdateConfiguration(ctx context.Context if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v ConnectwiseIntegration - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 422 { var v interface{} - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Get all ticketing alerts available for a provider's ticketing integration. Get all ticketing alerts available for a provider's ticketing integration. @@ -5025,10 +5054,10 @@ Get all ticketing alerts available for a provider's ticketing integration. */ func (a *ProvidersApiService) MtpIntegrationRetrieveAlerts(ctx context.Context, providerId string) (TicketingIntegrationAlertsResp, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue TicketingIntegrationAlertsResp ) @@ -5067,7 +5096,7 @@ func (a *ProvidersApiService) MtpIntegrationRetrieveAlerts(ctx context.Context, key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -5088,82 +5117,83 @@ func (a *ProvidersApiService) MtpIntegrationRetrieveAlerts(ctx context.Context, if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v TicketingIntegrationAlertsResp - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Retrieve Recent Integration Sync Errors Retrieves recent sync errors for given integration type and integration id. You must be associated to the provider the integration is tied to in order to use this api. @@ -5174,10 +5204,10 @@ Retrieves recent sync errors for given integration type and integration id. You */ func (a *ProvidersApiService) MtpIntegrationRetrieveSyncErrors(ctx context.Context, uUID string, integrationType string) (IntegrationSyncErrorResp, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue IntegrationSyncErrorResp ) @@ -5217,7 +5247,7 @@ func (a *ProvidersApiService) MtpIntegrationRetrieveSyncErrors(ctx context.Conte key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -5238,82 +5268,83 @@ func (a *ProvidersApiService) MtpIntegrationRetrieveSyncErrors(ctx context.Conte if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v IntegrationSyncErrorResp - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Update Provider Organization This endpoint updates a provider's organization @@ -5321,20 +5352,20 @@ This endpoint updates a provider's organization * @param providerId * @param id * @param optional nil or *ProvidersApiProviderOrganizationsUpdateOrgOpts - Optional Parameters: - * @param "Body" (optional.Interface of Organization) - + * @param "Body" (optional.Interface of Organization) - @return Organization */ type ProvidersApiProviderOrganizationsUpdateOrgOpts struct { - Body optional.Interface + Body optional.Interface } func (a *ProvidersApiService) ProviderOrganizationsUpdateOrg(ctx context.Context, providerId string, id string, localVarOptionals *ProvidersApiProviderOrganizationsUpdateOrgOpts) (Organization, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue Organization ) @@ -5366,8 +5397,8 @@ func (a *ProvidersApiService) ProviderOrganizationsUpdateOrg(ctx context.Context } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - - localVarOptionalBody:= localVarOptionals.Body.Value() + + localVarOptionalBody := localVarOptionals.Body.Value() localVarPostBody = &localVarOptionalBody } if ctx != nil { @@ -5380,7 +5411,7 @@ func (a *ProvidersApiService) ProviderOrganizationsUpdateOrg(ctx context.Context key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -5401,52 +5432,53 @@ func (a *ProvidersApiService) ProviderOrganizationsUpdateOrg(ctx context.Context if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v Organization - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Retrieve Provider This endpoint returns details about a provider * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param providerId * @param optional nil or *ProvidersApiProvidersGetProviderOpts - Optional Parameters: - * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. @return Provider */ type ProvidersApiProvidersGetProviderOpts struct { - Fields optional.Interface + Fields optional.Interface } func (a *ProvidersApiService) ProvidersGetProvider(ctx context.Context, providerId string, localVarOptionals *ProvidersApiProvidersGetProviderOpts) (Provider, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue Provider ) @@ -5488,7 +5520,7 @@ func (a *ProvidersApiService) ProvidersGetProvider(ctx context.Context, provider key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -5509,110 +5541,111 @@ func (a *ProvidersApiService) ProvidersGetProvider(ctx context.Context, provider if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v Provider - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService List Provider Administrators This endpoint returns a list of the Administrators associated with the Provider. You must be associated with the provider to use this route. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param providerId * @param optional nil or *ProvidersApiProvidersListAdministratorsOpts - Optional Parameters: - * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. * @param "Skip" (optional.Int32) - The offset into the records to return. - * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. @return InlineResponse20012 */ type ProvidersApiProvidersListAdministratorsOpts struct { - Fields optional.Interface - Filter optional.Interface - Limit optional.Int32 - Skip optional.Int32 - Sort optional.Interface + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface } func (a *ProvidersApiService) ProvidersListAdministrators(ctx context.Context, providerId string, localVarOptionals *ProvidersApiProvidersListAdministratorsOpts) (InlineResponse20012, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue InlineResponse20012 ) @@ -5666,7 +5699,7 @@ func (a *ProvidersApiService) ProvidersListAdministrators(ctx context.Context, p key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -5687,70 +5720,71 @@ func (a *ProvidersApiService) ProvidersListAdministrators(ctx context.Context, p if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v InlineResponse20012 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v InlineResponse400 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService List Provider Organizations This endpoint returns a list of the Organizations associated with the Provider. You must be associated with the provider to use this route. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param providerId * @param optional nil or *ProvidersApiProvidersListOrganizationsOpts - Optional Parameters: - * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. * @param "Skip" (optional.Int32) - The offset into the records to return. - * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. @return InlineResponse20013 */ type ProvidersApiProvidersListOrganizationsOpts struct { - Fields optional.Interface - Filter optional.Interface - Limit optional.Int32 - Skip optional.Int32 - Sort optional.Interface + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface } func (a *ProvidersApiService) ProvidersListOrganizations(ctx context.Context, providerId string, localVarOptionals *ProvidersApiProvidersListOrganizationsOpts) (InlineResponse20013, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue InlineResponse20013 ) @@ -5804,7 +5838,7 @@ func (a *ProvidersApiService) ProvidersListOrganizations(ctx context.Context, pr key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -5825,102 +5859,103 @@ func (a *ProvidersApiService) ProvidersListOrganizations(ctx context.Context, pr if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v InlineResponse20013 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Create a new Provider Administrator This endpoint allows you to create a provider administrator. You must be associated with the provider to use this route. You must provide either `role` or `roleName`. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param providerId * @param optional nil or *ProvidersApiProvidersPostAdminsOpts - Optional Parameters: - * @param "Body" (optional.Interface of ProviderAdminReq) - + * @param "Body" (optional.Interface of ProviderAdminReq) - @return Administrator */ type ProvidersApiProvidersPostAdminsOpts struct { - Body optional.Interface + Body optional.Interface } func (a *ProvidersApiService) ProvidersPostAdmins(ctx context.Context, providerId string, localVarOptionals *ProvidersApiProvidersPostAdminsOpts) (Administrator, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue Administrator ) @@ -5951,8 +5986,8 @@ func (a *ProvidersApiService) ProvidersPostAdmins(ctx context.Context, providerI } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - - localVarOptionalBody:= localVarOptionals.Body.Value() + + localVarOptionalBody := localVarOptionals.Body.Value() localVarPostBody = &localVarOptionalBody } if ctx != nil { @@ -5965,7 +6000,7 @@ func (a *ProvidersApiService) ProvidersPostAdmins(ctx context.Context, providerI key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -5986,42 +6021,43 @@ func (a *ProvidersApiService) ProvidersPostAdmins(ctx context.Context, providerI if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v Administrator - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v InlineResponse400 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Delete Provider Administrator This endpoint removes an Administrator associated with the Provider. You must be associated with the provider to use this route. @@ -6036,7 +6072,6 @@ func (a *ProvidersApiService) ProvidersRemoveAdministrator(ctx context.Context, localVarPostBody interface{} localVarFileName string localVarFileBytes []byte - ) // create path and map variables @@ -6075,7 +6110,7 @@ func (a *ProvidersApiService) ProvidersRemoveAdministrator(ctx context.Context, key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -6094,67 +6129,67 @@ func (a *ProvidersApiService) ProvidersRemoveAdministrator(ctx context.Context, return localVarHttpResponse, err } - if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr } return localVarHttpResponse, newErr } return localVarHttpResponse, nil } + /* ProvidersApiService Retrieve Integrations for Provider Retrieves a list of integrations this provider has configured. You must be associated to the provider to use this endpoint. @@ -6164,23 +6199,23 @@ Retrieves a list of integrations this provider has configured. You must be assoc * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. * @param "Skip" (optional.Int32) - The offset into the records to return. - * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. @return IntegrationsResponse */ type ProvidersApiProvidersRetrieveIntegrationsOpts struct { - Filter optional.Interface - Limit optional.Int32 - Skip optional.Int32 - Sort optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface } func (a *ProvidersApiService) ProvidersRetrieveIntegrations(ctx context.Context, providerId string, localVarOptionals *ProvidersApiProvidersRetrieveIntegrationsOpts) (IntegrationsResponse, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue IntegrationsResponse ) @@ -6231,7 +6266,7 @@ func (a *ProvidersApiService) ProvidersRetrieveIntegrations(ctx context.Context, key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -6252,82 +6287,83 @@ func (a *ProvidersApiService) ProvidersRetrieveIntegrations(ctx context.Context, if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v IntegrationsResponse - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService Download a provider's invoice. Retrieves an invoice for this provider. You must be associated to the provider to use this endpoint. @@ -6338,10 +6374,10 @@ Retrieves an invoice for this provider. You must be associated to the provider t */ func (a *ProvidersApiService) ProvidersRetrieveInvoice(ctx context.Context, providerId string, iD string) (*os.File, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue *os.File ) @@ -6381,7 +6417,7 @@ func (a *ProvidersApiService) ProvidersRetrieveInvoice(ctx context.Context, prov key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -6402,82 +6438,83 @@ func (a *ProvidersApiService) ProvidersRetrieveInvoice(ctx context.Context, prov if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v *os.File - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ProvidersApiService List a provider's invoices. Retrieves a list of invoices for this provider. You must be associated to the provider to use this endpoint. @@ -6485,23 +6522,23 @@ Retrieves a list of invoices for this provider. You must be associated to the pr * @param providerId * @param optional nil or *ProvidersApiProvidersRetrieveInvoicesOpts - Optional Parameters: * @param "Skip" (optional.Int32) - The offset into the records to return. - * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. @return ProviderInvoiceResponse */ type ProvidersApiProvidersRetrieveInvoicesOpts struct { - Skip optional.Int32 - Sort optional.Interface - Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + Limit optional.Int32 } func (a *ProvidersApiService) ProvidersRetrieveInvoices(ctx context.Context, providerId string, localVarOptionals *ProvidersApiProvidersRetrieveInvoicesOpts) (ProviderInvoiceResponse, *http.Response, error) { var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte localVarReturnValue ProviderInvoiceResponse ) @@ -6549,7 +6586,7 @@ func (a *ProvidersApiService) ProvidersRetrieveInvoices(ctx context.Context, pro key = auth.Key } localVarHeaderParams["x-api-key"] = key - + } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -6570,76 +6607,76 @@ func (a *ProvidersApiService) ProvidersRetrieveInvoices(ctx context.Context, pro if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v ProviderInvoiceResponse - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v ErrorDetails - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 401 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } diff --git a/jcapiv2/go.mod b/jcapiv2/go.mod new file mode 100644 index 0000000..7406cfd --- /dev/null +++ b/jcapiv2/go.mod @@ -0,0 +1,15 @@ +module github.com/TheJumpCloud/jcapi-go/jcapiv2 + +go 1.18 + +require ( + github.com/antihax/optional v1.0.0 + golang.org/x/oauth2 v0.1.0 +) + +require ( + github.com/golang/protobuf v1.5.2 // indirect + golang.org/x/net v0.1.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/protobuf v1.28.0 // indirect +) diff --git a/jcapiv2/go.sum b/jcapiv2/go.sum new file mode 100644 index 0000000..fc7e35a --- /dev/null +++ b/jcapiv2/go.sum @@ -0,0 +1,25 @@ +github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +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/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +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/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +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/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.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=