diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..daf913b --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f5cb2ce --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/api/openapi.yaml b/api/openapi.yaml new file mode 100644 index 0000000..a126bc7 --- /dev/null +++ b/api/openapi.yaml @@ -0,0 +1,1582 @@ +openapi: 3.0.3 +info: + description: "With IONOS Cloud Database as a Service, you have the ability to quickly\ + \ set up and manage a MongoDB database. You can also delete clusters, manage backups\ + \ and users via the API. \n\nMongoDB is an open source, cross-platform, document-oriented\ + \ database program. Classified as a NoSQL database program, it uses JSON-like\ + \ documents with optional schemas.\n\nThe MongoDB API allows you to create additional\ + \ database clusters or modify existing ones. Both tools, the Data Center Designer\ + \ (DCD) and the API use the same concepts consistently and are well suited for\ + \ smooth and intuitive use.\n" + title: IONOS DBaaS MongoDB REST API + version: 0.1.0 +servers: +- description: Production + url: https://api.ionos.com/databases/mongodb +security: +- basicAuth: [] +- tokenAuth: [] +tags: +- description: A cluster in this context describes a grouping of multiple MongoDB + instances into a replica set. **Note** that we do not yet support sharded clusters. + name: Clusters +- description: Metadata about the API, such as versions. + name: Metadata +paths: + /clusters: + get: + description: Retrieves a list of MongoDB clusters. + operationId: clustersGet + parameters: + - description: | + Response filter to list only the MongoDB clusters that contain + the specified name. The value is case insensitive and matched on the + 'displayName' field. + explode: true + in: query + name: filter.name + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ClusterList' + description: Successful operation. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: | + Any erroneous status code: 400 (parse error), 401 (auth error), + 402 (trial access), 403 (insufficient permissions), 404 (not found), + 405 (unsupported HTTP method), 415 (unsupported content type), + 422 (validation error), 429 (request rate limit exceeded), + 500 (server error), 503 (maintenance) + headers: + Content-Type: + description: The content type of the response. + explode: false + schema: + default: application/problem+json + type: string + style: simple + security: + - basicAuth: [] + - tokenAuth: [] + summary: Get Clusters + tags: + - Clusters + post: + description: | + Creates a new MongoDB cluster. + operationId: clustersPost + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateClusterRequest' + description: The cluster to be created. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ClusterResponse' + description: | + The created cluster is returned and is automatically set to `state = BUSY`. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: | + Any erroneous status code: 400 (parse error), 401 (auth error), + 402 (trial access), 403 (insufficient permissions), 404 (not found), + 405 (unsupported HTTP method), 415 (unsupported content type), + 422 (validation error), 429 (request rate limit exceeded), + 500 (server error), 503 (maintenance) + headers: + Content-Type: + description: The content type of the response. + explode: false + schema: + default: application/problem+json + type: string + style: simple + security: + - basicAuth: [] + - tokenAuth: [] + summary: Create a Cluster + tags: + - Clusters + /clusters/{clusterId}: + delete: + description: Deletes a MongoDB cluster. + operationId: clustersDelete + parameters: + - description: The unique ID of the cluster. + explode: false + in: path + name: clusterId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ClusterResponse' + description: | + The cluster to be deleted is automatically set to `state = DESTROYING`. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: | + Any erroneous status code: 400 (parse error), 401 (auth error), + 402 (trial access), 403 (insufficient permissions), 404 (not found), + 405 (unsupported HTTP method), 415 (unsupported content type), + 422 (validation error), 429 (request rate limit exceeded), + 500 (server error), 503 (maintenance) + headers: + Content-Type: + description: The content type of the response. + explode: false + schema: + default: application/problem+json + type: string + style: simple + security: + - basicAuth: [] + - tokenAuth: [] + summary: Delete a Cluster + tags: + - Clusters + get: + description: Get a cluster by id. + operationId: clustersFindById + parameters: + - description: The unique ID of the cluster. + explode: false + in: path + name: clusterId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ClusterResponse' + description: Successful operation. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: | + Any erroneous status code: 400 (parse error), 401 (auth error), + 402 (trial access), 403 (insufficient permissions), 404 (not found), + 405 (unsupported HTTP method), 415 (unsupported content type), + 422 (validation error), 429 (request rate limit exceeded), + 500 (server error), 503 (maintenance) + headers: + Content-Type: + description: The content type of the response. + explode: false + schema: + default: application/problem+json + type: string + style: simple + security: + - basicAuth: [] + - tokenAuth: [] + summary: Get a cluster by id + tags: + - Clusters + /clusters/{clusterId}/users: + get: + description: Retrieves a list of MongoDB users. + operationId: clustersUsersGet + parameters: + - description: The unique ID of the cluster. + explode: false + in: path + name: clusterId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UsersList' + description: Successful operation. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: | + Any erroneous status code: 400 (parse error), 401 (auth error), + 402 (trial access), 403 (insufficient permissions), 404 (not found), + 405 (unsupported HTTP method), 415 (unsupported content type), + 422 (validation error), 429 (request rate limit exceeded), + 500 (server error), 503 (maintenance) + headers: + Content-Type: + description: The content type of the response. + explode: false + schema: + default: application/problem+json + type: string + style: simple + security: + - basicAuth: [] + - tokenAuth: [] + summary: Get a Cluster Users + tags: + - Users + post: + description: | + Creates a MongoDB user. + operationId: clustersUsersPost + parameters: + - description: The unique ID of the cluster. + explode: false + in: path + name: clusterId + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: The user to be created. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: | + The created user is returned with metadata indicating when the user was created and by whom. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: | + Any erroneous status code: 400 (parse error), 401 (auth error), + 402 (trial access), 403 (insufficient permissions), 404 (not found), + 405 (unsupported HTTP method), 415 (unsupported content type), + 422 (validation error), 429 (request rate limit exceeded), + 500 (server error), 503 (maintenance) + headers: + Content-Type: + description: The content type of the response. + explode: false + schema: + default: application/problem+json + type: string + style: simple + security: + - basicAuth: [] + - tokenAuth: [] + summary: Create MongoDB User + tags: + - Users + /clusters/{clusterId}/users/{database}/{username}: + delete: + description: Deletes a MongoDB user specified by its ID. + operationId: clustersUsersDelete + parameters: + - description: The unique ID of the cluster. + explode: false + in: path + name: clusterId + required: true + schema: + type: string + style: simple + - description: The authentication database. + explode: false + in: path + name: database + required: true + schema: + type: string + style: simple + - description: The authentication username. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: | + The user identified by the username and database parameters will be deleted from the cluster. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: | + Any erroneous status code: 400 (parse error), 401 (auth error), + 402 (trial access), 403 (insufficient permissions), 404 (not found), + 405 (unsupported HTTP method), 415 (unsupported content type), + 422 (validation error), 429 (request rate limit exceeded), + 500 (server error), 503 (maintenance) + headers: + Content-Type: + description: The content type of the response. + explode: false + schema: + default: application/problem+json + type: string + style: simple + security: + - basicAuth: [] + - tokenAuth: [] + summary: Delete a MongoDB User by ID + tags: + - Users + get: + description: Retrieves the MongoDB user identified by the username and database + parameters. + operationId: clustersUsersFindById + parameters: + - description: The unique ID of the cluster. + explode: false + in: path + name: clusterId + required: true + schema: + type: string + style: simple + - description: The authentication database. + explode: false + in: path + name: database + required: true + schema: + type: string + style: simple + - description: The authentication username. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: | + The user identified by the username and database parameters is returned. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: | + Any erroneous status code: 400 (parse error), 401 (auth error), + 402 (trial access), 403 (insufficient permissions), 404 (not found), + 405 (unsupported HTTP method), 415 (unsupported content type), + 422 (validation error), 429 (request rate limit exceeded), + 500 (server error), 503 (maintenance) + headers: + Content-Type: + description: The content type of the response. + explode: false + schema: + default: application/problem+json + type: string + style: simple + security: + - basicAuth: [] + - tokenAuth: [] + summary: Get a MongoDB User by ID + tags: + - Users + /clusters/{clusterId}/logs: + get: + description: Retrieves MongoDB logs based on the given parameters. + operationId: clustersLogsGet + parameters: + - description: The unique ID of the cluster. + explode: false + in: path + name: clusterId + required: true + schema: + type: string + style: simple + - description: The start time for the query in RFC3339 format. Must not be more + than 30 days ago but before the end parameter. The default is 30 days ago. + explode: true + in: query + name: start + required: false + schema: + format: date-time + type: string + style: form + - description: The end time for the query in RFC3339 format. Must not be greater + than now. The default is the current timestamp. + explode: true + in: query + name: end + required: false + schema: + format: date-time + type: string + style: form + - description: The direction in which to scan through the logs. The logs are + returned in order of the direction. + explode: true + in: query + name: direction + required: false + schema: + default: BACKWARD + enum: + - BACKWARD + - FORWARD + type: string + style: form + - description: The maximal number of log lines to return. If the limit is reached + then log lines will be cut at the end (respecting the scan direction). + explode: true + in: query + name: limit + required: false + schema: + default: 100 + maximum: 5000 + minimum: 1 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ClusterLogs' + description: Successful operation. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: | + Any erroneous status code: 400 (parse error), 401 (auth error), + 402 (trial access), 403 (insufficient permissions), 404 (not found), + 405 (unsupported HTTP method), 415 (unsupported content type), + 422 (validation error), 429 (request rate limit exceeded), + 500 (server error), 503 (maintenance) + headers: + Content-Type: + description: The content type of the response. + explode: false + schema: + default: application/problem+json + type: string + style: simple + security: + - basicAuth: [] + - tokenAuth: [] + summary: Get logs of your cluster + tags: + - Logs + /clusters/{clusterId}/snapshots: + get: + description: Retrieves MongoDB snapshots. + operationId: clustersSnapshotsGet + parameters: + - description: The unique ID of the cluster. + explode: false + in: path + name: clusterId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SnapshotList' + description: Successful operation. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: | + Any erroneous status code: 400 (parse error), 401 (auth error), + 402 (trial access), 403 (insufficient permissions), 404 (not found), + 405 (unsupported HTTP method), 415 (unsupported content type), + 422 (validation error), 429 (request rate limit exceeded), + 500 (server error), 503 (maintenance) + headers: + Content-Type: + description: The content type of the response. + explode: false + schema: + default: application/problem+json + type: string + style: simple + security: + - basicAuth: [] + - tokenAuth: [] + summary: Get the snapshots of your cluster + tags: + - Snapshots + /clusters/{clusterId}/restore: + post: + description: Triggers an in-place restore of the given MongoDB cluster. + operationId: clustersRestorePost + parameters: + - description: The unique ID of the cluster. + explode: false + in: path + name: clusterId + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateRestoreRequest' + description: The restore request to create. + required: true + responses: + "202": + description: Successful operation. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: | + Any erroneous status code: 400 (parse error), 401 (auth error), + 402 (trial access), 403 (insufficient permissions), 404 (not found), + 405 (unsupported HTTP method), 415 (unsupported content type), + 422 (validation error), 429 (request rate limit exceeded), + 500 (server error), 503 (maintenance) + headers: + Content-Type: + description: The content type of the response. + explode: false + schema: + default: application/problem+json + type: string + style: simple + security: + - basicAuth: [] + - tokenAuth: [] + summary: In-place restore of a cluster + tags: + - Restores + /templates: + get: + description: | + Retrieves a list of valid templates. These templates can be used to create MongoDB clusters; they contain properties, such as number of cores, RAM, and the storage size. + operationId: templatesGet + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateList' + description: Successful operation. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: | + Any erroneous status code: 400 (parse error), 401 (auth error), + 402 (trial access), 403 (insufficient permissions), 404 (not found), + 405 (unsupported HTTP method), 415 (unsupported content type), + 422 (validation error), 429 (request rate limit exceeded), + 500 (server error), 503 (maintenance) + headers: + Content-Type: + description: The content type of the response. + explode: false + schema: + default: application/problem+json + type: string + style: simple + security: + - basicAuth: [] + - tokenAuth: [] + summary: Get Templates + tags: + - Templates + /infos/version: + get: + description: Retrieves the current version of the responding API. + operationId: infosVersionGet + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIVersion' + description: Successful operation. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: | + Any erroneous status code: 400 (parse error), 401 (auth error), + 402 (trial access), 403 (insufficient permissions), 404 (not found), + 405 (unsupported HTTP method), 415 (unsupported content type), + 422 (validation error), 429 (request rate limit exceeded), + 500 (server error), 503 (maintenance) + headers: + Content-Type: + description: The content type of the response. + explode: false + schema: + default: application/problem+json + type: string + style: simple + security: + - basicAuth: [] + - tokenAuth: [] + summary: Get API Version + tags: + - Metadata + /infos/versions: + get: + description: Retrieves all available versions of the responding API. + operationId: infosVersionsGet + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/APIVersion' + type: array + description: Successful operation. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: | + Any erroneous status code: 400 (parse error), 401 (auth error), + 402 (trial access), 403 (insufficient permissions), 404 (not found), + 405 (unsupported HTTP method), 415 (unsupported content type), + 422 (validation error), 429 (request rate limit exceeded), + 500 (server error), 503 (maintenance) + headers: + Content-Type: + description: The content type of the response. + explode: false + schema: + default: application/problem+json + type: string + style: simple + security: + - basicAuth: [] + - tokenAuth: [] + summary: Get All API Versions + tags: + - Metadata +components: + parameters: + ClusterNameQuery: + description: | + Response filter to list only the MongoDB clusters that contain + the specified name. The value is case insensitive and matched on the + 'displayName' field. + explode: true + in: query + name: filter.name + required: false + schema: + type: string + style: form + ClusterIdPath: + description: The unique ID of the cluster. + explode: false + in: path + name: clusterId + required: true + schema: + type: string + style: simple + DatabasePath: + description: The authentication database. + explode: false + in: path + name: database + required: true + schema: + type: string + style: simple + UsernamePath: + description: The authentication username. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + ApiError: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: | + Any erroneous status code: 400 (parse error), 401 (auth error), + 402 (trial access), 403 (insufficient permissions), 404 (not found), + 405 (unsupported HTTP method), 415 (unsupported content type), + 422 (validation error), 429 (request rate limit exceeded), + 500 (server error), 503 (maintenance) + headers: + Content-Type: + description: The content type of the response. + explode: false + schema: + default: application/problem+json + type: string + style: simple + schemas: + ErrorResponse: + properties: + httpStatus: + description: The HTTP status code of the operation. + example: 400 + type: integer + messages: + items: + $ref: '#/components/schemas/ErrorMessage' + type: array + type: object + ErrorMessage: + properties: + errorCode: + description: | + Application internal error code. + example: dbaas-err-api-123 + type: string + message: + description: | + A human readable explanation specific to this occurrence of the + problem. + example: Error message example + type: string + type: object + APIVersion: + example: + name: v2.1 + swaggerUrl: https://api.ionos.com/databases/mongodb/infos/assets/swagger-v2.1.yml + properties: + name: + example: v2.1 + type: string + swaggerUrl: + example: https://api.ionos.com/databases/mongodb/infos/assets/swagger-v2.1.yml + type: string + type: object + UsersList: + description: List of cluster users. + example: + id: 498ae72f-411f-11eb-9d07-046c59cc737e + items: + - metadata: + createdByUserId: 87f9a82e-b28d-49ed-9d04-fba2c0459cd3 + createdDate: 2020-12-10T13:37:50+01:00 + createdBy: john.doe@example.com + state: CREATING + properties: + database: admin + password: password + roles: + - database: database + role: read + - database: database + role: read + username: username + - metadata: + createdByUserId: 87f9a82e-b28d-49ed-9d04-fba2c0459cd3 + createdDate: 2020-12-10T13:37:50+01:00 + createdBy: john.doe@example.com + state: CREATING + properties: + database: admin + password: password + roles: + - database: database + role: read + - database: database + role: read + username: username + properties: + type: + $ref: '#/components/schemas/ResourceType' + id: + description: The unique ID of the resource. + example: 498ae72f-411f-11eb-9d07-046c59cc737e + type: string + items: + items: + $ref: '#/components/schemas/User' + type: array + type: object + UserProperties: + description: Mongodb user properties. + example: + database: admin + password: password + roles: + - database: database + role: read + - database: database + role: read + username: username + properties: + username: + type: string + database: + description: The user database to use for authentication. + example: admin + type: string + password: + type: string + writeOnly: true + roles: + items: + $ref: '#/components/schemas/UserRoles' + type: array + required: + - database + - password + - username + User: + description: MongoDB database user. + example: + metadata: + createdByUserId: 87f9a82e-b28d-49ed-9d04-fba2c0459cd3 + createdDate: 2020-12-10T13:37:50+01:00 + createdBy: john.doe@example.com + state: CREATING + properties: + database: admin + password: password + roles: + - database: database + role: read + - database: database + role: read + username: username + properties: + type: + $ref: '#/components/schemas/ResourceType' + metadata: + $ref: '#/components/schemas/UserMetadata' + properties: + $ref: '#/components/schemas/UserProperties' + type: object + UserRoles: + description: a list of mongodb user role. + example: + database: database + role: read + properties: + role: + enum: + - read + - readWrite + - readAnyDatabase + example: read + type: string + database: + type: string + type: object + SnapshotList: + allOf: + - $ref: '#/components/schemas/SnapshotList_allOf' + - $ref: '#/components/schemas/Pagination' + description: List of snapshots. + type: object + SnapshotResponse: + description: A database snapshost. + properties: + type: + $ref: '#/components/schemas/ResourceType' + id: + description: The unique ID of the resource. + example: 498ae72f-411f-11eb-9d07-046c59cc737e + type: string + properties: + $ref: '#/components/schemas/SnapshotProperties' + type: object + SnapshotProperties: + description: Properties of a snapshot. + properties: + version: + description: The MongoDB version this backup was created from. + example: "5.0" + type: string + size: + description: The size of the snapshot in Mebibytes. + example: 150 + type: integer + creationTime: + description: The date the resource was created. + example: 2020-12-10T13:37:50+01:00 + format: date-time + type: string + type: object + CreateRestoreRequest: + description: The restore request. + example: + snapshotId: dcd31531-3ac8-11eb-9feb-046c59cc737e + properties: + snapshotId: + description: The unique ID of the snapshot you want to restore. + example: dcd31531-3ac8-11eb-9feb-046c59cc737e + type: string + required: + - snapshotId + type: object + ClusterList: + allOf: + - $ref: '#/components/schemas/ClusterList_allOf' + - $ref: '#/components/schemas/Pagination' + description: List of clusters. + type: object + ClusterResponse: + description: A database cluster. + example: + metadata: + createdByUserId: 87f9a82e-b28d-49ed-9d04-fba2c0459cd3 + createdDate: 2020-12-10T13:37:50+01:00 + createdBy: john.doe@example.com + lastModifiedDate: 2020-12-11T13:37:50+01:00 + lastModifiedBy: jane.doe@example.com + state: AVAILABLE + lastModifiedByUserId: 87f9a82e-b28d-49ed-9d04-fba2c0459cd3 + id: 498ae72f-411f-11eb-9d07-046c59cc737e + properties: + maintenanceWindow: + dayOfTheWeek: Monday + time: 16:30:59 + connectionString: mongo+srv://m-498ae72f-411f-11eb-9d07-046c59cc737e.mongodb.de-txl.ionos.com + instances: 3 + displayName: MongoDB cluster + location: de/txl + templateID: 498ae72f-411f-11eb-9d07-046c59cc737e + mongoDBVersion: "5.0" + connections: + - cidrList: + - 192.168.1.100/24 + - 192.168.1.101/24 + datacenterId: 5a029f4a-72e5-11ec-90d6-0242ac120003 + lanId: "2" + properties: + type: + $ref: '#/components/schemas/ResourceType' + id: + description: The unique ID of the resource. + example: 498ae72f-411f-11eb-9d07-046c59cc737e + type: string + metadata: + $ref: '#/components/schemas/Metadata' + properties: + $ref: '#/components/schemas/ClusterProperties' + type: object + ResourceType: + description: The resource type. + enum: + - collection + - cluster + - user + type: string + ResourceId: + description: The unique ID of the resource. + example: 498ae72f-411f-11eb-9d07-046c59cc737e + type: string + ClusterProperties: + description: Properties of a database cluster. + example: + maintenanceWindow: + dayOfTheWeek: Monday + time: 16:30:59 + connectionString: mongo+srv://m-498ae72f-411f-11eb-9d07-046c59cc737e.mongodb.de-txl.ionos.com + instances: 3 + displayName: MongoDB cluster + location: de/txl + templateID: 498ae72f-411f-11eb-9d07-046c59cc737e + mongoDBVersion: "5.0" + connections: + - cidrList: + - 192.168.1.100/24 + - 192.168.1.101/24 + datacenterId: 5a029f4a-72e5-11ec-90d6-0242ac120003 + lanId: "2" + properties: + displayName: + description: The name of your cluster. + example: MongoDB cluster + type: string + mongoDBVersion: + description: The MongoDB version of your cluster. + example: "5.0" + type: string + location: + description: | + The physical location where the cluster will be created. This is the location where all your instances will be located. This property is immutable. + example: de/txl + type: string + x-extensible-enum: + - de/fra + - de/txl + - gb/lhr + - es/vit + instances: + description: | + The total number of instances in the cluster (one primary and n-1 secondaries). + example: 3 + type: integer + x-extensible-enum: + - 3 + - 5 + - 7 + connections: + items: + $ref: '#/components/schemas/Connection' + maxItems: 1 + minItems: 1 + type: array + maintenanceWindow: + $ref: '#/components/schemas/MaintenanceWindow' + templateID: + description: | + The unique ID of the template, which specifies the number of cores, storage size, and memory. + example: 498ae72f-411f-11eb-9d07-046c59cc737e + type: string + connectionString: + description: The connection string for your cluster. + example: mongo+srv://m-498ae72f-411f-11eb-9d07-046c59cc737e.mongodb.de-txl.ionos.com + type: string + type: object + Pagination: + properties: + offset: + description: | + The offset specified in the request (if none was specified, the default + offset is 0) (not implemented yet). + example: 0 + minimum: 0 + readOnly: true + type: integer + limit: + description: | + The limit specified in the request (if none was specified, use the + endpoint's default pagination limit) (not implemented yet, always return + number of items). + example: 42 + minimum: 0 + readOnly: true + type: integer + _links: + $ref: '#/components/schemas/PaginationLinks' + type: object + PaginationOffset: + description: | + The offset specified in the request (if none was specified, the default + offset is 0) (not implemented yet). + example: 0 + minimum: 0 + readOnly: true + type: integer + PaginationLimit: + description: | + The limit specified in the request (if none was specified, use the + endpoint's default pagination limit) (not implemented yet, always return + number of items). + example: 42 + minimum: 0 + readOnly: true + type: integer + PaginationLinks: + description: | + The URLs to navigate the different pages. As of now we always only return a + single page. + properties: + prev: + description: | + The URL (with offset and limit parameters) of the previous page; only + present if the offset is greater than 0. + example: + format: uri + readOnly: true + type: string + self: + description: | + The URL (with offset and limit parameters) of the current page. + example: + format: uri + readOnly: true + type: string + next: + description: | + The URL (with offset and limit parameters) of the next page; only + present if the offset and limit is less than the total number of elements. + example: + format: uri + readOnly: true + type: string + type: object + CreateClusterRequest: + description: | + The request payload with all data needed to create a new MongoDB cluster. + example: + metadata: + createdByUserId: 87f9a82e-b28d-49ed-9d04-fba2c0459cd3 + createdDate: 2020-12-10T13:37:50+01:00 + createdBy: john.doe@example.com + lastModifiedDate: 2020-12-11T13:37:50+01:00 + lastModifiedBy: jane.doe@example.com + state: AVAILABLE + lastModifiedByUserId: 87f9a82e-b28d-49ed-9d04-fba2c0459cd3 + properties: + maintenanceWindow: + dayOfTheWeek: Monday + time: 16:30:59 + instances: 3 + displayName: MongoDB cluster + location: de/txl + templateID: 498ae72f-411f-11eb-9d07-046c59cc737e + mongoDBVersion: "5.0" + connections: + - cidrList: + - 192.168.1.100/24 + - 192.168.1.101/24 + datacenterId: 5a029f4a-72e5-11ec-90d6-0242ac120003 + lanId: "2" + properties: + metadata: + $ref: '#/components/schemas/Metadata' + properties: + $ref: '#/components/schemas/CreateClusterProperties' + type: object + UserMetadata: + description: The metadata of the resource. + example: + createdByUserId: 87f9a82e-b28d-49ed-9d04-fba2c0459cd3 + createdDate: 2020-12-10T13:37:50+01:00 + createdBy: john.doe@example.com + state: CREATING + properties: + createdDate: + description: The date the resource was created. + example: 2020-12-10T13:37:50+01:00 + format: date-time + type: string + createdBy: + description: The user who created the resource. + example: john.doe@example.com + type: string + createdByUserId: + description: The ID of the user who created the resource. + example: 87f9a82e-b28d-49ed-9d04-fba2c0459cd3 + type: string + state: + description: The user state. + enum: + - AVAILABLE + - CREATING + - DESTROYING + example: CREATING + type: string + Metadata: + description: The metadata of the resource. + example: + createdByUserId: 87f9a82e-b28d-49ed-9d04-fba2c0459cd3 + createdDate: 2020-12-10T13:37:50+01:00 + createdBy: john.doe@example.com + lastModifiedDate: 2020-12-11T13:37:50+01:00 + lastModifiedBy: jane.doe@example.com + state: AVAILABLE + lastModifiedByUserId: 87f9a82e-b28d-49ed-9d04-fba2c0459cd3 + properties: + createdDate: + description: The date the resource was created. + example: 2020-12-10T13:37:50+01:00 + format: date-time + type: string + createdBy: + description: The user who created the resource. + example: john.doe@example.com + type: string + createdByUserId: + description: The ID of the user who created the resource. + example: 87f9a82e-b28d-49ed-9d04-fba2c0459cd3 + type: string + lastModifiedDate: + description: The date the resource was last modified. + example: 2020-12-11T13:37:50+01:00 + format: date-time + type: string + lastModifiedBy: + description: The last user who modified the resource. + example: jane.doe@example.com + type: string + lastModifiedByUserId: + description: The ID of the user who last modified the resource. + example: 87f9a82e-b28d-49ed-9d04-fba2c0459cd3 + type: string + state: + $ref: '#/components/schemas/State' + State: + description: The current status reported by the cluster. + enum: + - AVAILABLE + - BUSY + - DESTROYING + - FAILED + - UNKNOWN + example: AVAILABLE + type: string + CreateClusterProperties: + description: | + The properties with all data needed to create a new MongoDB cluster. + example: + maintenanceWindow: + dayOfTheWeek: Monday + time: 16:30:59 + instances: 3 + displayName: MongoDB cluster + location: de/txl + templateID: 498ae72f-411f-11eb-9d07-046c59cc737e + mongoDBVersion: "5.0" + connections: + - cidrList: + - 192.168.1.100/24 + - 192.168.1.101/24 + datacenterId: 5a029f4a-72e5-11ec-90d6-0242ac120003 + lanId: "2" + properties: + templateID: + description: | + The unique ID of the template, which specifies the number of cores, storage size, and memory. + example: 498ae72f-411f-11eb-9d07-046c59cc737e + type: string + mongoDBVersion: + description: The MongoDB version of your cluster. + example: "5.0" + type: string + instances: + description: | + The total number of instances in the cluster (one primary and n-1 secondaries). + example: 3 + type: integer + x-extensible-enum: + - 3 + - 5 + - 7 + connections: + items: + $ref: '#/components/schemas/Connection' + maxItems: 1 + minItems: 1 + type: array + location: + description: | + The physical location where the cluster will be created. This is the location where all your instances will be located. This property is immutable. + example: de/txl + type: string + x-extensible-enum: + - de/fra + - de/txl + - gb/lhr + - es/vit + displayName: + description: The name of your cluster. + example: MongoDB cluster + type: string + maintenanceWindow: + $ref: '#/components/schemas/MaintenanceWindow' + required: + - connections + - displayName + - instances + - location + - mongodbVersion + - templateID + type: object + TemplateID: + description: | + The unique ID of the template, which specifies the number of cores, storage size, and memory. + example: 498ae72f-411f-11eb-9d07-046c59cc737e + type: string + ClusterLogs: + description: The logs of the MongoDB cluster. + example: + instances: + - name: mongodb-cluster-0 + messages: + - time: 2021-09-06T10:00:38.253+02:00 + message: Hello World + - time: 2021-09-06T10:00:38.253+02:00 + message: Hello World + - name: mongodb-cluster-0 + messages: + - time: 2021-09-06T10:00:38.253+02:00 + message: Hello World + - time: 2021-09-06T10:00:38.253+02:00 + message: Hello World + properties: + instances: + items: + $ref: '#/components/schemas/ClusterLogs_instances' + type: array + type: object + MongoDBVersion: + description: The MongoDB version of your cluster. + example: "5.0" + type: string + ConnectionString: + description: The connection string for your cluster. + example: mongo+srv://m-498ae72f-411f-11eb-9d07-046c59cc737e.mongodb.de-txl.ionos.com + type: string + Instances: + description: | + The total number of instances in the cluster (one primary and n-1 secondaries). + example: 3 + type: integer + x-extensible-enum: + - 3 + - 5 + - 7 + Location: + description: | + The physical location where the cluster will be created. This is the location where all your instances will be located. This property is immutable. + example: de/txl + type: string + x-extensible-enum: + - de/fra + - de/txl + - gb/lhr + - es/vit + Connection: + description: The network connection details for your cluster. + example: + cidrList: + - 192.168.1.100/24 + - 192.168.1.101/24 + datacenterId: 5a029f4a-72e5-11ec-90d6-0242ac120003 + lanId: "2" + properties: + datacenterId: + description: The datacenter to which your cluster will be connected. + example: 5a029f4a-72e5-11ec-90d6-0242ac120003 + type: string + lanId: + description: The numeric LAN ID with which you connect your cluster. + example: "2" + type: string + cidrList: + description: | + The list of IPs and subnet for your cluster. + Note the following unavailable IP ranges: + 10.233.64.0/18 + 10.233.0.0/18 + 10.233.114.0/24 + example: + - 192.168.1.100/24 + - 192.168.1.101/24 + items: + type: string + type: array + required: + - cidrList + - datacenterId + - lanId + type: object + DisplayName: + description: The name of your cluster. + example: MongoDB cluster + type: string + MaintenanceWindow: + description: | + A weekly window of 4 hours during which maintenance work can be performed. + example: + dayOfTheWeek: Monday + time: 16:30:59 + properties: + time: + example: 16:30:59 + type: string + dayOfTheWeek: + $ref: '#/components/schemas/DayOfTheWeek' + required: + - dayOfTheWeek + - time + type: object + DayOfTheWeek: + description: The week day. + enum: + - Sunday + - Monday + - Tuesday + - Wednesday + - Thursday + - Friday + - Saturday + example: Monday + type: string + TemplateList: + allOf: + - $ref: '#/components/schemas/TemplateList_allOf' + description: The list of MongoDB templates. + type: object + TemplateResponse: + description: A MongoDB template item. + properties: + id: + description: The unique template ID. + example: 15c6dd2f-02d2-4987-b439-9a58dd59ecc3 + type: string + cores: + description: The number of CPU cores. + example: 1 + type: integer + ram: + description: The amount of memory in GB. + example: 4 + type: integer + storageSize: + description: The amount of storage size in GB. + example: 30 + type: integer + SnapshotList_allOf: + properties: + type: + $ref: '#/components/schemas/ResourceType' + id: + description: The unique ID of the resource. + example: 498ae72f-411f-11eb-9d07-046c59cc737e + type: string + items: + items: + $ref: '#/components/schemas/SnapshotResponse' + type: array + type: object + ClusterList_allOf: + properties: + type: + $ref: '#/components/schemas/ResourceType' + id: + description: The unique ID of the resource. + example: 498ae72f-411f-11eb-9d07-046c59cc737e + type: string + items: + items: + $ref: '#/components/schemas/ClusterResponse' + type: array + type: object + ClusterLogs_messages: + example: + time: 2021-09-06T10:00:38.253+02:00 + message: Hello World + properties: + time: + example: 2021-09-06T10:00:38.253+02:00 + format: date-time + type: string + message: + example: Hello World + type: string + type: object + ClusterLogs_instances: + example: + name: mongodb-cluster-0 + messages: + - time: 2021-09-06T10:00:38.253+02:00 + message: Hello World + - time: 2021-09-06T10:00:38.253+02:00 + message: Hello World + properties: + name: + description: The name of the MongoDB instance. + example: mongodb-cluster-0 + type: string + messages: + items: + $ref: '#/components/schemas/ClusterLogs_messages' + type: array + type: object + TemplateList_allOf: + properties: + items: + items: + $ref: '#/components/schemas/TemplateResponse' + type: array + type: object + securitySchemes: + basicAuth: + description: | + For 'Basic' authentication, take your credentials by first combining the username and password with a colon (``username:password``) and then encoding the resulting string in base64 (``YWxhZGRpbjpvcGVuc2VzYW1l``). + + **Example Request Header** + + ``Authorization: Basic YWxhZGRpbjpvcGVuc2Vzl`` + + More details: https://en.wikipedia.org/wiki/Basic_access_authentication + scheme: basic + type: http + tokenAuth: + description: | + Authorization is granted when a valid proof of identity is provided along with an API request for data. This proof of identity is in the form of a JSON web access token, a unique string that identifies a user. + + **Example Request Header** + + ``Authorization: Bearer ACCESS_TOKEN`` + in: header + name: Authorization + type: apiKey diff --git a/api_clusters.go b/api_clusters.go new file mode 100644 index 0000000..96a78ab --- /dev/null +++ b/api_clusters.go @@ -0,0 +1,585 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + _context "context" + "fmt" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// ClustersApiService ClustersApi service +type ClustersApiService service + +type ApiClustersDeleteRequest struct { + ctx _context.Context + ApiService *ClustersApiService + clusterId string +} + +func (r ApiClustersDeleteRequest) Execute() (ClusterResponse, *APIResponse, error) { + return r.ApiService.ClustersDeleteExecute(r) +} + +/* + * ClustersDelete Delete a Cluster + * Deletes a MongoDB cluster. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param clusterId The unique ID of the cluster. + * @return ApiClustersDeleteRequest + */ +func (a *ClustersApiService) ClustersDelete(ctx _context.Context, clusterId string) ApiClustersDeleteRequest { + return ApiClustersDeleteRequest{ + ApiService: a, + ctx: ctx, + clusterId: clusterId, + } +} + +/* + * Execute executes the request + * @return ClusterResponse + */ +func (a *ClustersApiService) ClustersDeleteExecute(r ApiClustersDeleteRequest) (ClusterResponse, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ClusterResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ClustersApiService.ClustersDelete") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clusters/{clusterId}" + localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterToString(r.clusterId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + Operation: "ClustersDelete", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), + } + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarAPIResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiClustersFindByIdRequest struct { + ctx _context.Context + ApiService *ClustersApiService + clusterId string +} + +func (r ApiClustersFindByIdRequest) Execute() (ClusterResponse, *APIResponse, error) { + return r.ApiService.ClustersFindByIdExecute(r) +} + +/* + * ClustersFindById Get a cluster by id + * Get a cluster by id. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param clusterId The unique ID of the cluster. + * @return ApiClustersFindByIdRequest + */ +func (a *ClustersApiService) ClustersFindById(ctx _context.Context, clusterId string) ApiClustersFindByIdRequest { + return ApiClustersFindByIdRequest{ + ApiService: a, + ctx: ctx, + clusterId: clusterId, + } +} + +/* + * Execute executes the request + * @return ClusterResponse + */ +func (a *ClustersApiService) ClustersFindByIdExecute(r ApiClustersFindByIdRequest) (ClusterResponse, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ClusterResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ClustersApiService.ClustersFindById") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clusters/{clusterId}" + localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterToString(r.clusterId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + Operation: "ClustersFindById", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), + } + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarAPIResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiClustersGetRequest struct { + ctx _context.Context + ApiService *ClustersApiService + filterName *string +} + +func (r ApiClustersGetRequest) FilterName(filterName string) ApiClustersGetRequest { + r.filterName = &filterName + return r +} + +func (r ApiClustersGetRequest) Execute() (ClusterList, *APIResponse, error) { + return r.ApiService.ClustersGetExecute(r) +} + +/* + * ClustersGet Get Clusters + * Retrieves a list of MongoDB clusters. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiClustersGetRequest + */ +func (a *ClustersApiService) ClustersGet(ctx _context.Context) ApiClustersGetRequest { + return ApiClustersGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return ClusterList + */ +func (a *ClustersApiService) ClustersGetExecute(r ApiClustersGetRequest) (ClusterList, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ClusterList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ClustersApiService.ClustersGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clusters" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.filterName != nil { + localVarQueryParams.Add("filter.name", parameterToString(*r.filterName, "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + Operation: "ClustersGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), + } + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarAPIResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiClustersPostRequest struct { + ctx _context.Context + ApiService *ClustersApiService + createClusterRequest *CreateClusterRequest +} + +func (r ApiClustersPostRequest) CreateClusterRequest(createClusterRequest CreateClusterRequest) ApiClustersPostRequest { + r.createClusterRequest = &createClusterRequest + return r +} + +func (r ApiClustersPostRequest) Execute() (ClusterResponse, *APIResponse, error) { + return r.ApiService.ClustersPostExecute(r) +} + +/* +* ClustersPost Create a Cluster +* Creates a new MongoDB cluster. + +* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +* @return ApiClustersPostRequest + */ +func (a *ClustersApiService) ClustersPost(ctx _context.Context) ApiClustersPostRequest { + return ApiClustersPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return ClusterResponse + */ +func (a *ClustersApiService) ClustersPostExecute(r ApiClustersPostRequest) (ClusterResponse, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ClusterResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ClustersApiService.ClustersPost") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clusters" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.createClusterRequest == nil { + return localVarReturnValue, nil, reportError("createClusterRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createClusterRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + Operation: "ClustersPost", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), + } + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarAPIResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} diff --git a/api_logs.go b/api_logs.go new file mode 100644 index 0000000..6d6d77f --- /dev/null +++ b/api_logs.go @@ -0,0 +1,198 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + _context "context" + "fmt" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" + "time" +) + +// Linger please +var ( + _ _context.Context +) + +// LogsApiService LogsApi service +type LogsApiService service + +type ApiClustersLogsGetRequest struct { + ctx _context.Context + ApiService *LogsApiService + clusterId string + start *time.Time + end *time.Time + direction *string + limit *int32 +} + +func (r ApiClustersLogsGetRequest) Start(start time.Time) ApiClustersLogsGetRequest { + r.start = &start + return r +} +func (r ApiClustersLogsGetRequest) End(end time.Time) ApiClustersLogsGetRequest { + r.end = &end + return r +} +func (r ApiClustersLogsGetRequest) Direction(direction string) ApiClustersLogsGetRequest { + r.direction = &direction + return r +} +func (r ApiClustersLogsGetRequest) Limit(limit int32) ApiClustersLogsGetRequest { + r.limit = &limit + return r +} + +func (r ApiClustersLogsGetRequest) Execute() (ClusterLogs, *APIResponse, error) { + return r.ApiService.ClustersLogsGetExecute(r) +} + +/* + * ClustersLogsGet Get logs of your cluster + * Retrieves MongoDB logs based on the given parameters. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param clusterId The unique ID of the cluster. + * @return ApiClustersLogsGetRequest + */ +func (a *LogsApiService) ClustersLogsGet(ctx _context.Context, clusterId string) ApiClustersLogsGetRequest { + return ApiClustersLogsGetRequest{ + ApiService: a, + ctx: ctx, + clusterId: clusterId, + } +} + +/* + * Execute executes the request + * @return ClusterLogs + */ +func (a *LogsApiService) ClustersLogsGetExecute(r ApiClustersLogsGetRequest) (ClusterLogs, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ClusterLogs + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LogsApiService.ClustersLogsGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clusters/{clusterId}/logs" + localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterToString(r.clusterId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.start != nil { + localVarQueryParams.Add("start", parameterToString(*r.start, "")) + } + if r.end != nil { + localVarQueryParams.Add("end", parameterToString(*r.end, "")) + } + if r.direction != nil { + localVarQueryParams.Add("direction", parameterToString(*r.direction, "")) + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + Operation: "ClustersLogsGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), + } + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarAPIResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} diff --git a/api_metadata.go b/api_metadata.go new file mode 100644 index 0000000..1376b6b --- /dev/null +++ b/api_metadata.go @@ -0,0 +1,291 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + _context "context" + "fmt" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" +) + +// Linger please +var ( + _ _context.Context +) + +// MetadataApiService MetadataApi service +type MetadataApiService service + +type ApiInfosVersionGetRequest struct { + ctx _context.Context + ApiService *MetadataApiService +} + +func (r ApiInfosVersionGetRequest) Execute() (APIVersion, *APIResponse, error) { + return r.ApiService.InfosVersionGetExecute(r) +} + +/* + * InfosVersionGet Get API Version + * Retrieves the current version of the responding API. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiInfosVersionGetRequest + */ +func (a *MetadataApiService) InfosVersionGet(ctx _context.Context) ApiInfosVersionGetRequest { + return ApiInfosVersionGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return APIVersion + */ +func (a *MetadataApiService) InfosVersionGetExecute(r ApiInfosVersionGetRequest) (APIVersion, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue APIVersion + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetadataApiService.InfosVersionGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/infos/version" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + Operation: "InfosVersionGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), + } + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarAPIResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiInfosVersionsGetRequest struct { + ctx _context.Context + ApiService *MetadataApiService +} + +func (r ApiInfosVersionsGetRequest) Execute() ([]APIVersion, *APIResponse, error) { + return r.ApiService.InfosVersionsGetExecute(r) +} + +/* + * InfosVersionsGet Get All API Versions + * Retrieves all available versions of the responding API. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiInfosVersionsGetRequest + */ +func (a *MetadataApiService) InfosVersionsGet(ctx _context.Context) ApiInfosVersionsGetRequest { + return ApiInfosVersionsGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return []APIVersion + */ +func (a *MetadataApiService) InfosVersionsGetExecute(r ApiInfosVersionsGetRequest) ([]APIVersion, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []APIVersion + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetadataApiService.InfosVersionsGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/infos/versions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + Operation: "InfosVersionsGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), + } + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarAPIResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} diff --git a/api_restores.go b/api_restores.go new file mode 100644 index 0000000..a961083 --- /dev/null +++ b/api_restores.go @@ -0,0 +1,163 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + _context "context" + "fmt" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// RestoresApiService RestoresApi service +type RestoresApiService service + +type ApiClustersRestorePostRequest struct { + ctx _context.Context + ApiService *RestoresApiService + clusterId string + createRestoreRequest *CreateRestoreRequest +} + +func (r ApiClustersRestorePostRequest) CreateRestoreRequest(createRestoreRequest CreateRestoreRequest) ApiClustersRestorePostRequest { + r.createRestoreRequest = &createRestoreRequest + return r +} + +func (r ApiClustersRestorePostRequest) Execute() (*APIResponse, error) { + return r.ApiService.ClustersRestorePostExecute(r) +} + +/* + * ClustersRestorePost In-place restore of a cluster + * Triggers an in-place restore of the given MongoDB cluster. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param clusterId The unique ID of the cluster. + * @return ApiClustersRestorePostRequest + */ +func (a *RestoresApiService) ClustersRestorePost(ctx _context.Context, clusterId string) ApiClustersRestorePostRequest { + return ApiClustersRestorePostRequest{ + ApiService: a, + ctx: ctx, + clusterId: clusterId, + } +} + +/* + * Execute executes the request + */ +func (a *RestoresApiService) ClustersRestorePostExecute(r ApiClustersRestorePostRequest) (*APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RestoresApiService.ClustersRestorePost") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clusters/{clusterId}/restore" + localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterToString(r.clusterId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.createRestoreRequest == nil { + return nil, reportError("createRestoreRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createRestoreRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + Operation: "ClustersRestorePost", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), + } + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr + } + + return localVarAPIResponse, nil +} diff --git a/api_snapshots.go b/api_snapshots.go new file mode 100644 index 0000000..663c80a --- /dev/null +++ b/api_snapshots.go @@ -0,0 +1,164 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + _context "context" + "fmt" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// SnapshotsApiService SnapshotsApi service +type SnapshotsApiService service + +type ApiClustersSnapshotsGetRequest struct { + ctx _context.Context + ApiService *SnapshotsApiService + clusterId string +} + +func (r ApiClustersSnapshotsGetRequest) Execute() (SnapshotList, *APIResponse, error) { + return r.ApiService.ClustersSnapshotsGetExecute(r) +} + +/* + * ClustersSnapshotsGet Get the snapshots of your cluster + * Retrieves MongoDB snapshots. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param clusterId The unique ID of the cluster. + * @return ApiClustersSnapshotsGetRequest + */ +func (a *SnapshotsApiService) ClustersSnapshotsGet(ctx _context.Context, clusterId string) ApiClustersSnapshotsGetRequest { + return ApiClustersSnapshotsGetRequest{ + ApiService: a, + ctx: ctx, + clusterId: clusterId, + } +} + +/* + * Execute executes the request + * @return SnapshotList + */ +func (a *SnapshotsApiService) ClustersSnapshotsGetExecute(r ApiClustersSnapshotsGetRequest) (SnapshotList, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SnapshotList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SnapshotsApiService.ClustersSnapshotsGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clusters/{clusterId}/snapshots" + localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterToString(r.clusterId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + Operation: "ClustersSnapshotsGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), + } + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarAPIResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} diff --git a/api_templates.go b/api_templates.go new file mode 100644 index 0000000..007145f --- /dev/null +++ b/api_templates.go @@ -0,0 +1,160 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + _context "context" + "fmt" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" +) + +// Linger please +var ( + _ _context.Context +) + +// TemplatesApiService TemplatesApi service +type TemplatesApiService service + +type ApiTemplatesGetRequest struct { + ctx _context.Context + ApiService *TemplatesApiService +} + +func (r ApiTemplatesGetRequest) Execute() (TemplateList, *APIResponse, error) { + return r.ApiService.TemplatesGetExecute(r) +} + +/* +* TemplatesGet Get Templates +* Retrieves a list of valid templates. These templates can be used to create MongoDB clusters; they contain properties, such as number of cores, RAM, and the storage size. + +* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +* @return ApiTemplatesGetRequest + */ +func (a *TemplatesApiService) TemplatesGet(ctx _context.Context) ApiTemplatesGetRequest { + return ApiTemplatesGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return TemplateList + */ +func (a *TemplatesApiService) TemplatesGetExecute(r ApiTemplatesGetRequest) (TemplateList, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue TemplateList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TemplatesApiService.TemplatesGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/templates" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + Operation: "TemplatesGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), + } + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarAPIResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} diff --git a/api_users.go b/api_users.go new file mode 100644 index 0000000..b74e300 --- /dev/null +++ b/api_users.go @@ -0,0 +1,600 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + _context "context" + "fmt" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// UsersApiService UsersApi service +type UsersApiService service + +type ApiClustersUsersDeleteRequest struct { + ctx _context.Context + ApiService *UsersApiService + clusterId string + database string + username string +} + +func (r ApiClustersUsersDeleteRequest) Execute() (User, *APIResponse, error) { + return r.ApiService.ClustersUsersDeleteExecute(r) +} + +/* + * ClustersUsersDelete Delete a MongoDB User by ID + * Deletes a MongoDB user specified by its ID. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param clusterId The unique ID of the cluster. + * @param database The authentication database. + * @param username The authentication username. + * @return ApiClustersUsersDeleteRequest + */ +func (a *UsersApiService) ClustersUsersDelete(ctx _context.Context, clusterId string, database string, username string) ApiClustersUsersDeleteRequest { + return ApiClustersUsersDeleteRequest{ + ApiService: a, + ctx: ctx, + clusterId: clusterId, + database: database, + username: username, + } +} + +/* + * Execute executes the request + * @return User + */ +func (a *UsersApiService) ClustersUsersDeleteExecute(r ApiClustersUsersDeleteRequest) (User, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.ClustersUsersDelete") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clusters/{clusterId}/users/{database}/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterToString(r.clusterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"database"+"}", _neturl.PathEscape(parameterToString(r.database, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + Operation: "ClustersUsersDelete", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), + } + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarAPIResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiClustersUsersFindByIdRequest struct { + ctx _context.Context + ApiService *UsersApiService + clusterId string + database string + username string +} + +func (r ApiClustersUsersFindByIdRequest) Execute() (User, *APIResponse, error) { + return r.ApiService.ClustersUsersFindByIdExecute(r) +} + +/* + * ClustersUsersFindById Get a MongoDB User by ID + * Retrieves the MongoDB user identified by the username and database parameters. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param clusterId The unique ID of the cluster. + * @param database The authentication database. + * @param username The authentication username. + * @return ApiClustersUsersFindByIdRequest + */ +func (a *UsersApiService) ClustersUsersFindById(ctx _context.Context, clusterId string, database string, username string) ApiClustersUsersFindByIdRequest { + return ApiClustersUsersFindByIdRequest{ + ApiService: a, + ctx: ctx, + clusterId: clusterId, + database: database, + username: username, + } +} + +/* + * Execute executes the request + * @return User + */ +func (a *UsersApiService) ClustersUsersFindByIdExecute(r ApiClustersUsersFindByIdRequest) (User, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.ClustersUsersFindById") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clusters/{clusterId}/users/{database}/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterToString(r.clusterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"database"+"}", _neturl.PathEscape(parameterToString(r.database, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + Operation: "ClustersUsersFindById", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), + } + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarAPIResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiClustersUsersGetRequest struct { + ctx _context.Context + ApiService *UsersApiService + clusterId string +} + +func (r ApiClustersUsersGetRequest) Execute() (UsersList, *APIResponse, error) { + return r.ApiService.ClustersUsersGetExecute(r) +} + +/* + * ClustersUsersGet Get a Cluster Users + * Retrieves a list of MongoDB users. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param clusterId The unique ID of the cluster. + * @return ApiClustersUsersGetRequest + */ +func (a *UsersApiService) ClustersUsersGet(ctx _context.Context, clusterId string) ApiClustersUsersGetRequest { + return ApiClustersUsersGetRequest{ + ApiService: a, + ctx: ctx, + clusterId: clusterId, + } +} + +/* + * Execute executes the request + * @return UsersList + */ +func (a *UsersApiService) ClustersUsersGetExecute(r ApiClustersUsersGetRequest) (UsersList, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue UsersList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.ClustersUsersGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clusters/{clusterId}/users" + localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterToString(r.clusterId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + Operation: "ClustersUsersGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), + } + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarAPIResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiClustersUsersPostRequest struct { + ctx _context.Context + ApiService *UsersApiService + clusterId string + user *User +} + +func (r ApiClustersUsersPostRequest) User(user User) ApiClustersUsersPostRequest { + r.user = &user + return r +} + +func (r ApiClustersUsersPostRequest) Execute() (User, *APIResponse, error) { + return r.ApiService.ClustersUsersPostExecute(r) +} + +/* +* ClustersUsersPost Create MongoDB User +* Creates a MongoDB user. + +* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +* @param clusterId The unique ID of the cluster. +* @return ApiClustersUsersPostRequest + */ +func (a *UsersApiService) ClustersUsersPost(ctx _context.Context, clusterId string) ApiClustersUsersPostRequest { + return ApiClustersUsersPostRequest{ + ApiService: a, + ctx: ctx, + clusterId: clusterId, + } +} + +/* + * Execute executes the request + * @return User + */ +func (a *UsersApiService) ClustersUsersPostExecute(r ApiClustersUsersPostRequest) (User, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.ClustersUsersPost") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clusters/{clusterId}/users" + localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterToString(r.clusterId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.user == nil { + return localVarReturnValue, nil, reportError("user is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.user + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + Operation: "ClustersUsersPost", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), + } + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarAPIResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} diff --git a/client.go b/client.go new file mode 100644 index 0000000..17cce25 --- /dev/null +++ b/client.go @@ -0,0 +1,744 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "bytes" + "context" + "crypto/sha256" + "crypto/tls" + "crypto/x509" + "encoding/hex" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "mime/multipart" + "net" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "golang.org/x/oauth2" +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)\/(?:vnd\.[^;]+|problem\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) +) + +const ( + RequestStatusQueued = "QUEUED" + RequestStatusRunning = "RUNNING" + RequestStatusFailed = "FAILED" + RequestStatusDone = "DONE" + + Version = "1.0.0" +) + +// APIClient manages communication with the IONOS DBaaS MongoDB REST API API v0.1.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + ClustersApi *ClustersApiService + + LogsApi *LogsApiService + + MetadataApi *MetadataApiService + + RestoresApi *RestoresApiService + + SnapshotsApi *SnapshotsApiService + + TemplatesApi *TemplatesApiService + + UsersApi *UsersApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + //enable certificate pinning if the env variable is set + pkFingerprint := os.Getenv(IonosPinnedCertEnvVar) + if pkFingerprint != "" { + httpTransport := &http.Transport{} + AddPinnedCert(httpTransport, pkFingerprint) + cfg.HTTPClient.Transport = httpTransport + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.ClustersApi = (*ClustersApiService)(&c.common) + c.LogsApi = (*LogsApiService)(&c.common) + c.MetadataApi = (*MetadataApiService)(&c.common) + c.RestoresApi = (*RestoresApiService)(&c.common) + c.SnapshotsApi = (*SnapshotsApiService)(&c.common) + c.TemplatesApi = (*TemplatesApiService)(&c.common) + c.UsersApi = (*UsersApiService)(&c.common) + + return c +} + +// AddPinnedCert - enables pinning of the sha256 public fingerprint to the http client's transport +func AddPinnedCert(transport *http.Transport, pkFingerprint string) { + if pkFingerprint != "" { + transport.DialTLSContext = addPinnedCertVerification([]byte(pkFingerprint), new(tls.Config)) + } +} + +// TLSDial can be assigned to a http.Transport's DialTLS field. +type TLSDial func(ctx context.Context, network, addr string) (net.Conn, error) + +// addPinnedCertVerification returns a TLSDial function which checks that +// the remote server provides a certificate whose SHA256 fingerprint matches +// the provided value. +// +// The returned dialer function can be plugged into a http.Transport's DialTLS +// field to allow for certificate pinning. +func addPinnedCertVerification(fingerprint []byte, tlsConfig *tls.Config) TLSDial { + return func(ctx context.Context, network, addr string) (net.Conn, error) { + //fingerprints can be added with ':', we need to trim + fingerprint = bytes.ReplaceAll(fingerprint, []byte(":"), []byte("")) + fingerprint = bytes.ReplaceAll(fingerprint, []byte(" "), []byte("")) + //we are manually checking a certificate, so we need to enable insecure + tlsConfig.InsecureSkipVerify = true + + // Dial the connection to get certificates to check + conn, err := tls.Dial(network, addr, tlsConfig) + if err != nil { + return nil, err + } + + if err := verifyPinnedCert(fingerprint, conn.ConnectionState().PeerCertificates); err != nil { + _ = conn.Close() + return nil, err + } + + return conn, nil + } +} + +// verifyPinnedCert iterates the list of peer certificates and attempts to +// locate a certificate that is not a CA and whose public key fingerprint matches pkFingerprint. +func verifyPinnedCert(pkFingerprint []byte, peerCerts []*x509.Certificate) error { + for _, cert := range peerCerts { + fingerprint := sha256.Sum256(cert.Raw) + + var bytesFingerPrint = make([]byte, hex.EncodedLen(len(fingerprint[:]))) + hex.Encode(bytesFingerPrint, fingerprint[:]) + + // we have a match, and it's not an authority certificate + if cert.IsCA == false && bytes.EqualFold(bytesFingerPrint, pkFingerprint) { + return nil + } + } + + return fmt.Errorf("remote server presented a certificate which does not match the provided fingerprint") +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insenstive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.ToLower(a) == strings.ToLower(needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. +func parameterToString(obj interface{}, collectionFormat string) string { + var delimiter string + + switch collectionFormat { + case "pipes": + delimiter = "|" + case "ssv": + delimiter = " " + case "tsv": + delimiter = "\t" + case "csv": + delimiter = "," + } + + if reflect.TypeOf(obj).Kind() == reflect.Slice { + return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") + } else if t, ok := obj.(time.Time); ok { + return t.Format(time.RFC3339) + } + + return fmt.Sprintf("%v", obj) +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + retryCount := 0 + + var resp *http.Response + var err error + + for { + + retryCount++ + + /* we need to clone the request with every retry time because Body closes after the request */ + var clonedRequest *http.Request = request.Clone(request.Context()) + if request.Body != nil { + clonedRequest.Body, err = request.GetBody() + if err != nil { + return nil, err + } + } + + if c.cfg.Debug || c.cfg.LogLevel.Satisfies(Trace) { + dump, err := httputil.DumpRequestOut(clonedRequest, true) + if err == nil { + c.cfg.Logger.Printf(" DumpRequestOut : %s\n", string(dump)) + } else { + c.cfg.Logger.Printf(" DumpRequestOut err: %+v", err) + } + c.cfg.Logger.Printf("\n try no: %d\n", retryCount) + } + + clonedRequest.Close = true + resp, err = c.cfg.HTTPClient.Do(clonedRequest) + if err != nil { + return resp, err + } + + if c.cfg.Debug || c.cfg.LogLevel.Satisfies(Trace) { + dump, err := httputil.DumpResponse(resp, true) + if err == nil { + c.cfg.Logger.Printf("\n DumpResponse : %s\n", string(dump)) + } else { + c.cfg.Logger.Printf(" DumpResponse err %+v", err) + } + } + + var backoffTime time.Duration + + switch resp.StatusCode { + case http.StatusServiceUnavailable, + http.StatusGatewayTimeout, + http.StatusBadGateway: + backoffTime = c.GetConfig().WaitTime + + case http.StatusTooManyRequests: + if retryAfterSeconds := resp.Header.Get("Retry-After"); retryAfterSeconds != "" { + waitTime, err := time.ParseDuration(retryAfterSeconds + "s") + if err != nil { + return resp, err + } + backoffTime = waitTime + } else { + backoffTime = c.GetConfig().WaitTime + } + default: + return resp, err + + } + + if retryCount >= c.GetConfig().MaxRetries { + if c.cfg.Debug || c.cfg.LogLevel.Satisfies(Debug) { + c.cfg.Logger.Printf(" Number of maximum retries exceeded (%d retries)\n", c.cfg.MaxRetries) + } + break + } else { + c.backOff(backoffTime) + } + } + + return resp, err +} + +func (c *APIClient) backOff(t time.Duration) { + if t > c.GetConfig().MaxWaitTime { + t = c.GetConfig().MaxWaitTime + } + if c.cfg.Debug || c.cfg.LogLevel.Satisfies(Debug) { + c.cfg.Logger.Printf(" Sleeping %s before retrying request\n", t.String()) + } + time.Sleep(t) +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *Configuration { + return c.cfg +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFileName string, + fileName string, + fileBytes []byte) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + if len(fileBytes) > 0 && fileName != "" { + w.Boundary() + //_, fileNm := filepath.Split(fileName) + part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(fileBytes) + if err != nil { + return nil, err + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + /* adding default query params */ + for k, v := range c.cfg.DefaultQueryParams { + if _, ok := queryParams[k]; !ok { + queryParams[k] = v + } + } + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = query.Encode() + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers.Set(h, v) + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if c.cfg.Token != "" { + localVarRequest.Header.Add("Authorization", "Bearer "+c.cfg.Token) + } else { + if c.cfg.Username != "" { + localVarRequest.SetBasicAuth(c.cfg.Username, c.cfg.Password) + } + } + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + // OAuth2 authentication + if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { + // We were able to grab an oauth2 token from the context + var latestToken *oauth2.Token + if latestToken, err = tok.Token(); err != nil { + return nil, err + } + + latestToken.SetAuthHeader(localVarRequest) + } + + // Basic HTTP Authentication + if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { + localVarRequest.SetBasicAuth(auth.UserName, auth.Password) + } + + // AccessToken Authentication + if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + localVarRequest.Header.Add("Authorization", "Bearer "+auth) + } + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return fmt.Errorf("undefined response type for content %s", contentType) +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(path) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("Invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + statusCode int + body []byte + error string + model interface{} +} + +// NewGenericOpenAPIError - constructor for GenericOpenAPIError +func NewGenericOpenAPIError(message string, body []byte, model interface{}, statusCode int) *GenericOpenAPIError { + return &GenericOpenAPIError{ + statusCode: statusCode, + body: body, + error: message, + model: model, + } +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// SetError sets the error string +func (e *GenericOpenAPIError) SetError(error string) { + e.error = error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// SetBody sets the raw body of the error +func (e *GenericOpenAPIError) SetBody(body []byte) { + e.body = body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// SetModel sets the model of the error +func (e *GenericOpenAPIError) SetModel(model interface{}) { + e.model = model +} + +// StatusCode returns the status code of the error +func (e GenericOpenAPIError) StatusCode() int { + return e.statusCode +} + +// SetStatusCode sets the status code of the error +func (e *GenericOpenAPIError) SetStatusCode(statusCode int) { + e.statusCode = statusCode +} diff --git a/configuration.go b/configuration.go new file mode 100644 index 0000000..d85e2c0 --- /dev/null +++ b/configuration.go @@ -0,0 +1,286 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "context" + "fmt" + "net/http" + "net/url" + "os" + "strings" + "time" +) + +const ( + IonosUsernameEnvVar = "IONOS_USERNAME" + IonosPasswordEnvVar = "IONOS_PASSWORD" + IonosTokenEnvVar = "IONOS_TOKEN" + IonosApiUrlEnvVar = "IONOS_API_URL" + IonosPinnedCertEnvVar = "IONOS_PINNED_CERT" + IonosLogLevelEnvVar = "IONOS_LOG_LEVEL" + DefaultIonosServerUrl = "https://api.ionos.com/databases/mongodb" + DefaultIonosBasePath = "/databases/mongodb" + defaultMaxRetries = 3 + defaultWaitTime = time.Duration(100) * time.Millisecond + defaultMaxWaitTime = time.Duration(2000) * time.Millisecond +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. + ContextOAuth2 = contextKey("token") + + // ContextBasicAuth takes BasicAuth as authentication for the request. + ContextBasicAuth = contextKey("basic") + + // ContextAccessToken takes a string oauth2 access token as authentication for the request. + ContextAccessToken = contextKey("accesstoken") + + // ContextAPIKeys takes a string apikey as authentication for the request + ContextAPIKeys = contextKey("apiKeys") + + // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. + ContextHttpSignatureAuth = contextKey("httpsignature") + + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + DefaultQueryParams url.Values `json:"defaultQueryParams,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client + Username string `json:"username,omitempty"` + Password string `json:"password,omitempty"` + Token string `json:"token,omitempty"` + MaxRetries int `json:"maxRetries,omitempty"` + WaitTime time.Duration `json:"waitTime,omitempty"` + MaxWaitTime time.Duration `json:"maxWaitTime,omitempty"` + LogLevel LogLevel + Logger Logger +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration(username, password, token, hostUrl string) *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + DefaultQueryParams: url.Values{}, + UserAgent: "ionos-cloud-sdk-go-dbaas-mongo/v1.0.0", + Debug: false, + Username: username, + Password: password, + Token: token, + MaxRetries: defaultMaxRetries, + MaxWaitTime: defaultMaxWaitTime, + WaitTime: defaultWaitTime, + Logger: NewDefaultLogger(), + LogLevel: getLogLevelFromEnv(), + Servers: ServerConfigurations{ + { + URL: getServerUrl(hostUrl), + Description: "Production", + }, + }, + OperationServers: map[string]ServerConfigurations{}, + } + return cfg +} + +func NewConfigurationFromEnv() *Configuration { + return NewConfiguration(os.Getenv(IonosUsernameEnvVar), os.Getenv(IonosPasswordEnvVar), os.Getenv(IonosTokenEnvVar), os.Getenv(IonosApiUrlEnvVar)) +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +func (c *Configuration) AddDefaultQueryParam(key string, value string) { + c.DefaultQueryParams[key] = []string{value} +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +func getServerUrl(serverUrl string) string { + if serverUrl == "" { + return DefaultIonosServerUrl + } + // Support both HTTPS & HTTP schemas + if !strings.HasPrefix(serverUrl, "https://") && !strings.HasPrefix(serverUrl, "http://") { + serverUrl = fmt.Sprintf("https://%s", serverUrl) + } + if !strings.HasSuffix(serverUrl, DefaultIonosBasePath) { + serverUrl = fmt.Sprintf("%s%s", serverUrl, DefaultIonosBasePath) + } + return serverUrl +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/docs/api/ClustersApi.md b/docs/api/ClustersApi.md new file mode 100644 index 0000000..bf60719 --- /dev/null +++ b/docs/api/ClustersApi.md @@ -0,0 +1,272 @@ +# \ClustersApi + +All URIs are relative to *https://api.ionos.com/databases/mongodb* + +|Method | HTTP request | Description| +|------------- | ------------- | -------------| +|[**ClustersDelete**](ClustersApi.md#ClustersDelete) | **Delete** /clusters/{clusterId} | Delete a Cluster| +|[**ClustersFindById**](ClustersApi.md#ClustersFindById) | **Get** /clusters/{clusterId} | Get a cluster by id| +|[**ClustersGet**](ClustersApi.md#ClustersGet) | **Get** /clusters | Get Clusters| +|[**ClustersPost**](ClustersApi.md#ClustersPost) | **Post** /clusters | Create a Cluster| + + + +## ClustersDelete + +```go +var result ClusterResponse = ClustersDelete(ctx, clusterId) + .Execute() +``` + +Delete a Cluster + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + ionoscloud "github.com/ionos-cloud/sdk-go-dbaas-mongo" +) + +func main() { + clusterId := "clusterId_example" // string | The unique ID of the cluster. + + configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL") + apiClient := ionoscloud.NewAPIClient(configuration) + resource, resp, err := apiClient.ClustersApi.ClustersDelete(context.Background(), clusterId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ClustersApi.ClustersDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp) + } + // response from `ClustersDelete`: ClusterResponse + fmt.Fprintf(os.Stdout, "Response from `ClustersApi.ClustersDelete`: %v\n", resource) +} +``` + +### Path Parameters + + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +|**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| +|**clusterId** | **string** | The unique ID of the cluster. | | + +### Other Parameters + +Other parameters are passed through a pointer to an apiClustersDeleteRequest struct via the builder pattern + + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| + +### Return type + +[**ClusterResponse**](ClusterResponse.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + + +## ClustersFindById + +```go +var result ClusterResponse = ClustersFindById(ctx, clusterId) + .Execute() +``` + +Get a cluster by id + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + ionoscloud "github.com/ionos-cloud/sdk-go-dbaas-mongo" +) + +func main() { + clusterId := "clusterId_example" // string | The unique ID of the cluster. + + configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL") + apiClient := ionoscloud.NewAPIClient(configuration) + resource, resp, err := apiClient.ClustersApi.ClustersFindById(context.Background(), clusterId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ClustersApi.ClustersFindById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp) + } + // response from `ClustersFindById`: ClusterResponse + fmt.Fprintf(os.Stdout, "Response from `ClustersApi.ClustersFindById`: %v\n", resource) +} +``` + +### Path Parameters + + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +|**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| +|**clusterId** | **string** | The unique ID of the cluster. | | + +### Other Parameters + +Other parameters are passed through a pointer to an apiClustersFindByIdRequest struct via the builder pattern + + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| + +### Return type + +[**ClusterResponse**](ClusterResponse.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + + +## ClustersGet + +```go +var result ClusterList = ClustersGet(ctx) + .FilterName(filterName) + .Execute() +``` + +Get Clusters + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + ionoscloud "github.com/ionos-cloud/sdk-go-dbaas-mongo" +) + +func main() { + filterName := "filterName_example" // string | Response filter to list only the MongoDB clusters that contain the specified name. The value is case insensitive and matched on the 'displayName' field. (optional) + + configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL") + apiClient := ionoscloud.NewAPIClient(configuration) + resource, resp, err := apiClient.ClustersApi.ClustersGet(context.Background()).FilterName(filterName).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ClustersApi.ClustersGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp) + } + // response from `ClustersGet`: ClusterList + fmt.Fprintf(os.Stdout, "Response from `ClustersApi.ClustersGet`: %v\n", resource) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to an apiClustersGetRequest struct via the builder pattern + + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **filterName** | **string** | Response filter to list only the MongoDB clusters that contain the specified name. The value is case insensitive and matched on the 'displayName' field. | | + +### Return type + +[**ClusterList**](ClusterList.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + + +## ClustersPost + +```go +var result ClusterResponse = ClustersPost(ctx) + .CreateClusterRequest(createClusterRequest) + .Execute() +``` + +Create a Cluster + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + ionoscloud "github.com/ionos-cloud/sdk-go-dbaas-mongo" +) + +func main() { + createClusterRequest := *openapiclient.NewCreateClusterRequest() // CreateClusterRequest | The cluster to be created. + + configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL") + apiClient := ionoscloud.NewAPIClient(configuration) + resource, resp, err := apiClient.ClustersApi.ClustersPost(context.Background()).CreateClusterRequest(createClusterRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ClustersApi.ClustersPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp) + } + // response from `ClustersPost`: ClusterResponse + fmt.Fprintf(os.Stdout, "Response from `ClustersApi.ClustersPost`: %v\n", resource) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to an apiClustersPostRequest struct via the builder pattern + + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **createClusterRequest** | [**CreateClusterRequest**](CreateClusterRequest.md) | The cluster to be created. | | + +### Return type + +[**ClusterResponse**](ClusterResponse.md) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + diff --git a/docs/api/LogsApi.md b/docs/api/LogsApi.md new file mode 100644 index 0000000..4e3a527 --- /dev/null +++ b/docs/api/LogsApi.md @@ -0,0 +1,87 @@ +# \LogsApi + +All URIs are relative to *https://api.ionos.com/databases/mongodb* + +|Method | HTTP request | Description| +|------------- | ------------- | -------------| +|[**ClustersLogsGet**](LogsApi.md#ClustersLogsGet) | **Get** /clusters/{clusterId}/logs | Get logs of your cluster| + + + +## ClustersLogsGet + +```go +var result ClusterLogs = ClustersLogsGet(ctx, clusterId) + .Start(start) + .End(end) + .Direction(direction) + .Limit(limit) + .Execute() +``` + +Get logs of your cluster + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + ionoscloud "github.com/ionos-cloud/sdk-go-dbaas-mongo" +) + +func main() { + clusterId := "clusterId_example" // string | The unique ID of the cluster. + start := time.Now() // time.Time | The start time for the query in RFC3339 format. Must not be more than 30 days ago but before the end parameter. The default is 30 days ago. (optional) + end := time.Now() // time.Time | The end time for the query in RFC3339 format. Must not be greater than now. The default is the current timestamp. (optional) + direction := "direction_example" // string | The direction in which to scan through the logs. The logs are returned in order of the direction. (optional) (default to "BACKWARD") + limit := int32(56) // int32 | The maximal number of log lines to return. If the limit is reached then log lines will be cut at the end (respecting the scan direction). (optional) (default to 100) + + configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL") + apiClient := ionoscloud.NewAPIClient(configuration) + resource, resp, err := apiClient.LogsApi.ClustersLogsGet(context.Background(), clusterId).Start(start).End(end).Direction(direction).Limit(limit).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LogsApi.ClustersLogsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp) + } + // response from `ClustersLogsGet`: ClusterLogs + fmt.Fprintf(os.Stdout, "Response from `LogsApi.ClustersLogsGet`: %v\n", resource) +} +``` + +### Path Parameters + + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +|**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| +|**clusterId** | **string** | The unique ID of the cluster. | | + +### Other Parameters + +Other parameters are passed through a pointer to an apiClustersLogsGetRequest struct via the builder pattern + + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **start** | **time.Time** | The start time for the query in RFC3339 format. Must not be more than 30 days ago but before the end parameter. The default is 30 days ago. | | +| **end** | **time.Time** | The end time for the query in RFC3339 format. Must not be greater than now. The default is the current timestamp. | | +| **direction** | **string** | The direction in which to scan through the logs. The logs are returned in order of the direction. | [default to "BACKWARD"]| +| **limit** | **int32** | The maximal number of log lines to return. If the limit is reached then log lines will be cut at the end (respecting the scan direction). | [default to 100]| + +### Return type + +[**ClusterLogs**](ClusterLogs.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + diff --git a/docs/api/MetadataApi.md b/docs/api/MetadataApi.md new file mode 100644 index 0000000..7bd539b --- /dev/null +++ b/docs/api/MetadataApi.md @@ -0,0 +1,126 @@ +# \MetadataApi + +All URIs are relative to *https://api.ionos.com/databases/mongodb* + +|Method | HTTP request | Description| +|------------- | ------------- | -------------| +|[**InfosVersionGet**](MetadataApi.md#InfosVersionGet) | **Get** /infos/version | Get API Version| +|[**InfosVersionsGet**](MetadataApi.md#InfosVersionsGet) | **Get** /infos/versions | Get All API Versions| + + + +## InfosVersionGet + +```go +var result APIVersion = InfosVersionGet(ctx) + .Execute() +``` + +Get API Version + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + ionoscloud "github.com/ionos-cloud/sdk-go-dbaas-mongo" +) + +func main() { + + configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL") + apiClient := ionoscloud.NewAPIClient(configuration) + resource, resp, err := apiClient.MetadataApi.InfosVersionGet(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MetadataApi.InfosVersionGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp) + } + // response from `InfosVersionGet`: APIVersion + fmt.Fprintf(os.Stdout, "Response from `MetadataApi.InfosVersionGet`: %v\n", resource) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to an apiInfosVersionGetRequest struct via the builder pattern + + +### Return type + +[**APIVersion**](APIVersion.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + + +## InfosVersionsGet + +```go +var result []APIVersion = InfosVersionsGet(ctx) + .Execute() +``` + +Get All API Versions + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + ionoscloud "github.com/ionos-cloud/sdk-go-dbaas-mongo" +) + +func main() { + + configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL") + apiClient := ionoscloud.NewAPIClient(configuration) + resource, resp, err := apiClient.MetadataApi.InfosVersionsGet(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MetadataApi.InfosVersionsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp) + } + // response from `InfosVersionsGet`: []APIVersion + fmt.Fprintf(os.Stdout, "Response from `MetadataApi.InfosVersionsGet`: %v\n", resource) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to an apiInfosVersionsGetRequest struct via the builder pattern + + +### Return type + +[**[]APIVersion**](APIVersion.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + diff --git a/docs/api/RestoresApi.md b/docs/api/RestoresApi.md new file mode 100644 index 0000000..799ab00 --- /dev/null +++ b/docs/api/RestoresApi.md @@ -0,0 +1,76 @@ +# \RestoresApi + +All URIs are relative to *https://api.ionos.com/databases/mongodb* + +|Method | HTTP request | Description| +|------------- | ------------- | -------------| +|[**ClustersRestorePost**](RestoresApi.md#ClustersRestorePost) | **Post** /clusters/{clusterId}/restore | In-place restore of a cluster| + + + +## ClustersRestorePost + +```go +var result = ClustersRestorePost(ctx, clusterId) + .CreateRestoreRequest(createRestoreRequest) + .Execute() +``` + +In-place restore of a cluster + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + ionoscloud "github.com/ionos-cloud/sdk-go-dbaas-mongo" +) + +func main() { + clusterId := "clusterId_example" // string | The unique ID of the cluster. + createRestoreRequest := *openapiclient.NewCreateRestoreRequest("dcd31531-3ac8-11eb-9feb-046c59cc737e") // CreateRestoreRequest | The restore request to create. + + configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL") + apiClient := ionoscloud.NewAPIClient(configuration) + resource, resp, err := apiClient.RestoresApi.ClustersRestorePost(context.Background(), clusterId).CreateRestoreRequest(createRestoreRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RestoresApi.ClustersRestorePost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp) + } +} +``` + +### Path Parameters + + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +|**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| +|**clusterId** | **string** | The unique ID of the cluster. | | + +### Other Parameters + +Other parameters are passed through a pointer to an apiClustersRestorePostRequest struct via the builder pattern + + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **createRestoreRequest** | [**CreateRestoreRequest**](CreateRestoreRequest.md) | The restore request to create. | | + +### Return type + + (empty response body) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + diff --git a/docs/api/SnapshotsApi.md b/docs/api/SnapshotsApi.md new file mode 100644 index 0000000..517c8a7 --- /dev/null +++ b/docs/api/SnapshotsApi.md @@ -0,0 +1,75 @@ +# \SnapshotsApi + +All URIs are relative to *https://api.ionos.com/databases/mongodb* + +|Method | HTTP request | Description| +|------------- | ------------- | -------------| +|[**ClustersSnapshotsGet**](SnapshotsApi.md#ClustersSnapshotsGet) | **Get** /clusters/{clusterId}/snapshots | Get the snapshots of your cluster| + + + +## ClustersSnapshotsGet + +```go +var result SnapshotList = ClustersSnapshotsGet(ctx, clusterId) + .Execute() +``` + +Get the snapshots of your cluster + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + ionoscloud "github.com/ionos-cloud/sdk-go-dbaas-mongo" +) + +func main() { + clusterId := "clusterId_example" // string | The unique ID of the cluster. + + configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL") + apiClient := ionoscloud.NewAPIClient(configuration) + resource, resp, err := apiClient.SnapshotsApi.ClustersSnapshotsGet(context.Background(), clusterId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SnapshotsApi.ClustersSnapshotsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp) + } + // response from `ClustersSnapshotsGet`: SnapshotList + fmt.Fprintf(os.Stdout, "Response from `SnapshotsApi.ClustersSnapshotsGet`: %v\n", resource) +} +``` + +### Path Parameters + + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +|**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| +|**clusterId** | **string** | The unique ID of the cluster. | | + +### Other Parameters + +Other parameters are passed through a pointer to an apiClustersSnapshotsGetRequest struct via the builder pattern + + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| + +### Return type + +[**SnapshotList**](SnapshotList.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + diff --git a/docs/api/TemplatesApi.md b/docs/api/TemplatesApi.md new file mode 100644 index 0000000..2e0eb09 --- /dev/null +++ b/docs/api/TemplatesApi.md @@ -0,0 +1,67 @@ +# \TemplatesApi + +All URIs are relative to *https://api.ionos.com/databases/mongodb* + +|Method | HTTP request | Description| +|------------- | ------------- | -------------| +|[**TemplatesGet**](TemplatesApi.md#TemplatesGet) | **Get** /templates | Get Templates| + + + +## TemplatesGet + +```go +var result TemplateList = TemplatesGet(ctx) + .Execute() +``` + +Get Templates + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + ionoscloud "github.com/ionos-cloud/sdk-go-dbaas-mongo" +) + +func main() { + + configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL") + apiClient := ionoscloud.NewAPIClient(configuration) + resource, resp, err := apiClient.TemplatesApi.TemplatesGet(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TemplatesApi.TemplatesGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp) + } + // response from `TemplatesGet`: TemplateList + fmt.Fprintf(os.Stdout, "Response from `TemplatesApi.TemplatesGet`: %v\n", resource) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to an apiTemplatesGetRequest struct via the builder pattern + + +### Return type + +[**TemplateList**](TemplateList.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + diff --git a/docs/api/UsersApi.md b/docs/api/UsersApi.md new file mode 100644 index 0000000..dedbe99 --- /dev/null +++ b/docs/api/UsersApi.md @@ -0,0 +1,287 @@ +# \UsersApi + +All URIs are relative to *https://api.ionos.com/databases/mongodb* + +|Method | HTTP request | Description| +|------------- | ------------- | -------------| +|[**ClustersUsersDelete**](UsersApi.md#ClustersUsersDelete) | **Delete** /clusters/{clusterId}/users/{database}/{username} | Delete a MongoDB User by ID| +|[**ClustersUsersFindById**](UsersApi.md#ClustersUsersFindById) | **Get** /clusters/{clusterId}/users/{database}/{username} | Get a MongoDB User by ID| +|[**ClustersUsersGet**](UsersApi.md#ClustersUsersGet) | **Get** /clusters/{clusterId}/users | Get a Cluster Users| +|[**ClustersUsersPost**](UsersApi.md#ClustersUsersPost) | **Post** /clusters/{clusterId}/users | Create MongoDB User| + + + +## ClustersUsersDelete + +```go +var result User = ClustersUsersDelete(ctx, clusterId, database, username) + .Execute() +``` + +Delete a MongoDB User by ID + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + ionoscloud "github.com/ionos-cloud/sdk-go-dbaas-mongo" +) + +func main() { + clusterId := "clusterId_example" // string | The unique ID of the cluster. + database := "database_example" // string | The authentication database. + username := "username_example" // string | The authentication username. + + configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL") + apiClient := ionoscloud.NewAPIClient(configuration) + resource, resp, err := apiClient.UsersApi.ClustersUsersDelete(context.Background(), clusterId, database, username).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersApi.ClustersUsersDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp) + } + // response from `ClustersUsersDelete`: User + fmt.Fprintf(os.Stdout, "Response from `UsersApi.ClustersUsersDelete`: %v\n", resource) +} +``` + +### Path Parameters + + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +|**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| +|**clusterId** | **string** | The unique ID of the cluster. | | +|**database** | **string** | The authentication database. | | +|**username** | **string** | The authentication username. | | + +### Other Parameters + +Other parameters are passed through a pointer to an apiClustersUsersDeleteRequest struct via the builder pattern + + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| + +### Return type + +[**User**](User.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + + +## ClustersUsersFindById + +```go +var result User = ClustersUsersFindById(ctx, clusterId, database, username) + .Execute() +``` + +Get a MongoDB User by ID + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + ionoscloud "github.com/ionos-cloud/sdk-go-dbaas-mongo" +) + +func main() { + clusterId := "clusterId_example" // string | The unique ID of the cluster. + database := "database_example" // string | The authentication database. + username := "username_example" // string | The authentication username. + + configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL") + apiClient := ionoscloud.NewAPIClient(configuration) + resource, resp, err := apiClient.UsersApi.ClustersUsersFindById(context.Background(), clusterId, database, username).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersApi.ClustersUsersFindById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp) + } + // response from `ClustersUsersFindById`: User + fmt.Fprintf(os.Stdout, "Response from `UsersApi.ClustersUsersFindById`: %v\n", resource) +} +``` + +### Path Parameters + + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +|**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| +|**clusterId** | **string** | The unique ID of the cluster. | | +|**database** | **string** | The authentication database. | | +|**username** | **string** | The authentication username. | | + +### Other Parameters + +Other parameters are passed through a pointer to an apiClustersUsersFindByIdRequest struct via the builder pattern + + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| + +### Return type + +[**User**](User.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + + +## ClustersUsersGet + +```go +var result UsersList = ClustersUsersGet(ctx, clusterId) + .Execute() +``` + +Get a Cluster Users + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + ionoscloud "github.com/ionos-cloud/sdk-go-dbaas-mongo" +) + +func main() { + clusterId := "clusterId_example" // string | The unique ID of the cluster. + + configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL") + apiClient := ionoscloud.NewAPIClient(configuration) + resource, resp, err := apiClient.UsersApi.ClustersUsersGet(context.Background(), clusterId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersApi.ClustersUsersGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp) + } + // response from `ClustersUsersGet`: UsersList + fmt.Fprintf(os.Stdout, "Response from `UsersApi.ClustersUsersGet`: %v\n", resource) +} +``` + +### Path Parameters + + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +|**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| +|**clusterId** | **string** | The unique ID of the cluster. | | + +### Other Parameters + +Other parameters are passed through a pointer to an apiClustersUsersGetRequest struct via the builder pattern + + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| + +### Return type + +[**UsersList**](UsersList.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + + +## ClustersUsersPost + +```go +var result User = ClustersUsersPost(ctx, clusterId) + .User(user) + .Execute() +``` + +Create MongoDB User + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + ionoscloud "github.com/ionos-cloud/sdk-go-dbaas-mongo" +) + +func main() { + clusterId := "clusterId_example" // string | The unique ID of the cluster. + user := *openapiclient.NewUser() // User | The user to be created. + + configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL") + apiClient := ionoscloud.NewAPIClient(configuration) + resource, resp, err := apiClient.UsersApi.ClustersUsersPost(context.Background(), clusterId).User(user).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersApi.ClustersUsersPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp) + } + // response from `ClustersUsersPost`: User + fmt.Fprintf(os.Stdout, "Response from `UsersApi.ClustersUsersPost`: %v\n", resource) +} +``` + +### Path Parameters + + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +|**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| +|**clusterId** | **string** | The unique ID of the cluster. | | + +### Other Parameters + +Other parameters are passed through a pointer to an apiClustersUsersPostRequest struct via the builder pattern + + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **user** | [**User**](User.md) | The user to be created. | | + +### Return type + +[**User**](User.md) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + diff --git a/docs/models/APIVersion.md b/docs/models/APIVersion.md new file mode 100644 index 0000000..c63431e --- /dev/null +++ b/docs/models/APIVersion.md @@ -0,0 +1,66 @@ +# APIVersion + + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Name** | Pointer to **string** | | [optional] | +|**SwaggerUrl** | Pointer to **string** | | [optional] | + +## Methods + + +### GetName + +`func (o *APIVersion) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *APIVersion) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *APIVersion) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *APIVersion) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetSwaggerUrl + +`func (o *APIVersion) GetSwaggerUrl() string` + +GetSwaggerUrl returns the SwaggerUrl field if non-nil, zero value otherwise. + +### GetSwaggerUrlOk + +`func (o *APIVersion) GetSwaggerUrlOk() (*string, bool)` + +GetSwaggerUrlOk returns a tuple with the SwaggerUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSwaggerUrl + +`func (o *APIVersion) SetSwaggerUrl(v string)` + +SetSwaggerUrl sets SwaggerUrl field to given value. + +### HasSwaggerUrl + +`func (o *APIVersion) HasSwaggerUrl() bool` + +HasSwaggerUrl returns a boolean if a field has been set. + + + diff --git a/docs/models/ClusterList.md b/docs/models/ClusterList.md new file mode 100644 index 0000000..7fe3af9 --- /dev/null +++ b/docs/models/ClusterList.md @@ -0,0 +1,171 @@ +# ClusterList + +List of clusters. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Type** | Pointer to [**ResourceType**](ResourceType.md) | | [optional] | +|**Id** | Pointer to **string** | The unique ID of the resource. | [optional] | +|**Items** | Pointer to [**[]ClusterResponse**](ClusterResponse.md) | | [optional] | +|**Offset** | Pointer to **int32** | The offset specified in the request (if none was specified, the default offset is 0) (not implemented yet). | [optional] [readonly] | +|**Limit** | Pointer to **int32** | The limit specified in the request (if none was specified, use the endpoint's default pagination limit) (not implemented yet, always return number of items). | [optional] [readonly] | +|**Links** | Pointer to [**PaginationLinks**](PaginationLinks.md) | | [optional] | + +## Methods + + +### GetType + +`func (o *ClusterList) GetType() ResourceType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ClusterList) GetTypeOk() (*ResourceType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ClusterList) SetType(v ResourceType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *ClusterList) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetId + +`func (o *ClusterList) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *ClusterList) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *ClusterList) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *ClusterList) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetItems + +`func (o *ClusterList) GetItems() []ClusterResponse` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ClusterList) GetItemsOk() (*[]ClusterResponse, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ClusterList) SetItems(v []ClusterResponse)` + +SetItems sets Items field to given value. + +### HasItems + +`func (o *ClusterList) HasItems() bool` + +HasItems returns a boolean if a field has been set. + +### GetOffset + +`func (o *ClusterList) GetOffset() int32` + +GetOffset returns the Offset field if non-nil, zero value otherwise. + +### GetOffsetOk + +`func (o *ClusterList) GetOffsetOk() (*int32, bool)` + +GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOffset + +`func (o *ClusterList) SetOffset(v int32)` + +SetOffset sets Offset field to given value. + +### HasOffset + +`func (o *ClusterList) HasOffset() bool` + +HasOffset returns a boolean if a field has been set. + +### GetLimit + +`func (o *ClusterList) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *ClusterList) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *ClusterList) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + +### HasLimit + +`func (o *ClusterList) HasLimit() bool` + +HasLimit returns a boolean if a field has been set. + +### GetLinks + +`func (o *ClusterList) GetLinks() PaginationLinks` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *ClusterList) GetLinksOk() (*PaginationLinks, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *ClusterList) SetLinks(v PaginationLinks)` + +SetLinks sets Links field to given value. + +### HasLinks + +`func (o *ClusterList) HasLinks() bool` + +HasLinks returns a boolean if a field has been set. + + + diff --git a/docs/models/ClusterListAllOf.md b/docs/models/ClusterListAllOf.md new file mode 100644 index 0000000..11935f6 --- /dev/null +++ b/docs/models/ClusterListAllOf.md @@ -0,0 +1,92 @@ +# ClusterListAllOf + + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Type** | Pointer to [**ResourceType**](ResourceType.md) | | [optional] | +|**Id** | Pointer to **string** | The unique ID of the resource. | [optional] | +|**Items** | Pointer to [**[]ClusterResponse**](ClusterResponse.md) | | [optional] | + +## Methods + + +### GetType + +`func (o *ClusterListAllOf) GetType() ResourceType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ClusterListAllOf) GetTypeOk() (*ResourceType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ClusterListAllOf) SetType(v ResourceType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *ClusterListAllOf) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetId + +`func (o *ClusterListAllOf) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *ClusterListAllOf) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *ClusterListAllOf) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *ClusterListAllOf) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetItems + +`func (o *ClusterListAllOf) GetItems() []ClusterResponse` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ClusterListAllOf) GetItemsOk() (*[]ClusterResponse, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ClusterListAllOf) SetItems(v []ClusterResponse)` + +SetItems sets Items field to given value. + +### HasItems + +`func (o *ClusterListAllOf) HasItems() bool` + +HasItems returns a boolean if a field has been set. + + + diff --git a/docs/models/ClusterLogs.md b/docs/models/ClusterLogs.md new file mode 100644 index 0000000..59f43ca --- /dev/null +++ b/docs/models/ClusterLogs.md @@ -0,0 +1,41 @@ +# ClusterLogs + +The logs of the MongoDB cluster. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Instances** | Pointer to [**[]ClusterLogsInstances**](ClusterLogsInstances.md) | | [optional] | + +## Methods + + +### GetInstances + +`func (o *ClusterLogs) GetInstances() []ClusterLogsInstances` + +GetInstances returns the Instances field if non-nil, zero value otherwise. + +### GetInstancesOk + +`func (o *ClusterLogs) GetInstancesOk() (*[]ClusterLogsInstances, bool)` + +GetInstancesOk returns a tuple with the Instances field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstances + +`func (o *ClusterLogs) SetInstances(v []ClusterLogsInstances)` + +SetInstances sets Instances field to given value. + +### HasInstances + +`func (o *ClusterLogs) HasInstances() bool` + +HasInstances returns a boolean if a field has been set. + + + diff --git a/docs/models/ClusterLogsInstances.md b/docs/models/ClusterLogsInstances.md new file mode 100644 index 0000000..bb54f24 --- /dev/null +++ b/docs/models/ClusterLogsInstances.md @@ -0,0 +1,66 @@ +# ClusterLogsInstances + + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Name** | Pointer to **string** | The name of the MongoDB instance. | [optional] | +|**Messages** | Pointer to [**[]ClusterLogsMessages**](ClusterLogsMessages.md) | | [optional] | + +## Methods + + +### GetName + +`func (o *ClusterLogsInstances) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ClusterLogsInstances) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ClusterLogsInstances) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *ClusterLogsInstances) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetMessages + +`func (o *ClusterLogsInstances) GetMessages() []ClusterLogsMessages` + +GetMessages returns the Messages field if non-nil, zero value otherwise. + +### GetMessagesOk + +`func (o *ClusterLogsInstances) GetMessagesOk() (*[]ClusterLogsMessages, bool)` + +GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessages + +`func (o *ClusterLogsInstances) SetMessages(v []ClusterLogsMessages)` + +SetMessages sets Messages field to given value. + +### HasMessages + +`func (o *ClusterLogsInstances) HasMessages() bool` + +HasMessages returns a boolean if a field has been set. + + + diff --git a/docs/models/ClusterLogsMessages.md b/docs/models/ClusterLogsMessages.md new file mode 100644 index 0000000..37fe28d --- /dev/null +++ b/docs/models/ClusterLogsMessages.md @@ -0,0 +1,66 @@ +# ClusterLogsMessages + + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Time** | Pointer to [**time.Time**](time.Time.md) | | [optional] | +|**Message** | Pointer to **string** | | [optional] | + +## Methods + + +### GetTime + +`func (o *ClusterLogsMessages) GetTime() time.Time` + +GetTime returns the Time field if non-nil, zero value otherwise. + +### GetTimeOk + +`func (o *ClusterLogsMessages) GetTimeOk() (*time.Time, bool)` + +GetTimeOk returns a tuple with the Time field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTime + +`func (o *ClusterLogsMessages) SetTime(v time.Time)` + +SetTime sets Time field to given value. + +### HasTime + +`func (o *ClusterLogsMessages) HasTime() bool` + +HasTime returns a boolean if a field has been set. + +### GetMessage + +`func (o *ClusterLogsMessages) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *ClusterLogsMessages) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *ClusterLogsMessages) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *ClusterLogsMessages) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + + diff --git a/docs/models/ClusterProperties.md b/docs/models/ClusterProperties.md new file mode 100644 index 0000000..7704882 --- /dev/null +++ b/docs/models/ClusterProperties.md @@ -0,0 +1,223 @@ +# ClusterProperties + +Properties of a database cluster. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**DisplayName** | Pointer to **string** | The name of your cluster. | [optional] | +|**MongoDBVersion** | Pointer to **string** | The MongoDB version of your cluster. | [optional] | +|**Location** | Pointer to **string** | The physical location where the cluster will be created. This is the location where all your instances will be located. This property is immutable. | [optional] | +|**Instances** | Pointer to **int32** | The total number of instances in the cluster (one primary and n-1 secondaries). | [optional] | +|**Connections** | Pointer to [**[]Connection**](Connection.md) | | [optional] | +|**MaintenanceWindow** | Pointer to [**MaintenanceWindow**](MaintenanceWindow.md) | | [optional] | +|**TemplateID** | Pointer to **string** | The unique ID of the template, which specifies the number of cores, storage size, and memory. | [optional] | +|**ConnectionString** | Pointer to **string** | The connection string for your cluster. | [optional] | + +## Methods + + +### GetDisplayName + +`func (o *ClusterProperties) GetDisplayName() string` + +GetDisplayName returns the DisplayName field if non-nil, zero value otherwise. + +### GetDisplayNameOk + +`func (o *ClusterProperties) GetDisplayNameOk() (*string, bool)` + +GetDisplayNameOk returns a tuple with the DisplayName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDisplayName + +`func (o *ClusterProperties) SetDisplayName(v string)` + +SetDisplayName sets DisplayName field to given value. + +### HasDisplayName + +`func (o *ClusterProperties) HasDisplayName() bool` + +HasDisplayName returns a boolean if a field has been set. + +### GetMongoDBVersion + +`func (o *ClusterProperties) GetMongoDBVersion() string` + +GetMongoDBVersion returns the MongoDBVersion field if non-nil, zero value otherwise. + +### GetMongoDBVersionOk + +`func (o *ClusterProperties) GetMongoDBVersionOk() (*string, bool)` + +GetMongoDBVersionOk returns a tuple with the MongoDBVersion field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMongoDBVersion + +`func (o *ClusterProperties) SetMongoDBVersion(v string)` + +SetMongoDBVersion sets MongoDBVersion field to given value. + +### HasMongoDBVersion + +`func (o *ClusterProperties) HasMongoDBVersion() bool` + +HasMongoDBVersion returns a boolean if a field has been set. + +### GetLocation + +`func (o *ClusterProperties) GetLocation() string` + +GetLocation returns the Location field if non-nil, zero value otherwise. + +### GetLocationOk + +`func (o *ClusterProperties) GetLocationOk() (*string, bool)` + +GetLocationOk returns a tuple with the Location field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLocation + +`func (o *ClusterProperties) SetLocation(v string)` + +SetLocation sets Location field to given value. + +### HasLocation + +`func (o *ClusterProperties) HasLocation() bool` + +HasLocation returns a boolean if a field has been set. + +### GetInstances + +`func (o *ClusterProperties) GetInstances() int32` + +GetInstances returns the Instances field if non-nil, zero value otherwise. + +### GetInstancesOk + +`func (o *ClusterProperties) GetInstancesOk() (*int32, bool)` + +GetInstancesOk returns a tuple with the Instances field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstances + +`func (o *ClusterProperties) SetInstances(v int32)` + +SetInstances sets Instances field to given value. + +### HasInstances + +`func (o *ClusterProperties) HasInstances() bool` + +HasInstances returns a boolean if a field has been set. + +### GetConnections + +`func (o *ClusterProperties) GetConnections() []Connection` + +GetConnections returns the Connections field if non-nil, zero value otherwise. + +### GetConnectionsOk + +`func (o *ClusterProperties) GetConnectionsOk() (*[]Connection, bool)` + +GetConnectionsOk returns a tuple with the Connections field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConnections + +`func (o *ClusterProperties) SetConnections(v []Connection)` + +SetConnections sets Connections field to given value. + +### HasConnections + +`func (o *ClusterProperties) HasConnections() bool` + +HasConnections returns a boolean if a field has been set. + +### GetMaintenanceWindow + +`func (o *ClusterProperties) GetMaintenanceWindow() MaintenanceWindow` + +GetMaintenanceWindow returns the MaintenanceWindow field if non-nil, zero value otherwise. + +### GetMaintenanceWindowOk + +`func (o *ClusterProperties) GetMaintenanceWindowOk() (*MaintenanceWindow, bool)` + +GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaintenanceWindow + +`func (o *ClusterProperties) SetMaintenanceWindow(v MaintenanceWindow)` + +SetMaintenanceWindow sets MaintenanceWindow field to given value. + +### HasMaintenanceWindow + +`func (o *ClusterProperties) HasMaintenanceWindow() bool` + +HasMaintenanceWindow returns a boolean if a field has been set. + +### GetTemplateID + +`func (o *ClusterProperties) GetTemplateID() string` + +GetTemplateID returns the TemplateID field if non-nil, zero value otherwise. + +### GetTemplateIDOk + +`func (o *ClusterProperties) GetTemplateIDOk() (*string, bool)` + +GetTemplateIDOk returns a tuple with the TemplateID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTemplateID + +`func (o *ClusterProperties) SetTemplateID(v string)` + +SetTemplateID sets TemplateID field to given value. + +### HasTemplateID + +`func (o *ClusterProperties) HasTemplateID() bool` + +HasTemplateID returns a boolean if a field has been set. + +### GetConnectionString + +`func (o *ClusterProperties) GetConnectionString() string` + +GetConnectionString returns the ConnectionString field if non-nil, zero value otherwise. + +### GetConnectionStringOk + +`func (o *ClusterProperties) GetConnectionStringOk() (*string, bool)` + +GetConnectionStringOk returns a tuple with the ConnectionString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConnectionString + +`func (o *ClusterProperties) SetConnectionString(v string)` + +SetConnectionString sets ConnectionString field to given value. + +### HasConnectionString + +`func (o *ClusterProperties) HasConnectionString() bool` + +HasConnectionString returns a boolean if a field has been set. + + + diff --git a/docs/models/ClusterResponse.md b/docs/models/ClusterResponse.md new file mode 100644 index 0000000..a7e235f --- /dev/null +++ b/docs/models/ClusterResponse.md @@ -0,0 +1,119 @@ +# ClusterResponse + +A database cluster. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Type** | Pointer to [**ResourceType**](ResourceType.md) | | [optional] | +|**Id** | Pointer to **string** | The unique ID of the resource. | [optional] | +|**Metadata** | Pointer to [**Metadata**](Metadata.md) | | [optional] | +|**Properties** | Pointer to [**ClusterProperties**](ClusterProperties.md) | | [optional] | + +## Methods + + +### GetType + +`func (o *ClusterResponse) GetType() ResourceType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ClusterResponse) GetTypeOk() (*ResourceType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ClusterResponse) SetType(v ResourceType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *ClusterResponse) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetId + +`func (o *ClusterResponse) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *ClusterResponse) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *ClusterResponse) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *ClusterResponse) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetMetadata + +`func (o *ClusterResponse) GetMetadata() Metadata` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *ClusterResponse) GetMetadataOk() (*Metadata, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *ClusterResponse) SetMetadata(v Metadata)` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *ClusterResponse) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + +### GetProperties + +`func (o *ClusterResponse) GetProperties() ClusterProperties` + +GetProperties returns the Properties field if non-nil, zero value otherwise. + +### GetPropertiesOk + +`func (o *ClusterResponse) GetPropertiesOk() (*ClusterProperties, bool)` + +GetPropertiesOk returns a tuple with the Properties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProperties + +`func (o *ClusterResponse) SetProperties(v ClusterProperties)` + +SetProperties sets Properties field to given value. + +### HasProperties + +`func (o *ClusterResponse) HasProperties() bool` + +HasProperties returns a boolean if a field has been set. + + + diff --git a/docs/models/Connection.md b/docs/models/Connection.md new file mode 100644 index 0000000..1e68560 --- /dev/null +++ b/docs/models/Connection.md @@ -0,0 +1,78 @@ +# Connection + +The network connection details for your cluster. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**DatacenterId** | **string** | The datacenter to which your cluster will be connected. | | +|**LanId** | **string** | The numeric LAN ID with which you connect your cluster. | | +|**CidrList** | **[]string** | The list of IPs and subnet for your cluster. Note the following unavailable IP ranges: 10.233.64.0/18 10.233.0.0/18 10.233.114.0/24 | | + +## Methods + + +### GetDatacenterId + +`func (o *Connection) GetDatacenterId() string` + +GetDatacenterId returns the DatacenterId field if non-nil, zero value otherwise. + +### GetDatacenterIdOk + +`func (o *Connection) GetDatacenterIdOk() (*string, bool)` + +GetDatacenterIdOk returns a tuple with the DatacenterId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDatacenterId + +`func (o *Connection) SetDatacenterId(v string)` + +SetDatacenterId sets DatacenterId field to given value. + + +### GetLanId + +`func (o *Connection) GetLanId() string` + +GetLanId returns the LanId field if non-nil, zero value otherwise. + +### GetLanIdOk + +`func (o *Connection) GetLanIdOk() (*string, bool)` + +GetLanIdOk returns a tuple with the LanId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLanId + +`func (o *Connection) SetLanId(v string)` + +SetLanId sets LanId field to given value. + + +### GetCidrList + +`func (o *Connection) GetCidrList() []string` + +GetCidrList returns the CidrList field if non-nil, zero value otherwise. + +### GetCidrListOk + +`func (o *Connection) GetCidrListOk() (*[]string, bool)` + +GetCidrListOk returns a tuple with the CidrList field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCidrList + +`func (o *Connection) SetCidrList(v []string)` + +SetCidrList sets CidrList field to given value. + + + + diff --git a/docs/models/CreateClusterProperties.md b/docs/models/CreateClusterProperties.md new file mode 100644 index 0000000..51f9d76 --- /dev/null +++ b/docs/models/CreateClusterProperties.md @@ -0,0 +1,172 @@ +# CreateClusterProperties + +The properties with all data needed to create a new MongoDB cluster. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**TemplateID** | **string** | The unique ID of the template, which specifies the number of cores, storage size, and memory. | | +|**MongoDBVersion** | Pointer to **string** | The MongoDB version of your cluster. | [optional] | +|**Instances** | **int32** | The total number of instances in the cluster (one primary and n-1 secondaries). | | +|**Connections** | [**[]Connection**](Connection.md) | | | +|**Location** | **string** | The physical location where the cluster will be created. This is the location where all your instances will be located. This property is immutable. | | +|**DisplayName** | **string** | The name of your cluster. | | +|**MaintenanceWindow** | Pointer to [**MaintenanceWindow**](MaintenanceWindow.md) | | [optional] | + +## Methods + + +### GetTemplateID + +`func (o *CreateClusterProperties) GetTemplateID() string` + +GetTemplateID returns the TemplateID field if non-nil, zero value otherwise. + +### GetTemplateIDOk + +`func (o *CreateClusterProperties) GetTemplateIDOk() (*string, bool)` + +GetTemplateIDOk returns a tuple with the TemplateID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTemplateID + +`func (o *CreateClusterProperties) SetTemplateID(v string)` + +SetTemplateID sets TemplateID field to given value. + + +### GetMongoDBVersion + +`func (o *CreateClusterProperties) GetMongoDBVersion() string` + +GetMongoDBVersion returns the MongoDBVersion field if non-nil, zero value otherwise. + +### GetMongoDBVersionOk + +`func (o *CreateClusterProperties) GetMongoDBVersionOk() (*string, bool)` + +GetMongoDBVersionOk returns a tuple with the MongoDBVersion field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMongoDBVersion + +`func (o *CreateClusterProperties) SetMongoDBVersion(v string)` + +SetMongoDBVersion sets MongoDBVersion field to given value. + +### HasMongoDBVersion + +`func (o *CreateClusterProperties) HasMongoDBVersion() bool` + +HasMongoDBVersion returns a boolean if a field has been set. + +### GetInstances + +`func (o *CreateClusterProperties) GetInstances() int32` + +GetInstances returns the Instances field if non-nil, zero value otherwise. + +### GetInstancesOk + +`func (o *CreateClusterProperties) GetInstancesOk() (*int32, bool)` + +GetInstancesOk returns a tuple with the Instances field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstances + +`func (o *CreateClusterProperties) SetInstances(v int32)` + +SetInstances sets Instances field to given value. + + +### GetConnections + +`func (o *CreateClusterProperties) GetConnections() []Connection` + +GetConnections returns the Connections field if non-nil, zero value otherwise. + +### GetConnectionsOk + +`func (o *CreateClusterProperties) GetConnectionsOk() (*[]Connection, bool)` + +GetConnectionsOk returns a tuple with the Connections field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConnections + +`func (o *CreateClusterProperties) SetConnections(v []Connection)` + +SetConnections sets Connections field to given value. + + +### GetLocation + +`func (o *CreateClusterProperties) GetLocation() string` + +GetLocation returns the Location field if non-nil, zero value otherwise. + +### GetLocationOk + +`func (o *CreateClusterProperties) GetLocationOk() (*string, bool)` + +GetLocationOk returns a tuple with the Location field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLocation + +`func (o *CreateClusterProperties) SetLocation(v string)` + +SetLocation sets Location field to given value. + + +### GetDisplayName + +`func (o *CreateClusterProperties) GetDisplayName() string` + +GetDisplayName returns the DisplayName field if non-nil, zero value otherwise. + +### GetDisplayNameOk + +`func (o *CreateClusterProperties) GetDisplayNameOk() (*string, bool)` + +GetDisplayNameOk returns a tuple with the DisplayName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDisplayName + +`func (o *CreateClusterProperties) SetDisplayName(v string)` + +SetDisplayName sets DisplayName field to given value. + + +### GetMaintenanceWindow + +`func (o *CreateClusterProperties) GetMaintenanceWindow() MaintenanceWindow` + +GetMaintenanceWindow returns the MaintenanceWindow field if non-nil, zero value otherwise. + +### GetMaintenanceWindowOk + +`func (o *CreateClusterProperties) GetMaintenanceWindowOk() (*MaintenanceWindow, bool)` + +GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaintenanceWindow + +`func (o *CreateClusterProperties) SetMaintenanceWindow(v MaintenanceWindow)` + +SetMaintenanceWindow sets MaintenanceWindow field to given value. + +### HasMaintenanceWindow + +`func (o *CreateClusterProperties) HasMaintenanceWindow() bool` + +HasMaintenanceWindow returns a boolean if a field has been set. + + + diff --git a/docs/models/CreateClusterRequest.md b/docs/models/CreateClusterRequest.md new file mode 100644 index 0000000..87f11ce --- /dev/null +++ b/docs/models/CreateClusterRequest.md @@ -0,0 +1,67 @@ +# CreateClusterRequest + +The request payload with all data needed to create a new MongoDB cluster. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Metadata** | Pointer to [**Metadata**](Metadata.md) | | [optional] | +|**Properties** | Pointer to [**CreateClusterProperties**](CreateClusterProperties.md) | | [optional] | + +## Methods + + +### GetMetadata + +`func (o *CreateClusterRequest) GetMetadata() Metadata` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *CreateClusterRequest) GetMetadataOk() (*Metadata, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *CreateClusterRequest) SetMetadata(v Metadata)` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *CreateClusterRequest) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + +### GetProperties + +`func (o *CreateClusterRequest) GetProperties() CreateClusterProperties` + +GetProperties returns the Properties field if non-nil, zero value otherwise. + +### GetPropertiesOk + +`func (o *CreateClusterRequest) GetPropertiesOk() (*CreateClusterProperties, bool)` + +GetPropertiesOk returns a tuple with the Properties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProperties + +`func (o *CreateClusterRequest) SetProperties(v CreateClusterProperties)` + +SetProperties sets Properties field to given value. + +### HasProperties + +`func (o *CreateClusterRequest) HasProperties() bool` + +HasProperties returns a boolean if a field has been set. + + + diff --git a/docs/models/CreateRestoreRequest.md b/docs/models/CreateRestoreRequest.md new file mode 100644 index 0000000..03dde1f --- /dev/null +++ b/docs/models/CreateRestoreRequest.md @@ -0,0 +1,36 @@ +# CreateRestoreRequest + +The restore request. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**SnapshotId** | **string** | The unique ID of the snapshot you want to restore. | | + +## Methods + + +### GetSnapshotId + +`func (o *CreateRestoreRequest) GetSnapshotId() string` + +GetSnapshotId returns the SnapshotId field if non-nil, zero value otherwise. + +### GetSnapshotIdOk + +`func (o *CreateRestoreRequest) GetSnapshotIdOk() (*string, bool)` + +GetSnapshotIdOk returns a tuple with the SnapshotId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSnapshotId + +`func (o *CreateRestoreRequest) SetSnapshotId(v string)` + +SetSnapshotId sets SnapshotId field to given value. + + + + diff --git a/docs/models/DayOfTheWeek.md b/docs/models/DayOfTheWeek.md new file mode 100644 index 0000000..40af6ac --- /dev/null +++ b/docs/models/DayOfTheWeek.md @@ -0,0 +1,18 @@ +# DayOfTheWeek + +The week day. + +## PossibleValues +|Value | +|------------ | +|SUNDAY | +|MONDAY | +|TUESDAY | +|WEDNESDAY | +|THURSDAY | +|FRIDAY | +|SATURDAY | + + + + diff --git a/docs/models/ErrorMessage.md b/docs/models/ErrorMessage.md new file mode 100644 index 0000000..331fcd2 --- /dev/null +++ b/docs/models/ErrorMessage.md @@ -0,0 +1,66 @@ +# ErrorMessage + + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**ErrorCode** | Pointer to **string** | Application internal error code. | [optional] | +|**Message** | Pointer to **string** | A human readable explanation specific to this occurrence of the problem. | [optional] | + +## Methods + + +### GetErrorCode + +`func (o *ErrorMessage) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *ErrorMessage) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *ErrorMessage) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + +### HasErrorCode + +`func (o *ErrorMessage) HasErrorCode() bool` + +HasErrorCode returns a boolean if a field has been set. + +### GetMessage + +`func (o *ErrorMessage) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *ErrorMessage) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *ErrorMessage) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *ErrorMessage) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + + diff --git a/docs/models/ErrorResponse.md b/docs/models/ErrorResponse.md new file mode 100644 index 0000000..9cc88ad --- /dev/null +++ b/docs/models/ErrorResponse.md @@ -0,0 +1,66 @@ +# ErrorResponse + + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**HttpStatus** | Pointer to **int32** | The HTTP status code of the operation. | [optional] | +|**Messages** | Pointer to [**[]ErrorMessage**](ErrorMessage.md) | | [optional] | + +## Methods + + +### GetHttpStatus + +`func (o *ErrorResponse) GetHttpStatus() int32` + +GetHttpStatus returns the HttpStatus field if non-nil, zero value otherwise. + +### GetHttpStatusOk + +`func (o *ErrorResponse) GetHttpStatusOk() (*int32, bool)` + +GetHttpStatusOk returns a tuple with the HttpStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHttpStatus + +`func (o *ErrorResponse) SetHttpStatus(v int32)` + +SetHttpStatus sets HttpStatus field to given value. + +### HasHttpStatus + +`func (o *ErrorResponse) HasHttpStatus() bool` + +HasHttpStatus returns a boolean if a field has been set. + +### GetMessages + +`func (o *ErrorResponse) GetMessages() []ErrorMessage` + +GetMessages returns the Messages field if non-nil, zero value otherwise. + +### GetMessagesOk + +`func (o *ErrorResponse) GetMessagesOk() (*[]ErrorMessage, bool)` + +GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessages + +`func (o *ErrorResponse) SetMessages(v []ErrorMessage)` + +SetMessages sets Messages field to given value. + +### HasMessages + +`func (o *ErrorResponse) HasMessages() bool` + +HasMessages returns a boolean if a field has been set. + + + diff --git a/docs/models/MaintenanceWindow.md b/docs/models/MaintenanceWindow.md new file mode 100644 index 0000000..0f0ed14 --- /dev/null +++ b/docs/models/MaintenanceWindow.md @@ -0,0 +1,57 @@ +# MaintenanceWindow + +A weekly window of 4 hours during which maintenance work can be performed. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Time** | **string** | | | +|**DayOfTheWeek** | [**DayOfTheWeek**](DayOfTheWeek.md) | | | + +## Methods + + +### GetTime + +`func (o *MaintenanceWindow) GetTime() string` + +GetTime returns the Time field if non-nil, zero value otherwise. + +### GetTimeOk + +`func (o *MaintenanceWindow) GetTimeOk() (*string, bool)` + +GetTimeOk returns a tuple with the Time field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTime + +`func (o *MaintenanceWindow) SetTime(v string)` + +SetTime sets Time field to given value. + + +### GetDayOfTheWeek + +`func (o *MaintenanceWindow) GetDayOfTheWeek() DayOfTheWeek` + +GetDayOfTheWeek returns the DayOfTheWeek field if non-nil, zero value otherwise. + +### GetDayOfTheWeekOk + +`func (o *MaintenanceWindow) GetDayOfTheWeekOk() (*DayOfTheWeek, bool)` + +GetDayOfTheWeekOk returns a tuple with the DayOfTheWeek field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDayOfTheWeek + +`func (o *MaintenanceWindow) SetDayOfTheWeek(v DayOfTheWeek)` + +SetDayOfTheWeek sets DayOfTheWeek field to given value. + + + + diff --git a/docs/models/Metadata.md b/docs/models/Metadata.md new file mode 100644 index 0000000..9c99f6f --- /dev/null +++ b/docs/models/Metadata.md @@ -0,0 +1,197 @@ +# Metadata + +The metadata of the resource. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**CreatedDate** | Pointer to [**time.Time**](time.Time.md) | The date the resource was created. | [optional] | +|**CreatedBy** | Pointer to **string** | The user who created the resource. | [optional] | +|**CreatedByUserId** | Pointer to **string** | The ID of the user who created the resource. | [optional] | +|**LastModifiedDate** | Pointer to [**time.Time**](time.Time.md) | The date the resource was last modified. | [optional] | +|**LastModifiedBy** | Pointer to **string** | The last user who modified the resource. | [optional] | +|**LastModifiedByUserId** | Pointer to **string** | The ID of the user who last modified the resource. | [optional] | +|**State** | Pointer to [**State**](State.md) | | [optional] | + +## Methods + + +### GetCreatedDate + +`func (o *Metadata) GetCreatedDate() time.Time` + +GetCreatedDate returns the CreatedDate field if non-nil, zero value otherwise. + +### GetCreatedDateOk + +`func (o *Metadata) GetCreatedDateOk() (*time.Time, bool)` + +GetCreatedDateOk returns a tuple with the CreatedDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedDate + +`func (o *Metadata) SetCreatedDate(v time.Time)` + +SetCreatedDate sets CreatedDate field to given value. + +### HasCreatedDate + +`func (o *Metadata) HasCreatedDate() bool` + +HasCreatedDate returns a boolean if a field has been set. + +### GetCreatedBy + +`func (o *Metadata) GetCreatedBy() string` + +GetCreatedBy returns the CreatedBy field if non-nil, zero value otherwise. + +### GetCreatedByOk + +`func (o *Metadata) GetCreatedByOk() (*string, bool)` + +GetCreatedByOk returns a tuple with the CreatedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedBy + +`func (o *Metadata) SetCreatedBy(v string)` + +SetCreatedBy sets CreatedBy field to given value. + +### HasCreatedBy + +`func (o *Metadata) HasCreatedBy() bool` + +HasCreatedBy returns a boolean if a field has been set. + +### GetCreatedByUserId + +`func (o *Metadata) GetCreatedByUserId() string` + +GetCreatedByUserId returns the CreatedByUserId field if non-nil, zero value otherwise. + +### GetCreatedByUserIdOk + +`func (o *Metadata) GetCreatedByUserIdOk() (*string, bool)` + +GetCreatedByUserIdOk returns a tuple with the CreatedByUserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedByUserId + +`func (o *Metadata) SetCreatedByUserId(v string)` + +SetCreatedByUserId sets CreatedByUserId field to given value. + +### HasCreatedByUserId + +`func (o *Metadata) HasCreatedByUserId() bool` + +HasCreatedByUserId returns a boolean if a field has been set. + +### GetLastModifiedDate + +`func (o *Metadata) GetLastModifiedDate() time.Time` + +GetLastModifiedDate returns the LastModifiedDate field if non-nil, zero value otherwise. + +### GetLastModifiedDateOk + +`func (o *Metadata) GetLastModifiedDateOk() (*time.Time, bool)` + +GetLastModifiedDateOk returns a tuple with the LastModifiedDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastModifiedDate + +`func (o *Metadata) SetLastModifiedDate(v time.Time)` + +SetLastModifiedDate sets LastModifiedDate field to given value. + +### HasLastModifiedDate + +`func (o *Metadata) HasLastModifiedDate() bool` + +HasLastModifiedDate returns a boolean if a field has been set. + +### GetLastModifiedBy + +`func (o *Metadata) GetLastModifiedBy() string` + +GetLastModifiedBy returns the LastModifiedBy field if non-nil, zero value otherwise. + +### GetLastModifiedByOk + +`func (o *Metadata) GetLastModifiedByOk() (*string, bool)` + +GetLastModifiedByOk returns a tuple with the LastModifiedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastModifiedBy + +`func (o *Metadata) SetLastModifiedBy(v string)` + +SetLastModifiedBy sets LastModifiedBy field to given value. + +### HasLastModifiedBy + +`func (o *Metadata) HasLastModifiedBy() bool` + +HasLastModifiedBy returns a boolean if a field has been set. + +### GetLastModifiedByUserId + +`func (o *Metadata) GetLastModifiedByUserId() string` + +GetLastModifiedByUserId returns the LastModifiedByUserId field if non-nil, zero value otherwise. + +### GetLastModifiedByUserIdOk + +`func (o *Metadata) GetLastModifiedByUserIdOk() (*string, bool)` + +GetLastModifiedByUserIdOk returns a tuple with the LastModifiedByUserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastModifiedByUserId + +`func (o *Metadata) SetLastModifiedByUserId(v string)` + +SetLastModifiedByUserId sets LastModifiedByUserId field to given value. + +### HasLastModifiedByUserId + +`func (o *Metadata) HasLastModifiedByUserId() bool` + +HasLastModifiedByUserId returns a boolean if a field has been set. + +### GetState + +`func (o *Metadata) GetState() State` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *Metadata) GetStateOk() (*State, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *Metadata) SetState(v State)` + +SetState sets State field to given value. + +### HasState + +`func (o *Metadata) HasState() bool` + +HasState returns a boolean if a field has been set. + + + diff --git a/docs/models/Pagination.md b/docs/models/Pagination.md new file mode 100644 index 0000000..6f5b04a --- /dev/null +++ b/docs/models/Pagination.md @@ -0,0 +1,92 @@ +# Pagination + + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Offset** | Pointer to **int32** | The offset specified in the request (if none was specified, the default offset is 0) (not implemented yet). | [optional] [readonly] | +|**Limit** | Pointer to **int32** | The limit specified in the request (if none was specified, use the endpoint's default pagination limit) (not implemented yet, always return number of items). | [optional] [readonly] | +|**Links** | Pointer to [**PaginationLinks**](PaginationLinks.md) | | [optional] | + +## Methods + + +### GetOffset + +`func (o *Pagination) GetOffset() int32` + +GetOffset returns the Offset field if non-nil, zero value otherwise. + +### GetOffsetOk + +`func (o *Pagination) GetOffsetOk() (*int32, bool)` + +GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOffset + +`func (o *Pagination) SetOffset(v int32)` + +SetOffset sets Offset field to given value. + +### HasOffset + +`func (o *Pagination) HasOffset() bool` + +HasOffset returns a boolean if a field has been set. + +### GetLimit + +`func (o *Pagination) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *Pagination) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *Pagination) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + +### HasLimit + +`func (o *Pagination) HasLimit() bool` + +HasLimit returns a boolean if a field has been set. + +### GetLinks + +`func (o *Pagination) GetLinks() PaginationLinks` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *Pagination) GetLinksOk() (*PaginationLinks, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *Pagination) SetLinks(v PaginationLinks)` + +SetLinks sets Links field to given value. + +### HasLinks + +`func (o *Pagination) HasLinks() bool` + +HasLinks returns a boolean if a field has been set. + + + diff --git a/docs/models/PaginationLinks.md b/docs/models/PaginationLinks.md new file mode 100644 index 0000000..f40c031 --- /dev/null +++ b/docs/models/PaginationLinks.md @@ -0,0 +1,93 @@ +# PaginationLinks + +The URLs to navigate the different pages. As of now we always only return a single page. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Prev** | Pointer to **string** | The URL (with offset and limit parameters) of the previous page; only present if the offset is greater than 0. | [optional] [readonly] | +|**Self** | Pointer to **string** | The URL (with offset and limit parameters) of the current page. | [optional] [readonly] | +|**Next** | Pointer to **string** | The URL (with offset and limit parameters) of the next page; only present if the offset and limit is less than the total number of elements. | [optional] [readonly] | + +## Methods + + +### GetPrev + +`func (o *PaginationLinks) GetPrev() string` + +GetPrev returns the Prev field if non-nil, zero value otherwise. + +### GetPrevOk + +`func (o *PaginationLinks) GetPrevOk() (*string, bool)` + +GetPrevOk returns a tuple with the Prev field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrev + +`func (o *PaginationLinks) SetPrev(v string)` + +SetPrev sets Prev field to given value. + +### HasPrev + +`func (o *PaginationLinks) HasPrev() bool` + +HasPrev returns a boolean if a field has been set. + +### GetSelf + +`func (o *PaginationLinks) GetSelf() string` + +GetSelf returns the Self field if non-nil, zero value otherwise. + +### GetSelfOk + +`func (o *PaginationLinks) GetSelfOk() (*string, bool)` + +GetSelfOk returns a tuple with the Self field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSelf + +`func (o *PaginationLinks) SetSelf(v string)` + +SetSelf sets Self field to given value. + +### HasSelf + +`func (o *PaginationLinks) HasSelf() bool` + +HasSelf returns a boolean if a field has been set. + +### GetNext + +`func (o *PaginationLinks) GetNext() string` + +GetNext returns the Next field if non-nil, zero value otherwise. + +### GetNextOk + +`func (o *PaginationLinks) GetNextOk() (*string, bool)` + +GetNextOk returns a tuple with the Next field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNext + +`func (o *PaginationLinks) SetNext(v string)` + +SetNext sets Next field to given value. + +### HasNext + +`func (o *PaginationLinks) HasNext() bool` + +HasNext returns a boolean if a field has been set. + + + diff --git a/docs/models/ResourceType.md b/docs/models/ResourceType.md new file mode 100644 index 0000000..049e063 --- /dev/null +++ b/docs/models/ResourceType.md @@ -0,0 +1,14 @@ +# ResourceType + +The resource type. + +## PossibleValues +|Value | +|------------ | +|COLLECTION | +|CLUSTER | +|USER | + + + + diff --git a/docs/models/SnapshotList.md b/docs/models/SnapshotList.md new file mode 100644 index 0000000..5a2f247 --- /dev/null +++ b/docs/models/SnapshotList.md @@ -0,0 +1,171 @@ +# SnapshotList + +List of snapshots. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Type** | Pointer to [**ResourceType**](ResourceType.md) | | [optional] | +|**Id** | Pointer to **string** | The unique ID of the resource. | [optional] | +|**Items** | Pointer to [**[]SnapshotResponse**](SnapshotResponse.md) | | [optional] | +|**Offset** | Pointer to **int32** | The offset specified in the request (if none was specified, the default offset is 0) (not implemented yet). | [optional] [readonly] | +|**Limit** | Pointer to **int32** | The limit specified in the request (if none was specified, use the endpoint's default pagination limit) (not implemented yet, always return number of items). | [optional] [readonly] | +|**Links** | Pointer to [**PaginationLinks**](PaginationLinks.md) | | [optional] | + +## Methods + + +### GetType + +`func (o *SnapshotList) GetType() ResourceType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *SnapshotList) GetTypeOk() (*ResourceType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *SnapshotList) SetType(v ResourceType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *SnapshotList) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetId + +`func (o *SnapshotList) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *SnapshotList) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *SnapshotList) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *SnapshotList) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetItems + +`func (o *SnapshotList) GetItems() []SnapshotResponse` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *SnapshotList) GetItemsOk() (*[]SnapshotResponse, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *SnapshotList) SetItems(v []SnapshotResponse)` + +SetItems sets Items field to given value. + +### HasItems + +`func (o *SnapshotList) HasItems() bool` + +HasItems returns a boolean if a field has been set. + +### GetOffset + +`func (o *SnapshotList) GetOffset() int32` + +GetOffset returns the Offset field if non-nil, zero value otherwise. + +### GetOffsetOk + +`func (o *SnapshotList) GetOffsetOk() (*int32, bool)` + +GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOffset + +`func (o *SnapshotList) SetOffset(v int32)` + +SetOffset sets Offset field to given value. + +### HasOffset + +`func (o *SnapshotList) HasOffset() bool` + +HasOffset returns a boolean if a field has been set. + +### GetLimit + +`func (o *SnapshotList) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *SnapshotList) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *SnapshotList) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + +### HasLimit + +`func (o *SnapshotList) HasLimit() bool` + +HasLimit returns a boolean if a field has been set. + +### GetLinks + +`func (o *SnapshotList) GetLinks() PaginationLinks` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *SnapshotList) GetLinksOk() (*PaginationLinks, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *SnapshotList) SetLinks(v PaginationLinks)` + +SetLinks sets Links field to given value. + +### HasLinks + +`func (o *SnapshotList) HasLinks() bool` + +HasLinks returns a boolean if a field has been set. + + + diff --git a/docs/models/SnapshotListAllOf.md b/docs/models/SnapshotListAllOf.md new file mode 100644 index 0000000..c66240f --- /dev/null +++ b/docs/models/SnapshotListAllOf.md @@ -0,0 +1,92 @@ +# SnapshotListAllOf + + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Type** | Pointer to [**ResourceType**](ResourceType.md) | | [optional] | +|**Id** | Pointer to **string** | The unique ID of the resource. | [optional] | +|**Items** | Pointer to [**[]SnapshotResponse**](SnapshotResponse.md) | | [optional] | + +## Methods + + +### GetType + +`func (o *SnapshotListAllOf) GetType() ResourceType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *SnapshotListAllOf) GetTypeOk() (*ResourceType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *SnapshotListAllOf) SetType(v ResourceType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *SnapshotListAllOf) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetId + +`func (o *SnapshotListAllOf) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *SnapshotListAllOf) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *SnapshotListAllOf) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *SnapshotListAllOf) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetItems + +`func (o *SnapshotListAllOf) GetItems() []SnapshotResponse` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *SnapshotListAllOf) GetItemsOk() (*[]SnapshotResponse, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *SnapshotListAllOf) SetItems(v []SnapshotResponse)` + +SetItems sets Items field to given value. + +### HasItems + +`func (o *SnapshotListAllOf) HasItems() bool` + +HasItems returns a boolean if a field has been set. + + + diff --git a/docs/models/SnapshotProperties.md b/docs/models/SnapshotProperties.md new file mode 100644 index 0000000..77b9f2a --- /dev/null +++ b/docs/models/SnapshotProperties.md @@ -0,0 +1,93 @@ +# SnapshotProperties + +Properties of a snapshot. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Version** | Pointer to **string** | The MongoDB version this backup was created from. | [optional] | +|**Size** | Pointer to **int32** | The size of the snapshot in Mebibytes. | [optional] | +|**CreationTime** | Pointer to [**time.Time**](time.Time.md) | The date the resource was created. | [optional] | + +## Methods + + +### GetVersion + +`func (o *SnapshotProperties) GetVersion() string` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *SnapshotProperties) GetVersionOk() (*string, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *SnapshotProperties) SetVersion(v string)` + +SetVersion sets Version field to given value. + +### HasVersion + +`func (o *SnapshotProperties) HasVersion() bool` + +HasVersion returns a boolean if a field has been set. + +### GetSize + +`func (o *SnapshotProperties) GetSize() int32` + +GetSize returns the Size field if non-nil, zero value otherwise. + +### GetSizeOk + +`func (o *SnapshotProperties) GetSizeOk() (*int32, bool)` + +GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSize + +`func (o *SnapshotProperties) SetSize(v int32)` + +SetSize sets Size field to given value. + +### HasSize + +`func (o *SnapshotProperties) HasSize() bool` + +HasSize returns a boolean if a field has been set. + +### GetCreationTime + +`func (o *SnapshotProperties) GetCreationTime() time.Time` + +GetCreationTime returns the CreationTime field if non-nil, zero value otherwise. + +### GetCreationTimeOk + +`func (o *SnapshotProperties) GetCreationTimeOk() (*time.Time, bool)` + +GetCreationTimeOk returns a tuple with the CreationTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreationTime + +`func (o *SnapshotProperties) SetCreationTime(v time.Time)` + +SetCreationTime sets CreationTime field to given value. + +### HasCreationTime + +`func (o *SnapshotProperties) HasCreationTime() bool` + +HasCreationTime returns a boolean if a field has been set. + + + diff --git a/docs/models/SnapshotResponse.md b/docs/models/SnapshotResponse.md new file mode 100644 index 0000000..03f00cc --- /dev/null +++ b/docs/models/SnapshotResponse.md @@ -0,0 +1,93 @@ +# SnapshotResponse + +A database snapshost. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Type** | Pointer to [**ResourceType**](ResourceType.md) | | [optional] | +|**Id** | Pointer to **string** | The unique ID of the resource. | [optional] | +|**Properties** | Pointer to [**SnapshotProperties**](SnapshotProperties.md) | | [optional] | + +## Methods + + +### GetType + +`func (o *SnapshotResponse) GetType() ResourceType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *SnapshotResponse) GetTypeOk() (*ResourceType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *SnapshotResponse) SetType(v ResourceType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *SnapshotResponse) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetId + +`func (o *SnapshotResponse) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *SnapshotResponse) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *SnapshotResponse) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *SnapshotResponse) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetProperties + +`func (o *SnapshotResponse) GetProperties() SnapshotProperties` + +GetProperties returns the Properties field if non-nil, zero value otherwise. + +### GetPropertiesOk + +`func (o *SnapshotResponse) GetPropertiesOk() (*SnapshotProperties, bool)` + +GetPropertiesOk returns a tuple with the Properties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProperties + +`func (o *SnapshotResponse) SetProperties(v SnapshotProperties)` + +SetProperties sets Properties field to given value. + +### HasProperties + +`func (o *SnapshotResponse) HasProperties() bool` + +HasProperties returns a boolean if a field has been set. + + + diff --git a/docs/models/State.md b/docs/models/State.md new file mode 100644 index 0000000..dfa89cc --- /dev/null +++ b/docs/models/State.md @@ -0,0 +1,16 @@ +# State + +The current status reported by the cluster. + +## PossibleValues +|Value | +|------------ | +|AVAILABLE | +|BUSY | +|DESTROYING | +|FAILED | +|UNKNOWN | + + + + diff --git a/docs/models/TemplateList.md b/docs/models/TemplateList.md new file mode 100644 index 0000000..fc20212 --- /dev/null +++ b/docs/models/TemplateList.md @@ -0,0 +1,41 @@ +# TemplateList + +The list of MongoDB templates. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Items** | Pointer to [**[]TemplateResponse**](TemplateResponse.md) | | [optional] | + +## Methods + + +### GetItems + +`func (o *TemplateList) GetItems() []TemplateResponse` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *TemplateList) GetItemsOk() (*[]TemplateResponse, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *TemplateList) SetItems(v []TemplateResponse)` + +SetItems sets Items field to given value. + +### HasItems + +`func (o *TemplateList) HasItems() bool` + +HasItems returns a boolean if a field has been set. + + + diff --git a/docs/models/TemplateListAllOf.md b/docs/models/TemplateListAllOf.md new file mode 100644 index 0000000..bfb7229 --- /dev/null +++ b/docs/models/TemplateListAllOf.md @@ -0,0 +1,40 @@ +# TemplateListAllOf + + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Items** | Pointer to [**[]TemplateResponse**](TemplateResponse.md) | | [optional] | + +## Methods + + +### GetItems + +`func (o *TemplateListAllOf) GetItems() []TemplateResponse` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *TemplateListAllOf) GetItemsOk() (*[]TemplateResponse, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *TemplateListAllOf) SetItems(v []TemplateResponse)` + +SetItems sets Items field to given value. + +### HasItems + +`func (o *TemplateListAllOf) HasItems() bool` + +HasItems returns a boolean if a field has been set. + + + diff --git a/docs/models/TemplateResponse.md b/docs/models/TemplateResponse.md new file mode 100644 index 0000000..4066b3f --- /dev/null +++ b/docs/models/TemplateResponse.md @@ -0,0 +1,119 @@ +# TemplateResponse + +A MongoDB template item. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Id** | Pointer to **string** | The unique template ID. | [optional] | +|**Cores** | Pointer to **int32** | The number of CPU cores. | [optional] | +|**Ram** | Pointer to **int32** | The amount of memory in GB. | [optional] | +|**StorageSize** | Pointer to **int32** | The amount of storage size in GB. | [optional] | + +## Methods + + +### GetId + +`func (o *TemplateResponse) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *TemplateResponse) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *TemplateResponse) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *TemplateResponse) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetCores + +`func (o *TemplateResponse) GetCores() int32` + +GetCores returns the Cores field if non-nil, zero value otherwise. + +### GetCoresOk + +`func (o *TemplateResponse) GetCoresOk() (*int32, bool)` + +GetCoresOk returns a tuple with the Cores field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCores + +`func (o *TemplateResponse) SetCores(v int32)` + +SetCores sets Cores field to given value. + +### HasCores + +`func (o *TemplateResponse) HasCores() bool` + +HasCores returns a boolean if a field has been set. + +### GetRam + +`func (o *TemplateResponse) GetRam() int32` + +GetRam returns the Ram field if non-nil, zero value otherwise. + +### GetRamOk + +`func (o *TemplateResponse) GetRamOk() (*int32, bool)` + +GetRamOk returns a tuple with the Ram field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRam + +`func (o *TemplateResponse) SetRam(v int32)` + +SetRam sets Ram field to given value. + +### HasRam + +`func (o *TemplateResponse) HasRam() bool` + +HasRam returns a boolean if a field has been set. + +### GetStorageSize + +`func (o *TemplateResponse) GetStorageSize() int32` + +GetStorageSize returns the StorageSize field if non-nil, zero value otherwise. + +### GetStorageSizeOk + +`func (o *TemplateResponse) GetStorageSizeOk() (*int32, bool)` + +GetStorageSizeOk returns a tuple with the StorageSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStorageSize + +`func (o *TemplateResponse) SetStorageSize(v int32)` + +SetStorageSize sets StorageSize field to given value. + +### HasStorageSize + +`func (o *TemplateResponse) HasStorageSize() bool` + +HasStorageSize returns a boolean if a field has been set. + + + diff --git a/docs/models/User.md b/docs/models/User.md new file mode 100644 index 0000000..2cac3b2 --- /dev/null +++ b/docs/models/User.md @@ -0,0 +1,93 @@ +# User + +MongoDB database user. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Type** | Pointer to [**ResourceType**](ResourceType.md) | | [optional] | +|**Metadata** | Pointer to [**UserMetadata**](UserMetadata.md) | | [optional] | +|**Properties** | Pointer to [**UserProperties**](UserProperties.md) | | [optional] | + +## Methods + + +### GetType + +`func (o *User) GetType() ResourceType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *User) GetTypeOk() (*ResourceType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *User) SetType(v ResourceType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *User) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetMetadata + +`func (o *User) GetMetadata() UserMetadata` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *User) GetMetadataOk() (*UserMetadata, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *User) SetMetadata(v UserMetadata)` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *User) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + +### GetProperties + +`func (o *User) GetProperties() UserProperties` + +GetProperties returns the Properties field if non-nil, zero value otherwise. + +### GetPropertiesOk + +`func (o *User) GetPropertiesOk() (*UserProperties, bool)` + +GetPropertiesOk returns a tuple with the Properties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProperties + +`func (o *User) SetProperties(v UserProperties)` + +SetProperties sets Properties field to given value. + +### HasProperties + +`func (o *User) HasProperties() bool` + +HasProperties returns a boolean if a field has been set. + + + diff --git a/docs/models/UserMetadata.md b/docs/models/UserMetadata.md new file mode 100644 index 0000000..90baf55 --- /dev/null +++ b/docs/models/UserMetadata.md @@ -0,0 +1,119 @@ +# UserMetadata + +The metadata of the resource. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**CreatedDate** | Pointer to [**time.Time**](time.Time.md) | The date the resource was created. | [optional] | +|**CreatedBy** | Pointer to **string** | The user who created the resource. | [optional] | +|**CreatedByUserId** | Pointer to **string** | The ID of the user who created the resource. | [optional] | +|**State** | Pointer to **string** | The user state. | [optional] | + +## Methods + + +### GetCreatedDate + +`func (o *UserMetadata) GetCreatedDate() time.Time` + +GetCreatedDate returns the CreatedDate field if non-nil, zero value otherwise. + +### GetCreatedDateOk + +`func (o *UserMetadata) GetCreatedDateOk() (*time.Time, bool)` + +GetCreatedDateOk returns a tuple with the CreatedDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedDate + +`func (o *UserMetadata) SetCreatedDate(v time.Time)` + +SetCreatedDate sets CreatedDate field to given value. + +### HasCreatedDate + +`func (o *UserMetadata) HasCreatedDate() bool` + +HasCreatedDate returns a boolean if a field has been set. + +### GetCreatedBy + +`func (o *UserMetadata) GetCreatedBy() string` + +GetCreatedBy returns the CreatedBy field if non-nil, zero value otherwise. + +### GetCreatedByOk + +`func (o *UserMetadata) GetCreatedByOk() (*string, bool)` + +GetCreatedByOk returns a tuple with the CreatedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedBy + +`func (o *UserMetadata) SetCreatedBy(v string)` + +SetCreatedBy sets CreatedBy field to given value. + +### HasCreatedBy + +`func (o *UserMetadata) HasCreatedBy() bool` + +HasCreatedBy returns a boolean if a field has been set. + +### GetCreatedByUserId + +`func (o *UserMetadata) GetCreatedByUserId() string` + +GetCreatedByUserId returns the CreatedByUserId field if non-nil, zero value otherwise. + +### GetCreatedByUserIdOk + +`func (o *UserMetadata) GetCreatedByUserIdOk() (*string, bool)` + +GetCreatedByUserIdOk returns a tuple with the CreatedByUserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedByUserId + +`func (o *UserMetadata) SetCreatedByUserId(v string)` + +SetCreatedByUserId sets CreatedByUserId field to given value. + +### HasCreatedByUserId + +`func (o *UserMetadata) HasCreatedByUserId() bool` + +HasCreatedByUserId returns a boolean if a field has been set. + +### GetState + +`func (o *UserMetadata) GetState() string` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *UserMetadata) GetStateOk() (*string, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *UserMetadata) SetState(v string)` + +SetState sets State field to given value. + +### HasState + +`func (o *UserMetadata) HasState() bool` + +HasState returns a boolean if a field has been set. + + + diff --git a/docs/models/UserProperties.md b/docs/models/UserProperties.md new file mode 100644 index 0000000..30e54e2 --- /dev/null +++ b/docs/models/UserProperties.md @@ -0,0 +1,104 @@ +# UserProperties + +Mongodb user properties. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Username** | **string** | | | +|**Database** | **string** | The user database to use for authentication. | | +|**Password** | **string** | | | +|**Roles** | Pointer to [**[]UserRoles**](UserRoles.md) | | [optional] | + +## Methods + + +### GetUsername + +`func (o *UserProperties) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *UserProperties) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *UserProperties) SetUsername(v string)` + +SetUsername sets Username field to given value. + + +### GetDatabase + +`func (o *UserProperties) GetDatabase() string` + +GetDatabase returns the Database field if non-nil, zero value otherwise. + +### GetDatabaseOk + +`func (o *UserProperties) GetDatabaseOk() (*string, bool)` + +GetDatabaseOk returns a tuple with the Database field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDatabase + +`func (o *UserProperties) SetDatabase(v string)` + +SetDatabase sets Database field to given value. + + +### GetPassword + +`func (o *UserProperties) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *UserProperties) GetPasswordOk() (*string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPassword + +`func (o *UserProperties) SetPassword(v string)` + +SetPassword sets Password field to given value. + + +### GetRoles + +`func (o *UserProperties) GetRoles() []UserRoles` + +GetRoles returns the Roles field if non-nil, zero value otherwise. + +### GetRolesOk + +`func (o *UserProperties) GetRolesOk() (*[]UserRoles, bool)` + +GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoles + +`func (o *UserProperties) SetRoles(v []UserRoles)` + +SetRoles sets Roles field to given value. + +### HasRoles + +`func (o *UserProperties) HasRoles() bool` + +HasRoles returns a boolean if a field has been set. + + + diff --git a/docs/models/UserRoles.md b/docs/models/UserRoles.md new file mode 100644 index 0000000..8181a0e --- /dev/null +++ b/docs/models/UserRoles.md @@ -0,0 +1,67 @@ +# UserRoles + +a list of mongodb user role. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Role** | Pointer to **string** | | [optional] | +|**Database** | Pointer to **string** | | [optional] | + +## Methods + + +### GetRole + +`func (o *UserRoles) GetRole() string` + +GetRole returns the Role field if non-nil, zero value otherwise. + +### GetRoleOk + +`func (o *UserRoles) GetRoleOk() (*string, bool)` + +GetRoleOk returns a tuple with the Role field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRole + +`func (o *UserRoles) SetRole(v string)` + +SetRole sets Role field to given value. + +### HasRole + +`func (o *UserRoles) HasRole() bool` + +HasRole returns a boolean if a field has been set. + +### GetDatabase + +`func (o *UserRoles) GetDatabase() string` + +GetDatabase returns the Database field if non-nil, zero value otherwise. + +### GetDatabaseOk + +`func (o *UserRoles) GetDatabaseOk() (*string, bool)` + +GetDatabaseOk returns a tuple with the Database field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDatabase + +`func (o *UserRoles) SetDatabase(v string)` + +SetDatabase sets Database field to given value. + +### HasDatabase + +`func (o *UserRoles) HasDatabase() bool` + +HasDatabase returns a boolean if a field has been set. + + + diff --git a/docs/models/UsersList.md b/docs/models/UsersList.md new file mode 100644 index 0000000..b7ee485 --- /dev/null +++ b/docs/models/UsersList.md @@ -0,0 +1,93 @@ +# UsersList + +List of cluster users. + + +## Properties + +|Name | Type | Description | Notes| +|------------ | ------------- | ------------- | -------------| +|**Type** | Pointer to [**ResourceType**](ResourceType.md) | | [optional] | +|**Id** | Pointer to **string** | The unique ID of the resource. | [optional] | +|**Items** | Pointer to [**[]User**](User.md) | | [optional] | + +## Methods + + +### GetType + +`func (o *UsersList) GetType() ResourceType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *UsersList) GetTypeOk() (*ResourceType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *UsersList) SetType(v ResourceType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *UsersList) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetId + +`func (o *UsersList) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *UsersList) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *UsersList) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *UsersList) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetItems + +`func (o *UsersList) GetItems() []User` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *UsersList) GetItemsOk() (*[]User, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *UsersList) SetItems(v []User)` + +SetItems sets Items field to given value. + +### HasItems + +`func (o *UsersList) HasItems() bool` + +HasItems returns a boolean if a field has been set. + + + diff --git a/docs/summary.md b/docs/summary.md new file mode 100644 index 0000000..658481b --- /dev/null +++ b/docs/summary.md @@ -0,0 +1,50 @@ +# Table of contents + +* [Introduction](README.md) +* [Changelog](CHANGELOG.md) + +## API + +* [ClustersApi](api/ClustersApi.md) +* [LogsApi](api/LogsApi.md) +* [MetadataApi](api/MetadataApi.md) +* [RestoresApi](api/RestoresApi.md) +* [SnapshotsApi](api/SnapshotsApi.md) +* [TemplatesApi](api/TemplatesApi.md) +* [UsersApi](api/UsersApi.md) + +## Models + +* [APIVersion](models/APIVersion.md) +* [ClusterList](models/ClusterList.md) +* [ClusterListAllOf](models/ClusterListAllOf.md) +* [ClusterLogs](models/ClusterLogs.md) +* [ClusterLogsInstances](models/ClusterLogsInstances.md) +* [ClusterLogsMessages](models/ClusterLogsMessages.md) +* [ClusterProperties](models/ClusterProperties.md) +* [ClusterResponse](models/ClusterResponse.md) +* [Connection](models/Connection.md) +* [CreateClusterProperties](models/CreateClusterProperties.md) +* [CreateClusterRequest](models/CreateClusterRequest.md) +* [CreateRestoreRequest](models/CreateRestoreRequest.md) +* [DayOfTheWeek](models/DayOfTheWeek.md) +* [ErrorMessage](models/ErrorMessage.md) +* [ErrorResponse](models/ErrorResponse.md) +* [MaintenanceWindow](models/MaintenanceWindow.md) +* [Metadata](models/Metadata.md) +* [Pagination](models/Pagination.md) +* [PaginationLinks](models/PaginationLinks.md) +* [ResourceType](models/ResourceType.md) +* [SnapshotList](models/SnapshotList.md) +* [SnapshotListAllOf](models/SnapshotListAllOf.md) +* [SnapshotProperties](models/SnapshotProperties.md) +* [SnapshotResponse](models/SnapshotResponse.md) +* [State](models/State.md) +* [TemplateList](models/TemplateList.md) +* [TemplateListAllOf](models/TemplateListAllOf.md) +* [TemplateResponse](models/TemplateResponse.md) +* [User](models/User.md) +* [UserMetadata](models/UserMetadata.md) +* [UserProperties](models/UserProperties.md) +* [UserRoles](models/UserRoles.md) +* [UsersList](models/UsersList.md) diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..2c92a47 --- /dev/null +++ b/go.mod @@ -0,0 +1,12 @@ +module github.com/ionos-cloud/sdk-go-dbaas-mongo + +go 1.18 + +require golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 + +require ( + github.com/golang/protobuf v1.4.2 // indirect + golang.org/x/net v0.0.0-20200822124328-c89045814202 // indirect + google.golang.org/appengine v1.6.6 // indirect + google.golang.org/protobuf v1.25.0 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..6b0823d --- /dev/null +++ b/go.sum @@ -0,0 +1,365 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/logger.go b/logger.go new file mode 100644 index 0000000..ae6c8a1 --- /dev/null +++ b/logger.go @@ -0,0 +1,80 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "log" + "os" + "strings" +) + +type LogLevel uint + +func (l *LogLevel) Get() LogLevel { + if l != nil { + return *l + } + return Off +} + +// Satisfies returns true if this LogLevel is at least high enough for v +func (l *LogLevel) Satisfies(v LogLevel) bool { + return l.Get() >= v +} + +const ( + Off LogLevel = 0x100 * iota + Debug + // Trace We recommend you only set this field for debugging purposes. + // Disable it in your production environments because it can log sensitive data. + // It logs the full request and response without encryption, even for an HTTPS call. + // Verbose request and response logging can also significantly impact your application's performance. + Trace +) + +var LogLevelMap = map[string]LogLevel{ + "off": Off, + "debug": Debug, + "trace": Trace, +} + +// getLogLevelFromEnv - gets LogLevel type from env variable IonosLogLevelEnvVar +// returns Off if an invalid log level is encountered +func getLogLevelFromEnv() LogLevel { + strLogLevel := "off" + if os.Getenv(IonosLogLevelEnvVar) != "" { + strLogLevel = os.Getenv(IonosLogLevelEnvVar) + } + + logLevel, ok := LogLevelMap[strings.ToLower(strLogLevel)] + if !ok { + log.Printf("Cannot set logLevel for value: %s, setting loglevel to Off", strLogLevel) + } + return logLevel +} + +type Logger interface { + Printf(format string, args ...interface{}) +} + +func NewDefaultLogger() Logger { + return &defaultLogger{ + logger: log.New(os.Stderr, "IONOSLOG ", log.LstdFlags), + } +} + +type defaultLogger struct { + logger *log.Logger +} + +func (l defaultLogger) Printf(format string, args ...interface{}) { + l.logger.Printf(format, args...) +} diff --git a/model_api_version.go b/model_api_version.go new file mode 100644 index 0000000..e817e94 --- /dev/null +++ b/model_api_version.go @@ -0,0 +1,164 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// APIVersion struct for APIVersion +type APIVersion struct { + Name *string `json:"name,omitempty"` + SwaggerUrl *string `json:"swaggerUrl,omitempty"` +} + +// NewAPIVersion instantiates a new APIVersion object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAPIVersion() *APIVersion { + this := APIVersion{} + + return &this +} + +// NewAPIVersionWithDefaults instantiates a new APIVersion object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAPIVersionWithDefaults() *APIVersion { + this := APIVersion{} + return &this +} + +// GetName returns the Name field value +// If the value is explicit nil, the zero value for string will be returned +func (o *APIVersion) GetName() *string { + if o == nil { + return nil + } + + return o.Name + +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *APIVersion) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Name, true +} + +// SetName sets field value +func (o *APIVersion) SetName(v string) { + + o.Name = &v + +} + +// HasName returns a boolean if a field has been set. +func (o *APIVersion) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// GetSwaggerUrl returns the SwaggerUrl field value +// If the value is explicit nil, the zero value for string will be returned +func (o *APIVersion) GetSwaggerUrl() *string { + if o == nil { + return nil + } + + return o.SwaggerUrl + +} + +// GetSwaggerUrlOk returns a tuple with the SwaggerUrl field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *APIVersion) GetSwaggerUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.SwaggerUrl, true +} + +// SetSwaggerUrl sets field value +func (o *APIVersion) SetSwaggerUrl(v string) { + + o.SwaggerUrl = &v + +} + +// HasSwaggerUrl returns a boolean if a field has been set. +func (o *APIVersion) HasSwaggerUrl() bool { + if o != nil && o.SwaggerUrl != nil { + return true + } + + return false +} + +func (o APIVersion) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + + if o.SwaggerUrl != nil { + toSerialize["swaggerUrl"] = o.SwaggerUrl + } + + return json.Marshal(toSerialize) +} + +type NullableAPIVersion struct { + value *APIVersion + isSet bool +} + +func (v NullableAPIVersion) Get() *APIVersion { + return v.value +} + +func (v *NullableAPIVersion) Set(val *APIVersion) { + v.value = val + v.isSet = true +} + +func (v NullableAPIVersion) IsSet() bool { + return v.isSet +} + +func (v *NullableAPIVersion) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAPIVersion(val *APIVersion) *NullableAPIVersion { + return &NullableAPIVersion{value: val, isSet: true} +} + +func (v NullableAPIVersion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAPIVersion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_cluster_list.go b/model_cluster_list.go new file mode 100644 index 0000000..49aff1e --- /dev/null +++ b/model_cluster_list.go @@ -0,0 +1,339 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// ClusterList List of clusters. +type ClusterList struct { + Type *ResourceType `json:"type,omitempty"` + // The unique ID of the resource. + Id *string `json:"id,omitempty"` + Items *[]ClusterResponse `json:"items,omitempty"` + // The offset specified in the request (if none was specified, the default offset is 0) (not implemented yet). + Offset *int32 `json:"offset,omitempty"` + // The limit specified in the request (if none was specified, use the endpoint's default pagination limit) (not implemented yet, always return number of items). + Limit *int32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` +} + +// NewClusterList instantiates a new ClusterList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClusterList() *ClusterList { + this := ClusterList{} + + return &this +} + +// NewClusterListWithDefaults instantiates a new ClusterList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClusterListWithDefaults() *ClusterList { + this := ClusterList{} + return &this +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for ResourceType will be returned +func (o *ClusterList) GetType() *ResourceType { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterList) GetTypeOk() (*ResourceType, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *ClusterList) SetType(v ResourceType) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *ClusterList) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ClusterList) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterList) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *ClusterList) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *ClusterList) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetItems returns the Items field value +// If the value is explicit nil, the zero value for []ClusterResponse will be returned +func (o *ClusterList) GetItems() *[]ClusterResponse { + if o == nil { + return nil + } + + return o.Items + +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterList) GetItemsOk() (*[]ClusterResponse, bool) { + if o == nil { + return nil, false + } + + return o.Items, true +} + +// SetItems sets field value +func (o *ClusterList) SetItems(v []ClusterResponse) { + + o.Items = &v + +} + +// HasItems returns a boolean if a field has been set. +func (o *ClusterList) HasItems() bool { + if o != nil && o.Items != nil { + return true + } + + return false +} + +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *ClusterList) GetOffset() *int32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterList) GetOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *ClusterList) SetOffset(v int32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *ClusterList) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *ClusterList) GetLimit() *int32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterList) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *ClusterList) SetLimit(v int32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *ClusterList) HasLimit() bool { + if o != nil && o.Limit != nil { + return true + } + + return false +} + +// GetLinks returns the Links field value +// If the value is explicit nil, the zero value for PaginationLinks will be returned +func (o *ClusterList) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterList) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *ClusterList) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *ClusterList) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} + +func (o ClusterList) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Type != nil { + toSerialize["type"] = o.Type + } + + if o.Id != nil { + toSerialize["id"] = o.Id + } + + if o.Items != nil { + toSerialize["items"] = o.Items + } + + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + + if o.Links != nil { + toSerialize["_links"] = o.Links + } + + return json.Marshal(toSerialize) +} + +type NullableClusterList struct { + value *ClusterList + isSet bool +} + +func (v NullableClusterList) Get() *ClusterList { + return v.value +} + +func (v *NullableClusterList) Set(val *ClusterList) { + v.value = val + v.isSet = true +} + +func (v NullableClusterList) IsSet() bool { + return v.isSet +} + +func (v *NullableClusterList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClusterList(val *ClusterList) *NullableClusterList { + return &NullableClusterList{value: val, isSet: true} +} + +func (v NullableClusterList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClusterList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_cluster_list_all_of.go b/model_cluster_list_all_of.go new file mode 100644 index 0000000..cca759f --- /dev/null +++ b/model_cluster_list_all_of.go @@ -0,0 +1,208 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// ClusterListAllOf struct for ClusterListAllOf +type ClusterListAllOf struct { + Type *ResourceType `json:"type,omitempty"` + // The unique ID of the resource. + Id *string `json:"id,omitempty"` + Items *[]ClusterResponse `json:"items,omitempty"` +} + +// NewClusterListAllOf instantiates a new ClusterListAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClusterListAllOf() *ClusterListAllOf { + this := ClusterListAllOf{} + + return &this +} + +// NewClusterListAllOfWithDefaults instantiates a new ClusterListAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClusterListAllOfWithDefaults() *ClusterListAllOf { + this := ClusterListAllOf{} + return &this +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for ResourceType will be returned +func (o *ClusterListAllOf) GetType() *ResourceType { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterListAllOf) GetTypeOk() (*ResourceType, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *ClusterListAllOf) SetType(v ResourceType) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *ClusterListAllOf) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ClusterListAllOf) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterListAllOf) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *ClusterListAllOf) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *ClusterListAllOf) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetItems returns the Items field value +// If the value is explicit nil, the zero value for []ClusterResponse will be returned +func (o *ClusterListAllOf) GetItems() *[]ClusterResponse { + if o == nil { + return nil + } + + return o.Items + +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterListAllOf) GetItemsOk() (*[]ClusterResponse, bool) { + if o == nil { + return nil, false + } + + return o.Items, true +} + +// SetItems sets field value +func (o *ClusterListAllOf) SetItems(v []ClusterResponse) { + + o.Items = &v + +} + +// HasItems returns a boolean if a field has been set. +func (o *ClusterListAllOf) HasItems() bool { + if o != nil && o.Items != nil { + return true + } + + return false +} + +func (o ClusterListAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Type != nil { + toSerialize["type"] = o.Type + } + + if o.Id != nil { + toSerialize["id"] = o.Id + } + + if o.Items != nil { + toSerialize["items"] = o.Items + } + + return json.Marshal(toSerialize) +} + +type NullableClusterListAllOf struct { + value *ClusterListAllOf + isSet bool +} + +func (v NullableClusterListAllOf) Get() *ClusterListAllOf { + return v.value +} + +func (v *NullableClusterListAllOf) Set(val *ClusterListAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableClusterListAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableClusterListAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClusterListAllOf(val *ClusterListAllOf) *NullableClusterListAllOf { + return &NullableClusterListAllOf{value: val, isSet: true} +} + +func (v NullableClusterListAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClusterListAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_cluster_logs.go b/model_cluster_logs.go new file mode 100644 index 0000000..b14ebe3 --- /dev/null +++ b/model_cluster_logs.go @@ -0,0 +1,121 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// ClusterLogs The logs of the MongoDB cluster. +type ClusterLogs struct { + Instances *[]ClusterLogsInstances `json:"instances,omitempty"` +} + +// NewClusterLogs instantiates a new ClusterLogs object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClusterLogs() *ClusterLogs { + this := ClusterLogs{} + + return &this +} + +// NewClusterLogsWithDefaults instantiates a new ClusterLogs object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClusterLogsWithDefaults() *ClusterLogs { + this := ClusterLogs{} + return &this +} + +// GetInstances returns the Instances field value +// If the value is explicit nil, the zero value for []ClusterLogsInstances will be returned +func (o *ClusterLogs) GetInstances() *[]ClusterLogsInstances { + if o == nil { + return nil + } + + return o.Instances + +} + +// GetInstancesOk returns a tuple with the Instances field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterLogs) GetInstancesOk() (*[]ClusterLogsInstances, bool) { + if o == nil { + return nil, false + } + + return o.Instances, true +} + +// SetInstances sets field value +func (o *ClusterLogs) SetInstances(v []ClusterLogsInstances) { + + o.Instances = &v + +} + +// HasInstances returns a boolean if a field has been set. +func (o *ClusterLogs) HasInstances() bool { + if o != nil && o.Instances != nil { + return true + } + + return false +} + +func (o ClusterLogs) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Instances != nil { + toSerialize["instances"] = o.Instances + } + + return json.Marshal(toSerialize) +} + +type NullableClusterLogs struct { + value *ClusterLogs + isSet bool +} + +func (v NullableClusterLogs) Get() *ClusterLogs { + return v.value +} + +func (v *NullableClusterLogs) Set(val *ClusterLogs) { + v.value = val + v.isSet = true +} + +func (v NullableClusterLogs) IsSet() bool { + return v.isSet +} + +func (v *NullableClusterLogs) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClusterLogs(val *ClusterLogs) *NullableClusterLogs { + return &NullableClusterLogs{value: val, isSet: true} +} + +func (v NullableClusterLogs) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClusterLogs) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_cluster_logs_instances.go b/model_cluster_logs_instances.go new file mode 100644 index 0000000..3d0c83e --- /dev/null +++ b/model_cluster_logs_instances.go @@ -0,0 +1,165 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// ClusterLogsInstances struct for ClusterLogsInstances +type ClusterLogsInstances struct { + // The name of the MongoDB instance. + Name *string `json:"name,omitempty"` + Messages *[]ClusterLogsMessages `json:"messages,omitempty"` +} + +// NewClusterLogsInstances instantiates a new ClusterLogsInstances object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClusterLogsInstances() *ClusterLogsInstances { + this := ClusterLogsInstances{} + + return &this +} + +// NewClusterLogsInstancesWithDefaults instantiates a new ClusterLogsInstances object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClusterLogsInstancesWithDefaults() *ClusterLogsInstances { + this := ClusterLogsInstances{} + return &this +} + +// GetName returns the Name field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ClusterLogsInstances) GetName() *string { + if o == nil { + return nil + } + + return o.Name + +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterLogsInstances) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Name, true +} + +// SetName sets field value +func (o *ClusterLogsInstances) SetName(v string) { + + o.Name = &v + +} + +// HasName returns a boolean if a field has been set. +func (o *ClusterLogsInstances) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// GetMessages returns the Messages field value +// If the value is explicit nil, the zero value for []ClusterLogsMessages will be returned +func (o *ClusterLogsInstances) GetMessages() *[]ClusterLogsMessages { + if o == nil { + return nil + } + + return o.Messages + +} + +// GetMessagesOk returns a tuple with the Messages field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterLogsInstances) GetMessagesOk() (*[]ClusterLogsMessages, bool) { + if o == nil { + return nil, false + } + + return o.Messages, true +} + +// SetMessages sets field value +func (o *ClusterLogsInstances) SetMessages(v []ClusterLogsMessages) { + + o.Messages = &v + +} + +// HasMessages returns a boolean if a field has been set. +func (o *ClusterLogsInstances) HasMessages() bool { + if o != nil && o.Messages != nil { + return true + } + + return false +} + +func (o ClusterLogsInstances) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + + if o.Messages != nil { + toSerialize["messages"] = o.Messages + } + + return json.Marshal(toSerialize) +} + +type NullableClusterLogsInstances struct { + value *ClusterLogsInstances + isSet bool +} + +func (v NullableClusterLogsInstances) Get() *ClusterLogsInstances { + return v.value +} + +func (v *NullableClusterLogsInstances) Set(val *ClusterLogsInstances) { + v.value = val + v.isSet = true +} + +func (v NullableClusterLogsInstances) IsSet() bool { + return v.isSet +} + +func (v *NullableClusterLogsInstances) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClusterLogsInstances(val *ClusterLogsInstances) *NullableClusterLogsInstances { + return &NullableClusterLogsInstances{value: val, isSet: true} +} + +func (v NullableClusterLogsInstances) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClusterLogsInstances) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_cluster_logs_messages.go b/model_cluster_logs_messages.go new file mode 100644 index 0000000..a366409 --- /dev/null +++ b/model_cluster_logs_messages.go @@ -0,0 +1,172 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" + "time" +) + +// ClusterLogsMessages struct for ClusterLogsMessages +type ClusterLogsMessages struct { + Time *IonosTime `json:"time,omitempty"` + Message *string `json:"message,omitempty"` +} + +// NewClusterLogsMessages instantiates a new ClusterLogsMessages object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClusterLogsMessages() *ClusterLogsMessages { + this := ClusterLogsMessages{} + + return &this +} + +// NewClusterLogsMessagesWithDefaults instantiates a new ClusterLogsMessages object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClusterLogsMessagesWithDefaults() *ClusterLogsMessages { + this := ClusterLogsMessages{} + return &this +} + +// GetTime returns the Time field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ClusterLogsMessages) GetTime() *time.Time { + if o == nil { + return nil + } + + if o.Time == nil { + return nil + } + return &o.Time.Time + +} + +// GetTimeOk returns a tuple with the Time field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterLogsMessages) GetTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + + if o.Time == nil { + return nil, false + } + return &o.Time.Time, true + +} + +// SetTime sets field value +func (o *ClusterLogsMessages) SetTime(v time.Time) { + + o.Time = &IonosTime{v} + +} + +// HasTime returns a boolean if a field has been set. +func (o *ClusterLogsMessages) HasTime() bool { + if o != nil && o.Time != nil { + return true + } + + return false +} + +// GetMessage returns the Message field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ClusterLogsMessages) GetMessage() *string { + if o == nil { + return nil + } + + return o.Message + +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterLogsMessages) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Message, true +} + +// SetMessage sets field value +func (o *ClusterLogsMessages) SetMessage(v string) { + + o.Message = &v + +} + +// HasMessage returns a boolean if a field has been set. +func (o *ClusterLogsMessages) HasMessage() bool { + if o != nil && o.Message != nil { + return true + } + + return false +} + +func (o ClusterLogsMessages) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Time != nil { + toSerialize["time"] = o.Time + } + + if o.Message != nil { + toSerialize["message"] = o.Message + } + + return json.Marshal(toSerialize) +} + +type NullableClusterLogsMessages struct { + value *ClusterLogsMessages + isSet bool +} + +func (v NullableClusterLogsMessages) Get() *ClusterLogsMessages { + return v.value +} + +func (v *NullableClusterLogsMessages) Set(val *ClusterLogsMessages) { + v.value = val + v.isSet = true +} + +func (v NullableClusterLogsMessages) IsSet() bool { + return v.isSet +} + +func (v *NullableClusterLogsMessages) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClusterLogsMessages(val *ClusterLogsMessages) *NullableClusterLogsMessages { + return &NullableClusterLogsMessages{value: val, isSet: true} +} + +func (v NullableClusterLogsMessages) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClusterLogsMessages) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_cluster_properties.go b/model_cluster_properties.go new file mode 100644 index 0000000..114c5b9 --- /dev/null +++ b/model_cluster_properties.go @@ -0,0 +1,428 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// ClusterProperties Properties of a database cluster. +type ClusterProperties struct { + // The name of your cluster. + DisplayName *string `json:"displayName,omitempty"` + // The MongoDB version of your cluster. + MongoDBVersion *string `json:"mongoDBVersion,omitempty"` + // The physical location where the cluster will be created. This is the location where all your instances will be located. This property is immutable. + Location *string `json:"location,omitempty"` + // The total number of instances in the cluster (one primary and n-1 secondaries). + Instances *int32 `json:"instances,omitempty"` + Connections *[]Connection `json:"connections,omitempty"` + MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` + // The unique ID of the template, which specifies the number of cores, storage size, and memory. + TemplateID *string `json:"templateID,omitempty"` + // The connection string for your cluster. + ConnectionString *string `json:"connectionString,omitempty"` +} + +// NewClusterProperties instantiates a new ClusterProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClusterProperties() *ClusterProperties { + this := ClusterProperties{} + + return &this +} + +// NewClusterPropertiesWithDefaults instantiates a new ClusterProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClusterPropertiesWithDefaults() *ClusterProperties { + this := ClusterProperties{} + return &this +} + +// GetDisplayName returns the DisplayName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ClusterProperties) GetDisplayName() *string { + if o == nil { + return nil + } + + return o.DisplayName + +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterProperties) GetDisplayNameOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.DisplayName, true +} + +// SetDisplayName sets field value +func (o *ClusterProperties) SetDisplayName(v string) { + + o.DisplayName = &v + +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *ClusterProperties) HasDisplayName() bool { + if o != nil && o.DisplayName != nil { + return true + } + + return false +} + +// GetMongoDBVersion returns the MongoDBVersion field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ClusterProperties) GetMongoDBVersion() *string { + if o == nil { + return nil + } + + return o.MongoDBVersion + +} + +// GetMongoDBVersionOk returns a tuple with the MongoDBVersion field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterProperties) GetMongoDBVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.MongoDBVersion, true +} + +// SetMongoDBVersion sets field value +func (o *ClusterProperties) SetMongoDBVersion(v string) { + + o.MongoDBVersion = &v + +} + +// HasMongoDBVersion returns a boolean if a field has been set. +func (o *ClusterProperties) HasMongoDBVersion() bool { + if o != nil && o.MongoDBVersion != nil { + return true + } + + return false +} + +// GetLocation returns the Location field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ClusterProperties) GetLocation() *string { + if o == nil { + return nil + } + + return o.Location + +} + +// GetLocationOk returns a tuple with the Location field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterProperties) GetLocationOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Location, true +} + +// SetLocation sets field value +func (o *ClusterProperties) SetLocation(v string) { + + o.Location = &v + +} + +// HasLocation returns a boolean if a field has been set. +func (o *ClusterProperties) HasLocation() bool { + if o != nil && o.Location != nil { + return true + } + + return false +} + +// GetInstances returns the Instances field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *ClusterProperties) GetInstances() *int32 { + if o == nil { + return nil + } + + return o.Instances + +} + +// GetInstancesOk returns a tuple with the Instances field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterProperties) GetInstancesOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.Instances, true +} + +// SetInstances sets field value +func (o *ClusterProperties) SetInstances(v int32) { + + o.Instances = &v + +} + +// HasInstances returns a boolean if a field has been set. +func (o *ClusterProperties) HasInstances() bool { + if o != nil && o.Instances != nil { + return true + } + + return false +} + +// GetConnections returns the Connections field value +// If the value is explicit nil, the zero value for []Connection will be returned +func (o *ClusterProperties) GetConnections() *[]Connection { + if o == nil { + return nil + } + + return o.Connections + +} + +// GetConnectionsOk returns a tuple with the Connections field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterProperties) GetConnectionsOk() (*[]Connection, bool) { + if o == nil { + return nil, false + } + + return o.Connections, true +} + +// SetConnections sets field value +func (o *ClusterProperties) SetConnections(v []Connection) { + + o.Connections = &v + +} + +// HasConnections returns a boolean if a field has been set. +func (o *ClusterProperties) HasConnections() bool { + if o != nil && o.Connections != nil { + return true + } + + return false +} + +// GetMaintenanceWindow returns the MaintenanceWindow field value +// If the value is explicit nil, the zero value for MaintenanceWindow will be returned +func (o *ClusterProperties) GetMaintenanceWindow() *MaintenanceWindow { + if o == nil { + return nil + } + + return o.MaintenanceWindow + +} + +// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterProperties) GetMaintenanceWindowOk() (*MaintenanceWindow, bool) { + if o == nil { + return nil, false + } + + return o.MaintenanceWindow, true +} + +// SetMaintenanceWindow sets field value +func (o *ClusterProperties) SetMaintenanceWindow(v MaintenanceWindow) { + + o.MaintenanceWindow = &v + +} + +// HasMaintenanceWindow returns a boolean if a field has been set. +func (o *ClusterProperties) HasMaintenanceWindow() bool { + if o != nil && o.MaintenanceWindow != nil { + return true + } + + return false +} + +// GetTemplateID returns the TemplateID field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ClusterProperties) GetTemplateID() *string { + if o == nil { + return nil + } + + return o.TemplateID + +} + +// GetTemplateIDOk returns a tuple with the TemplateID field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterProperties) GetTemplateIDOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.TemplateID, true +} + +// SetTemplateID sets field value +func (o *ClusterProperties) SetTemplateID(v string) { + + o.TemplateID = &v + +} + +// HasTemplateID returns a boolean if a field has been set. +func (o *ClusterProperties) HasTemplateID() bool { + if o != nil && o.TemplateID != nil { + return true + } + + return false +} + +// GetConnectionString returns the ConnectionString field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ClusterProperties) GetConnectionString() *string { + if o == nil { + return nil + } + + return o.ConnectionString + +} + +// GetConnectionStringOk returns a tuple with the ConnectionString field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterProperties) GetConnectionStringOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.ConnectionString, true +} + +// SetConnectionString sets field value +func (o *ClusterProperties) SetConnectionString(v string) { + + o.ConnectionString = &v + +} + +// HasConnectionString returns a boolean if a field has been set. +func (o *ClusterProperties) HasConnectionString() bool { + if o != nil && o.ConnectionString != nil { + return true + } + + return false +} + +func (o ClusterProperties) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.DisplayName != nil { + toSerialize["displayName"] = o.DisplayName + } + + if o.MongoDBVersion != nil { + toSerialize["mongoDBVersion"] = o.MongoDBVersion + } + + if o.Location != nil { + toSerialize["location"] = o.Location + } + + if o.Instances != nil { + toSerialize["instances"] = o.Instances + } + + if o.Connections != nil { + toSerialize["connections"] = o.Connections + } + + if o.MaintenanceWindow != nil { + toSerialize["maintenanceWindow"] = o.MaintenanceWindow + } + + if o.TemplateID != nil { + toSerialize["templateID"] = o.TemplateID + } + + if o.ConnectionString != nil { + toSerialize["connectionString"] = o.ConnectionString + } + + return json.Marshal(toSerialize) +} + +type NullableClusterProperties struct { + value *ClusterProperties + isSet bool +} + +func (v NullableClusterProperties) Get() *ClusterProperties { + return v.value +} + +func (v *NullableClusterProperties) Set(val *ClusterProperties) { + v.value = val + v.isSet = true +} + +func (v NullableClusterProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableClusterProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClusterProperties(val *ClusterProperties) *NullableClusterProperties { + return &NullableClusterProperties{value: val, isSet: true} +} + +func (v NullableClusterProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClusterProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_cluster_response.go b/model_cluster_response.go new file mode 100644 index 0000000..8f616eb --- /dev/null +++ b/model_cluster_response.go @@ -0,0 +1,251 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// ClusterResponse A database cluster. +type ClusterResponse struct { + Type *ResourceType `json:"type,omitempty"` + // The unique ID of the resource. + Id *string `json:"id,omitempty"` + Metadata *Metadata `json:"metadata,omitempty"` + Properties *ClusterProperties `json:"properties,omitempty"` +} + +// NewClusterResponse instantiates a new ClusterResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClusterResponse() *ClusterResponse { + this := ClusterResponse{} + + return &this +} + +// NewClusterResponseWithDefaults instantiates a new ClusterResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClusterResponseWithDefaults() *ClusterResponse { + this := ClusterResponse{} + return &this +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for ResourceType will be returned +func (o *ClusterResponse) GetType() *ResourceType { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterResponse) GetTypeOk() (*ResourceType, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *ClusterResponse) SetType(v ResourceType) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *ClusterResponse) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ClusterResponse) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *ClusterResponse) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *ClusterResponse) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetMetadata returns the Metadata field value +// If the value is explicit nil, the zero value for Metadata will be returned +func (o *ClusterResponse) GetMetadata() *Metadata { + if o == nil { + return nil + } + + return o.Metadata + +} + +// GetMetadataOk returns a tuple with the Metadata field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterResponse) GetMetadataOk() (*Metadata, bool) { + if o == nil { + return nil, false + } + + return o.Metadata, true +} + +// SetMetadata sets field value +func (o *ClusterResponse) SetMetadata(v Metadata) { + + o.Metadata = &v + +} + +// HasMetadata returns a boolean if a field has been set. +func (o *ClusterResponse) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for ClusterProperties will be returned +func (o *ClusterResponse) GetProperties() *ClusterProperties { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterResponse) GetPropertiesOk() (*ClusterProperties, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *ClusterResponse) SetProperties(v ClusterProperties) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *ClusterResponse) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +func (o ClusterResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Type != nil { + toSerialize["type"] = o.Type + } + + if o.Id != nil { + toSerialize["id"] = o.Id + } + + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + + return json.Marshal(toSerialize) +} + +type NullableClusterResponse struct { + value *ClusterResponse + isSet bool +} + +func (v NullableClusterResponse) Get() *ClusterResponse { + return v.value +} + +func (v *NullableClusterResponse) Set(val *ClusterResponse) { + v.value = val + v.isSet = true +} + +func (v NullableClusterResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableClusterResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClusterResponse(val *ClusterResponse) *NullableClusterResponse { + return &NullableClusterResponse{value: val, isSet: true} +} + +func (v NullableClusterResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClusterResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_connection.go b/model_connection.go new file mode 100644 index 0000000..15c0d30 --- /dev/null +++ b/model_connection.go @@ -0,0 +1,214 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// Connection The network connection details for your cluster. +type Connection struct { + // The datacenter to which your cluster will be connected. + DatacenterId *string `json:"datacenterId"` + // The numeric LAN ID with which you connect your cluster. + LanId *string `json:"lanId"` + // The list of IPs and subnet for your cluster. Note the following unavailable IP ranges: 10.233.64.0/18 10.233.0.0/18 10.233.114.0/24 + CidrList *[]string `json:"cidrList"` +} + +// NewConnection instantiates a new Connection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConnection(datacenterId string, lanId string, cidrList []string) *Connection { + this := Connection{} + + this.DatacenterId = &datacenterId + this.LanId = &lanId + this.CidrList = &cidrList + + return &this +} + +// NewConnectionWithDefaults instantiates a new Connection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConnectionWithDefaults() *Connection { + this := Connection{} + return &this +} + +// GetDatacenterId returns the DatacenterId field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Connection) GetDatacenterId() *string { + if o == nil { + return nil + } + + return o.DatacenterId + +} + +// GetDatacenterIdOk returns a tuple with the DatacenterId field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Connection) GetDatacenterIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.DatacenterId, true +} + +// SetDatacenterId sets field value +func (o *Connection) SetDatacenterId(v string) { + + o.DatacenterId = &v + +} + +// HasDatacenterId returns a boolean if a field has been set. +func (o *Connection) HasDatacenterId() bool { + if o != nil && o.DatacenterId != nil { + return true + } + + return false +} + +// GetLanId returns the LanId field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Connection) GetLanId() *string { + if o == nil { + return nil + } + + return o.LanId + +} + +// GetLanIdOk returns a tuple with the LanId field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Connection) GetLanIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.LanId, true +} + +// SetLanId sets field value +func (o *Connection) SetLanId(v string) { + + o.LanId = &v + +} + +// HasLanId returns a boolean if a field has been set. +func (o *Connection) HasLanId() bool { + if o != nil && o.LanId != nil { + return true + } + + return false +} + +// GetCidrList returns the CidrList field value +// If the value is explicit nil, the zero value for []string will be returned +func (o *Connection) GetCidrList() *[]string { + if o == nil { + return nil + } + + return o.CidrList + +} + +// GetCidrListOk returns a tuple with the CidrList field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Connection) GetCidrListOk() (*[]string, bool) { + if o == nil { + return nil, false + } + + return o.CidrList, true +} + +// SetCidrList sets field value +func (o *Connection) SetCidrList(v []string) { + + o.CidrList = &v + +} + +// HasCidrList returns a boolean if a field has been set. +func (o *Connection) HasCidrList() bool { + if o != nil && o.CidrList != nil { + return true + } + + return false +} + +func (o Connection) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.DatacenterId != nil { + toSerialize["datacenterId"] = o.DatacenterId + } + + if o.LanId != nil { + toSerialize["lanId"] = o.LanId + } + + if o.CidrList != nil { + toSerialize["cidrList"] = o.CidrList + } + + return json.Marshal(toSerialize) +} + +type NullableConnection struct { + value *Connection + isSet bool +} + +func (v NullableConnection) Get() *Connection { + return v.value +} + +func (v *NullableConnection) Set(val *Connection) { + v.value = val + v.isSet = true +} + +func (v NullableConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConnection(val *Connection) *NullableConnection { + return &NullableConnection{value: val, isSet: true} +} + +func (v NullableConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_create_cluster_properties.go b/model_create_cluster_properties.go new file mode 100644 index 0000000..912dab8 --- /dev/null +++ b/model_create_cluster_properties.go @@ -0,0 +1,390 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// CreateClusterProperties The properties with all data needed to create a new MongoDB cluster. +type CreateClusterProperties struct { + // The unique ID of the template, which specifies the number of cores, storage size, and memory. + TemplateID *string `json:"templateID"` + // The MongoDB version of your cluster. + MongoDBVersion *string `json:"mongoDBVersion,omitempty"` + // The total number of instances in the cluster (one primary and n-1 secondaries). + Instances *int32 `json:"instances"` + Connections *[]Connection `json:"connections"` + // The physical location where the cluster will be created. This is the location where all your instances will be located. This property is immutable. + Location *string `json:"location"` + // The name of your cluster. + DisplayName *string `json:"displayName"` + MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` +} + +// NewCreateClusterProperties instantiates a new CreateClusterProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateClusterProperties(templateID string, instances int32, connections []Connection, location string, displayName string) *CreateClusterProperties { + this := CreateClusterProperties{} + + this.TemplateID = &templateID + this.Instances = &instances + this.Connections = &connections + this.Location = &location + this.DisplayName = &displayName + + return &this +} + +// NewCreateClusterPropertiesWithDefaults instantiates a new CreateClusterProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateClusterPropertiesWithDefaults() *CreateClusterProperties { + this := CreateClusterProperties{} + return &this +} + +// GetTemplateID returns the TemplateID field value +// If the value is explicit nil, the zero value for string will be returned +func (o *CreateClusterProperties) GetTemplateID() *string { + if o == nil { + return nil + } + + return o.TemplateID + +} + +// GetTemplateIDOk returns a tuple with the TemplateID field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateClusterProperties) GetTemplateIDOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.TemplateID, true +} + +// SetTemplateID sets field value +func (o *CreateClusterProperties) SetTemplateID(v string) { + + o.TemplateID = &v + +} + +// HasTemplateID returns a boolean if a field has been set. +func (o *CreateClusterProperties) HasTemplateID() bool { + if o != nil && o.TemplateID != nil { + return true + } + + return false +} + +// GetMongoDBVersion returns the MongoDBVersion field value +// If the value is explicit nil, the zero value for string will be returned +func (o *CreateClusterProperties) GetMongoDBVersion() *string { + if o == nil { + return nil + } + + return o.MongoDBVersion + +} + +// GetMongoDBVersionOk returns a tuple with the MongoDBVersion field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateClusterProperties) GetMongoDBVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.MongoDBVersion, true +} + +// SetMongoDBVersion sets field value +func (o *CreateClusterProperties) SetMongoDBVersion(v string) { + + o.MongoDBVersion = &v + +} + +// HasMongoDBVersion returns a boolean if a field has been set. +func (o *CreateClusterProperties) HasMongoDBVersion() bool { + if o != nil && o.MongoDBVersion != nil { + return true + } + + return false +} + +// GetInstances returns the Instances field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *CreateClusterProperties) GetInstances() *int32 { + if o == nil { + return nil + } + + return o.Instances + +} + +// GetInstancesOk returns a tuple with the Instances field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateClusterProperties) GetInstancesOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.Instances, true +} + +// SetInstances sets field value +func (o *CreateClusterProperties) SetInstances(v int32) { + + o.Instances = &v + +} + +// HasInstances returns a boolean if a field has been set. +func (o *CreateClusterProperties) HasInstances() bool { + if o != nil && o.Instances != nil { + return true + } + + return false +} + +// GetConnections returns the Connections field value +// If the value is explicit nil, the zero value for []Connection will be returned +func (o *CreateClusterProperties) GetConnections() *[]Connection { + if o == nil { + return nil + } + + return o.Connections + +} + +// GetConnectionsOk returns a tuple with the Connections field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateClusterProperties) GetConnectionsOk() (*[]Connection, bool) { + if o == nil { + return nil, false + } + + return o.Connections, true +} + +// SetConnections sets field value +func (o *CreateClusterProperties) SetConnections(v []Connection) { + + o.Connections = &v + +} + +// HasConnections returns a boolean if a field has been set. +func (o *CreateClusterProperties) HasConnections() bool { + if o != nil && o.Connections != nil { + return true + } + + return false +} + +// GetLocation returns the Location field value +// If the value is explicit nil, the zero value for string will be returned +func (o *CreateClusterProperties) GetLocation() *string { + if o == nil { + return nil + } + + return o.Location + +} + +// GetLocationOk returns a tuple with the Location field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateClusterProperties) GetLocationOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Location, true +} + +// SetLocation sets field value +func (o *CreateClusterProperties) SetLocation(v string) { + + o.Location = &v + +} + +// HasLocation returns a boolean if a field has been set. +func (o *CreateClusterProperties) HasLocation() bool { + if o != nil && o.Location != nil { + return true + } + + return false +} + +// GetDisplayName returns the DisplayName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *CreateClusterProperties) GetDisplayName() *string { + if o == nil { + return nil + } + + return o.DisplayName + +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateClusterProperties) GetDisplayNameOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.DisplayName, true +} + +// SetDisplayName sets field value +func (o *CreateClusterProperties) SetDisplayName(v string) { + + o.DisplayName = &v + +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *CreateClusterProperties) HasDisplayName() bool { + if o != nil && o.DisplayName != nil { + return true + } + + return false +} + +// GetMaintenanceWindow returns the MaintenanceWindow field value +// If the value is explicit nil, the zero value for MaintenanceWindow will be returned +func (o *CreateClusterProperties) GetMaintenanceWindow() *MaintenanceWindow { + if o == nil { + return nil + } + + return o.MaintenanceWindow + +} + +// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateClusterProperties) GetMaintenanceWindowOk() (*MaintenanceWindow, bool) { + if o == nil { + return nil, false + } + + return o.MaintenanceWindow, true +} + +// SetMaintenanceWindow sets field value +func (o *CreateClusterProperties) SetMaintenanceWindow(v MaintenanceWindow) { + + o.MaintenanceWindow = &v + +} + +// HasMaintenanceWindow returns a boolean if a field has been set. +func (o *CreateClusterProperties) HasMaintenanceWindow() bool { + if o != nil && o.MaintenanceWindow != nil { + return true + } + + return false +} + +func (o CreateClusterProperties) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.TemplateID != nil { + toSerialize["templateID"] = o.TemplateID + } + + if o.MongoDBVersion != nil { + toSerialize["mongoDBVersion"] = o.MongoDBVersion + } + + if o.Instances != nil { + toSerialize["instances"] = o.Instances + } + + if o.Connections != nil { + toSerialize["connections"] = o.Connections + } + + if o.Location != nil { + toSerialize["location"] = o.Location + } + + if o.DisplayName != nil { + toSerialize["displayName"] = o.DisplayName + } + + if o.MaintenanceWindow != nil { + toSerialize["maintenanceWindow"] = o.MaintenanceWindow + } + + return json.Marshal(toSerialize) +} + +type NullableCreateClusterProperties struct { + value *CreateClusterProperties + isSet bool +} + +func (v NullableCreateClusterProperties) Get() *CreateClusterProperties { + return v.value +} + +func (v *NullableCreateClusterProperties) Set(val *CreateClusterProperties) { + v.value = val + v.isSet = true +} + +func (v NullableCreateClusterProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateClusterProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateClusterProperties(val *CreateClusterProperties) *NullableCreateClusterProperties { + return &NullableCreateClusterProperties{value: val, isSet: true} +} + +func (v NullableCreateClusterProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateClusterProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_create_cluster_request.go b/model_create_cluster_request.go new file mode 100644 index 0000000..dbbd6ad --- /dev/null +++ b/model_create_cluster_request.go @@ -0,0 +1,164 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// CreateClusterRequest The request payload with all data needed to create a new MongoDB cluster. +type CreateClusterRequest struct { + Metadata *Metadata `json:"metadata,omitempty"` + Properties *CreateClusterProperties `json:"properties,omitempty"` +} + +// NewCreateClusterRequest instantiates a new CreateClusterRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateClusterRequest() *CreateClusterRequest { + this := CreateClusterRequest{} + + return &this +} + +// NewCreateClusterRequestWithDefaults instantiates a new CreateClusterRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateClusterRequestWithDefaults() *CreateClusterRequest { + this := CreateClusterRequest{} + return &this +} + +// GetMetadata returns the Metadata field value +// If the value is explicit nil, the zero value for Metadata will be returned +func (o *CreateClusterRequest) GetMetadata() *Metadata { + if o == nil { + return nil + } + + return o.Metadata + +} + +// GetMetadataOk returns a tuple with the Metadata field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateClusterRequest) GetMetadataOk() (*Metadata, bool) { + if o == nil { + return nil, false + } + + return o.Metadata, true +} + +// SetMetadata sets field value +func (o *CreateClusterRequest) SetMetadata(v Metadata) { + + o.Metadata = &v + +} + +// HasMetadata returns a boolean if a field has been set. +func (o *CreateClusterRequest) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for CreateClusterProperties will be returned +func (o *CreateClusterRequest) GetProperties() *CreateClusterProperties { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateClusterRequest) GetPropertiesOk() (*CreateClusterProperties, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *CreateClusterRequest) SetProperties(v CreateClusterProperties) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *CreateClusterRequest) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +func (o CreateClusterRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + + return json.Marshal(toSerialize) +} + +type NullableCreateClusterRequest struct { + value *CreateClusterRequest + isSet bool +} + +func (v NullableCreateClusterRequest) Get() *CreateClusterRequest { + return v.value +} + +func (v *NullableCreateClusterRequest) Set(val *CreateClusterRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCreateClusterRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateClusterRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateClusterRequest(val *CreateClusterRequest) *NullableCreateClusterRequest { + return &NullableCreateClusterRequest{value: val, isSet: true} +} + +func (v NullableCreateClusterRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateClusterRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_create_restore_request.go b/model_create_restore_request.go new file mode 100644 index 0000000..617a725 --- /dev/null +++ b/model_create_restore_request.go @@ -0,0 +1,124 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// CreateRestoreRequest The restore request. +type CreateRestoreRequest struct { + // The unique ID of the snapshot you want to restore. + SnapshotId *string `json:"snapshotId"` +} + +// NewCreateRestoreRequest instantiates a new CreateRestoreRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateRestoreRequest(snapshotId string) *CreateRestoreRequest { + this := CreateRestoreRequest{} + + this.SnapshotId = &snapshotId + + return &this +} + +// NewCreateRestoreRequestWithDefaults instantiates a new CreateRestoreRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateRestoreRequestWithDefaults() *CreateRestoreRequest { + this := CreateRestoreRequest{} + return &this +} + +// GetSnapshotId returns the SnapshotId field value +// If the value is explicit nil, the zero value for string will be returned +func (o *CreateRestoreRequest) GetSnapshotId() *string { + if o == nil { + return nil + } + + return o.SnapshotId + +} + +// GetSnapshotIdOk returns a tuple with the SnapshotId field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateRestoreRequest) GetSnapshotIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.SnapshotId, true +} + +// SetSnapshotId sets field value +func (o *CreateRestoreRequest) SetSnapshotId(v string) { + + o.SnapshotId = &v + +} + +// HasSnapshotId returns a boolean if a field has been set. +func (o *CreateRestoreRequest) HasSnapshotId() bool { + if o != nil && o.SnapshotId != nil { + return true + } + + return false +} + +func (o CreateRestoreRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.SnapshotId != nil { + toSerialize["snapshotId"] = o.SnapshotId + } + + return json.Marshal(toSerialize) +} + +type NullableCreateRestoreRequest struct { + value *CreateRestoreRequest + isSet bool +} + +func (v NullableCreateRestoreRequest) Get() *CreateRestoreRequest { + return v.value +} + +func (v *NullableCreateRestoreRequest) Set(val *CreateRestoreRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCreateRestoreRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateRestoreRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateRestoreRequest(val *CreateRestoreRequest) *NullableCreateRestoreRequest { + return &NullableCreateRestoreRequest{value: val, isSet: true} +} + +func (v NullableCreateRestoreRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateRestoreRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_day_of_the_week.go b/model_day_of_the_week.go new file mode 100644 index 0000000..e253dd0 --- /dev/null +++ b/model_day_of_the_week.go @@ -0,0 +1,88 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" + "fmt" +) + +// DayOfTheWeek The week day. +type DayOfTheWeek string + +// List of DayOfTheWeek +const ( + SUNDAY DayOfTheWeek = "Sunday" + MONDAY DayOfTheWeek = "Monday" + TUESDAY DayOfTheWeek = "Tuesday" + WEDNESDAY DayOfTheWeek = "Wednesday" + THURSDAY DayOfTheWeek = "Thursday" + FRIDAY DayOfTheWeek = "Friday" + SATURDAY DayOfTheWeek = "Saturday" +) + +func (v *DayOfTheWeek) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DayOfTheWeek(value) + for _, existing := range []DayOfTheWeek{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"} { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DayOfTheWeek", value) +} + +// Ptr returns reference to DayOfTheWeek value +func (v DayOfTheWeek) Ptr() *DayOfTheWeek { + return &v +} + +type NullableDayOfTheWeek struct { + value *DayOfTheWeek + isSet bool +} + +func (v NullableDayOfTheWeek) Get() *DayOfTheWeek { + return v.value +} + +func (v *NullableDayOfTheWeek) Set(val *DayOfTheWeek) { + v.value = val + v.isSet = true +} + +func (v NullableDayOfTheWeek) IsSet() bool { + return v.isSet +} + +func (v *NullableDayOfTheWeek) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDayOfTheWeek(val *DayOfTheWeek) *NullableDayOfTheWeek { + return &NullableDayOfTheWeek{value: val, isSet: true} +} + +func (v NullableDayOfTheWeek) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDayOfTheWeek) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_error_message.go b/model_error_message.go new file mode 100644 index 0000000..a39809a --- /dev/null +++ b/model_error_message.go @@ -0,0 +1,166 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// ErrorMessage struct for ErrorMessage +type ErrorMessage struct { + // Application internal error code. + ErrorCode *string `json:"errorCode,omitempty"` + // A human readable explanation specific to this occurrence of the problem. + Message *string `json:"message,omitempty"` +} + +// NewErrorMessage instantiates a new ErrorMessage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewErrorMessage() *ErrorMessage { + this := ErrorMessage{} + + return &this +} + +// NewErrorMessageWithDefaults instantiates a new ErrorMessage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorMessageWithDefaults() *ErrorMessage { + this := ErrorMessage{} + return &this +} + +// GetErrorCode returns the ErrorCode field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ErrorMessage) GetErrorCode() *string { + if o == nil { + return nil + } + + return o.ErrorCode + +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ErrorMessage) GetErrorCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.ErrorCode, true +} + +// SetErrorCode sets field value +func (o *ErrorMessage) SetErrorCode(v string) { + + o.ErrorCode = &v + +} + +// HasErrorCode returns a boolean if a field has been set. +func (o *ErrorMessage) HasErrorCode() bool { + if o != nil && o.ErrorCode != nil { + return true + } + + return false +} + +// GetMessage returns the Message field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ErrorMessage) GetMessage() *string { + if o == nil { + return nil + } + + return o.Message + +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ErrorMessage) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Message, true +} + +// SetMessage sets field value +func (o *ErrorMessage) SetMessage(v string) { + + o.Message = &v + +} + +// HasMessage returns a boolean if a field has been set. +func (o *ErrorMessage) HasMessage() bool { + if o != nil && o.Message != nil { + return true + } + + return false +} + +func (o ErrorMessage) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ErrorCode != nil { + toSerialize["errorCode"] = o.ErrorCode + } + + if o.Message != nil { + toSerialize["message"] = o.Message + } + + return json.Marshal(toSerialize) +} + +type NullableErrorMessage struct { + value *ErrorMessage + isSet bool +} + +func (v NullableErrorMessage) Get() *ErrorMessage { + return v.value +} + +func (v *NullableErrorMessage) Set(val *ErrorMessage) { + v.value = val + v.isSet = true +} + +func (v NullableErrorMessage) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorMessage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorMessage(val *ErrorMessage) *NullableErrorMessage { + return &NullableErrorMessage{value: val, isSet: true} +} + +func (v NullableErrorMessage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorMessage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_error_response.go b/model_error_response.go new file mode 100644 index 0000000..8a43753 --- /dev/null +++ b/model_error_response.go @@ -0,0 +1,165 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + // The HTTP status code of the operation. + HttpStatus *int32 `json:"httpStatus,omitempty"` + Messages *[]ErrorMessage `json:"messages,omitempty"` +} + +// NewErrorResponse instantiates a new ErrorResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewErrorResponse() *ErrorResponse { + this := ErrorResponse{} + + return &this +} + +// NewErrorResponseWithDefaults instantiates a new ErrorResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorResponseWithDefaults() *ErrorResponse { + this := ErrorResponse{} + return &this +} + +// GetHttpStatus returns the HttpStatus field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *ErrorResponse) GetHttpStatus() *int32 { + if o == nil { + return nil + } + + return o.HttpStatus + +} + +// GetHttpStatusOk returns a tuple with the HttpStatus field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ErrorResponse) GetHttpStatusOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.HttpStatus, true +} + +// SetHttpStatus sets field value +func (o *ErrorResponse) SetHttpStatus(v int32) { + + o.HttpStatus = &v + +} + +// HasHttpStatus returns a boolean if a field has been set. +func (o *ErrorResponse) HasHttpStatus() bool { + if o != nil && o.HttpStatus != nil { + return true + } + + return false +} + +// GetMessages returns the Messages field value +// If the value is explicit nil, the zero value for []ErrorMessage will be returned +func (o *ErrorResponse) GetMessages() *[]ErrorMessage { + if o == nil { + return nil + } + + return o.Messages + +} + +// GetMessagesOk returns a tuple with the Messages field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ErrorResponse) GetMessagesOk() (*[]ErrorMessage, bool) { + if o == nil { + return nil, false + } + + return o.Messages, true +} + +// SetMessages sets field value +func (o *ErrorResponse) SetMessages(v []ErrorMessage) { + + o.Messages = &v + +} + +// HasMessages returns a boolean if a field has been set. +func (o *ErrorResponse) HasMessages() bool { + if o != nil && o.Messages != nil { + return true + } + + return false +} + +func (o ErrorResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.HttpStatus != nil { + toSerialize["httpStatus"] = o.HttpStatus + } + + if o.Messages != nil { + toSerialize["messages"] = o.Messages + } + + return json.Marshal(toSerialize) +} + +type NullableErrorResponse struct { + value *ErrorResponse + isSet bool +} + +func (v NullableErrorResponse) Get() *ErrorResponse { + return v.value +} + +func (v *NullableErrorResponse) Set(val *ErrorResponse) { + v.value = val + v.isSet = true +} + +func (v NullableErrorResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorResponse(val *ErrorResponse) *NullableErrorResponse { + return &NullableErrorResponse{value: val, isSet: true} +} + +func (v NullableErrorResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_maintenance_window.go b/model_maintenance_window.go new file mode 100644 index 0000000..eb77e8b --- /dev/null +++ b/model_maintenance_window.go @@ -0,0 +1,167 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// MaintenanceWindow A weekly window of 4 hours during which maintenance work can be performed. +type MaintenanceWindow struct { + Time *string `json:"time"` + DayOfTheWeek *DayOfTheWeek `json:"dayOfTheWeek"` +} + +// NewMaintenanceWindow instantiates a new MaintenanceWindow object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMaintenanceWindow(time string, dayOfTheWeek DayOfTheWeek) *MaintenanceWindow { + this := MaintenanceWindow{} + + this.Time = &time + this.DayOfTheWeek = &dayOfTheWeek + + return &this +} + +// NewMaintenanceWindowWithDefaults instantiates a new MaintenanceWindow object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMaintenanceWindowWithDefaults() *MaintenanceWindow { + this := MaintenanceWindow{} + return &this +} + +// GetTime returns the Time field value +// If the value is explicit nil, the zero value for string will be returned +func (o *MaintenanceWindow) GetTime() *string { + if o == nil { + return nil + } + + return o.Time + +} + +// GetTimeOk returns a tuple with the Time field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *MaintenanceWindow) GetTimeOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Time, true +} + +// SetTime sets field value +func (o *MaintenanceWindow) SetTime(v string) { + + o.Time = &v + +} + +// HasTime returns a boolean if a field has been set. +func (o *MaintenanceWindow) HasTime() bool { + if o != nil && o.Time != nil { + return true + } + + return false +} + +// GetDayOfTheWeek returns the DayOfTheWeek field value +// If the value is explicit nil, the zero value for DayOfTheWeek will be returned +func (o *MaintenanceWindow) GetDayOfTheWeek() *DayOfTheWeek { + if o == nil { + return nil + } + + return o.DayOfTheWeek + +} + +// GetDayOfTheWeekOk returns a tuple with the DayOfTheWeek field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *MaintenanceWindow) GetDayOfTheWeekOk() (*DayOfTheWeek, bool) { + if o == nil { + return nil, false + } + + return o.DayOfTheWeek, true +} + +// SetDayOfTheWeek sets field value +func (o *MaintenanceWindow) SetDayOfTheWeek(v DayOfTheWeek) { + + o.DayOfTheWeek = &v + +} + +// HasDayOfTheWeek returns a boolean if a field has been set. +func (o *MaintenanceWindow) HasDayOfTheWeek() bool { + if o != nil && o.DayOfTheWeek != nil { + return true + } + + return false +} + +func (o MaintenanceWindow) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Time != nil { + toSerialize["time"] = o.Time + } + + if o.DayOfTheWeek != nil { + toSerialize["dayOfTheWeek"] = o.DayOfTheWeek + } + + return json.Marshal(toSerialize) +} + +type NullableMaintenanceWindow struct { + value *MaintenanceWindow + isSet bool +} + +func (v NullableMaintenanceWindow) Get() *MaintenanceWindow { + return v.value +} + +func (v *NullableMaintenanceWindow) Set(val *MaintenanceWindow) { + v.value = val + v.isSet = true +} + +func (v NullableMaintenanceWindow) IsSet() bool { + return v.isSet +} + +func (v *NullableMaintenanceWindow) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMaintenanceWindow(val *MaintenanceWindow) *NullableMaintenanceWindow { + return &NullableMaintenanceWindow{value: val, isSet: true} +} + +func (v NullableMaintenanceWindow) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMaintenanceWindow) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_metadata.go b/model_metadata.go new file mode 100644 index 0000000..03c3dbc --- /dev/null +++ b/model_metadata.go @@ -0,0 +1,400 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" + "time" +) + +// Metadata The metadata of the resource. +type Metadata struct { + // The date the resource was created. + CreatedDate *IonosTime `json:"createdDate,omitempty"` + // The user who created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + // The ID of the user who created the resource. + CreatedByUserId *string `json:"createdByUserId,omitempty"` + // The date the resource was last modified. + LastModifiedDate *IonosTime `json:"lastModifiedDate,omitempty"` + // The last user who modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // The ID of the user who last modified the resource. + LastModifiedByUserId *string `json:"lastModifiedByUserId,omitempty"` + State *State `json:"state,omitempty"` +} + +// NewMetadata instantiates a new Metadata object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMetadata() *Metadata { + this := Metadata{} + + return &this +} + +// NewMetadataWithDefaults instantiates a new Metadata object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMetadataWithDefaults() *Metadata { + this := Metadata{} + return &this +} + +// GetCreatedDate returns the CreatedDate field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Metadata) GetCreatedDate() *time.Time { + if o == nil { + return nil + } + + if o.CreatedDate == nil { + return nil + } + return &o.CreatedDate.Time + +} + +// GetCreatedDateOk returns a tuple with the CreatedDate field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Metadata) GetCreatedDateOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + + if o.CreatedDate == nil { + return nil, false + } + return &o.CreatedDate.Time, true + +} + +// SetCreatedDate sets field value +func (o *Metadata) SetCreatedDate(v time.Time) { + + o.CreatedDate = &IonosTime{v} + +} + +// HasCreatedDate returns a boolean if a field has been set. +func (o *Metadata) HasCreatedDate() bool { + if o != nil && o.CreatedDate != nil { + return true + } + + return false +} + +// GetCreatedBy returns the CreatedBy field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Metadata) GetCreatedBy() *string { + if o == nil { + return nil + } + + return o.CreatedBy + +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Metadata) GetCreatedByOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.CreatedBy, true +} + +// SetCreatedBy sets field value +func (o *Metadata) SetCreatedBy(v string) { + + o.CreatedBy = &v + +} + +// HasCreatedBy returns a boolean if a field has been set. +func (o *Metadata) HasCreatedBy() bool { + if o != nil && o.CreatedBy != nil { + return true + } + + return false +} + +// GetCreatedByUserId returns the CreatedByUserId field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Metadata) GetCreatedByUserId() *string { + if o == nil { + return nil + } + + return o.CreatedByUserId + +} + +// GetCreatedByUserIdOk returns a tuple with the CreatedByUserId field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Metadata) GetCreatedByUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.CreatedByUserId, true +} + +// SetCreatedByUserId sets field value +func (o *Metadata) SetCreatedByUserId(v string) { + + o.CreatedByUserId = &v + +} + +// HasCreatedByUserId returns a boolean if a field has been set. +func (o *Metadata) HasCreatedByUserId() bool { + if o != nil && o.CreatedByUserId != nil { + return true + } + + return false +} + +// GetLastModifiedDate returns the LastModifiedDate field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Metadata) GetLastModifiedDate() *time.Time { + if o == nil { + return nil + } + + if o.LastModifiedDate == nil { + return nil + } + return &o.LastModifiedDate.Time + +} + +// GetLastModifiedDateOk returns a tuple with the LastModifiedDate field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Metadata) GetLastModifiedDateOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + + if o.LastModifiedDate == nil { + return nil, false + } + return &o.LastModifiedDate.Time, true + +} + +// SetLastModifiedDate sets field value +func (o *Metadata) SetLastModifiedDate(v time.Time) { + + o.LastModifiedDate = &IonosTime{v} + +} + +// HasLastModifiedDate returns a boolean if a field has been set. +func (o *Metadata) HasLastModifiedDate() bool { + if o != nil && o.LastModifiedDate != nil { + return true + } + + return false +} + +// GetLastModifiedBy returns the LastModifiedBy field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Metadata) GetLastModifiedBy() *string { + if o == nil { + return nil + } + + return o.LastModifiedBy + +} + +// GetLastModifiedByOk returns a tuple with the LastModifiedBy field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Metadata) GetLastModifiedByOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.LastModifiedBy, true +} + +// SetLastModifiedBy sets field value +func (o *Metadata) SetLastModifiedBy(v string) { + + o.LastModifiedBy = &v + +} + +// HasLastModifiedBy returns a boolean if a field has been set. +func (o *Metadata) HasLastModifiedBy() bool { + if o != nil && o.LastModifiedBy != nil { + return true + } + + return false +} + +// GetLastModifiedByUserId returns the LastModifiedByUserId field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Metadata) GetLastModifiedByUserId() *string { + if o == nil { + return nil + } + + return o.LastModifiedByUserId + +} + +// GetLastModifiedByUserIdOk returns a tuple with the LastModifiedByUserId field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Metadata) GetLastModifiedByUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.LastModifiedByUserId, true +} + +// SetLastModifiedByUserId sets field value +func (o *Metadata) SetLastModifiedByUserId(v string) { + + o.LastModifiedByUserId = &v + +} + +// HasLastModifiedByUserId returns a boolean if a field has been set. +func (o *Metadata) HasLastModifiedByUserId() bool { + if o != nil && o.LastModifiedByUserId != nil { + return true + } + + return false +} + +// GetState returns the State field value +// If the value is explicit nil, the zero value for State will be returned +func (o *Metadata) GetState() *State { + if o == nil { + return nil + } + + return o.State + +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Metadata) GetStateOk() (*State, bool) { + if o == nil { + return nil, false + } + + return o.State, true +} + +// SetState sets field value +func (o *Metadata) SetState(v State) { + + o.State = &v + +} + +// HasState returns a boolean if a field has been set. +func (o *Metadata) HasState() bool { + if o != nil && o.State != nil { + return true + } + + return false +} + +func (o Metadata) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.CreatedDate != nil { + toSerialize["createdDate"] = o.CreatedDate + } + + if o.CreatedBy != nil { + toSerialize["createdBy"] = o.CreatedBy + } + + if o.CreatedByUserId != nil { + toSerialize["createdByUserId"] = o.CreatedByUserId + } + + if o.LastModifiedDate != nil { + toSerialize["lastModifiedDate"] = o.LastModifiedDate + } + + if o.LastModifiedBy != nil { + toSerialize["lastModifiedBy"] = o.LastModifiedBy + } + + if o.LastModifiedByUserId != nil { + toSerialize["lastModifiedByUserId"] = o.LastModifiedByUserId + } + + if o.State != nil { + toSerialize["state"] = o.State + } + + return json.Marshal(toSerialize) +} + +type NullableMetadata struct { + value *Metadata + isSet bool +} + +func (v NullableMetadata) Get() *Metadata { + return v.value +} + +func (v *NullableMetadata) Set(val *Metadata) { + v.value = val + v.isSet = true +} + +func (v NullableMetadata) IsSet() bool { + return v.isSet +} + +func (v *NullableMetadata) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMetadata(val *Metadata) *NullableMetadata { + return &NullableMetadata{value: val, isSet: true} +} + +func (v NullableMetadata) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMetadata) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_pagination.go b/model_pagination.go new file mode 100644 index 0000000..1450879 --- /dev/null +++ b/model_pagination.go @@ -0,0 +1,209 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// Pagination struct for Pagination +type Pagination struct { + // The offset specified in the request (if none was specified, the default offset is 0) (not implemented yet). + Offset *int32 `json:"offset,omitempty"` + // The limit specified in the request (if none was specified, use the endpoint's default pagination limit) (not implemented yet, always return number of items). + Limit *int32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` +} + +// NewPagination instantiates a new Pagination object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPagination() *Pagination { + this := Pagination{} + + return &this +} + +// NewPaginationWithDefaults instantiates a new Pagination object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginationWithDefaults() *Pagination { + this := Pagination{} + return &this +} + +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *Pagination) GetOffset() *int32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Pagination) GetOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *Pagination) SetOffset(v int32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *Pagination) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *Pagination) GetLimit() *int32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Pagination) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *Pagination) SetLimit(v int32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *Pagination) HasLimit() bool { + if o != nil && o.Limit != nil { + return true + } + + return false +} + +// GetLinks returns the Links field value +// If the value is explicit nil, the zero value for PaginationLinks will be returned +func (o *Pagination) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Pagination) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *Pagination) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *Pagination) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} + +func (o Pagination) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + + if o.Links != nil { + toSerialize["_links"] = o.Links + } + + return json.Marshal(toSerialize) +} + +type NullablePagination struct { + value *Pagination + isSet bool +} + +func (v NullablePagination) Get() *Pagination { + return v.value +} + +func (v *NullablePagination) Set(val *Pagination) { + v.value = val + v.isSet = true +} + +func (v NullablePagination) IsSet() bool { + return v.isSet +} + +func (v *NullablePagination) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePagination(val *Pagination) *NullablePagination { + return &NullablePagination{value: val, isSet: true} +} + +func (v NullablePagination) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePagination) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_pagination_links.go b/model_pagination_links.go new file mode 100644 index 0000000..1bafeff --- /dev/null +++ b/model_pagination_links.go @@ -0,0 +1,210 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// PaginationLinks The URLs to navigate the different pages. As of now we always only return a single page. +type PaginationLinks struct { + // The URL (with offset and limit parameters) of the previous page; only present if the offset is greater than 0. + Prev *string `json:"prev,omitempty"` + // The URL (with offset and limit parameters) of the current page. + Self *string `json:"self,omitempty"` + // The URL (with offset and limit parameters) of the next page; only present if the offset and limit is less than the total number of elements. + Next *string `json:"next,omitempty"` +} + +// NewPaginationLinks instantiates a new PaginationLinks object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginationLinks() *PaginationLinks { + this := PaginationLinks{} + + return &this +} + +// NewPaginationLinksWithDefaults instantiates a new PaginationLinks object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginationLinksWithDefaults() *PaginationLinks { + this := PaginationLinks{} + return &this +} + +// GetPrev returns the Prev field value +// If the value is explicit nil, the zero value for string will be returned +func (o *PaginationLinks) GetPrev() *string { + if o == nil { + return nil + } + + return o.Prev + +} + +// GetPrevOk returns a tuple with the Prev field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginationLinks) GetPrevOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Prev, true +} + +// SetPrev sets field value +func (o *PaginationLinks) SetPrev(v string) { + + o.Prev = &v + +} + +// HasPrev returns a boolean if a field has been set. +func (o *PaginationLinks) HasPrev() bool { + if o != nil && o.Prev != nil { + return true + } + + return false +} + +// GetSelf returns the Self field value +// If the value is explicit nil, the zero value for string will be returned +func (o *PaginationLinks) GetSelf() *string { + if o == nil { + return nil + } + + return o.Self + +} + +// GetSelfOk returns a tuple with the Self field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginationLinks) GetSelfOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Self, true +} + +// SetSelf sets field value +func (o *PaginationLinks) SetSelf(v string) { + + o.Self = &v + +} + +// HasSelf returns a boolean if a field has been set. +func (o *PaginationLinks) HasSelf() bool { + if o != nil && o.Self != nil { + return true + } + + return false +} + +// GetNext returns the Next field value +// If the value is explicit nil, the zero value for string will be returned +func (o *PaginationLinks) GetNext() *string { + if o == nil { + return nil + } + + return o.Next + +} + +// GetNextOk returns a tuple with the Next field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginationLinks) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Next, true +} + +// SetNext sets field value +func (o *PaginationLinks) SetNext(v string) { + + o.Next = &v + +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginationLinks) HasNext() bool { + if o != nil && o.Next != nil { + return true + } + + return false +} + +func (o PaginationLinks) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Prev != nil { + toSerialize["prev"] = o.Prev + } + + if o.Self != nil { + toSerialize["self"] = o.Self + } + + if o.Next != nil { + toSerialize["next"] = o.Next + } + + return json.Marshal(toSerialize) +} + +type NullablePaginationLinks struct { + value *PaginationLinks + isSet bool +} + +func (v NullablePaginationLinks) Get() *PaginationLinks { + return v.value +} + +func (v *NullablePaginationLinks) Set(val *PaginationLinks) { + v.value = val + v.isSet = true +} + +func (v NullablePaginationLinks) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginationLinks) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginationLinks(val *PaginationLinks) *NullablePaginationLinks { + return &NullablePaginationLinks{value: val, isSet: true} +} + +func (v NullablePaginationLinks) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginationLinks) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_resource_type.go b/model_resource_type.go new file mode 100644 index 0000000..ffcb3bf --- /dev/null +++ b/model_resource_type.go @@ -0,0 +1,84 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" + "fmt" +) + +// ResourceType The resource type. +type ResourceType string + +// List of ResourceType +const ( + COLLECTION ResourceType = "collection" + CLUSTER ResourceType = "cluster" + USER ResourceType = "user" +) + +func (v *ResourceType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ResourceType(value) + for _, existing := range []ResourceType{"collection", "cluster", "user"} { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ResourceType", value) +} + +// Ptr returns reference to ResourceType value +func (v ResourceType) Ptr() *ResourceType { + return &v +} + +type NullableResourceType struct { + value *ResourceType + isSet bool +} + +func (v NullableResourceType) Get() *ResourceType { + return v.value +} + +func (v *NullableResourceType) Set(val *ResourceType) { + v.value = val + v.isSet = true +} + +func (v NullableResourceType) IsSet() bool { + return v.isSet +} + +func (v *NullableResourceType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResourceType(val *ResourceType) *NullableResourceType { + return &NullableResourceType{value: val, isSet: true} +} + +func (v NullableResourceType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResourceType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_snapshot_list.go b/model_snapshot_list.go new file mode 100644 index 0000000..75fa7dd --- /dev/null +++ b/model_snapshot_list.go @@ -0,0 +1,339 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// SnapshotList List of snapshots. +type SnapshotList struct { + Type *ResourceType `json:"type,omitempty"` + // The unique ID of the resource. + Id *string `json:"id,omitempty"` + Items *[]SnapshotResponse `json:"items,omitempty"` + // The offset specified in the request (if none was specified, the default offset is 0) (not implemented yet). + Offset *int32 `json:"offset,omitempty"` + // The limit specified in the request (if none was specified, use the endpoint's default pagination limit) (not implemented yet, always return number of items). + Limit *int32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` +} + +// NewSnapshotList instantiates a new SnapshotList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSnapshotList() *SnapshotList { + this := SnapshotList{} + + return &this +} + +// NewSnapshotListWithDefaults instantiates a new SnapshotList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSnapshotListWithDefaults() *SnapshotList { + this := SnapshotList{} + return &this +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for ResourceType will be returned +func (o *SnapshotList) GetType() *ResourceType { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SnapshotList) GetTypeOk() (*ResourceType, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *SnapshotList) SetType(v ResourceType) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *SnapshotList) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SnapshotList) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SnapshotList) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *SnapshotList) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *SnapshotList) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetItems returns the Items field value +// If the value is explicit nil, the zero value for []SnapshotResponse will be returned +func (o *SnapshotList) GetItems() *[]SnapshotResponse { + if o == nil { + return nil + } + + return o.Items + +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SnapshotList) GetItemsOk() (*[]SnapshotResponse, bool) { + if o == nil { + return nil, false + } + + return o.Items, true +} + +// SetItems sets field value +func (o *SnapshotList) SetItems(v []SnapshotResponse) { + + o.Items = &v + +} + +// HasItems returns a boolean if a field has been set. +func (o *SnapshotList) HasItems() bool { + if o != nil && o.Items != nil { + return true + } + + return false +} + +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *SnapshotList) GetOffset() *int32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SnapshotList) GetOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *SnapshotList) SetOffset(v int32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *SnapshotList) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *SnapshotList) GetLimit() *int32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SnapshotList) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *SnapshotList) SetLimit(v int32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *SnapshotList) HasLimit() bool { + if o != nil && o.Limit != nil { + return true + } + + return false +} + +// GetLinks returns the Links field value +// If the value is explicit nil, the zero value for PaginationLinks will be returned +func (o *SnapshotList) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SnapshotList) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *SnapshotList) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *SnapshotList) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} + +func (o SnapshotList) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Type != nil { + toSerialize["type"] = o.Type + } + + if o.Id != nil { + toSerialize["id"] = o.Id + } + + if o.Items != nil { + toSerialize["items"] = o.Items + } + + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + + if o.Links != nil { + toSerialize["_links"] = o.Links + } + + return json.Marshal(toSerialize) +} + +type NullableSnapshotList struct { + value *SnapshotList + isSet bool +} + +func (v NullableSnapshotList) Get() *SnapshotList { + return v.value +} + +func (v *NullableSnapshotList) Set(val *SnapshotList) { + v.value = val + v.isSet = true +} + +func (v NullableSnapshotList) IsSet() bool { + return v.isSet +} + +func (v *NullableSnapshotList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSnapshotList(val *SnapshotList) *NullableSnapshotList { + return &NullableSnapshotList{value: val, isSet: true} +} + +func (v NullableSnapshotList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSnapshotList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_snapshot_list_all_of.go b/model_snapshot_list_all_of.go new file mode 100644 index 0000000..65ff5da --- /dev/null +++ b/model_snapshot_list_all_of.go @@ -0,0 +1,208 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// SnapshotListAllOf struct for SnapshotListAllOf +type SnapshotListAllOf struct { + Type *ResourceType `json:"type,omitempty"` + // The unique ID of the resource. + Id *string `json:"id,omitempty"` + Items *[]SnapshotResponse `json:"items,omitempty"` +} + +// NewSnapshotListAllOf instantiates a new SnapshotListAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSnapshotListAllOf() *SnapshotListAllOf { + this := SnapshotListAllOf{} + + return &this +} + +// NewSnapshotListAllOfWithDefaults instantiates a new SnapshotListAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSnapshotListAllOfWithDefaults() *SnapshotListAllOf { + this := SnapshotListAllOf{} + return &this +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for ResourceType will be returned +func (o *SnapshotListAllOf) GetType() *ResourceType { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SnapshotListAllOf) GetTypeOk() (*ResourceType, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *SnapshotListAllOf) SetType(v ResourceType) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *SnapshotListAllOf) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SnapshotListAllOf) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SnapshotListAllOf) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *SnapshotListAllOf) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *SnapshotListAllOf) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetItems returns the Items field value +// If the value is explicit nil, the zero value for []SnapshotResponse will be returned +func (o *SnapshotListAllOf) GetItems() *[]SnapshotResponse { + if o == nil { + return nil + } + + return o.Items + +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SnapshotListAllOf) GetItemsOk() (*[]SnapshotResponse, bool) { + if o == nil { + return nil, false + } + + return o.Items, true +} + +// SetItems sets field value +func (o *SnapshotListAllOf) SetItems(v []SnapshotResponse) { + + o.Items = &v + +} + +// HasItems returns a boolean if a field has been set. +func (o *SnapshotListAllOf) HasItems() bool { + if o != nil && o.Items != nil { + return true + } + + return false +} + +func (o SnapshotListAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Type != nil { + toSerialize["type"] = o.Type + } + + if o.Id != nil { + toSerialize["id"] = o.Id + } + + if o.Items != nil { + toSerialize["items"] = o.Items + } + + return json.Marshal(toSerialize) +} + +type NullableSnapshotListAllOf struct { + value *SnapshotListAllOf + isSet bool +} + +func (v NullableSnapshotListAllOf) Get() *SnapshotListAllOf { + return v.value +} + +func (v *NullableSnapshotListAllOf) Set(val *SnapshotListAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableSnapshotListAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableSnapshotListAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSnapshotListAllOf(val *SnapshotListAllOf) *NullableSnapshotListAllOf { + return &NullableSnapshotListAllOf{value: val, isSet: true} +} + +func (v NullableSnapshotListAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSnapshotListAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_snapshot_properties.go b/model_snapshot_properties.go new file mode 100644 index 0000000..ec07325 --- /dev/null +++ b/model_snapshot_properties.go @@ -0,0 +1,218 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" + "time" +) + +// SnapshotProperties Properties of a snapshot. +type SnapshotProperties struct { + // The MongoDB version this backup was created from. + Version *string `json:"version,omitempty"` + // The size of the snapshot in Mebibytes. + Size *int32 `json:"size,omitempty"` + // The date the resource was created. + CreationTime *IonosTime `json:"creationTime,omitempty"` +} + +// NewSnapshotProperties instantiates a new SnapshotProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSnapshotProperties() *SnapshotProperties { + this := SnapshotProperties{} + + return &this +} + +// NewSnapshotPropertiesWithDefaults instantiates a new SnapshotProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSnapshotPropertiesWithDefaults() *SnapshotProperties { + this := SnapshotProperties{} + return &this +} + +// GetVersion returns the Version field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SnapshotProperties) GetVersion() *string { + if o == nil { + return nil + } + + return o.Version + +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SnapshotProperties) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Version, true +} + +// SetVersion sets field value +func (o *SnapshotProperties) SetVersion(v string) { + + o.Version = &v + +} + +// HasVersion returns a boolean if a field has been set. +func (o *SnapshotProperties) HasVersion() bool { + if o != nil && o.Version != nil { + return true + } + + return false +} + +// GetSize returns the Size field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *SnapshotProperties) GetSize() *int32 { + if o == nil { + return nil + } + + return o.Size + +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SnapshotProperties) GetSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.Size, true +} + +// SetSize sets field value +func (o *SnapshotProperties) SetSize(v int32) { + + o.Size = &v + +} + +// HasSize returns a boolean if a field has been set. +func (o *SnapshotProperties) HasSize() bool { + if o != nil && o.Size != nil { + return true + } + + return false +} + +// GetCreationTime returns the CreationTime field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *SnapshotProperties) GetCreationTime() *time.Time { + if o == nil { + return nil + } + + if o.CreationTime == nil { + return nil + } + return &o.CreationTime.Time + +} + +// GetCreationTimeOk returns a tuple with the CreationTime field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SnapshotProperties) GetCreationTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + + if o.CreationTime == nil { + return nil, false + } + return &o.CreationTime.Time, true + +} + +// SetCreationTime sets field value +func (o *SnapshotProperties) SetCreationTime(v time.Time) { + + o.CreationTime = &IonosTime{v} + +} + +// HasCreationTime returns a boolean if a field has been set. +func (o *SnapshotProperties) HasCreationTime() bool { + if o != nil && o.CreationTime != nil { + return true + } + + return false +} + +func (o SnapshotProperties) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Version != nil { + toSerialize["version"] = o.Version + } + + if o.Size != nil { + toSerialize["size"] = o.Size + } + + if o.CreationTime != nil { + toSerialize["creationTime"] = o.CreationTime + } + + return json.Marshal(toSerialize) +} + +type NullableSnapshotProperties struct { + value *SnapshotProperties + isSet bool +} + +func (v NullableSnapshotProperties) Get() *SnapshotProperties { + return v.value +} + +func (v *NullableSnapshotProperties) Set(val *SnapshotProperties) { + v.value = val + v.isSet = true +} + +func (v NullableSnapshotProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableSnapshotProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSnapshotProperties(val *SnapshotProperties) *NullableSnapshotProperties { + return &NullableSnapshotProperties{value: val, isSet: true} +} + +func (v NullableSnapshotProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSnapshotProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_snapshot_response.go b/model_snapshot_response.go new file mode 100644 index 0000000..96c5216 --- /dev/null +++ b/model_snapshot_response.go @@ -0,0 +1,208 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// SnapshotResponse A database snapshost. +type SnapshotResponse struct { + Type *ResourceType `json:"type,omitempty"` + // The unique ID of the resource. + Id *string `json:"id,omitempty"` + Properties *SnapshotProperties `json:"properties,omitempty"` +} + +// NewSnapshotResponse instantiates a new SnapshotResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSnapshotResponse() *SnapshotResponse { + this := SnapshotResponse{} + + return &this +} + +// NewSnapshotResponseWithDefaults instantiates a new SnapshotResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSnapshotResponseWithDefaults() *SnapshotResponse { + this := SnapshotResponse{} + return &this +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for ResourceType will be returned +func (o *SnapshotResponse) GetType() *ResourceType { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SnapshotResponse) GetTypeOk() (*ResourceType, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *SnapshotResponse) SetType(v ResourceType) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *SnapshotResponse) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SnapshotResponse) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SnapshotResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *SnapshotResponse) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *SnapshotResponse) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for SnapshotProperties will be returned +func (o *SnapshotResponse) GetProperties() *SnapshotProperties { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SnapshotResponse) GetPropertiesOk() (*SnapshotProperties, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *SnapshotResponse) SetProperties(v SnapshotProperties) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *SnapshotResponse) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +func (o SnapshotResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Type != nil { + toSerialize["type"] = o.Type + } + + if o.Id != nil { + toSerialize["id"] = o.Id + } + + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + + return json.Marshal(toSerialize) +} + +type NullableSnapshotResponse struct { + value *SnapshotResponse + isSet bool +} + +func (v NullableSnapshotResponse) Get() *SnapshotResponse { + return v.value +} + +func (v *NullableSnapshotResponse) Set(val *SnapshotResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSnapshotResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSnapshotResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSnapshotResponse(val *SnapshotResponse) *NullableSnapshotResponse { + return &NullableSnapshotResponse{value: val, isSet: true} +} + +func (v NullableSnapshotResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSnapshotResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_state.go b/model_state.go new file mode 100644 index 0000000..93ed642 --- /dev/null +++ b/model_state.go @@ -0,0 +1,86 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" + "fmt" +) + +// State The current status reported by the cluster. +type State string + +// List of State +const ( + AVAILABLE State = "AVAILABLE" + BUSY State = "BUSY" + DESTROYING State = "DESTROYING" + FAILED State = "FAILED" + UNKNOWN State = "UNKNOWN" +) + +func (v *State) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := State(value) + for _, existing := range []State{"AVAILABLE", "BUSY", "DESTROYING", "FAILED", "UNKNOWN"} { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid State", value) +} + +// Ptr returns reference to State value +func (v State) Ptr() *State { + return &v +} + +type NullableState struct { + value *State + isSet bool +} + +func (v NullableState) Get() *State { + return v.value +} + +func (v *NullableState) Set(val *State) { + v.value = val + v.isSet = true +} + +func (v NullableState) IsSet() bool { + return v.isSet +} + +func (v *NullableState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableState(val *State) *NullableState { + return &NullableState{value: val, isSet: true} +} + +func (v NullableState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_template_list.go b/model_template_list.go new file mode 100644 index 0000000..38e14a4 --- /dev/null +++ b/model_template_list.go @@ -0,0 +1,121 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// TemplateList The list of MongoDB templates. +type TemplateList struct { + Items *[]TemplateResponse `json:"items,omitempty"` +} + +// NewTemplateList instantiates a new TemplateList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTemplateList() *TemplateList { + this := TemplateList{} + + return &this +} + +// NewTemplateListWithDefaults instantiates a new TemplateList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTemplateListWithDefaults() *TemplateList { + this := TemplateList{} + return &this +} + +// GetItems returns the Items field value +// If the value is explicit nil, the zero value for []TemplateResponse will be returned +func (o *TemplateList) GetItems() *[]TemplateResponse { + if o == nil { + return nil + } + + return o.Items + +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TemplateList) GetItemsOk() (*[]TemplateResponse, bool) { + if o == nil { + return nil, false + } + + return o.Items, true +} + +// SetItems sets field value +func (o *TemplateList) SetItems(v []TemplateResponse) { + + o.Items = &v + +} + +// HasItems returns a boolean if a field has been set. +func (o *TemplateList) HasItems() bool { + if o != nil && o.Items != nil { + return true + } + + return false +} + +func (o TemplateList) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Items != nil { + toSerialize["items"] = o.Items + } + + return json.Marshal(toSerialize) +} + +type NullableTemplateList struct { + value *TemplateList + isSet bool +} + +func (v NullableTemplateList) Get() *TemplateList { + return v.value +} + +func (v *NullableTemplateList) Set(val *TemplateList) { + v.value = val + v.isSet = true +} + +func (v NullableTemplateList) IsSet() bool { + return v.isSet +} + +func (v *NullableTemplateList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTemplateList(val *TemplateList) *NullableTemplateList { + return &NullableTemplateList{value: val, isSet: true} +} + +func (v NullableTemplateList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTemplateList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_template_list_all_of.go b/model_template_list_all_of.go new file mode 100644 index 0000000..ba0dd59 --- /dev/null +++ b/model_template_list_all_of.go @@ -0,0 +1,121 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// TemplateListAllOf struct for TemplateListAllOf +type TemplateListAllOf struct { + Items *[]TemplateResponse `json:"items,omitempty"` +} + +// NewTemplateListAllOf instantiates a new TemplateListAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTemplateListAllOf() *TemplateListAllOf { + this := TemplateListAllOf{} + + return &this +} + +// NewTemplateListAllOfWithDefaults instantiates a new TemplateListAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTemplateListAllOfWithDefaults() *TemplateListAllOf { + this := TemplateListAllOf{} + return &this +} + +// GetItems returns the Items field value +// If the value is explicit nil, the zero value for []TemplateResponse will be returned +func (o *TemplateListAllOf) GetItems() *[]TemplateResponse { + if o == nil { + return nil + } + + return o.Items + +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TemplateListAllOf) GetItemsOk() (*[]TemplateResponse, bool) { + if o == nil { + return nil, false + } + + return o.Items, true +} + +// SetItems sets field value +func (o *TemplateListAllOf) SetItems(v []TemplateResponse) { + + o.Items = &v + +} + +// HasItems returns a boolean if a field has been set. +func (o *TemplateListAllOf) HasItems() bool { + if o != nil && o.Items != nil { + return true + } + + return false +} + +func (o TemplateListAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Items != nil { + toSerialize["items"] = o.Items + } + + return json.Marshal(toSerialize) +} + +type NullableTemplateListAllOf struct { + value *TemplateListAllOf + isSet bool +} + +func (v NullableTemplateListAllOf) Get() *TemplateListAllOf { + return v.value +} + +func (v *NullableTemplateListAllOf) Set(val *TemplateListAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableTemplateListAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableTemplateListAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTemplateListAllOf(val *TemplateListAllOf) *NullableTemplateListAllOf { + return &NullableTemplateListAllOf{value: val, isSet: true} +} + +func (v NullableTemplateListAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTemplateListAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_template_response.go b/model_template_response.go new file mode 100644 index 0000000..e3e8fb1 --- /dev/null +++ b/model_template_response.go @@ -0,0 +1,254 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// TemplateResponse A MongoDB template item. +type TemplateResponse struct { + // The unique template ID. + Id *string `json:"id,omitempty"` + // The number of CPU cores. + Cores *int32 `json:"cores,omitempty"` + // The amount of memory in GB. + Ram *int32 `json:"ram,omitempty"` + // The amount of storage size in GB. + StorageSize *int32 `json:"storageSize,omitempty"` +} + +// NewTemplateResponse instantiates a new TemplateResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTemplateResponse() *TemplateResponse { + this := TemplateResponse{} + + return &this +} + +// NewTemplateResponseWithDefaults instantiates a new TemplateResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTemplateResponseWithDefaults() *TemplateResponse { + this := TemplateResponse{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *TemplateResponse) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TemplateResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *TemplateResponse) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *TemplateResponse) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetCores returns the Cores field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *TemplateResponse) GetCores() *int32 { + if o == nil { + return nil + } + + return o.Cores + +} + +// GetCoresOk returns a tuple with the Cores field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TemplateResponse) GetCoresOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.Cores, true +} + +// SetCores sets field value +func (o *TemplateResponse) SetCores(v int32) { + + o.Cores = &v + +} + +// HasCores returns a boolean if a field has been set. +func (o *TemplateResponse) HasCores() bool { + if o != nil && o.Cores != nil { + return true + } + + return false +} + +// GetRam returns the Ram field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *TemplateResponse) GetRam() *int32 { + if o == nil { + return nil + } + + return o.Ram + +} + +// GetRamOk returns a tuple with the Ram field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TemplateResponse) GetRamOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.Ram, true +} + +// SetRam sets field value +func (o *TemplateResponse) SetRam(v int32) { + + o.Ram = &v + +} + +// HasRam returns a boolean if a field has been set. +func (o *TemplateResponse) HasRam() bool { + if o != nil && o.Ram != nil { + return true + } + + return false +} + +// GetStorageSize returns the StorageSize field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *TemplateResponse) GetStorageSize() *int32 { + if o == nil { + return nil + } + + return o.StorageSize + +} + +// GetStorageSizeOk returns a tuple with the StorageSize field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TemplateResponse) GetStorageSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.StorageSize, true +} + +// SetStorageSize sets field value +func (o *TemplateResponse) SetStorageSize(v int32) { + + o.StorageSize = &v + +} + +// HasStorageSize returns a boolean if a field has been set. +func (o *TemplateResponse) HasStorageSize() bool { + if o != nil && o.StorageSize != nil { + return true + } + + return false +} + +func (o TemplateResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + + if o.Cores != nil { + toSerialize["cores"] = o.Cores + } + + if o.Ram != nil { + toSerialize["ram"] = o.Ram + } + + if o.StorageSize != nil { + toSerialize["storageSize"] = o.StorageSize + } + + return json.Marshal(toSerialize) +} + +type NullableTemplateResponse struct { + value *TemplateResponse + isSet bool +} + +func (v NullableTemplateResponse) Get() *TemplateResponse { + return v.value +} + +func (v *NullableTemplateResponse) Set(val *TemplateResponse) { + v.value = val + v.isSet = true +} + +func (v NullableTemplateResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableTemplateResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTemplateResponse(val *TemplateResponse) *NullableTemplateResponse { + return &NullableTemplateResponse{value: val, isSet: true} +} + +func (v NullableTemplateResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTemplateResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_user.go b/model_user.go new file mode 100644 index 0000000..b2c53b8 --- /dev/null +++ b/model_user.go @@ -0,0 +1,207 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// User MongoDB database user. +type User struct { + Type *ResourceType `json:"type,omitempty"` + Metadata *UserMetadata `json:"metadata,omitempty"` + Properties *UserProperties `json:"properties,omitempty"` +} + +// NewUser instantiates a new User object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUser() *User { + this := User{} + + return &this +} + +// NewUserWithDefaults instantiates a new User object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserWithDefaults() *User { + this := User{} + return &this +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for ResourceType will be returned +func (o *User) GetType() *ResourceType { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetTypeOk() (*ResourceType, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *User) SetType(v ResourceType) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *User) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetMetadata returns the Metadata field value +// If the value is explicit nil, the zero value for UserMetadata will be returned +func (o *User) GetMetadata() *UserMetadata { + if o == nil { + return nil + } + + return o.Metadata + +} + +// GetMetadataOk returns a tuple with the Metadata field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetMetadataOk() (*UserMetadata, bool) { + if o == nil { + return nil, false + } + + return o.Metadata, true +} + +// SetMetadata sets field value +func (o *User) SetMetadata(v UserMetadata) { + + o.Metadata = &v + +} + +// HasMetadata returns a boolean if a field has been set. +func (o *User) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for UserProperties will be returned +func (o *User) GetProperties() *UserProperties { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetPropertiesOk() (*UserProperties, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *User) SetProperties(v UserProperties) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *User) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +func (o User) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Type != nil { + toSerialize["type"] = o.Type + } + + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + + return json.Marshal(toSerialize) +} + +type NullableUser struct { + value *User + isSet bool +} + +func (v NullableUser) Get() *User { + return v.value +} + +func (v *NullableUser) Set(val *User) { + v.value = val + v.isSet = true +} + +func (v NullableUser) IsSet() bool { + return v.isSet +} + +func (v *NullableUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUser(val *User) *NullableUser { + return &NullableUser{value: val, isSet: true} +} + +func (v NullableUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_user_metadata.go b/model_user_metadata.go new file mode 100644 index 0000000..26bfaab --- /dev/null +++ b/model_user_metadata.go @@ -0,0 +1,262 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" + "time" +) + +// UserMetadata The metadata of the resource. +type UserMetadata struct { + // The date the resource was created. + CreatedDate *IonosTime `json:"createdDate,omitempty"` + // The user who created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + // The ID of the user who created the resource. + CreatedByUserId *string `json:"createdByUserId,omitempty"` + // The user state. + State *string `json:"state,omitempty"` +} + +// NewUserMetadata instantiates a new UserMetadata object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserMetadata() *UserMetadata { + this := UserMetadata{} + + return &this +} + +// NewUserMetadataWithDefaults instantiates a new UserMetadata object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserMetadataWithDefaults() *UserMetadata { + this := UserMetadata{} + return &this +} + +// GetCreatedDate returns the CreatedDate field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *UserMetadata) GetCreatedDate() *time.Time { + if o == nil { + return nil + } + + if o.CreatedDate == nil { + return nil + } + return &o.CreatedDate.Time + +} + +// GetCreatedDateOk returns a tuple with the CreatedDate field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserMetadata) GetCreatedDateOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + + if o.CreatedDate == nil { + return nil, false + } + return &o.CreatedDate.Time, true + +} + +// SetCreatedDate sets field value +func (o *UserMetadata) SetCreatedDate(v time.Time) { + + o.CreatedDate = &IonosTime{v} + +} + +// HasCreatedDate returns a boolean if a field has been set. +func (o *UserMetadata) HasCreatedDate() bool { + if o != nil && o.CreatedDate != nil { + return true + } + + return false +} + +// GetCreatedBy returns the CreatedBy field value +// If the value is explicit nil, the zero value for string will be returned +func (o *UserMetadata) GetCreatedBy() *string { + if o == nil { + return nil + } + + return o.CreatedBy + +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserMetadata) GetCreatedByOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.CreatedBy, true +} + +// SetCreatedBy sets field value +func (o *UserMetadata) SetCreatedBy(v string) { + + o.CreatedBy = &v + +} + +// HasCreatedBy returns a boolean if a field has been set. +func (o *UserMetadata) HasCreatedBy() bool { + if o != nil && o.CreatedBy != nil { + return true + } + + return false +} + +// GetCreatedByUserId returns the CreatedByUserId field value +// If the value is explicit nil, the zero value for string will be returned +func (o *UserMetadata) GetCreatedByUserId() *string { + if o == nil { + return nil + } + + return o.CreatedByUserId + +} + +// GetCreatedByUserIdOk returns a tuple with the CreatedByUserId field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserMetadata) GetCreatedByUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.CreatedByUserId, true +} + +// SetCreatedByUserId sets field value +func (o *UserMetadata) SetCreatedByUserId(v string) { + + o.CreatedByUserId = &v + +} + +// HasCreatedByUserId returns a boolean if a field has been set. +func (o *UserMetadata) HasCreatedByUserId() bool { + if o != nil && o.CreatedByUserId != nil { + return true + } + + return false +} + +// GetState returns the State field value +// If the value is explicit nil, the zero value for string will be returned +func (o *UserMetadata) GetState() *string { + if o == nil { + return nil + } + + return o.State + +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserMetadata) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.State, true +} + +// SetState sets field value +func (o *UserMetadata) SetState(v string) { + + o.State = &v + +} + +// HasState returns a boolean if a field has been set. +func (o *UserMetadata) HasState() bool { + if o != nil && o.State != nil { + return true + } + + return false +} + +func (o UserMetadata) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.CreatedDate != nil { + toSerialize["createdDate"] = o.CreatedDate + } + + if o.CreatedBy != nil { + toSerialize["createdBy"] = o.CreatedBy + } + + if o.CreatedByUserId != nil { + toSerialize["createdByUserId"] = o.CreatedByUserId + } + + if o.State != nil { + toSerialize["state"] = o.State + } + + return json.Marshal(toSerialize) +} + +type NullableUserMetadata struct { + value *UserMetadata + isSet bool +} + +func (v NullableUserMetadata) Get() *UserMetadata { + return v.value +} + +func (v *NullableUserMetadata) Set(val *UserMetadata) { + v.value = val + v.isSet = true +} + +func (v NullableUserMetadata) IsSet() bool { + return v.isSet +} + +func (v *NullableUserMetadata) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserMetadata(val *UserMetadata) *NullableUserMetadata { + return &NullableUserMetadata{value: val, isSet: true} +} + +func (v NullableUserMetadata) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserMetadata) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_user_properties.go b/model_user_properties.go new file mode 100644 index 0000000..d951c20 --- /dev/null +++ b/model_user_properties.go @@ -0,0 +1,255 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// UserProperties Mongodb user properties. +type UserProperties struct { + Username *string `json:"username"` + // The user database to use for authentication. + Database *string `json:"database"` + Password *string `json:"password"` + Roles *[]UserRoles `json:"roles,omitempty"` +} + +// NewUserProperties instantiates a new UserProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserProperties(username string, database string, password string) *UserProperties { + this := UserProperties{} + + this.Username = &username + this.Database = &database + this.Password = &password + + return &this +} + +// NewUserPropertiesWithDefaults instantiates a new UserProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserPropertiesWithDefaults() *UserProperties { + this := UserProperties{} + return &this +} + +// GetUsername returns the Username field value +// If the value is explicit nil, the zero value for string will be returned +func (o *UserProperties) GetUsername() *string { + if o == nil { + return nil + } + + return o.Username + +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserProperties) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Username, true +} + +// SetUsername sets field value +func (o *UserProperties) SetUsername(v string) { + + o.Username = &v + +} + +// HasUsername returns a boolean if a field has been set. +func (o *UserProperties) HasUsername() bool { + if o != nil && o.Username != nil { + return true + } + + return false +} + +// GetDatabase returns the Database field value +// If the value is explicit nil, the zero value for string will be returned +func (o *UserProperties) GetDatabase() *string { + if o == nil { + return nil + } + + return o.Database + +} + +// GetDatabaseOk returns a tuple with the Database field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserProperties) GetDatabaseOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Database, true +} + +// SetDatabase sets field value +func (o *UserProperties) SetDatabase(v string) { + + o.Database = &v + +} + +// HasDatabase returns a boolean if a field has been set. +func (o *UserProperties) HasDatabase() bool { + if o != nil && o.Database != nil { + return true + } + + return false +} + +// GetPassword returns the Password field value +// If the value is explicit nil, the zero value for string will be returned +func (o *UserProperties) GetPassword() *string { + if o == nil { + return nil + } + + return o.Password + +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserProperties) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Password, true +} + +// SetPassword sets field value +func (o *UserProperties) SetPassword(v string) { + + o.Password = &v + +} + +// HasPassword returns a boolean if a field has been set. +func (o *UserProperties) HasPassword() bool { + if o != nil && o.Password != nil { + return true + } + + return false +} + +// GetRoles returns the Roles field value +// If the value is explicit nil, the zero value for []UserRoles will be returned +func (o *UserProperties) GetRoles() *[]UserRoles { + if o == nil { + return nil + } + + return o.Roles + +} + +// GetRolesOk returns a tuple with the Roles field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserProperties) GetRolesOk() (*[]UserRoles, bool) { + if o == nil { + return nil, false + } + + return o.Roles, true +} + +// SetRoles sets field value +func (o *UserProperties) SetRoles(v []UserRoles) { + + o.Roles = &v + +} + +// HasRoles returns a boolean if a field has been set. +func (o *UserProperties) HasRoles() bool { + if o != nil && o.Roles != nil { + return true + } + + return false +} + +func (o UserProperties) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Username != nil { + toSerialize["username"] = o.Username + } + + if o.Database != nil { + toSerialize["database"] = o.Database + } + + if o.Password != nil { + toSerialize["password"] = o.Password + } + + if o.Roles != nil { + toSerialize["roles"] = o.Roles + } + + return json.Marshal(toSerialize) +} + +type NullableUserProperties struct { + value *UserProperties + isSet bool +} + +func (v NullableUserProperties) Get() *UserProperties { + return v.value +} + +func (v *NullableUserProperties) Set(val *UserProperties) { + v.value = val + v.isSet = true +} + +func (v NullableUserProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableUserProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserProperties(val *UserProperties) *NullableUserProperties { + return &NullableUserProperties{value: val, isSet: true} +} + +func (v NullableUserProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_user_roles.go b/model_user_roles.go new file mode 100644 index 0000000..ce2baf0 --- /dev/null +++ b/model_user_roles.go @@ -0,0 +1,164 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// UserRoles a list of mongodb user role. +type UserRoles struct { + Role *string `json:"role,omitempty"` + Database *string `json:"database,omitempty"` +} + +// NewUserRoles instantiates a new UserRoles object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserRoles() *UserRoles { + this := UserRoles{} + + return &this +} + +// NewUserRolesWithDefaults instantiates a new UserRoles object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserRolesWithDefaults() *UserRoles { + this := UserRoles{} + return &this +} + +// GetRole returns the Role field value +// If the value is explicit nil, the zero value for string will be returned +func (o *UserRoles) GetRole() *string { + if o == nil { + return nil + } + + return o.Role + +} + +// GetRoleOk returns a tuple with the Role field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserRoles) GetRoleOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Role, true +} + +// SetRole sets field value +func (o *UserRoles) SetRole(v string) { + + o.Role = &v + +} + +// HasRole returns a boolean if a field has been set. +func (o *UserRoles) HasRole() bool { + if o != nil && o.Role != nil { + return true + } + + return false +} + +// GetDatabase returns the Database field value +// If the value is explicit nil, the zero value for string will be returned +func (o *UserRoles) GetDatabase() *string { + if o == nil { + return nil + } + + return o.Database + +} + +// GetDatabaseOk returns a tuple with the Database field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserRoles) GetDatabaseOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Database, true +} + +// SetDatabase sets field value +func (o *UserRoles) SetDatabase(v string) { + + o.Database = &v + +} + +// HasDatabase returns a boolean if a field has been set. +func (o *UserRoles) HasDatabase() bool { + if o != nil && o.Database != nil { + return true + } + + return false +} + +func (o UserRoles) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Role != nil { + toSerialize["role"] = o.Role + } + + if o.Database != nil { + toSerialize["database"] = o.Database + } + + return json.Marshal(toSerialize) +} + +type NullableUserRoles struct { + value *UserRoles + isSet bool +} + +func (v NullableUserRoles) Get() *UserRoles { + return v.value +} + +func (v *NullableUserRoles) Set(val *UserRoles) { + v.value = val + v.isSet = true +} + +func (v NullableUserRoles) IsSet() bool { + return v.isSet +} + +func (v *NullableUserRoles) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserRoles(val *UserRoles) *NullableUserRoles { + return &NullableUserRoles{value: val, isSet: true} +} + +func (v NullableUserRoles) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserRoles) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_users_list.go b/model_users_list.go new file mode 100644 index 0000000..55881d5 --- /dev/null +++ b/model_users_list.go @@ -0,0 +1,208 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// UsersList List of cluster users. +type UsersList struct { + Type *ResourceType `json:"type,omitempty"` + // The unique ID of the resource. + Id *string `json:"id,omitempty"` + Items *[]User `json:"items,omitempty"` +} + +// NewUsersList instantiates a new UsersList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUsersList() *UsersList { + this := UsersList{} + + return &this +} + +// NewUsersListWithDefaults instantiates a new UsersList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUsersListWithDefaults() *UsersList { + this := UsersList{} + return &this +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for ResourceType will be returned +func (o *UsersList) GetType() *ResourceType { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UsersList) GetTypeOk() (*ResourceType, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *UsersList) SetType(v ResourceType) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *UsersList) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *UsersList) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UsersList) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *UsersList) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *UsersList) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetItems returns the Items field value +// If the value is explicit nil, the zero value for []User will be returned +func (o *UsersList) GetItems() *[]User { + if o == nil { + return nil + } + + return o.Items + +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UsersList) GetItemsOk() (*[]User, bool) { + if o == nil { + return nil, false + } + + return o.Items, true +} + +// SetItems sets field value +func (o *UsersList) SetItems(v []User) { + + o.Items = &v + +} + +// HasItems returns a boolean if a field has been set. +func (o *UsersList) HasItems() bool { + if o != nil && o.Items != nil { + return true + } + + return false +} + +func (o UsersList) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Type != nil { + toSerialize["type"] = o.Type + } + + if o.Id != nil { + toSerialize["id"] = o.Id + } + + if o.Items != nil { + toSerialize["items"] = o.Items + } + + return json.Marshal(toSerialize) +} + +type NullableUsersList struct { + value *UsersList + isSet bool +} + +func (v NullableUsersList) Get() *UsersList { + return v.value +} + +func (v *NullableUsersList) Set(val *UsersList) { + v.value = val + v.isSet = true +} + +func (v NullableUsersList) IsSet() bool { + return v.isSet +} + +func (v *NullableUsersList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUsersList(val *UsersList) *NullableUsersList { + return &NullableUsersList{value: val, isSet: true} +} + +func (v NullableUsersList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUsersList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/response.go b/response.go new file mode 100644 index 0000000..fd782bc --- /dev/null +++ b/response.go @@ -0,0 +1,69 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "log" + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResonse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} + +// HttpNotFound - returns true if a 404 status code was returned +// returns false for nil APIResponse values +func (resp *APIResponse) HttpNotFound() bool { + if resp != nil && resp.Response != nil && resp.StatusCode == http.StatusNotFound { + return true + } + return false +} + +// LogInfo - logs APIResponse values like RequestTime, Operation and StatusCode +// does not print anything for nil APIResponse values +func (resp *APIResponse) LogInfo() { + if resp != nil { + log.Printf("[DEBUG] operation : %s", + resp.Operation) + if resp.Response != nil { + log.Printf("[DEBUG] response status code : %d\n", resp.StatusCode) + } + } +} diff --git a/utils.go b/utils.go new file mode 100644 index 0000000..9ea2122 --- /dev/null +++ b/utils.go @@ -0,0 +1,744 @@ +/* + * IONOS DBaaS MongoDB REST API + * + * With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" + "strings" + "time" +) + +// PtrBool - returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt - returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 - returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 - returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 - returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 - returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString - returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime - returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +// ToBool - returns the value of the bool pointer passed in +func ToBool(ptr *bool) bool { + return *ptr +} + +// ToBoolDefault - returns the value of the bool pointer passed in, or false if the pointer is nil +func ToBoolDefault(ptr *bool) bool { + var defaultVal bool + if ptr == nil { + return defaultVal + } + return *ptr +} + +// ToBoolSlice - returns a bool slice of the pointer passed in +func ToBoolSlice(ptrSlice *[]bool) []bool { + valSlice := make([]bool, len(*ptrSlice)) + for i, v := range *ptrSlice { + valSlice[i] = v + } + + return valSlice +} + +// ToByte - returns the value of the byte pointer passed in +func ToByte(ptr *byte) byte { + return *ptr +} + +// ToByteDefault - returns the value of the byte pointer passed in, or 0 if the pointer is nil +func ToByteDefault(ptr *byte) byte { + var defaultVal byte + if ptr == nil { + return defaultVal + } + + return *ptr +} + +// ToByteSlice - returns a byte slice of the pointer passed in +func ToByteSlice(ptrSlice *[]byte) []byte { + valSlice := make([]byte, len(*ptrSlice)) + for i, v := range *ptrSlice { + valSlice[i] = v + } + + return valSlice +} + +// ToString - returns the value of the string pointer passed in +func ToString(ptr *string) string { + return *ptr +} + +// ToStringDefault - returns the value of the string pointer passed in, or "" if the pointer is nil +func ToStringDefault(ptr *string) string { + var defaultVal string + if ptr == nil { + return defaultVal + } + + return *ptr +} + +// ToStringSlice - returns a string slice of the pointer passed in +func ToStringSlice(ptrSlice *[]string) []string { + valSlice := make([]string, len(*ptrSlice)) + for i, v := range *ptrSlice { + valSlice[i] = v + } + + return valSlice +} + +// ToInt - returns the value of the int pointer passed in +func ToInt(ptr *int) int { + return *ptr +} + +// ToIntDefault - returns the value of the int pointer passed in, or 0 if the pointer is nil +func ToIntDefault(ptr *int) int { + var defaultVal int + if ptr == nil { + return defaultVal + } + return *ptr +} + +// ToIntSlice - returns a int slice of the pointer passed in +func ToIntSlice(ptrSlice *[]int) []int { + valSlice := make([]int, len(*ptrSlice)) + for i, v := range *ptrSlice { + valSlice[i] = v + } + + return valSlice +} + +// ToInt8 - returns the value of the int8 pointer passed in +func ToInt8(ptr *int8) int8 { + return *ptr +} + +// ToInt8Default - returns the value of the int8 pointer passed in, or 0 if the pointer is nil +func ToInt8Default(ptr *int8) int8 { + var defaultVal int8 + if ptr == nil { + return defaultVal + } + return *ptr +} + +// ToInt8Slice - returns a int8 slice of the pointer passed in +func ToInt8Slice(ptrSlice *[]int8) []int8 { + valSlice := make([]int8, len(*ptrSlice)) + for i, v := range *ptrSlice { + valSlice[i] = v + } + + return valSlice +} + +// ToInt16 - returns the value of the int16 pointer passed in +func ToInt16(ptr *int16) int16 { + return *ptr +} + +// ToInt16Default - returns the value of the int16 pointer passed in, or 0 if the pointer is nil +func ToInt16Default(ptr *int16) int16 { + var defaultVal int16 + if ptr == nil { + return defaultVal + } + return *ptr +} + +// ToInt16Slice - returns a int16 slice of the pointer passed in +func ToInt16Slice(ptrSlice *[]int16) []int16 { + valSlice := make([]int16, len(*ptrSlice)) + for i, v := range *ptrSlice { + valSlice[i] = v + } + + return valSlice +} + +// ToInt32 - returns the value of the int32 pointer passed in +func ToInt32(ptr *int32) int32 { + return *ptr +} + +// ToInt32Default - returns the value of the int32 pointer passed in, or 0 if the pointer is nil +func ToInt32Default(ptr *int32) int32 { + var defaultVal int32 + if ptr == nil { + return defaultVal + } + return *ptr +} + +// ToInt32Slice - returns a int32 slice of the pointer passed in +func ToInt32Slice(ptrSlice *[]int32) []int32 { + valSlice := make([]int32, len(*ptrSlice)) + for i, v := range *ptrSlice { + valSlice[i] = v + } + + return valSlice +} + +// ToInt64 - returns the value of the int64 pointer passed in +func ToInt64(ptr *int64) int64 { + return *ptr +} + +// ToInt64Default - returns the value of the int64 pointer passed in, or 0 if the pointer is nil +func ToInt64Default(ptr *int64) int64 { + var defaultVal int64 + if ptr == nil { + return defaultVal + } + return *ptr +} + +// ToInt64Slice - returns a int64 slice of the pointer passed in +func ToInt64Slice(ptrSlice *[]int64) []int64 { + valSlice := make([]int64, len(*ptrSlice)) + for i, v := range *ptrSlice { + valSlice[i] = v + } + + return valSlice +} + +// ToUint - returns the value of the uint pointer passed in +func ToUint(ptr *uint) uint { + return *ptr +} + +// ToUintDefault - returns the value of the uint pointer passed in, or 0 if the pointer is nil +func ToUintDefault(ptr *uint) uint { + var defaultVal uint + if ptr == nil { + return defaultVal + } + return *ptr +} + +// ToUintSlice - returns a uint slice of the pointer passed in +func ToUintSlice(ptrSlice *[]uint) []uint { + valSlice := make([]uint, len(*ptrSlice)) + for i, v := range *ptrSlice { + valSlice[i] = v + } + + return valSlice +} + +// ToUint8 -returns the value of the uint8 pointer passed in +func ToUint8(ptr *uint8) uint8 { + return *ptr +} + +// ToUint8Default - returns the value of the uint8 pointer passed in, or 0 if the pointer is nil +func ToUint8Default(ptr *uint8) uint8 { + var defaultVal uint8 + if ptr == nil { + return defaultVal + } + return *ptr +} + +// ToUint8Slice - returns a uint8 slice of the pointer passed in +func ToUint8Slice(ptrSlice *[]uint8) []uint8 { + valSlice := make([]uint8, len(*ptrSlice)) + for i, v := range *ptrSlice { + valSlice[i] = v + } + + return valSlice +} + +// ToUint16 - returns the value of the uint16 pointer passed in +func ToUint16(ptr *uint16) uint16 { + return *ptr +} + +// ToUint16Default - returns the value of the uint16 pointer passed in, or 0 if the pointer is nil +func ToUint16Default(ptr *uint16) uint16 { + var defaultVal uint16 + if ptr == nil { + return defaultVal + } + return *ptr +} + +// ToUint16Slice - returns a uint16 slice of the pointer passed in +func ToUint16Slice(ptrSlice *[]uint16) []uint16 { + valSlice := make([]uint16, len(*ptrSlice)) + for i, v := range *ptrSlice { + valSlice[i] = v + } + + return valSlice +} + +// ToUint32 - returns the value of the uint32 pointer passed in +func ToUint32(ptr *uint32) uint32 { + return *ptr +} + +// ToUint32Default - returns the value of the uint32 pointer passed in, or 0 if the pointer is nil +func ToUint32Default(ptr *uint32) uint32 { + var defaultVal uint32 + if ptr == nil { + return defaultVal + } + return *ptr +} + +// ToUint32Slice - returns a uint32 slice of the pointer passed in +func ToUint32Slice(ptrSlice *[]uint32) []uint32 { + valSlice := make([]uint32, len(*ptrSlice)) + for i, v := range *ptrSlice { + valSlice[i] = v + } + + return valSlice +} + +// ToUint64 - returns the value of the uint64 pointer passed in +func ToUint64(ptr *uint64) uint64 { + return *ptr +} + +// ToUint64Default - returns the value of the uint64 pointer passed in, or 0 if the pointer is nil +func ToUint64Default(ptr *uint64) uint64 { + var defaultVal uint64 + if ptr == nil { + return defaultVal + } + return *ptr +} + +// ToUint64Slice - returns a uint63 slice of the pointer passed in +func ToUint64Slice(ptrSlice *[]uint64) []uint64 { + valSlice := make([]uint64, len(*ptrSlice)) + for i, v := range *ptrSlice { + valSlice[i] = v + } + + return valSlice +} + +// ToFloat32 - returns the value of the float32 pointer passed in +func ToFloat32(ptr *float32) float32 { + return *ptr +} + +// ToFloat32Default - returns the value of the float32 pointer passed in, or 0 if the pointer is nil +func ToFloat32Default(ptr *float32) float32 { + var defaultVal float32 + if ptr == nil { + return defaultVal + } + return *ptr +} + +// ToFloat32Slice - returns a float32 slice of the pointer passed in +func ToFloat32Slice(ptrSlice *[]float32) []float32 { + valSlice := make([]float32, len(*ptrSlice)) + for i, v := range *ptrSlice { + valSlice[i] = v + } + + return valSlice +} + +// ToFloat64 - returns the value of the float64 pointer passed in +func ToFloat64(ptr *float64) float64 { + return *ptr +} + +// ToFloat64Default - returns the value of the float64 pointer passed in, or 0 if the pointer is nil +func ToFloat64Default(ptr *float64) float64 { + var defaultVal float64 + if ptr == nil { + return defaultVal + } + return *ptr +} + +// ToFloat64Slice - returns a float64 slice of the pointer passed in +func ToFloat64Slice(ptrSlice *[]float64) []float64 { + valSlice := make([]float64, len(*ptrSlice)) + for i, v := range *ptrSlice { + valSlice[i] = v + } + + return valSlice +} + +// ToTime - returns the value of the Time pointer passed in +func ToTime(ptr *time.Time) time.Time { + return *ptr +} + +// ToTimeDefault - returns the value of the Time pointer passed in, or 0001-01-01 00:00:00 +0000 UTC if the pointer is nil +func ToTimeDefault(ptr *time.Time) time.Time { + var defaultVal time.Time + if ptr == nil { + return defaultVal + } + return *ptr +} + +// ToTimeSlice - returns a Time slice of the pointer passed in +func ToTimeSlice(ptrSlice *[]time.Time) []time.Time { + valSlice := make([]time.Time, len(*ptrSlice)) + for i, v := range *ptrSlice { + valSlice[i] = v + } + + return valSlice +} + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type IonosTime struct { + time.Time +} + +func (t *IonosTime) UnmarshalJSON(data []byte) error { + str := string(data) + if strlen(str) == 0 { + t = nil + return nil + } + if str[0] == '"' { + str = str[1:] + } + if str[len(str)-1] == '"' { + str = str[:len(str)-1] + } + if !strings.Contains(str, "Z") { + /* forcefully adding timezone suffix to be able to parse the + * string using RFC3339 */ + str += "Z" + } + tt, err := time.Parse(time.RFC3339, str) + if err != nil { + return err + } + *t = IonosTime{tt} + return nil +}